/* ============================================================
   Neroz Operations Brain — Command Center design system v2
   Deep-space navy · Neroz purple #A55BFF · Inter + JetBrains Mono
   Same selectors as v1 — pure visual upgrade, no template changes.
   ============================================================ */

:root {
    --bg: #0a0c12;
    --surface: #12151f;
    --surface-2: #171b28;
    --surface-3: #1d2232;
    --hair: rgba(255, 255, 255, 0.06);
    --hair-strong: rgba(255, 255, 255, 0.11);
    --brand: #a55bff;
    --brand-soft: rgba(165, 91, 255, 0.12);
    --brand-border: rgba(165, 91, 255, 0.38);
    --brand-glow: rgba(165, 91, 255, 0.22);
    --t1: #edf0f7;
    --t2: #b7bfd1;
    --t3: #6b7387;
    --green: #2fd98b;
    --green-bg: rgba(47, 217, 139, 0.10);
    --green-bd: rgba(47, 217, 139, 0.32);
    --red: #ff5d5d;
    --red-bg: rgba(255, 93, 93, 0.10);
    --red-bd: rgba(255, 93, 93, 0.32);
    --yellow: #ffc24b;
    --yellow-bg: rgba(255, 194, 75, 0.10);
    --yellow-bd: rgba(255, 194, 75, 0.32);
    --blue: #58b9ff;
    --blue-bg: rgba(88, 185, 255, 0.10);
    --blue-bd: rgba(88, 185, 255, 0.32);
    --mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { scrollbar-color: #2a3046 transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3046; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(165, 91, 255, 0.35); color: #fff; }

body {
    font-family: var(--sans);
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(165, 91, 255, 0.07), transparent 60%),
        radial-gradient(900px 420px at -10% 0%, rgba(88, 185, 255, 0.05), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    color: var(--t2);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: #c9a2ff; text-decoration: none; transition: color .15s; }
a:hover { color: #e0c8ff; }

:focus-visible { outline: 2px solid var(--brand-border); outline-offset: 2px; border-radius: 4px; }

/* ---------------- Nav ---------------- */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 15, 23, 0.82);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--hair);
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 54px;
    gap: 2px;
    white-space: nowrap;
}
nav .brand {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--t1);
    margin-right: 20px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 9px;
}
nav .brand::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 10px var(--brand), 0 0 22px var(--brand-glow);
    flex: 0 0 8px;
}
nav a.tab {
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--t3);
    border-radius: 999px;
    border: 1px solid transparent;
    border-bottom: none;
    transition: all .15s;
    line-height: 1.4;
}
nav a.tab:hover { color: var(--t1); background: rgba(255, 255, 255, 0.05); }
nav a.tab.active {
    color: #e6d5ff;
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    box-shadow: 0 0 14px rgba(165, 91, 255, 0.12);
}

/* ---------------- Layout ---------------- */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px 56px; }
h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 22px;
    color: var(--t1);
}
h2 {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: 30px 0 12px;
    color: var(--t3);
    display: flex;
    align-items: center;
    gap: 8px;
}
h2::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 8px var(--brand-glow);
    flex: 0 0 5px;
}

