﻿/* ============================================================================
   ACKINGLOBAL global.css
   One shared stylesheet used across the public site, admin panel, and
   client portal. Both themes are defined as CSS variables on :root and
   [data-theme="light"], switched by toggling the data-theme attribute on
   <html>. Do not duplicate these variables anywhere else, every page
   pulls colors from here so the platform always stays visually consistent.
   ============================================================================ */

/* Font files are not bundled in this build, see HOW-TO-EDIT.md for where to
   get Clash Display and Satoshi (both free for commercial use) and where to
   drop the .woff2 files. Until those files exist, font-display: swap means
   the browser falls back instantly to the system stack below rather than
   showing blank text, so the site looks correct either way, just with a
   different typeface until the real fonts are added. */
@font-face {
    font-family: 'Clash Display';
    src: url('../fonts/ClashDisplay-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Clash Display';
    src: url('../fonts/ClashDisplay-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Clash Display';
    src: url('../fonts/ClashDisplay-Semibold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Satoshi';
    src: url('../fonts/Satoshi-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Satoshi';
    src: url('../fonts/Satoshi-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

:root,
[data-theme="dark"] {
    --bg: #080C14;
    --surface: #0D1120;
    --surface-2: #111828;
    --border: rgba(212, 175, 55, 0.15);
    --text-primary: #F4F2EC;
    --text-secondary: #9CA3B4;
    --text-muted: #5F6679;
    --gold: #D4AF37;
    --gold-hover: #E8C84A;
    --gold-glow: rgba(212, 175, 55, 0.35);
    --success: #3FAE6A;
    --danger: #D6534A;
    --warning: #E0A93B;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}

[data-theme="light"] {
    --bg: #F8F6F2;
    --surface: #FFFFFF;
    --surface-2: #F2EFE9;
    --border: rgba(20, 24, 31, 0.09);
    --text-primary: #14181F;
    --text-secondary: #4B5160;
    --text-muted: #8A8F9C;
    --gold: #B8922B;
    --gold-hover: #9E7C23;
    --gold-glow: rgba(184, 146, 43, 0.10);
    --success: #2E8C53;
    --danger: #B8413A;
    --warning: #B5821F;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 12px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text-primary);
    font-family: 'Satoshi', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Clash Display', 'General Sans', -apple-system, sans-serif;
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.5em 0;
    letter-spacing: -0.01em;
}

p { margin: 0 0 1em 0; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }

img { max-width: 100%; display: block; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                  */
/* ---------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-family: 'Satoshi', sans-serif;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-gold {
    background: var(--gold);
    color: #080C14;
}
.btn-gold:hover {
    background: var(--gold-hover);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-outline:hover {
    border-color: var(--gold);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ---------------------------------------------------------------------- */
/* Cards and surfaces                                                      */
/* ---------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.card-2 {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
}

/* ---------------------------------------------------------------------- */
/* Forms                                                                    */
/* ---------------------------------------------------------------------- */

label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="tel"], input[type="file"], select, textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 11px 14px;
    color: var(--text-primary);
    font-family: 'Satoshi', sans-serif;
    font-size: 15px;
    margin-bottom: 16px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

/* Number input spinner arrows render with the browser's own default
   look regardless of the input's other styling, this keeps them from
   looking like an unstyled, oversized leftover next to a custom field. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    opacity: 0.6;
}

/* ---------------------------------------------------------------------- */
/* Tables                                                                   */
/* ---------------------------------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
tr:last-child td { border-bottom: none; }

/* ---------------------------------------------------------------------- */
/* Badges                                                                   */
/* ---------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}
.badge-gold { background: var(--gold-glow); color: var(--gold); }
.badge-success { background: rgba(63, 174, 106, 0.15); color: var(--success); }
.badge-danger { background: rgba(214, 83, 74, 0.15); color: var(--danger); }
.badge-warning { background: rgba(224, 169, 59, 0.15); color: var(--warning); }
.badge-muted { background: rgba(255,255,255,0.06); color: var(--text-muted); }

.verified-badge {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 4px;
}

/* ---------------------------------------------------------------------- */
/* Staging banner                                                          */
/* ---------------------------------------------------------------------- */

.staging-banner {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: repeating-linear-gradient(45deg, #E0A93B, #E0A93B 12px, #080C14 12px, #080C14 24px);
    color: #080C14;
    text-align: center;
    font-family: 'Clash Display', sans-serif;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 8px 0;
    font-size: 13px;
}

/* ---------------------------------------------------------------------- */
/* Admin / portal shell layout                                             */
/* ---------------------------------------------------------------------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 0 24px 24px;
    font-family: 'Clash Display', sans-serif;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.02em;
}
.sidebar-brand .gold { color: var(--gold); }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}
.sidebar nav a:hover, .sidebar nav a.active {
    color: var(--text-primary);
    background: var(--surface-2);
    border-right: 2px solid var(--gold);
}

.sidebar-section-label {
    padding: 18px 24px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.main-content {
    flex: 1;
    padding: 32px;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.theme-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.theme-toggle button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
}
.theme-toggle button.active {
    background: var(--gold);
    color: #080C14;
}

/* ---------------------------------------------------------------------- */
/* Responsive grid utilities                                               */
/* Use these instead of inline style="grid-template-columns:..." on new   */
/* pages. They collapse to a single column automatically on phones        */
/* without needing the !important override further down this file.       */
/* ---------------------------------------------------------------------- */

.grid-auto-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-auto-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 900px) {
    .grid-auto-3, .grid-auto-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .grid-auto-2, .grid-auto-3, .grid-auto-4 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------- */
/* Mobile navigation: hamburger toggle and slide-in sidebar                */
/* Used by admin and client portal shells. The toggle button is hidden    */
/* on desktop and only appears under the tablet breakpoint. JS in         */
/* dashboard.js handles opening/closing by toggling the .open class.      */
/* ---------------------------------------------------------------------- */

.mobile-nav-toggle {
    display: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}
.sidebar-overlay.open { display: block; }

.mobile-site-nav-toggle {
    display: none;
}

/* ---------------------------------------------------------------------- */
/* Responsive breakpoints, mobile-first overrides                         */
/* Breakpoints used throughout this file:                                 */
/*   up to 480px   = phones                                               */
/*   481px - 767px = large phones                                         */
/*   768px - 1023px = tablets                                             */
/*   1024px - 1439px = laptops / standard desktop (default, no query)     */
/*   1440px - 1919px = large desktop                                      */
/*   1920px+         = ultra-wide                                         */
/* ---------------------------------------------------------------------- */

@media (min-width: 1920px) {
    .container { max-width: 1440px; }
}

@media (max-width: 1023px) {
    .mobile-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 999;
        width: 260px;
        max-width: 80vw;
    }
    .sidebar.open { transform: translateX(0); }

    .main-content { padding: 20px; }

    .topbar { flex-wrap: wrap; gap: 12px; }

    /* Tables collapse into stacked cards on small screens rather than
       scrolling horizontally, which is unusable with a thumb. Apply
       .table-responsive to a wrapping div around any data table that
       needs this on phones; simpler reference tables can keep scrolling
       via .table-scroll instead, see below. */
    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 767px) {
    .hero { padding: 80px 0 56px; }
    .hero h1 { font-size: 34px; padding: 0 16px; }
    .hero p.lead { font-size: 16px; padding: 0 16px; }

    .site-header nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
        gap: 16px;
    }
    .site-header nav.open { display: flex; }
    .site-header .container { flex-wrap: wrap; position: relative; }
    .mobile-site-nav-toggle {
        display: inline-flex;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 6px 10px;
        color: var(--text-primary);
        font-size: 18px;
        cursor: pointer;
    }

    .card, .card-2 { padding: 16px; }

    /* Grids that were hardcoded inline (e.g. style="grid-template-columns:
       repeat(4,1fr)") in admin/client pages get overridden here so they
       still stack on phones even though the column count was set inline.
       New pages should use .grid-auto instead of inline grid-template-columns
       so they don't need this override, see HOW-TO-EDIT.md. */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .receipt { padding: 20px; }
    .receipt-header { flex-direction: column; gap: 12px; }
    .receipt-meta { text-align: left; }

    /* Tables are not auto-hidden on phones, that silently drops data the
       person may need. Instead, wrap any wide table in a div with class
       .table-scroll (see admin/_header.php pattern) so it scrolls
       horizontally with a visible scrollbar rather than losing columns. */
    .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-scroll table { min-width: 600px; }
}

@media (max-width: 480px) {
    .btn { padding: 11px 18px; font-size: 14px; }
    .hero h1 { font-size: 28px; }
}

/* ---------------------------------------------------------------------- */
/* Receipt / payslip shared template style                                 */
/* ---------------------------------------------------------------------- */

.receipt {
    max-width: 640px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 40px;
}
.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
    margin-bottom: 24px;
}
.receipt-header h2 { margin: 0; }
.receipt-meta { text-align: right; color: var(--text-secondary); font-size: 13px; }
.receipt table td { font-size: 14px; }
.receipt-total {
    display: flex;
    justify-content: space-between;
    font-family: 'Clash Display', sans-serif;
    font-size: 20px;
    font-weight: 600;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------------- */
/* Hero / marketing site                                                   */
/* ---------------------------------------------------------------------- */

.hero {
    padding: 120px 0 80px;
    text-align: center;
    background: radial-gradient(ellipse at top, var(--gold-glow), transparent 60%);
}
.hero h1 {
    font-size: 52px;
    max-width: 800px;
    margin: 0 auto 20px;
}
.hero p.lead {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.site-header {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
}
.site-header nav { display: flex; gap: 28px; align-items: center; }
.site-header nav a { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.site-header nav a:hover { color: var(--text-primary); }

.nav-dropdown { position: relative; }
.nav-dropdown > a { cursor: pointer; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--surface-2); }

@media (max-width: 767px) {
    .nav-dropdown-menu { position: static; display: block; box-shadow: none; border: none; padding-left: 12px; }
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 48px 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Cookie consent bar ──────────────────────────────────────── */
.cookie-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: var(--surface);
    border-top: 2px solid rgba(212,175,55,0.35);
    box-shadow: 0 -4px 32px rgba(0,0,0,0.25);
    animation: cookieSlideUp 0.38s cubic-bezier(0.34,1.2,0.64,1) both;
}
@keyframes cookieSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.cookie-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
}
.cookie-bar-lead { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 240px; }
.cookie-bar-icon { font-size: 22px; line-height: 1.4; flex-shrink: 0; }
.cookie-bar-msg { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.cookie-bar-link { color: var(--gold); text-decoration: none; }
.cookie-bar-link:hover { text-decoration: underline; }
.cookie-bar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.cookie-btn-ghost {
    padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
    background: transparent; color: var(--text-secondary); font-size: 13px;
    font-weight: 500; cursor: pointer; transition: border-color .15s,color .15s;
    white-space: nowrap; font-family: inherit;
}
.cookie-btn-ghost:hover { border-color: var(--gold); color: var(--text-primary); }
.cookie-btn-gold {
    padding: 8px 20px; border-radius: 8px; border: none;
    background: var(--gold); color: #000; font-size: 13px;
    font-weight: 600; cursor: pointer; transition: opacity .15s;
    white-space: nowrap; font-family: inherit;
}
.cookie-btn-gold:hover { opacity: 0.85; }
/* Preferences modal */
.cookie-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 9100; display: flex; align-items: center;
    justify-content: center; padding: 16px;
}
.cookie-modal-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; max-width: 440px; width: 100%; overflow: hidden;
}
.cookie-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px 14px; border-bottom: 1px solid var(--border);
}
.cookie-modal-title { font-size: 16px; font-weight: 700; margin: 0; }
.cookie-modal-close {
    background: none; border: none; font-size: 22px; line-height: 1;
    cursor: pointer; color: var(--text-muted); padding: 2px 6px;
    border-radius: 4px; transition: color .15s,background .15s; font-family: inherit;
}
.cookie-modal-close:hover { color: var(--text-primary); background: var(--surface-2); }
.cookie-modal-body { padding: 4px 0; }
.cookie-pref-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 14px 24px;
}
.cookie-pref-row + .cookie-pref-row { border-top: 1px solid var(--border); }
.cookie-pref-info { flex: 1; }
.cookie-pref-info strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.cookie-pref-info span { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.cookie-pref-locked { font-size: 11px; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.cookie-toggle { position: relative; display: inline-flex; cursor: pointer; flex-shrink: 0; }
.cookie-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.cookie-toggle-track {
    display: block; width: 40px; height: 22px; border-radius: 11px;
    background: var(--border); transition: background .2s; position: relative;
}
.cookie-toggle-track::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .2s;
}
.cookie-toggle input:checked + .cookie-toggle-track { background: var(--gold); }
.cookie-toggle input:checked + .cookie-toggle-track::after { transform: translateX(18px); }
.cookie-modal-foot {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
@media (max-width: 640px) {
    .cookie-bar-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .cookie-bar-actions { width: 100%; }
    .cookie-btn-ghost, .cookie-btn-gold { flex: 1; text-align: center; }
    .cookie-modal-foot { flex-direction: column-reverse; }
    .cookie-modal-foot button { width: 100%; text-align: center; }
}

.dynamic-form label { margin-top: 14px; }
.dynamic-form label:first-of-type { margin-top: 0; }
.form-submit-message { font-size: 14px; margin-top: 10px; }

.header-icon-dropdown { position: relative; }
.header-icon-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
}
.header-icon-btn:hover { color: var(--text-primary); }
.header-icon-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--gold);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 5px;
    line-height: 1.4;
}
.header-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    z-index: 100;
}
.header-dropdown-item {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}
.header-dropdown-item:last-child { border-bottom: none; }
.header-dropdown-item.unread { color: var(--text-primary); background: rgba(212,175,55,0.06); }
.header-dropdown-item:hover { background: var(--surface-2); }

/* ── User profile avatar + dropdown ─────────────────────────── */
.user-profile-wrap { position: relative; }
.user-avatar-btn {
    background: none; border: none; padding: 0;
    cursor: pointer; position: relative; display: flex;
    align-items: center;
}
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--gold); color: #000;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; overflow: hidden;
    border: 2px solid rgba(212,175,55,0.3);
    transition: border-color .15s, transform .15s;
    flex-shrink: 0;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-avatar-btn:hover .user-avatar { border-color: var(--gold); transform: scale(1.05); }
