/* ParsHost client shell — matches client-dashboard.html exactly */

:root {
    --ph-sidebar-width: 280px;
}

/* ========== SIDEBAR (HTML .sidebar) ========== */
body.ph-client-shell #header,
body.ph-client-shell .master-breadcrumb,
body.ph-client-shell #footer {
    display: none !important;
}

body.ph-client-shell #main-body.main {
    margin-right: var(--ph-sidebar-width);
    margin-left: 0;
    padding: 32px;
    min-height: 100vh;
    position: relative;
    z-index: 5;
    width: auto;
    max-width: none;
}

html[dir="ltr"] body.ph-client-shell #main-body.main {
    margin-right: 0;
    margin-left: var(--ph-sidebar-width);
}

body.ph-client-shell .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--ph-sidebar-width);
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid rgba(16, 185, 129, 0.1);
    padding: 24px 0;
    z-index: 30;
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(16, 185, 129, 0.06);
    transition: transform 0.3s ease;
}

html[dir="ltr"] body.ph-client-shell .sidebar {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid rgba(16, 185, 129, 0.1);
    box-shadow: 4px 0 24px rgba(16, 185, 129, 0.06);
}

body.ph-client-shell .sidebar-logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    margin-bottom: 16px;
}

body.ph-client-shell .sidebar-logo a.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #059669, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

body.ph-client-shell .logo-mark {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    -webkit-text-fill-color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}

body.ph-client-shell .sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.ph-client-shell .sidebar-menu li {
    margin: 0;
}

body.ph-client-shell .sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

html[dir="ltr"] body.ph-client-shell .sidebar-menu a {
    border-right: none;
    border-left: 3px solid transparent;
}

body.ph-client-shell .sidebar-menu a:hover,
body.ph-client-shell .sidebar-menu a.active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), transparent);
    color: #047857;
    border-right-color: #10b981;
}

html[dir="ltr"] body.ph-client-shell .sidebar-menu a:hover,
html[dir="ltr"] body.ph-client-shell .sidebar-menu a.active {
    background: linear-gradient(270deg, rgba(16, 185, 129, 0.1), transparent);
    border-left-color: #10b981;
    border-right-color: transparent;
}

body.ph-client-shell .sidebar-menu svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

body.ph-client-shell .sidebar-badge {
    margin-right: auto;
    font-size: 10px;
    padding: 2px 8px;
}

html[dir="ltr"] body.ph-client-shell .sidebar-badge {
    margin-right: 0;
    margin-left: auto;
}

/* Mobile menu toggle */
body.ph-client-shell .menu-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 35;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

html[dir="rtl"] body.ph-client-shell .menu-toggle {
    left: auto;
    right: 24px;
}

body.ph-client-shell .btn-return-to-admin.ph-admin-float {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    bottom: 24px !important;
    left: calc(var(--ph-sidebar-width) + 24px) !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    transform: none !important;
    transform-origin: center !important;
    font-size: 16px !important;
    line-height: 1 !important;
    z-index: 35;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    text-decoration: none !important;
    overflow: hidden;
}

body.ph-client-shell .btn-return-to-admin.ph-admin-float:hover {
    background: #047857 !important;
    color: #fff !important;
    transform: none !important;
}

html[dir="rtl"] body.ph-client-shell .btn-return-to-admin.ph-admin-float {
    left: 24px !important;
    right: auto !important;
}

html[dir="ltr"] body.ph-client-shell .btn-return-to-admin.ph-admin-float {
    left: calc(var(--ph-sidebar-width) + 24px) !important;
    right: auto !important;
}

.ph-sidebar-backdrop {
    display: none;
}

/* ========== WELCOME BANNER ========== */
.welcome-banner {
    background: linear-gradient(135deg, #10b981 0%, #059669 60%, #047857 100%);
    color: white;
    padding: 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.25);
    border-radius: 0 !important;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.12) 0%, transparent 40%);
}

.welcome-banner > * {
    position: relative;
    z-index: 2;
}

.welcome-banner-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.welcome-banner h1 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: none !important;
}

.welcome-banner p {
    opacity: 0.95;
    font-size: 15px;
    margin: 0;
    color: #fff !important;
}

.welcome-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 14px;
    color: #fff;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50% !important;
}

.status-online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.welcome-banner-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.welcome-tool-btn {
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: white !important;
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    position: relative;
}

.welcome-tool-btn-icon {
    padding: 9px;
}

.welcome-tool-btn-profile {
    padding: 6px 14px 6px 8px;
}

.welcome-notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #fbbf24;
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px white;
}

.welcome-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.welcome-notif-menu {
    min-width: 340px;
    max-height: 400px;
    overflow-y: auto;
}