/* ---------------- KPI cards ---------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}
.kpi-card {
    position: relative;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--hair);
    border-radius: 14px;
    padding: 18px 18px 16px;
    overflow: hidden;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}
.kpi-card:hover {
    border-color: var(--hair-strong);
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.kpi-card .label {
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}
.kpi-card .value {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--t1);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.kpi-card .value.green { color: var(--green); text-shadow: 0 0 22px rgba(47, 217, 139, 0.25); }
.kpi-card .value.red { color: var(--red); text-shadow: 0 0 22px rgba(255, 93, 93, 0.25); }
.kpi-card .value.yellow { color: var(--yellow); text-shadow: 0 0 22px rgba(255, 194, 75, 0.25); }
.kpi-card .value.blue { color: var(--blue); text-shadow: 0 0 22px rgba(88, 185, 255, 0.25); }
.kpi-card .sub { font-size: 12px; color: var(--t3); margin-top: 5px; }

/* ---------------- Tables ---------------- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--hair);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 26px;
    font-size: 13px;
}
thead th {
    background: rgba(255, 255, 255, 0.025);
    padding: 11px 16px;
    text-align: left;
    font-family: var(--mono);
    font-weight: 600;
    color: var(--t3);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--hair-strong);
}
tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--hair);
    color: var(--t2);
    font-variant-numeric: tabular-nums;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(165, 91, 255, 0.045); }
tbody tr:last-child td { border-bottom: none; }

/* ---------------- Badges ---------------- */
.badge {
    display: inline-block;
    padding: 2.5px 10px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    line-height: 1.5;
}
.badge.active,
.badge.completed,
.badge.ok,
.badge.approved,
.badge.executed,
.badge.high { background: var(--green-bg); color: var(--green); border-color: var(--green-bd); }
.badge.past-due,
.badge.rejected,
.badge.canceled { background: rgba(255, 145, 77, 0.10); color: #ff914d; border-color: rgba(255, 145, 77, 0.32); }
.badge.unpaid,
.badge.failed,
.badge.critical { background: var(--red-bg); color: var(--red); border-color: var(--red-bd); }
.badge.incomplete { background: var(--brand-soft); color: #c9a2ff; border-color: var(--brand-border); }
.badge.logged,
.badge.low,
.badge.normal { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-bd); }
.badge.running,
.badge.pending,
.badge.medium { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-bd); }

/* ---------------- Login ---------------- */
.login-box {
    max-width: 380px;
    margin: 130px auto;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--hair-strong);
    border-radius: 18px;
    padding: 38px 34px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(165, 91, 255, 0.06);
}
.login-box h1 { margin-bottom: 8px; font-size: 20px; }
.login-box p { color: var(--t3); font-size: 13px; margin-bottom: 22px; }
.login-box input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--hair-strong);
    border-radius: 9px;
    color: var(--t1);
    font-size: 14px;
    font-family: var(--sans);
    margin-bottom: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.login-box input:focus {
    outline: none;
    border-color: var(--brand-border);
    box-shadow: 0 0 0 3px rgba(165, 91, 255, 0.14);
}
.login-box button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(180deg, #b06dff, #9a4df5);
    border: none;
    border-radius: 9px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    font-family: var(--sans);
    cursor: pointer;
    transition: filter .15s, box-shadow .15s;
    box-shadow: 0 6px 22px rgba(165, 91, 255, 0.28);
}
.login-box button:hover { filter: brightness(1.08); box-shadow: 0 8px 28px rgba(165, 91, 255, 0.38); }
.login-box .error { color: var(--red); font-size: 13px; margin-bottom: 12px; }

/* ---------------- Misc ---------------- */
.muted { color: var(--t3); }
.mono { font-family: var(--mono); font-size: 12px; }
.section { margin-bottom: 34px; }
.green { color: var(--green); }
.red { color: var(--red); }

/* ---------------- CEO dashboard ---------------- */
.ceo-header { margin-bottom: 22px; }
.ceo-header h1 { font-size: 22px; margin-bottom: 4px; }
.ceo-date { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--t3); }

.ceo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 768px) {
    .ceo-grid { grid-template-columns: 1fr; }
    .container { padding: 20px 14px 44px; }
    nav { padding: 0 12px; }
}

.ceo-section { min-width: 0; }
.ceo-section h2 { margin-top: 0; }

.change-list { display: flex; flex-direction: column; gap: 7px; }
.change-item {
    font-size: 13.5px;
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--hair);
    border-left: 3px solid var(--hair-strong);
}
.change-item.positive { border-left-color: var(--green); background: linear-gradient(90deg, rgba(47, 217, 139, 0.05), var(--surface) 45%); }
.change-item.negative { border-left-color: var(--red); background: linear-gradient(90deg, rgba(255, 93, 93, 0.05), var(--surface) 45%); }
.change-item.warning { border-left-color: var(--yellow); background: linear-gradient(90deg, rgba(255, 194, 75, 0.05), var(--surface) 45%); }