.user-avatar-lg { width: 46px; height: 46px; font-size: 16px; }
.user-online-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #3fae6a;
    border: 2px solid var(--bg);
    position: absolute; bottom: 0; right: 0;
}
.user-profile-panel {
    position: absolute; top: calc(100% + 10px); right: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 13px; min-width: 220px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 800; overflow: hidden;
}
.user-profile-panel.open { animation: upDropDown 0.16s cubic-bezier(.4,0,.2,1) both; }
@keyframes upDropDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.user-profile-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.user-profile-name { font-size: 14px; font-weight: 600; line-height: 1.25; word-break: break-word; }
.user-profile-role { font-size: 11px; color: var(--text-muted); margin-top: 3px; text-transform: capitalize; letter-spacing: .04em; }
.user-online-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: #3fae6a; margin-top: 5px; font-weight: 500;
}
.user-online-label::before {
    content: ''; display: inline-block;
    width: 6px; height: 6px; border-radius: 50%;
    background: #3fae6a; flex-shrink: 0;
}
.user-profile-menu { padding: 5px 0; }
.user-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px; font-size: 13px; color: var(--text-secondary);
    text-decoration: none; transition: background .12s, color .12s;
    cursor: pointer; border: none; background: none;
    width: 100%; text-align: left; font-family: inherit;
}
.user-menu-item:hover { background: var(--surface-2); color: var(--text-primary); }
.user-menu-item svg { flex-shrink: 0; opacity: .65; }
.user-menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.user-menu-danger { color: var(--danger) !important; }
.user-menu-danger:hover { background: rgba(214,83,74,0.08) !important; color: var(--danger) !important; }
@media (max-width: 640px) {
    .user-profile-panel { right: -8px; min-width: 200px; }
}