.welcome-notif-item {
    padding: 14px !important;
}

.welcome-notif-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.welcome-notif-icon-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.welcome-notif-icon-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.welcome-notif-icon-info {
    background: linear-gradient(135deg, #06b6d4, #0e7490);
}

.welcome-notif-title {
    font-size: 13px;
    font-weight: 600;
    color: #064e3b;
}

.welcome-profile-head {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

.welcome-profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #064e3b;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.quick-btn {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white !important;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
    border-radius: 0 !important;
}

.quick-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    color: white !important;
}

.quick-btn svg {
    width: 22px;
    height: 22px;
}

.quick-btn i {
    font-size: 22px;
}

/* ========== KPI ========== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    padding: 24px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 2px 4px rgba(16, 185, 129, 0.05),
        0 8px 24px rgba(16, 185, 129, 0.08);
    transition: all 0.3s ease;
    text-decoration: none !important;
    color: inherit;
    display: block;
    border-radius: 0 !important;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 8px rgba(16, 185, 129, 0.08),
        0 16px 40px rgba(16, 185, 129, 0.12);
}

.kpi-card .kpi-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.kpi-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #059669, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 8px;
}

.kpi-trend {
    font-size: 12px;
    color: #10b981;
    font-weight: 500;
}

.kpi-trend.down {
    color: #ef4444;
}

.icon-circle {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #059669;
    flex-shrink: 0;
}

/* ========== DROPDOWNS (from HTML) ========== */
body.ph-client-shell .dropdown {
    position: relative;
    display: inline-block;
    z-index: 100;
}

body.ph-client-shell .dropdown.open {
    z-index: 1000;
}

body.ph-client-shell .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 16px 64px rgba(16, 185, 129, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
    padding: 4px 0;
}

html[dir="ltr"] body.ph-client-shell .dropdown-menu {
    right: auto;
    left: 0;
}

body.ph-client-shell .dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.ph-client-shell .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
}

html[dir="ltr"] body.ph-client-shell .dropdown-item {
    text-align: left;
}

body.ph-client-shell .dropdown-item:hover {
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
}

body.ph-client-shell .dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

body.ph-client-shell .dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.2), transparent);
    margin: 4px 0;
}

body.ph-client-shell .dropdown-header {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== WHMCS panels as HTML .card ========== */
body.ph-client-shell .client-home-cards .card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    padding: 0;
    box-shadow: 0 4px 24px rgba(16, 185, 129, 0.06) !important;
    border-radius: 0 !important;
    margin-bottom: 20px;
}

body.ph-client-shell .client-home-cards .card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(16, 185, 129, 0.1) !important;
    padding: 20px 24px 12px !important;
}

body.ph-client-shell .client-home-cards .card-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #064e3b !important;
}

body.ph-client-shell .client-home-cards .card-body {
    padding: 16px 24px 24px !important;
}

body.ph-client-shell .client-home-cards .card-footer {
    background: transparent !important;
    border-top: 1px solid rgba(16, 185, 129, 0.08) !important;
}

body.ph-client-shell .client-home-cards .list-group-item {
    background: transparent;
    border-color: rgba(16, 185, 129, 0.08);
}

/* Inner client pages */
body.ph-client-shell .ph-page-header {
    margin-bottom: 28px;
}

body.ph-client-shell .ph-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #064e3b;
    margin: 0;
}

body.ph-client-shell .ph-glass-panel,
body.ph-client-shell .table-container.ph-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 24px rgba(16, 185, 129, 0.06);
}

/* Animations from HTML */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s ease forwards; }
.fade-up-d1 { animation: fadeUp 0.6s ease 0.1s forwards; opacity: 0; }

.soft-shadow-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.soft-shadow-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(16, 185, 129, 0.12);
}

.text-xs { font-size: 12px; }
.text-muted { color: #6b7280; }
.text-sm { font-size: 13px; }

/* Shared layout utilities (from HTML kit) */
body.ph-client-shell .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}
body.ph-client-shell .page-title {
    font-size: 28px;
    font-weight: 700;
    color: #064e3b;
    margin: 0;
}
body.ph-client-shell .ph-page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
body.ph-client-shell .grid {
    display: grid;
    gap: 20px;
}
body.ph-client-shell .grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
body.ph-client-shell .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
body.ph-client-shell .chip-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.2);
}
body.ph-client-shell .card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 24px;
    box-shadow: 0 4px 24px rgba(16, 185, 129, 0.06);
}
body.ph-client-shell .kpi-card-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}
body.ph-client-shell .icon-circle-cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(34, 211, 238, 0.1));
    color: #0e7490;
}