.attention-list { display: flex; flex-direction: column; gap: 7px; }
.attention-item {
    font-size: 13px;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(255, 93, 93, 0.06), var(--surface) 45%);
    border: 1px solid var(--hair);
    border-radius: 9px;
    border-left: 3px solid var(--red);
}

.alert-bar { margin-bottom: 18px; display: flex; flex-direction: column; gap: 7px; }
.alert-item {
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
}
.alert-warning { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-bd); }
.alert-danger { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-bd); }
.alert-info { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-bd); }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bd); }

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 13px;
    margin-bottom: 26px;
}
.action-card {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--hair);
    border-radius: 13px;
    padding: 17px;
    transition: border-color .2s, box-shadow .2s;
}
.action-card:hover { border-color: var(--brand-border); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3), 0 0 24px rgba(165, 91, 255, 0.07); }
.action-title { font-size: 14px; font-weight: 600; color: var(--t1); margin-bottom: 6px; }
.action-reason { font-size: 12.5px; color: var(--t3); margin-bottom: 9px; line-height: 1.5; }
.action-meta { display: flex; align-items: center; gap: 8px; }
.action-impact { font-size: 13px; font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }

a.change-item { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.change-item:hover { border-color: var(--brand-border); transform: translateX(2px); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
a.action-card { text-decoration: none; color: inherit; display: block; cursor: pointer; }

/* ---------------- Approval buttons ---------------- */
.button-approve {
    padding: 7px 18px;
    border: 1px solid var(--green-bd);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--sans);
    background: var(--green-bg);
    color: var(--green);
    transition: background .15s, box-shadow .15s;
}
.button-approve:hover { background: rgba(47, 217, 139, 0.2); box-shadow: 0 0 18px rgba(47, 217, 139, 0.18); }
.button-reject {
    padding: 7px 18px;
    border: 1px solid var(--red-bd);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--sans);
    background: var(--red-bg);
    color: var(--red);
    transition: background .15s, box-shadow .15s;
}
.button-reject:hover { background: rgba(255, 93, 93, 0.2); box-shadow: 0 0 18px rgba(255, 93, 93, 0.18); }


/* ---------------- Nav groups (dropdowns) ---------------- */
.navgrp { position: relative; outline: none; }
/* Keyboard focus ring: the menu opens on focus, so surface where focus landed. */
.navgrp:focus-visible .tab.grp {
    outline: 2px solid var(--brand-border);
    outline-offset: 2px;
    border-radius: 999px;
}
.navgrp .tab.grp { display: inline-flex; align-items: center; gap: 5px; cursor: default; }
.navgrp .caret { font-size: 9px; opacity: .55; }
.navdd {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 168px;
    background: rgba(16, 19, 29, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid var(--hair-strong);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 200;
}
.navgrp:hover .navdd,
.navgrp:focus-within .navdd { display: block; }
/* Hover-bridge on the dropdown itself: a transparent strip filling the exact 6px
   gap directly above the open menu, spanning only the menu's own width. It exists
   only while the menu is open (.navdd is display:none when closed) and never
   extends past the menu, so moving from the label into the menu keeps :hover alive
   with no sibling overhang and no interception of page clicks. */
.navdd::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 6px;
}
.navdd a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--t2);
}
.navdd a:hover { background: rgba(255, 255, 255, 0.06); color: var(--t1); }
.navdd a.active { background: var(--brand-soft); color: #e6d5ff; }
@media (max-width: 900px) {
    nav { overflow-x: auto; scrollbar-width: none; }
    nav::-webkit-scrollbar { display: none; }
    .navdd { position: fixed; left: 12px; right: 12px; min-width: 0; }
}