/* =========================================================================
   COMMAND PALETTE (Cmd+K / Ctrl+K)
   ========================================================================= */
.cmd-palette-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.cmd-palette-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.cmd-palette-box {
    width: 100%;
    max-width: 580px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,175,55,0.1);
    overflow: hidden;
    transform: translateY(-12px) scale(0.98);
    transition: transform 0.15s ease;
}
.cmd-palette-overlay.open .cmd-palette-box {
    transform: translateY(0) scale(1);
}
.cmd-palette-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.cmd-palette-input-wrap svg { color: var(--text-muted); flex-shrink: 0; }
#cmd-palette-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-primary);
    font-family: inherit;
    margin: 0;
    padding: 0;
}
#cmd-palette-input::placeholder { color: var(--text-muted); }
.cmd-palette-results {
    max-height: 360px;
    overflow-y: auto;
    padding: 6px;
}
.cmd-palette-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.cmd-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s;
    text-decoration: none;
    color: var(--text-primary);
}
.cmd-result-item:hover, .cmd-result-item.active {
    background: var(--surface-2);
}
.cmd-result-item.active {
    border-left: 2px solid var(--gold);
    padding-left: 12px;
}
.cmd-result-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.cmd-result-text { flex: 1; min-width: 0; }
.cmd-result-label { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-result-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-result-type {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.cmd-palette-footer {
    padding: 10px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: var(--text-muted);
}
.cmd-palette-footer kbd {
    font-size: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: monospace;
    color: var(--text-secondary);
}

/* =========================================================================
   TOAST NOTIFICATIONS
   ========================================================================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    min-width: 280px;
    max-width: 380px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: all;
    border-left: 4px solid transparent;
    animation: toastIn 0.25s ease forwards;
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}
.toast.success { border-color: var(--success); }
.toast.danger, .toast.error { border-color: var(--danger); }
.toast.gold, .toast.warning { border-color: var(--gold); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.out { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(40px) scale(0.95); }
}

/* =========================================================================
   CHART CONTAINERS
   ========================================================================= */
.chart-card { position: relative; }
.chart-wrap { position: relative; width: 100%; }
.chart-wrap canvas { max-width: 100%; }

/* =========================================================================
   KPI CARDS - animated count-up style
   ========================================================================= */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 18px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { border-color: rgba(212,175,55,0.4); box-shadow: 0 4px 20px rgba(212,175,55,0.08); }
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}
.kpi-card:hover::before { opacity: 1; }
.kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 8px; }
.kpi-value { font-family: 'Clash Display', sans-serif; font-size: 26px; font-weight: 700; line-height: 1; color: var(--text-primary); }
.kpi-trend { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.neutral { color: var(--text-muted); }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .kpi-value { font-size: 20px; } }