/* Services page */
body.ph-client-shell .service-card {
    padding: 24px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    cursor: pointer;
}
body.ph-client-shell .service-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
    gap: 12px;
}
body.ph-client-shell .ph-service-head-main {
    display: flex;
    gap: 14px;
    align-items: center;
}
body.ph-client-shell .service-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}
body.ph-client-shell .service-icon-muted {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}
body.ph-client-shell .service-actions { display: flex; gap: 8px; }
body.ph-client-shell .icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
body.ph-client-shell .icon-btn:hover {
    background: #10b981;
    color: white;
}
body.ph-client-shell .service-domain {
    font-size: 16px;
    font-weight: 700;
    color: #064e3b;
    margin-bottom: 4px;
    direction: ltr;
    text-align: right;
}
html[dir="ltr"] body.ph-client-shell .service-domain { text-align: left; }
body.ph-client-shell .service-plan {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}
body.ph-client-shell .service-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 14px;
    background: rgba(16, 185, 129, 0.04);
    border: 1px solid rgba(16, 185, 129, 0.1);
    margin-bottom: 16px;
}
body.ph-client-shell .service-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4b5563;
}
body.ph-client-shell .service-meta-item svg {
    width: 14px;
    height: 14px;
    color: #10b981;
    flex-shrink: 0;
}
body.ph-client-shell .usage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 6px;
}
body.ph-client-shell .ph-service-footer { font-size: 11px; color: #9ca3af; margin-top: 8px; }
body.ph-client-shell .service-cta {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(16, 185, 129, 0.1);
}
body.ph-client-shell .service-cta .btn { flex: 1; padding: 8px; font-size: 12px; }

/* Service detail */
body.ph-client-shell .service-header-card {
    padding: 28px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.04));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
body.ph-client-shell .service-big-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}
body.ph-client-shell .ph-service-header-info { flex: 1; min-width: 200px; }
body.ph-client-shell .ph-service-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
body.ph-client-shell .ph-service-detail-tabs .card.ph-glass,
body.ph-client-shell .ph-service-detail-tabs .card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}
body.ph-client-shell .ph-service-detail-tabs .nav-tabs {
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
    margin-bottom: 20px;
}
body.ph-client-shell .ph-service-detail-tabs .nav-link.active {
    color: #047857;
    border-color: #10b981;
}

