/* ════════════════════════════════════════════════════════════════
   admin.css — Waypoint OS Admin Dashboard
   Glass treatment — v2
   ════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --brand-navy: #1a2a44;
    --brand-navy-deep: #0d1928;
    --brand-gold: #b89548;
    --brand-gold-light: #e8c96a;
    --brand-green: #27ae60;
    --brand-red: #e74c3c;
    --brand-blue: #2980b9;
    --brand-orange: #f39c12;
    --brand-purple: #8e44ad;
    --bg-dark: #0a1220;
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(160deg, #0d1928 0%, #0a1220 50%, #0e1c35 100%);
    background-attachment: fixed;
    color: white;
    margin: 0; padding: 0;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ── ambient glow on the page itself ── */
body::before {
    content: '';
    position: fixed;
    top: -80px; left: -60px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(184,149,72,0.09) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    bottom: 10%; right: -80px;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(41,128,185,0.07) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* ── Nav ── */
.admin-nav {
    background: rgba(10,18,32,0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 24px rgba(0,0,0,0.3);
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: white; letter-spacing: -0.3px; }
.nav-link { color: rgba(255,255,255,0.4); padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.nav-link:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.07); }
.nav-link.active { color: var(--brand-gold-light); background: rgba(184,149,72,0.12); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: 13px; color: rgba(255,255,255,0.38); }
.nav-user span { color: var(--brand-gold-light); font-weight: 600; }

/* ── Glass button — the standard for all nav/utility buttons ── */
.btn-signout {
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.65);
    padding: 7px 14px;
    border-radius: 9px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-signout:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.22);
    color: white;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 4px 16px rgba(0,0,0,0.2);
}

/* ── Page Body ── */
.page-body { max-width: 100%; padding: 0 16px 100px; position: relative; z-index: 1; }

/* ── Command Center Tabs & State Filters ── */
.cc-tab, .cc-state {
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    line-height: 1;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}
.cc-tab:hover, .cc-state:hover {
    background: rgba(255,255,255,0.11);
    color: rgba(255,255,255,0.9);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 4px 12px rgba(0,0,0,0.2);
}
.cc-tab.active {
    background: rgba(184,149,72,0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--brand-gold-light);
    border-color: rgba(184,149,72,0.5);
    box-shadow: inset 0 1px 0 rgba(255,220,100,0.15), 0 0 14px rgba(184,149,72,0.15);
}
.cc-state.active {
    background: rgba(255,255,255,0.14);
    color: white;
    border-color: rgba(255,255,255,0.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

/* ── Mobile Bottom Nav ── */
.mobile-bottom-nav { display: none; }
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed; bottom: 0; left: 0; right: 0;
        background: rgba(10,18,32,0.88);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255,255,255,0.08);
        padding: 8px 0;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        z-index: 200;
        justify-content: space-around;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
    }
    .mobile-bottom-nav a { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: rgba(255,255,255,0.3); font-size: 10px; font-weight: 600; gap: 3px; padding: 4px 8px; min-width: 56px; }
    .mobile-bottom-nav a.active { color: var(--brand-gold-light); }
    .mobile-bottom-nav a .nav-icon { font-size: 20px; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .admin-nav { padding: 0 12px; height: 56px; }
    .nav-right .nav-user { display: none; }
}