/* =========================================================================
   CRM PIPELINE / KANBAN BOARD
   ========================================================================= */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    align-items: flex-start;
}
.kanban-col {
    flex: 0 0 240px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}
.kanban-col-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: sticky;
    top: 0;
    background: var(--surface-2);
    border-radius: 12px 12px 0 0;
}
.kanban-col-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.kanban-col-count { font-size: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; color: var(--text-muted); font-weight: 600; }
.kanban-cards { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: grab;
    transition: box-shadow 0.15s, border-color 0.15s, opacity 0.15s;
    user-select: none;
}
.kanban-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.2); border-color: rgba(212,175,55,0.3); }
.kanban-card.dragging { opacity: 0.5; cursor: grabbing; }
.kanban-card-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.kanban-card-email { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.kanban-card-value { color: var(--gold); font-weight: 600; font-size: 12px; }
.kanban-col.drag-over { border-color: var(--gold); background: rgba(212,175,55,0.04); }

/* =========================================================================
   SLA BADGES (Support Tickets)
   ========================================================================= */
.sla-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.sla-ok { background: rgba(63,174,106,0.12); color: var(--success); border: 1px solid rgba(63,174,106,0.3); }
.sla-risk { background: rgba(224,169,59,0.12); color: var(--warning); border: 1px solid rgba(224,169,59,0.3); }
.sla-breached { background: rgba(214,83,74,0.12); color: var(--danger); border: 1px solid rgba(214,83,74,0.3); animation: sla-pulse 2s infinite; }
@keyframes sla-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* =========================================================================
   CLIENT HEALTH SCORE
   ========================================================================= */
.health-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.health-a { background: var(--success); box-shadow: 0 0 0 3px rgba(63,174,106,0.2); }
.health-b { background: #6FC98B; box-shadow: 0 0 0 3px rgba(111,201,139,0.2); }
.health-c { background: var(--warning); box-shadow: 0 0 0 3px rgba(224,169,59,0.2); }
.health-d { background: #E07B3B; box-shadow: 0 0 0 3px rgba(224,123,59,0.2); }
.health-f { background: var(--danger); box-shadow: 0 0 0 3px rgba(214,83,74,0.2); }
.health-score-ring {
    width: 80px; height: 80px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Clash Display', sans-serif;
    font-size: 22px;
    font-weight: 700;
    border: 4px solid var(--border);
    position: relative;
}

/* =========================================================================
   PASSWORD STRENGTH METER
   ========================================================================= */
.pw-strength-bar {
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    background: var(--surface-2);
    overflow: hidden;
}
.pw-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
    width: 0%;
}
.pw-strength-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* =========================================================================
   QUICK-ACTION BUTTONS (Dashboard)
   ========================================================================= */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.quick-action-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    cursor: pointer;
}
.quick-action-btn:hover {
    border-color: var(--gold);
    background: rgba(212,175,55,0.06);
    box-shadow: 0 2px 12px rgba(212,175,55,0.1);
    color: var(--gold);
}
.quick-action-icon { font-size: 16px; }

/* =========================================================================
   PROGRESS BAR (Client Portal)
   ========================================================================= */
.progress-bar-wrap { background: var(--surface-2); border-radius: 999px; height: 6px; overflow: hidden; }
.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), var(--gold-hover));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   ONBOARDING WIZARD OVERLAY
   ========================================================================= */
