/* ==========================================================================
   GROWUPHOST CLIENT AREA PORTAL — WHMCS LIGHT BRIGHT BLUE DESIGN SYSTEM
   Clean, Crisp, Light Slate & Electric Royal Blue Palette (§ Blueprint / WHMCS)
   ========================================================================== */

:root {
    /* Base & Surfaces (Crisp White & Light Sky Slate) */
    --bg-base: #f4f6fb;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8faff;
    --bg-glass: rgba(255, 255, 255, 0.95);
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-focus: #0066cc;
    --border-subtle: #f1f5f9;

    /* WHMCS Signature Bright Blues */
    --primary: #0066cc;
    --primary-hover: #004c99;
    --primary-dark: #003d80;
    --primary-light: #e7f1ff;
    --primary-glow: rgba(0, 102, 204, 0.18);
    
    --accent: #0284c7;
    --success: #10b981;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #0284c7;
    --info-light: #e0f2fe;

    /* High Contrast Text */
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-subtle: #64748b;
    --text-light: #94a3b8;

    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Crisp Light Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.09);
    --shadow-glow: 0 0 20px rgba(0, 102, 204, 0.15);

    --sidebar-width: 260px;
    --header-height: 68px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-display {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Base App Layout */
.client-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--bg-base);
}

/* Sidebar — Clean Crisp White with Royal Blue Accents */
.client-sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    background: linear-gradient(135deg, #0056b3 0%, #0066cc 100%);
    color: #ffffff;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: #ffffff;
}

.brand-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    margin-left: auto;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 14px;
}

.nav-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 0 12px 8px;
    letter-spacing: 0.06em;
}

.nav-list {
    list-style: none;
    margin-bottom: 20px;
}

.nav-item {
    margin-bottom: 3px;
}

.nav-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.nav-link-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link-content svg {
    width: 18px;
    height: 18px;
    color: #64748b;
    transition: color 0.2s;
}

.nav-item:hover a {
    color: var(--primary);
    background: #f1f5f9;
}

.nav-item:hover svg {
    color: var(--primary);
}

.nav-item.active a {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item.active svg {
    color: var(--primary);
}

.nav-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

/* Sidebar Footer User Box */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
}

.user-mini-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #0066cc, #0284c7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.25);
}

.user-meta-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main Container */
.client-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--bg-base);
}

/* Header — Crisp White */
.client-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 6px;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 8px 16px 8px 38px;
    font-size: 13px;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
}

.header-search input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.header-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: #94a3b8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.balance-chip {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-full);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.balance-amount {
    font-weight: 700;
    color: #15803d;
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.tier-gold {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.tier-platinum {
    background: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.tier-diamond {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.tier-silver {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.tier-bronze {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

/* Content Area */
.client-content {
    flex: 1;
    padding: 28px;
    max-width: 1400px;
    width: 100%;
}

/* Page Header */
.client-page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.client-page-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
}

.client-page-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* WHMCS Signature Hero Banner */
.whmcs-hero-banner {
    background: linear-gradient(135deg, #0056b3 0%, #0066cc 50%, #0284c7 100%);
    border-radius: var(--radius-xl);
    padding: 26px 30px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.22);
}

.whmcs-hero-banner h1 {
    color: #ffffff !important;
}

.whmcs-hero-banner p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.hero-pill {
    display: inline-block;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 11px;
    border-radius: var(--radius-full);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* WHMCS KPI Cards Grid */
.client-kpi-grid, .kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.client-kpi-card, .kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.client-kpi-card:hover, .kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

/* Color Accent Bars on top of KPI cards */
.kpi-blue { border-top: 4px solid #0066cc; }
.kpi-green { border-top: 4px solid #10b981; }
.kpi-amber { border-top: 4px solid #f59e0b; }
.kpi-cyan { border-top: 4px solid #0284c7; }

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.kpi-val {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 6px;
}

.kpi-sub, .kpi-meta {
    font-size: 12px;
    color: #64748b;
}

/* Data Cards & Containers — Pure White */
.client-card, .data-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.client-card-header {
    padding: 18px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.client-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.client-card-body {
    padding: 24px;
}

/* Tables — Crisp Light WHMCS Style */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.client-table, .data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

.client-table th, .data-table th {
    padding: 13px 20px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.client-table td, .data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    font-size: 13px;
    vertical-align: middle;
    background: #ffffff;
}

.client-table tbody tr, .data-table tbody tr {
    transition: background-color 0.15s;
}

.client-table tbody tr:hover, .data-table tbody tr:hover {
    background-color: #f0f7ff;
}

.client-table tbody tr:hover td {
    background-color: #f0f7ff;
}

/* Status Badges — Bright WHMCS Tints */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-primary {
    background: #e7f1ff;
    color: #0056b3;
    border: 1px solid #bfdbfe;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* Buttons — High Vibrancy */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d80 100%);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.35);
    color: #ffffff !important;
}

.btn-secondary {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff !important;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff !important;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-cpanel {
    background: linear-gradient(135deg, #ff6c2c, #e65100);
    color: #ffffff !important;
    font-weight: 700;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 108, 44, 0.3);
}

.btn-cpanel:hover {
    background: linear-gradient(135deg, #e65100, #bf360c);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(255, 108, 44, 0.4);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 9px 14px;
    font-size: 13px;
    color: #0f172a;
    outline: none;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Modals */
.modal-backdrop, .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-backdrop.active, .modal-overlay.active {
    display: flex;
}

.modal-card, .modal-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 540px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #0f172a;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 95;
}

.sidebar-backdrop.active {
    display: block;
}

/* RESPONSIVENESS */
@media (max-width: 1024px) {
    .client-sidebar {
        transform: translateX(-100%);
    }
    
    .client-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar-close-btn {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .client-main {
        margin-left: 0;
    }

    .client-content {
        padding: 20px;
    }

    .header-search {
        display: none;
    }
}

@media (max-width: 640px) {
    .client-content {
        padding: 16px;
    }

    .client-kpi-grid, .kpi-grid {
        grid-template-columns: 1fr;
    }

    .client-header {
        padding: 0 16px;
    }

    .balance-chip {
        display: none;
    }

    .client-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .client-page-title {
        font-size: 20px;
    }

    .whmcs-hero-banner {
        padding: 20px;
    }
}