/* ── Forms ── */
input, select, textarea { font-family: inherit; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(184,149,72,0.6) !important;
    box-shadow: 0 0 0 3px rgba(184,149,72,0.12) !important;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Signature Modal ── */
#sig-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); z-index: 500; overflow-y: auto; padding: 20px; }
.sig-content { background: #0f1e35; border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; max-width: 500px; margin: 80px auto; padding: 24px; box-shadow: 0 24px 64px rgba(0,0,0,0.5); }
.sig-content h3 { font-size: 16px; font-weight: 800; color: white; margin-bottom: 14px; }

/* ── Print ── */
@media print { .admin-nav, .mobile-bottom-nav { display: none !important; } }

/* ── Deal Cards in Pipeline ── */
.dashboard-grid { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.dashboard-grid > div {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 20px rgba(0,0,0,0.2);
    transition: all 0.2s;
    color: white;
}
.dashboard-grid > div:hover {
    border-color: rgba(255,255,255,0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 32px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

/* ── Tables ── */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table th { text-align: left; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.8px; padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
table td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); color: rgba(255,255,255,0.8); font-weight: 500; }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Summary / Section Cards ── */
.page-body h2, .page-body h3 { font-weight: 800; color: white; }
.page-body > div > div[style*="background"] { border-radius: 14px !important; }

/* ── Force glass card on JS-generated content sections ── */
div[style*="max-width:1400px"] > div:not([style*="grid"]):not([style*="flex"]) > table {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
}

/* ── Section Cards (pipeline, docs, fees, recruiting) ── */
.pipeline-section, .docs-section, .fees-section, .recruiting-section {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 20px 24px;
    margin: 20px auto 0;
    max-width: 1400px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 24px rgba(0,0,0,0.2);
}
.pipeline-section h3, .docs-section h3, .fees-section h3, .recruiting-section h3 {
    font-size: 16px; font-weight: 800; color: white;
}
.pipeline-table, .fees-table {
    width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px;
}
.pipeline-table th, .fees-table th {
    text-align: left; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.35);
    text-transform: uppercase; letter-spacing: 0.8px; padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pipeline-table td, .fees-table td {
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8); font-weight: 500;
}
.pipeline-table tr:last-child td, .fees-table tr:last-child td { border-bottom: none; }
.pipeline-table tr:hover td, .fees-table tr:hover td { background: rgba(255,255,255,0.03); }

.fees-month-nav { display: flex; align-items: center; gap: 12px; }
.month-btn {
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-family: inherit;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.month-btn:hover { background: rgba(255,255,255,0.12); color: white; }
.month-label { font-size: 15px; font-weight: 700; color: white; min-width: 140px; text-align: center; }

.recruit-tree { margin-top: 14px; }
.no-recruits { text-align: center; padding: 20px; color: rgba(255,255,255,0.25); font-size: 13px; }

/* ── Commission Breakdown (Math Path) ── */
.math-path {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px 18px;
    margin-top: 12px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}
.math-path .mp-header {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: rgba(255,255,255,0.3);
    margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.math-path .step-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 0; font-size: 13px; color: rgba(255,255,255,0.6);
}
.math-path .step-row strong { font-weight: 700; color: white; white-space: nowrap; }
.math-path .step-row.deduction { color: #f87171; }
.math-path .step-row.deduction strong { color: #f87171; }
.math-path .step-row.net-total {
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 6px; padding-top: 8px;
    font-weight: 800; font-size: 14px; color: white;
}
.math-path .step-row.net-total strong { color: white; font-size: 14px; }
.math-path .mp-divider { border: none; border-top: 1px dashed rgba(255,255,255,0.08); margin: 10px 0; }
.math-path .payout-block {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.math-path .payout-block .payout-name {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700; font-size: 14px; color: white;
}
.math-path .payout-block .payout-name strong { color: #4ade80; font-size: 15px; }
.math-path .payout-block .payout-detail {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 3px; padding-top: 3px;
}
.math-path .payout-block .payout-detail .split-tag {
    background: rgba(231,76,60,0.15);
    color: #f87171;
    font-weight: 700; font-size: 10px;
    padding: 2px 8px; border-radius: 20px; white-space: nowrap;
    border: 1px solid rgba(231,76,60,0.25);
}
.math-path .company-final {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(26,42,68,0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white; font-weight: 800; font-size: 14px;
    padding: 10px 14px; border-radius: 10px; margin-top: 4px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.math-path .company-final strong { color: var(--brand-gold-light); font-size: 15px; }