.onboarding-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    z-index: 8000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.onboarding-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%; max-width: 520px;
    padding: 40px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.onboarding-steps {
    display: flex; gap: 6px; margin-bottom: 32px;
}
.onboarding-step {
    flex: 1; height: 3px; border-radius: 999px;
    background: var(--surface-2);
    transition: background 0.3s;
}
.onboarding-step.done { background: var(--gold); }
.onboarding-step.active { background: linear-gradient(90deg, var(--gold), var(--gold-hover)); }

/* ── Live Flip Clock ──────────────────────────────────────────── */
.flip-clock-widget {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.04);
}
.fcw-time { display: flex; align-items: center; gap: 5px; }
.fcw-unit { display: flex; gap: 3px; }
.fcw-card {
    width: 40px; height: 54px;
    background: var(--bg);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.05);
    perspective: 280px; transform-style: preserve-3d;
}
.fcw-card span { font-family:'Clash Display','Courier New',monospace; font-size:32px; font-weight:700; color:var(--gold); line-height:1; pointer-events:none; }
.fcw-card.flipping { animation: fcFlipOut 0.18s ease-in  forwards; }
.fcw-card.fcw-in   { animation: fcFlipIn  0.20s ease-out forwards; }
@keyframes fcFlipOut { from { transform: rotateX(0deg);   } to { transform: rotateX(-90deg); } }
@keyframes fcFlipIn  { from { transform: rotateX(90deg);  } to { transform: rotateX(0deg);   } }
.fcw-colon {
    font-family:'Clash Display',monospace; font-size:28px; font-weight:700;
    color:var(--gold); opacity:0.8; margin-bottom:2px;
    animation: fcBlink 1s step-end infinite; width:18px; text-align:center;
}
@keyframes fcBlink { 0%,100% { opacity:0.8; } 50% { opacity:0.15; } }
.fcw-labels { display:flex; align-items:center; font-size:8px; font-weight:700; letter-spacing:1.5px; text-transform:uppercase; color:var(--text-muted); }
.fcw-label-unit { width:83px; text-align:center; }
.fcw-label-sep  { width:18px; visibility:hidden; }
.fcw-date { font-size:11px; color:var(--text-muted); letter-spacing:0.3px; text-align:center; }

/* ── Dashboard greeting row ───────────────────────────────────── */
.dash-greeting-row {
    display:flex; align-items:center; justify-content:space-between;
    gap:20px; margin-bottom:22px; flex-wrap:wrap;
}
.dash-greeting-text h2 { margin:0 0 4px; font-size:22px; font-family:'Clash Display',sans-serif; }
.dash-greeting-text p  { margin:0; color:var(--text-muted); font-size:13px; }

/* ── Project Timeline Bar ─────────────────────────────────────── */
.ptl-bar-wrap {
    position:relative; height:10px;
    background:var(--surface-2); border-radius:999px;
    margin:28px 0 44px; border:1px solid var(--border); overflow:visible;
}
.ptl-fill {
    height:100%; border-radius:999px;
    background:linear-gradient(90deg,var(--gold),var(--gold-hover));
    max-width:100%; transition:width 0.8s ease;
}
.ptl-today {
    position:absolute; top:-7px; width:3px; height:24px;
    background:#D6534A; border-radius:2px; z-index:2; transform:translateX(-50%);
}
.ptl-today::after {
    content:'Today'; position:absolute; top:28px; left:50%; transform:translateX(-50%);
    font-size:9px; font-weight:700; color:#D6534A; white-space:nowrap; letter-spacing:0.5px;
}
.ptl-milestone {
    position:absolute; top:-7px; width:24px; height:24px;
    background:var(--surface); border:2px solid var(--gold); border-radius:50%;
    z-index:3; transform:translateX(-50%);
    display:flex; align-items:center; justify-content:center;
    cursor:default; transition:transform 0.15s;
}
.ptl-milestone.done { background:var(--gold); }
.ptl-milestone:hover { transform:translateX(-50%) scale(1.3); z-index:10; }
.ptl-milestone svg { width:10px; height:10px; }
.ptl-milestone-label {
    position:absolute; top:30px; left:50%; transform:translateX(-50%);
    font-size:9px; font-weight:600; color:var(--text-muted);
    white-space:nowrap; max-width:90px; overflow:hidden; text-overflow:ellipsis; pointer-events:none;
}
.ptl-dates { display:flex; justify-content:space-between; font-size:11px; color:var(--text-muted); }
.ptl-stats { display:flex; gap:24px; flex-wrap:wrap; margin-top:16px; padding-top:16px; border-top:1px solid var(--border); }
.ptl-stat  { font-size:12px; color:var(--text-muted); }
.ptl-stat strong { color:var(--text-primary); font-weight:700; display:block; font-size:15px; }

/* ── Guarantee block (homepage + pricing) ──────────────────────────── */
.guarantee-block {
    display:flex; gap:24px; align-items:flex-start;
    padding:28px 32px;
    background:rgba(212,175,55,0.04);
    border:1px solid rgba(212,175,55,0.25);
    border-radius:14px;
}
.guarantee-icon {
    color:var(--gold); flex-shrink:0;
    width:52px; height:52px;
    display:flex; align-items:center; justify-content:center;
    background:rgba(212,175,55,0.08); border-radius:50%;
}
@media (max-width:560px) { .guarantee-block { flex-direction:column; } }

