/* ============================================================
   Client/Admin area — SAME layout as homepage (public navbar+footer)
   Only page-level sections, NO sidebar
   ============================================================ */

/* ---- Sticky footer ---- */
html, body { height: 100%; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main { flex: 1 0 auto; }
.footer { flex-shrink: 0; }

/* ---- Containers — CENTERED with margin:0 auto ---- */
.container {
    max-width: 1600px !important;
    margin: 0 auto !important;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    width: 100%;
}
.container-wide {
    max-width: 1800px !important;
    margin: 0 auto !important;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    width: 100%;
}
.container-narrow {
    max-width: 900px !important;
    margin: 0 auto !important;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    width: 100%;
}

/* ============================================================
   NAVBAR TWEAKS
   ============================================================ */
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
    white-space: nowrap;
}
.navbar-brand .brand-logo {
    height: 32px;
    width: auto;
}

/* ============================================================
   USER MENU DROPDOWN
   ============================================================ */
.user-menu {
    position: relative;
    display: inline-block;
}
.user-menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-base);
    padding: 0;
}
.user-menu-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 260px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    display: none !important;
    z-index: 9999;
    animation: fadeInDown 0.18s ease;
}
.user-menu.open .user-menu-dropdown {
    display: block !important;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-menu-header {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-2);
}
.user-menu-header .um-name {
    font-weight: 700;
    margin-bottom: 2px;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-menu-header .um-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-menu-header .um-balance {
    font-size: 0.82rem;
    color: var(--cyan);
}
.user-menu-dropdown a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all var(--t-fast);
}
.user-menu-dropdown a:hover {
    background: var(--purple-soft);
    color: var(--text-primary);
}
.user-menu-dropdown a.um-logout { color: var(--red); }
.user-menu-dropdown a.um-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}
.user-menu-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-2) 0;
}

/* Language switcher pill */
.lang-switch {
    display: inline-flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 3px;
    gap: 2px;
}
.lang-switch a {
    padding: 4px 10px;
    border-radius: var(--r-sm);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--t-fast);
    letter-spacing: 0.04em;
}
.lang-switch a:hover { color: var(--text-primary); }
.lang-switch a.active {
    background: var(--gradient-purple);
    color: #fff;
}

/* Navbar icon button (notifications bell) */
.navbar-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-secondary);
    transition: all var(--t-base);
    text-decoration: none;
}
.navbar-icon-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}
.navbar-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--red);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .navbar-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding: var(--space-3);
        z-index: 100;
    }
    .navbar-menu.open { display: flex; }
    .navbar-menu li { width: 100%; }
    .navbar-menu a { width: 100%; padding: var(--space-3); }

    .btn-icon-mobile .btn-label { display: none; }
    .btn-icon-mobile {
        width: 40px;
        height: 40px;
        padding: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .btn-icon-mobile svg { margin: 0; }

    .lang-switch { padding: 2px; }
    .lang-switch a { padding: 3px 7px; font-size: 0.72rem; }
}

/* ============================================================
   Dashboard page sections
   ============================================================ */
.dash-page {
    padding: var(--space-8) 0;
    width: 100%;
}

.dash-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    gap: var(--space-4);
    flex-wrap: wrap;
}
.dash-page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.dash-page-header .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}
.dash-page-header .actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.dash-cols {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}
@media (max-width: 992px) {
    .dash-cols { grid-template-columns: 1fr; }
}

/* Service detail */
.service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: var(--space-5);
    gap: var(--space-4);
    flex-wrap: wrap;
}
.service-header-info h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: var(--space-1);
}
.service-header-info .meta {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.power-controls {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: var(--space-5);
}
.info-item .lbl {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}
.info-item .val {
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    word-break: break-all;
}

/* Ticket thread */
.ticket-thread { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-5); }
.ticket-msg {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.ticket-msg.is-staff {
    background: var(--purple-soft);
    border-color: var(--border-strong);
}
.ticket-msg .avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}
.ticket-msg .msg-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}
.ticket-msg .msg-author { font-weight: 700; }
.ticket-msg .msg-time { color: var(--text-muted); font-size: 0.8rem; }
.ticket-msg .msg-body { color: var(--text-secondary); line-height: 1.6; white-space: pre-wrap; }

/* Invoice */
.invoice-items { width: 100%; margin-bottom: var(--space-5); }
.invoice-items th {
    text-align: left;
    padding: var(--space-3);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}
.invoice-items td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.invoice-total-row td {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    padding-top: var(--space-4);
}

/* Payment methods */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.payment-method {
    padding: var(--space-4);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
    text-align: center;
    transition: all var(--t-base);
}
.payment-method:hover { border-color: var(--border-hover); }
.payment-method input { display: none; }
.payment-method.selected {
    border-color: var(--purple-3);
    background: var(--purple-soft);
}

/* Admin tabs */
.admin-tabs {
    display: flex;
    gap: var(--space-1);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 4px;
    margin-bottom: var(--space-6);
    overflow-x: auto;
}
.admin-tabs a {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: all var(--t-base);
}
.admin-tabs a:hover { color: var(--text-primary); background: var(--purple-soft); }
.admin-tabs a.active {
    background: var(--gradient-purple);
    color: #fff;
}

/* Page header */
.page-header { margin-bottom: var(--space-6); }
.page-header .page-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.page-header .page-subtitle { color: var(--text-muted); }