/* Tickets list */
body.ph-client-shell .filter-bar {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
body.ph-client-shell .filter-input {
    flex: 1;
    min-width: 240px;
    padding: 10px 14px;
    background: white;
    border: 1px solid rgba(16, 185, 129, 0.15);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}
body.ph-client-shell .filter-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
body.ph-client-shell .ticket-row {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 16px;
    align-items: center;
}
body.ph-client-shell .ticket-row:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(-4px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
}
html[dir="ltr"] body.ph-client-shell .ticket-row:hover { transform: translateX(4px); }
body.ph-client-shell .ticket-row.unread {
    background: rgba(16, 185, 129, 0.05);
    border-right: 3px solid #10b981;
}
html[dir="ltr"] body.ph-client-shell .ticket-row.unread { border-right: none; border-left: 3px solid #10b981; }
body.ph-client-shell .ticket-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.ph-client-shell .ph-ticket-meta-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
body.ph-client-shell .ph-ticket-id { font-weight: 700; color: #064e3b; }
body.ph-client-shell .ph-ticket-subject {
    font-size: 14px;
    color: #064e3b;
    font-weight: 500;
}
body.ph-client-shell .ph-ticket-subject.unread { font-weight: 700; }

/* Ticket detail / chat */
body.ph-client-shell .ph-ticket-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #6b7280;
}
body.ph-client-shell .ph-ticket-breadcrumb a { color: #6b7280; text-decoration: none; }
body.ph-client-shell .ticket-header-card {
    padding: 24px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(6, 182, 212, 0.03));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
}
body.ph-client-shell .ph-ticket-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 20px;
    flex-wrap: wrap;
}
body.ph-client-shell .ph-ticket-title {
    font-size: 22px;
    font-weight: 800;
    color: #064e3b;
    margin: 0 0 8px;
}
body.ph-client-shell .ph-ticket-chips { display: flex; gap: 8px; flex-wrap: wrap; }
body.ph-client-shell .ph-ticket-header-actions { display: flex; gap: 8px; }
body.ph-client-shell .chat-wrap {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
}
body.ph-client-shell .chat-area {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}
body.ph-client-shell .chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 600px;
}
body.ph-client-shell .msg {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
body.ph-client-shell .msg.customer { flex-direction: row-reverse; }
body.ph-client-shell .msg-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}
body.ph-client-shell .msg-customer-avatar { background: linear-gradient(135deg, #10b981, #06b6d4); }
body.ph-client-shell .msg-staff-avatar { background: linear-gradient(135deg, #f59e0b, #d97706); }
body.ph-client-shell .msg-content {
    max-width: 70%;
    background: white;
    border: 1px solid rgba(16, 185, 129, 0.1);
    padding: 14px 16px;
}
body.ph-client-shell .msg.customer .msg-content {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(6, 182, 212, 0.03));
    border-color: rgba(16, 185, 129, 0.2);
}
body.ph-client-shell .msg-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
body.ph-client-shell .msg-meta strong { color: #064e3b; font-size: 13px; }
body.ph-client-shell .msg-text { font-size: 14px; color: #374151; line-height: 1.7; }
body.ph-client-shell .msg-attach {
    margin-top: 10px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
body.ph-client-shell .ph-attach-name { font-weight: 600; color: #064e3b; text-decoration: none; }
body.ph-client-shell .chat-input {
    border-top: 1px solid rgba(16, 185, 129, 0.1);
    padding: 16px;
    background: white;
}
body.ph-client-shell .ph-chat-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    outline: none;
}
body.ph-client-shell .ph-chat-textarea:focus { border-color: #10b981; }
body.ph-client-shell .chat-input-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 12px;
    flex-wrap: wrap;
}
body.ph-client-shell .chat-input-tools { display: flex; gap: 8px; align-items: center; }
body.ph-client-shell .ph-file-hidden { display: none; }
body.ph-client-shell .ph-attach-label { cursor: pointer; padding: 8px; color: #059669; }
body.ph-client-shell .sidebar-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 20px;
    margin-bottom: 16px;
}
body.ph-client-shell .ph-sidebar-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #064e3b;
    margin-bottom: 14px;
}
body.ph-client-shell .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(16, 185, 129, 0.06);
    font-size: 13px;
}
body.ph-client-shell .info-row:last-child { border-bottom: none; }
body.ph-client-shell .info-label { color: #6b7280; }
body.ph-client-shell .info-value { font-weight: 600; color: #064e3b; }

/* New ticket */
body.ph-client-shell .ph-ticket-new-grid {
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
body.ph-client-shell .ph-ticket-form-card { padding: 0; }
body.ph-client-shell .ph-priority-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
body.ph-client-shell .priority-option {
    padding: 16px;
    border: 2px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}
body.ph-client-shell .priority-option:hover { border-color: rgba(16, 185, 129, 0.3); }
body.ph-client-shell .priority-option input { display: none; }
body.ph-client-shell .priority-option.selected {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), transparent);
}
body.ph-client-shell .priority-dot {
    width: 12px;
    height: 12px;
    border-radius: 50% !important;
    flex-shrink: 0;
}
body.ph-client-shell .priority-dot.low { background: #10b981; }
body.ph-client-shell .priority-dot.medium { background: #f59e0b; }
body.ph-client-shell .priority-dot.high { background: #ef4444; }
body.ph-client-shell .help-box {
    padding: 18px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(6, 182, 212, 0.03));
    border: 1px solid rgba(16, 185, 129, 0.2);
}
body.ph-client-shell .ph-help-title {
    font-size: 14px;
    font-weight: 700;
    color: #064e3b;
    margin-bottom: 8px;
}
body.ph-client-shell .ph-ticket-submit-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
body.ph-client-shell .ph-dept-card {
    padding: 24px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    gap: 16px;
    align-items: start;
    text-decoration: none;
    color: inherit;
}
body.ph-client-shell .ph-dept-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
body.ph-client-shell .ph-dept-name {
    font-weight: 600;
    color: #064e3b;
    margin-bottom: 4px;
}

@media (max-width: 1024px) {
    body.ph-client-shell .chat-wrap { grid-template-columns: 1fr; }
    body.ph-client-shell .ph-ticket-new-grid { grid-template-columns: 1fr; }
    body.ph-client-shell .ph-priority-grid { grid-template-columns: 1fr; }
    body.ph-client-shell .ticket-row {
        grid-template-columns: auto 1fr;
    }
    body.ph-client-shell .ph-ticket-status,
    body.ph-client-shell .ph-ticket-date { display: none; }
}

/* ========== MOBILE ========== */
@media (max-width: 1024px) {
    body.ph-client-shell .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.ph-client-shell .sidebar {
        transform: translateX(100%);
    }

    html[dir="ltr"] body.ph-client-shell .sidebar {
        transform: translateX(-100%);
    }

    body.ph-client-shell .sidebar.open {
        transform: translateX(0);
        z-index: 999;
    }

    body.ph-client-shell #main-body.main {
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding: 16px;
    }

    .ph-sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(6, 78, 59, 0.35);
        z-index: 28;
    }
}