/* ==========================================================================
   CUSTOM SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.22); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,0.45); }
* { scrollbar-width: thin; scrollbar-color: rgba(212,175,55,0.22) transparent; }

/* ==========================================================================
   CUSTOM SELECT ARROW
   ========================================================================== */
select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235F6679' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px !important;
}

/* ==========================================================================
   TABLE ROW HOVER
   ========================================================================== */
tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: rgba(212,175,55,0.03); }

/* ==========================================================================
   CHART CARD VISUAL CONTAINER
   ========================================================================== */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

/* ==========================================================================
   SKELETON SHIMMER LOADING STATES
   ========================================================================== */
@keyframes shimmer {
    0% { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}
.skeleton {
    background: linear-gradient(90deg,
        var(--surface-2) 0%,
        rgba(212,175,55,0.04) 40%,
        var(--surface-2) 80%
    );
    background-size: 1200px 100%;
    animation: shimmer 1.6s infinite linear;
    border-radius: 6px;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}
.skeleton * { visibility: hidden; }
.skeleton-chart  { height: 220px; border-radius: 8px; }
.skeleton-kpi    { height: 88px;  border-radius: 12px; }
.skeleton-row    { height: 48px;  border-radius: 4px; margin-bottom: 1px; }
.skeleton-text   { height: 14px;  border-radius: 4px; margin-bottom: 8px; }
.skeleton-text.short  { width: 55%; }
.skeleton-text.medium { width: 75%; }

/* ==========================================================================
   GRADIENT BORDER CARDS
   ========================================================================== */
.card-gradient {
    position: relative;
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
}
.card-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(212,175,55,0.55), rgba(212,175,55,0.05) 50%, rgba(80,120,255,0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ==========================================================================
   PAGE NAVIGATION PROGRESS BAR
   ========================================================================== */
.page-nav-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 99999;
    pointer-events: none;
    background: linear-gradient(90deg, var(--gold), #f0c040);
    transform-origin: left;
    transform: scaleX(0);
    opacity: 0;
    transition: opacity 0.3s;
}
.page-nav-bar.running {
    opacity: 1;
    transform: scaleX(0.75);
    transition: transform 2.5s cubic-bezier(0.1,0.6,0.4,1), opacity 0.15s;
}
.page-nav-bar.done {
    transform: scaleX(1);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.25s ease 0.15s;
}

/* ==========================================================================
   SIDEBAR COLLAPSE
   ========================================================================== */
.sidebar-collapse-btn {
    display: flex; align-items: center; justify-content: flex-end;
    padding: 0 20px 20px;
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); width: 100%;
    transition: color 0.15s;
}
.sidebar-collapse-btn:hover { color: var(--gold); }
.sidebar-collapse-btn svg { transition: transform 0.25s ease; }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

.sidebar.collapsed { width: 62px; overflow: visible; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-brand-name { opacity: 0; width: 0; overflow: hidden; display: none; }
.sidebar.collapsed .sidebar-collapse-btn { justify-content: center; padding: 0 0 20px; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.collapsed nav a { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
.sidebar.collapsed nav a .nav-icon { margin: 0; }
.sidebar.collapsed + .main-content { margin-left: 62px; }

.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 20px 20px 0; }
.sidebar.collapsed .sidebar-brand { padding: 0 0 20px; }
.sidebar + .main-content { transition: margin-left 0.25s ease; }

@media (max-width: 1023px) {
    .sidebar-collapse-btn { display: none; }
    .sidebar.collapsed { width: var(--sidebar-w, 220px); }
    .sidebar.collapsed .nav-label,
    .sidebar.collapsed .sidebar-section-label,
    .sidebar.collapsed .sidebar-brand-name { display: block; opacity: 1; width: auto; overflow: visible; }
    .sidebar.collapsed nav a { justify-content: flex-start; padding-left: 20px; padding-right: 20px; gap: 10px; }
}

/* ==========================================================================
   SIDEBAR NAV ICON LAYOUT
   ========================================================================== */
.sidebar nav a { display: flex; align-items: center; gap: 10px; }
.sidebar nav a .nav-icon { flex-shrink: 0; opacity: 0.6; transition: opacity 0.15s; }
.sidebar nav a:hover .nav-icon,
.sidebar nav a.active .nav-icon { opacity: 1; }
.sidebar nav a .nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   NOISE GRAIN TEXTURE OVERLAY
   ========================================================================== */
body::before {
    content: '';
    position: fixed; inset: 0;
    z-index: 2000;
    pointer-events: none;
    opacity: 0.022;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}
[data-theme="light"] body::before { opacity: 0.008; }

/* ==========================================================================
   BUTTON RIPPLE EFFECT
   ========================================================================== */
.btn { overflow: hidden; position: relative; }
.btn-ripple {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: scale(0);
    animation: ripple-anim 0.55s linear forwards;
    pointer-events: none;
}
@keyframes ripple-anim {
    to { transform: scale(3.5); opacity: 0; }
}

/* ==========================================================================
   CURSOR GLOW ON CARDS
   ========================================================================== */
.cursor-glow-card {
    --glow-x: 50%; --glow-y: 50%; --glow-opacity: 0;
    position: relative; overflow: hidden;
}
.cursor-glow-card::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(
        circle at var(--glow-x) var(--glow-y),
        rgba(212,175,55,0.12) 0%, transparent 60%
    );
    opacity: var(--glow-opacity);
    transition: opacity 0.35s ease;
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}
.cursor-glow-card > * { position: relative; z-index: 1; }

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty-state {
    text-align: center; padding: 56px 24px; color: var(--text-muted);
}
.empty-state-icon {
    width: 60px; height: 60px; margin: 0 auto 18px;
    border-radius: 14px;
    background: var(--surface-2); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.empty-state h3 { font-size: 17px; color: var(--text-secondary); font-weight: 600; margin-bottom: 8px; }
.empty-state p  { font-size: 13px; line-height: 1.65; max-width: 320px; margin: 0 auto 20px; }

/* ==========================================================================
   ANIMATED SUCCESS CHECK
   ========================================================================== */
.success-anim {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
    background: rgba(63,174,106,0.1); border: 2px solid var(--success);
}
.success-anim svg { overflow: visible; }
.check-path {
    stroke: var(--success); stroke-width: 2.5; fill: none;
    stroke-dasharray: 32; stroke-dashoffset: 32;
    animation: draw-check 0.45s ease 0.1s forwards;
    stroke-linecap: round; stroke-linejoin: round;
}
@keyframes draw-check { to { stroke-dashoffset: 0; } }

/* ==========================================================================
   STAGGER REVEAL FOR ADMIN GRIDS
   ========================================================================== */
.reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 65ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 130ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 195ms; }
.reveal-stagger > *:nth-child(5) { transition-delay: 260ms; }
.reveal-stagger > *:nth-child(6) { transition-delay: 325ms; }
.reveal-stagger > *:nth-child(7) { transition-delay: 390ms; }
.reveal-stagger > *:nth-child(8) { transition-delay: 455ms; }

/* admin reveal (same mechanic as public but scoped to logged-in pages) */
.reveal-admin { opacity: 0; transform: translateY(20px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal-admin.visible { opacity: 1; transform: none; }

/* ==========================================================================
   ELITE UI ENHANCEMENT LAYER - v2
   Overrides and extends the base styles above for a more refined, premium
   dashboard experience across admin, staff, and client portals.
   ========================================================================== */

/* ── Sidebar: pill-style navigation ──────────────────────────── */
.sidebar {
    background: linear-gradient(180deg, var(--surface) 0%, rgba(8,12,22,0.98) 100%);
    border-right: 1px solid rgba(212,175,55,0.07);
}
.sidebar nav a {
    border-radius: 9px;
    margin: 2px 10px;
    padding: 9px 14px;
    border-right: none !important;
    transition: background 0.15s, color 0.13s, box-shadow 0.15s;
}
.sidebar nav a:hover {
    background: rgba(212,175,55,0.07);
    color: var(--text-primary);
    box-shadow: none;
    border-right: none !important;
}
.sidebar nav a.active {
    background: linear-gradient(90deg, rgba(212,175,55,0.14), rgba(212,175,55,0.06));
    color: var(--gold);
    box-shadow: inset 0 0 0 1px rgba(212,175,55,0.18);
    border-right: none !important;
    font-weight: 600;
}
.sidebar nav a.active .nav-icon,
.sidebar nav a.active svg { opacity: 1; color: var(--gold); }
.sidebar-section-label {
    padding: 16px 22px 5px;
    font-size: 10px;
    letter-spacing: 0.1em;
}
[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f5f3ef 100%);
    border-right: 1px solid rgba(20,24,31,0.08);
}
[data-theme="light"] .sidebar nav a.active {
    background: linear-gradient(90deg, rgba(184,146,43,0.12), rgba(184,146,43,0.04));
}

/* ── Sticky glass topbar ──────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(8,12,20,0.88);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(212,175,55,0.09);
    margin: -32px -32px 24px;
    padding: 13px 32px;
}
[data-theme="light"] .topbar {
    background: rgba(248,246,242,0.9);
    border-bottom: 1px solid rgba(20,24,31,0.07);
}
@media (max-width: 1023px) {
    .topbar { margin: -20px -20px 20px; padding: 12px 20px; }
}

/* ── Enhanced card hover ──────────────────────────────────────── */
.card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    border-color: rgba(212,175,55,0.22);
    box-shadow: 0 6px 28px rgba(0,0,0,0.14), 0 1px 0 rgba(255,255,255,0.025) inset;
}
[data-theme="light"] .card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ── KPI card with gold top stripe on hover ───────────────────── */
.kpi-card {
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(212,175,55,0.35);
    box-shadow: 0 8px 32px rgba(212,175,55,0.1), 0 2px 8px rgba(0,0,0,0.15);
}

/* ── Premium button elevations ────────────────────────────────── */
.btn-gold {
    background: linear-gradient(135deg, #D4AF37 0%, #B89020 100%);
    box-shadow: 0 2px 10px rgba(212,175,55,0.28), 0 1px 0 rgba(255,255,255,0.12) inset;
    font-weight: 600;
}
.btn-gold:hover {
    background: linear-gradient(135deg, #E8C84A 0%, #D4AF37 100%);
    box-shadow: 0 6px 20px rgba(212,175,55,0.42), 0 1px 0 rgba(255,255,255,0.18) inset;
    transform: translateY(-1px);
    color: #080C14;
}
.btn-gold:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(212,175,55,0.3); }

.btn-outline {
    transition: all 0.15s ease;
}
.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212,175,55,0.05);
}

/* ── Table: gold left accent on row hover ─────────────────────── */
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: rgba(212,175,55,0.03); }
tbody tr:hover td:first-child { border-left: 2px solid rgba(212,175,55,0.35); }
td:first-child { border-left: 2px solid transparent; transition: border-color 0.15s; }
th { font-size: 11px; letter-spacing: 0.07em; }

/* ── Input enhanced focus ─────────────────────────────────────── */
input:focus, select:focus, textarea:focus {
    background: var(--surface);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.1), 0 1px 4px rgba(0,0,0,0.08);
}
label { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }

/* ── Empty state with gold icon ───────────────────────────────── */
.empty-state-icon {
    background: rgba(212,175,55,0.08);
    border: 1px solid rgba(212,175,55,0.2);
    color: var(--gold);
    transition: transform 0.2s;
}
.empty-state-icon:hover { transform: scale(1.06); }
.empty-state-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.empty-state-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.65; }

/* ── Quick-action buttons (refined) ──────────────────────────── */
.quick-action-btn {
    border-radius: 10px;
    transition: all 0.15s ease;
}
.quick-action-btn:hover {
    border-color: rgba(212,175,55,0.4);
    background: rgba(212,175,55,0.06);
    box-shadow: 0 4px 16px rgba(212,175,55,0.12);
    color: var(--gold);
    transform: translateY(-1px);
}

/* ── Notification badge pulse ─────────────────────────────────── */
.header-icon-badge {
    animation: badgePop 0.3s cubic-bezier(0.34,1.6,0.64,1) both;
}
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

/* ── Card subtle top gradient accent ─────────────────────────── */
.card-accent-top {
    border-top: 2px solid var(--gold);
}
.card-accent-top-success { border-top: 2px solid var(--success); }
.card-accent-top-danger  { border-top: 2px solid var(--danger); }

/* ── Data highlight chip ──────────────────────────────────────── */
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary);
}
.chip-gold    { background: rgba(212,175,55,0.1);  border-color: rgba(212,175,55,0.25);  color: var(--gold);    }
.chip-success { background: rgba(63,174,106,0.1);  border-color: rgba(63,174,106,0.25);  color: var(--success); }
.chip-danger  { background: rgba(214,83,74,0.1);   border-color: rgba(214,83,74,0.25);   color: var(--danger);  }
.chip-info    { background: rgba(91,141,239,0.1);  border-color: rgba(91,141,239,0.25);  color: #5B8DEF;        }

/* ── Refined scrollbar (final override) ──────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,0.4); }

/* ── Modal / overlay transitions ─────────────────────────────── */
.modal-enter { animation: modalIn 0.22s cubic-bezier(0.34,1.2,0.64,1) both; }
.modal-leave { animation: modalOut 0.18s ease forwards; }
@keyframes modalIn  { from { opacity:0; transform:scale(0.94) translateY(8px); } to { opacity:1; transform:scale(1) translateY(0); } }
@keyframes modalOut { from { opacity:1; transform:scale(1);           } to   { opacity:0; transform:scale(0.94); } }

/* ── Code inline (override) ───────────────────────────────────── */
code {
    font-family: 'JetBrains Mono','Fira Code','Cascadia Code',monospace;
    font-size: 0.865em;
    background: var(--surface-2);
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--gold);
}

/* ── Utility: text gold ───────────────────────────────────────── */
.text-gold    { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }

/* ── Page heading row ─────────────────────────────────────────── */
.page-heading {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.page-heading h1 {
    font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 0;
    font-family: 'Clash Display', sans-serif;
}
.page-heading p { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }

/* ── Inline divider ───────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Subtle glow on active sidebar items ─────────────────────── */
.sidebar nav a.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
}
.sidebar nav a { position: relative; }

/* ── Data table: header uppercase with proper weight ─────────── */
th {
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Card loading state (shimmer class alias) ─────────────────── */
.card-loading { pointer-events: none; }

/* ── Responsive topbar content overlap fix ───────────────────── */
@media (max-width: 767px) {
    .topbar { margin: -20px -16px 16px; padding: 11px 16px; }
    tbody tr:hover td:first-child { border-left: none; }
    td:first-child { border-left: none !important; }
}

/* ── Announcement / notice bar ───────────────────────────────── */
.notice-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: 8px; font-size: 13px;
    border: 1px solid var(--border);
}
.notice-bar-gold    { background: rgba(212,175,55,0.07);  border-color: rgba(212,175,55,0.25);  color: var(--gold);    }
.notice-bar-success { background: rgba(63,174,106,0.07);  border-color: rgba(63,174,106,0.25);  color: var(--success); }
.notice-bar-danger  { background: rgba(214,83,74,0.07);   border-color: rgba(214,83,74,0.25);   color: var(--danger);  }
.notice-bar-info    { background: rgba(91,141,239,0.07);  border-color: rgba(91,141,239,0.25);  color: #5B8DEF;        }

/* ── User avatar group (for team display) ────────────────────── */
.avatar-group { display: flex; align-items: center; }
.avatar-group .user-avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-group .user-avatar:first-child { margin-left: 0; }

/* ── Smooth page transitions with reveal ─────────────────────── */
.main-content { animation: contentFadeIn 0.3s ease both; }
@keyframes contentFadeIn { from { opacity: 0.6; } to { opacity: 1; } }

/* ── Active section glow for admin sidebar ───────────────────── */
.sidebar-section-label:has(+ a.active),
.sidebar-section-label + a.active ~ .sidebar-section-label { color: var(--gold); }

/* ── Print protection ────────────────────────────────────────── */
@media print {
    body { visibility: hidden !important; }
    body::after {
        visibility: visible !important;
        display: block;
        text-align: center;
        padding: 4em;
        font-size: 18px;
        color: #000;
        content: "This content is protected and cannot be printed.";
    }
}
