/* ═══════════════════════════════════════════════════════════════════════════
   AI COO Command Center — Executive Design System
   ═══════════════════════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Surfaces */
    --bg:            #0a0d13;
    --surface:       #12161f;
    --surface-2:     #161b25;
    --surface-raise: linear-gradient(165deg, #1a212c 0%, #12161f 100%);
    --border:        #232b38;
    --border-strong: #313c4d;
    /* Text */
    --text:          #e9eef5;
    --text-2:        #9da7b3;
    --muted:         #6e7b8a;
    /* Accents */
    --accent:        #4c8dff;
    --accent-2:      #a371f7;
    --ok:            #3fb950;
    --warn:          #e3a008;
    --danger:        #f85149;
    --cyan:          #22d3ee;
    /* Radius / shadow / space */
    --r-sm: 7px;  --r: 10px;  --r-lg: 14px;
    --shadow:   0 1px 3px rgba(0,0,0,.3);
    --shadow-2: 0 8px 24px rgba(0,0,0,.4);
    --glow: 0 0 0 1px rgba(76,141,255,.14), 0 8px 24px rgba(0,0,0,.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text-2);
    line-height: 1.5;
    font-size: 14px;
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a323f; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #3a4150; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ── App Shell ─────────────────────────────────────────────────────────────── */

#app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    /* Horizontal padding scales with viewport so content stays a comfortable
       width on ultra-wide monitors instead of stretching edge-to-edge.
       Applies to every page for a consistent fit. */
    padding: 1.75rem clamp(1.5rem, 6vw, 11rem);
    background:
        radial-gradient(900px 500px at 100% -10%, rgba(88,166,255,.06), transparent 60%),
        radial-gradient(800px 500px at -5% 5%, rgba(163,113,247,.05), transparent 55%),
        #0b0e14;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */

.sidebar {
    width: 232px;
    min-width: 232px;
    background: linear-gradient(180deg, #0c1017 0%, #090c12 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sb-logo {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.15rem 1.1rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sb-brand-block {
    display: flex; align-items: center; gap: .65rem;
    padding: 1.1rem 1rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sb-gem {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, rgba(76,141,255,.18), rgba(163,113,247,.12));
    border: 1px solid rgba(120,140,255,.3);
    box-shadow: 0 0 16px rgba(76,141,255,.25);
}
.sb-brand-title { font-weight: 800; font-size: 1.05rem; color: var(--text); letter-spacing: -.01em; line-height: 1.1; }
.sb-brand-sub { font-size: .72rem; color: var(--accent); font-weight: 600; }

.sb-identity {
    border-top: 1px solid var(--border);
    padding: .85rem 1rem;
    flex-shrink: 0;
}
.sb-id-name { font-weight: 700; font-size: .82rem; color: var(--text); }
.sb-id-desc { font-size: .68rem; color: var(--muted); line-height: 1.4; margin-bottom: .3rem; }
.sb-id-ver { font-size: .68rem; color: var(--muted); }
.sb-id-ver .dot { font-size: .5rem; }

.sb-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
    display: block;
}

.sb-logomark {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, #1f6feb, #388bfd);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .7rem; color: #fff;
    flex-shrink: 0;
}

.sb-brand { font-weight: 700; font-size: .85rem; color: var(--text); }

.sb-nav { flex: 1; padding: .6rem .55rem; }

.sb-section {
    padding: .85rem .55rem .3rem;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .09em;
    color: var(--muted);
    text-transform: uppercase;
}

.si {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .7rem;
    margin: .1rem 0;
    color: var(--text-2);
    text-decoration: none;
    font-size: .84rem;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: background .12s, color .12s, box-shadow .12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.si:hover { background: rgba(255,255,255,.04); color: var(--text); }
.si.active {
    background: linear-gradient(90deg, rgba(76,141,255,.16), rgba(76,141,255,.04));
    color: #cfe0ff;
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--accent);
}
.si.active .si-icon { color: var(--accent); }
.si.muted { color: var(--muted); font-style: italic; font-size: .78rem; cursor: default; }
.si:hover.muted { background: none; color: var(--muted); }

.si-icon { width: 15px; height: 15px; flex-shrink: 0; }

.sb-foot {
    border-top: 1px solid #21262d;
    padding: .75rem 1rem;
    flex-shrink: 0;
}

.sb-foot-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    color: #8b949e;
    margin-bottom: .3rem;
}

.sb-foot-ver { font-size: .72rem; color: var(--text-2); }

/* ── Top Header ────────────────────────────────────────────────────────────── */

.top-header {
    height: 60px;
    min-height: 60px;
    background: rgba(10,13,19,.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    flex-shrink: 0;
    gap: 1rem;
}

.hdr-left { display: flex; flex-direction: column; gap: .1rem; }

.hdr-title {
    font-size: 1rem;
    font-weight: 700;
    color: #e6edf3;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.ver-pill {
    font-size: .65rem;
    padding: .1rem .45rem;
    background: #1f6feb22;
    border: 1px solid #1f6feb55;
    color: #58a6ff;
    border-radius: 20px;
    font-weight: 500;
}

.hdr-sub { font-size: .73rem; color: var(--muted); }

.hdr-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.sys-status {
    font-size: .76rem;
    color: #7ee2a8;
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    background: rgba(63,185,80,.1);
    border: 1px solid rgba(63,185,80,.25);
    border-radius: 20px;
}
.sys-status .dot { text-shadow: 0 0 6px currentColor; }

.hdr-ts { font-size: .73rem; color: var(--muted); }

.hdr-avatar {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #4c8dff, #a371f7);
    color: #fff; font-weight: 800; font-size: .78rem;
}

.icon-btn {
    background: none;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #8b949e;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .15s;
}
.icon-btn:hover { border-color: #8b949e; color: #e6edf3; background: #161b22; }
.icon-btn svg { width: 14px; height: 14px; }

/* ── Status Dots ───────────────────────────────────────────────────────────── */

.dot { font-size: .55rem; }
.dot.ok  { color: #3fb950; }
.dot.off { color: #6e7681; }
.dot.warn { color: #d29922; }

/* ── Badges ────────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: .18rem .5rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.badge-green  { background: rgba(63,185,80,.14);  color: #56d364; border: 1px solid rgba(63,185,80,.25); }
.badge-blue   { background: rgba(76,141,255,.14); color: #79b0ff; border: 1px solid rgba(76,141,255,.25); }
.badge-red    { background: rgba(248,81,73,.14);  color: #ff7b72; border: 1px solid rgba(248,81,73,.25); }
.badge-yellow { background: rgba(227,160,8,.14);  color: #e3b341; border: 1px solid rgba(227,160,8,.25); }
.badge-gray   { background: rgba(139,148,158,.12);color: #9da7b3; border: 1px solid rgba(139,148,158,.2); }
.badge-purple { background: rgba(163,113,247,.14);color: #c8a6ff; border: 1px solid rgba(163,113,247,.25); }

/* ── Page Loading & Errors ─────────────────────────────────────────────────── */

.init-loading, .page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-2);
    flex-direction: column;
    gap: .75rem;
}

.spinner {
    width: 20px; height: 20px;
    border: 2px solid #21262d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.err-panel {
    background: #1f1515;
    border: 1px solid #f8514955;
    border-radius: 8px;
    padding: 1.5rem;
    color: #ffa198;
}
.err-panel h3 { margin-bottom: .5rem; }
.err-panel button {
    margin-top: .75rem;
    padding: .4rem .9rem;
    background: #3d1a1a;
    border: 1px solid #f85149;
    color: #ffa198;
    border-radius: 6px;
    cursor: pointer;
}

/* ── KPI Row ───────────────────────────────────────────────────────────────── */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: .65rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: linear-gradient(160deg, #1a2029 0%, #14181f 100%);
    border: 1px solid #2a313c;
    border-radius: 10px;
    padding: .9rem .95rem;
    transition: border-color .18s, transform .18s, box-shadow .18s;
}
.kpi-card:hover {
    border-color: #3d6fd6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.35), 0 0 0 1px rgba(88,166,255,.12);
}

/* Workforce overview cards — shared depth + hover across pages */
.wf-emp-card {
    background: linear-gradient(160deg, #1a2029 0%, #14181f 100%);
    border: 1px solid #2a313c;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    transition: border-color .18s, transform .18s, box-shadow .18s;
}
.wf-emp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 0 1px rgba(88,166,255,.1);
}

.kpi-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e6edf3;
    line-height: 1.2;
    margin-bottom: .2rem;
}

.kpi-lbl {
    font-size: .73rem;
    color: #8b949e;
    font-weight: 500;
    margin-bottom: .1rem;
}

.kpi-sub { font-size: .68rem; color: #6e7b8a; }

/* ── Section Layout ────────────────────────────────────────────────────────── */

.dash-section { margin-bottom: 1.5rem; }

.section-hdr {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    margin-bottom: .85rem;
}

.section-title {
    font-size: .95rem;
    font-weight: 600;
    color: #e6edf3;
    position: relative;
    padding-left: .65rem;
}
.section-title::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 1em;
    border-radius: 2px;
    background: linear-gradient(#58a6ff, #a371f7);
}

.section-meta { font-size: .78rem; color: #6e7b8a; }

.dash-panels {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.panel {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1rem;
}

.panel-title {
    font-size: .82rem;
    font-weight: 600;
    color: #e6edf3;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #21262d;
}

.panel-link {
    background: none;
    border: none;
    color: #58a6ff;
    font-size: .78rem;
    cursor: pointer;
    padding: .4rem 0 0;
    display: block;
    text-align: left;
}
.panel-link:hover { text-decoration: underline; }

/* ── Workforce Grid ────────────────────────────────────────────────────────── */

.workforce-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .85rem;
}

.emp-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.emp-card:hover { border-color: #388bfd55; background: #1c2128; }

.emp-card-header {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: .75rem;
}

.emp-avatar {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: 1px solid #30363d;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
}

.emp-info { flex: 1; min-width: 0; }
.emp-name { font-weight: 600; color: #e6edf3; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-role { font-size: .72rem; color: var(--text-2); margin-top: .1rem; }

.emp-metrics {
    display: flex;
    gap: 0;
    border-top: 1px solid #21262d;
    border-bottom: 1px solid #21262d;
    margin-bottom: .65rem;
}

.emp-metric {
    flex: 1;
    text-align: center;
    padding: .45rem .25rem;
    border-right: 1px solid #21262d;
}
.emp-metric:last-child { border-right: none; }

.emp-metric-val { font-size: .9rem; font-weight: 700; color: #e6edf3; }
.emp-metric-lbl { font-size: .65rem; color: var(--text-2); margin-top: .1rem; }

.emp-health {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .75rem;
}

.emp-health-quick { color: #58a6ff; font-size: .72rem; }

.emp-card-qa {
    display: flex;
    gap: .4rem;
    margin-top: .55rem;
    padding-top: .55rem;
    border-top: 1px solid #21262d;
}

.emp-qa-btn {
    flex: 1;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #58a6ff;
    padding: .25rem .4rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: .72rem;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.emp-qa-btn:hover { border-color: #388bfd; background: #1c2128; }
.emp-qa-btn:disabled { opacity: .5; cursor: default; }

.emp-qa-start {
    background: #0d2215;
    border-color: #1a7f37;
    color: #3fb950;
    font-weight: 600;
}
.emp-qa-start:hover { background: #122a1a; border-color: #2ea043; }

.emp-qa-warn { border-color: #bb8009; color: #d29922; }
.emp-qa-warn:hover { background: #1a1000; }

/* ── Activity Feed ─────────────────────────────────────────────────────────── */

.activity-list { display: flex; flex-direction: column; gap: .5rem; }

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}

.activity-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-top: .35rem;
    flex-shrink: 0;
}

.activity-body { flex: 1; min-width: 0; }
.activity-label { font-size: .8rem; color: #c9d1d9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-sub { font-size: .72rem; color: var(--text-2); margin-top: .1rem; }

/* ── Decision Panel ────────────────────────────────────────────────────────── */

.decision-list { display: flex; flex-direction: column; gap: .35rem; }

.dec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .3rem 0;
    border-bottom: 1px solid #21262d;
}
.dec-item:last-child { border-bottom: none; }

.dec-stage { font-size: .78rem; color: #8b949e; }
.dec-outcome { font-size: .72rem; font-weight: 600; padding: .1rem .4rem; border-radius: 4px; }
.dec-outcome.ok      { background: #1f4a2a22; color: #3fb950; }
.dec-outcome.err     { background: #3d1a1a22; color: #f85149; }
.dec-outcome.neutral { background: #21262d; color: #8b949e; }

/* ── Workflow Panel ────────────────────────────────────────────────────────── */

.wf-list { display: flex; flex-direction: column; gap: .6rem; }

.wf-item { }
.wf-progress-bar { height: 4px; background: #21262d; border-radius: 2px; margin-bottom: .25rem; overflow: hidden; }
.wf-progress-fill { height: 100%; border-radius: 2px; }
.wf-meta { display: flex; justify-content: space-between; }
.wf-req { font-size: .75rem; color: #8b949e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.wf-pct { font-size: .72rem; color: var(--text-2); flex-shrink: 0; }

/* ── Timeline ──────────────────────────────────────────────────────────────── */

.timeline-wrap {
    position: relative;
    height: 100px;
    margin: .5rem 1rem;
}

.tl-line {
    position: absolute;
    top: 20px;
    left: 0; right: 0;
    height: 2px;
    background: #30363d;
}

.tl-stop {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tl-dot {
    width: 12px; height: 12px;
    background: #1f6feb;
    border: 2px solid #58a6ff;
    border-radius: 50%;
    margin-bottom: .4rem;
    margin-top: 14px;
}

.tl-label { text-align: center; max-width: 90px; }
.tl-time { font-size: .68rem; color: var(--text-2); }
.tl-evt  { font-size: .7rem; color: #8b949e; margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-out  { font-size: .68rem; font-weight: 600; margin-top: .1rem; }
.tl-out.ok { color: #3fb950; }
.tl-out.neutral { color: #8b949e; }

/* ── Health Table ──────────────────────────────────────────────────────────── */

.health-table {
    width: 100%;
    border-collapse: collapse;
}

.health-table th {
    text-align: left;
    padding: .5rem .75rem;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid #21262d;
}

.health-table td {
    padding: .55rem .75rem;
    font-size: .8rem;
    color: #c9d1d9;
    border-bottom: 1px solid #21262d;
}

.health-table tr:last-child td { border-bottom: none; }
.health-table tbody tr:hover { background: #1c2128; }

/* ── Employee Detail ───────────────────────────────────────────────────────── */

.back-btn {
    background: none;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: .4rem .85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .8rem;
    margin-bottom: 1.25rem;
    display: inline-block;
}
.back-btn:hover { border-color: #8b949e; color: #c9d1d9; }

.emp-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.emp-detail-avatar {
    width: 52px; height: 52px;
    border-radius: 10px;
    border: 1px solid #30363d;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.emp-detail-info { flex: 1; }
.emp-detail-info h1 { font-size: 1.15rem; color: #e6edf3; margin-bottom: .2rem; }
.emp-detail-meta { font-size: .78rem; color: #8b949e; }

.emp-detail-badges { display: flex; gap: .5rem; flex-shrink: 0; }

.emp-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .65rem;
    margin-bottom: 1rem;
}

.detail-section {
    background: linear-gradient(165deg, #171d25 0%, #12161d 100%);
    border: 1px solid #262d38;
    border-radius: 10px;
    padding: .85rem 1rem;
    margin-bottom: .8rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}

/* ── Operational Controls ──────────────────────────────────────────────────── */

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.controls-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.controls-result {
    padding: .55rem .8rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: .8rem;
    color: #c9d1d9;
    line-height: 1.5;
}

/* ── Page View Styles (Workflows, Decisions, etc.) ─────────────────────────── */

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #f0f4f9;
    margin-bottom: 1.15rem;
}

/* Tab bar (detail pages) */
.tab-bar {
    display: flex; gap: .15rem; flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.pd-tab {
    background: none; border: none; cursor: pointer;
    color: var(--text-2); font-size: .82rem; font-weight: 500;
    padding: .55rem .9rem; border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: color .12s, border-color .12s;
}
.pd-tab:hover { color: var(--text); }
.pd-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.ck-banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    background: linear-gradient(120deg, rgba(76,141,255,.08), rgba(163,113,247,.06));
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: .8rem 1.35rem;
}

/* Cockpit: single-viewport fixed layout, no page scroll */
.cockpit-fit {
    height: calc(100vh - 60px - 3.9rem);
    display: flex;
    flex-direction: column;
    gap: .7rem;
    overflow: hidden;
}
.cockpit-fit > * { margin-bottom: 0 !important; flex-shrink: 0; }
.cockpit-fit .ck-grow { flex: 1; min-height: 0; }
.cockpit-fit .ck-grow > * { max-height: 100%; overflow-y: auto; }
/* tighten section padding inside the cockpit so it all fits */
.cockpit-fit .detail-section { padding: .85rem 1.1rem; }

.placeholder-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-2);
    font-size: 1.1rem;
}

/* ── Chips / Tags ──────────────────────────────────────────────────────────── */

.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }

.chip {
    padding: .3rem .7rem;
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 20px;
    font-size: .78rem;
    color: #c9d1d9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: border-color .15s;
}
.chip:hover { border-color: #388bfd; }

.chip-badge {
    font-size: .65rem;
    padding: .05rem .35rem;
    border-radius: 10px;
    background: #21262d;
    color: #8b949e;
    font-weight: 600;
}
.chip-badge.ok   { background: #1f4a2a22; color: #3fb950; }
.chip-badge.warn { background: #3d2f0022; color: #d29922; }

/* ── Mini Elements ─────────────────────────────────────────────────────────── */

.mini-bar {
    display: inline-block;
    width: 60px; height: 4px;
    background: #21262d;
    border-radius: 2px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: .3rem;
}

.empty-state {
    color: var(--text-2);
    font-size: .8rem;
    padding: .75rem 0;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BACKWARD-COMPATIBLE CLASSES (used by existing render methods)
   ═══════════════════════════════════════════════════════════════════════════ */

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.25rem;
    transition: border-color .15s;
}
.card:hover { border-color: #8b949e55; }

.card-title    { font-size: .95rem; font-weight: 600; color: #e6edf3; margin-bottom: .4rem; }
.card-subtitle { font-size: .78rem; color: var(--text-2); margin-bottom: .75rem; }
.card-value    { font-size: 1.6rem; font-weight: 700; color: #58a6ff; }

.list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: .75rem;
}
.list-table thead { background: transparent; }
.list-table th {
    padding: .55rem .85rem;
    text-align: left;
    font-weight: 600;
    font-size: .7rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.list-table td {
    padding: .7rem .85rem;
    border-bottom: 1px solid rgba(35,43,56,.6);
    color: #c9d1d9;
    font-size: .82rem;
}
.list-table tbody tr { transition: background .12s; }
.list-table tr:hover { background: rgba(255,255,255,.025); }
.list-table tr:last-child td { border-bottom: none; }

.status-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
}
.status-badge.operational { background: #1f4a2a; color: #3fb950; }
.status-badge.degraded    { background: #3d2f00; color: #d29922; }
.status-badge.offline     { background: #3d1a1a; color: #f85149; }
.status-badge.in-progress { background: #0d2340; color: #58a6ff; }

.progress-bar {
    background: #21262d;
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    margin-top: .4rem;
}
.progress-fill {
    background: linear-gradient(90deg, #1f6feb, #58a6ff);
    height: 100%;
    transition: width .3s ease;
}

.loading { text-align: center; color: var(--text-2); padding: 2rem; }

.error {
    background: #1f1515;
    border: 1px solid #f8514955;
    color: #ffa198;
    padding: .85rem;
    border-radius: 6px;
    margin-bottom: .75rem;
    font-size: .82rem;
}

.module-title { font-size: 1.1rem; font-weight: 600; color: #e6edf3; margin-bottom: 1rem; }

.submit-form {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.submit-form button:hover:not(:disabled) { background: #1f6feb; }
.submit-form button:disabled { opacity: .45; cursor: not-allowed; }

/* ── Operations Readiness Panel ─────────────────────────────────────────────── */

.ops-readiness-panel {
    background: #12100a;
    border: 1px solid #bb800944;
    border-radius: 8px;
    padding: 1rem 1.1rem;
    max-width: 560px;
}
.ops-readiness-header {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .85rem;
}
.ops-readiness-title {
    font-weight: 600;
    color: #e6edf3;
    font-size: .95rem;
}
.ops-readiness-body {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: .85rem;
}
.ops-readiness-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: .5rem;
    font-size: .8rem;
}
.ops-readiness-label { color: var(--text-2); }
.ops-readiness-value { color: #c9d1d9; }
.ops-readiness-startup {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    border-top: 1px solid #21262d;
    padding-top: .75rem;
    margin-bottom: .75rem;
}
.ops-readiness-mode { }
.ops-readiness-mode-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-2);
    margin-bottom: .3rem;
}
.ops-readiness-cmd {
    background: #010409;
    border: 1px solid #30363d;
    border-radius: 5px;
    padding: .5rem .75rem;
    font-family: ui-monospace, Consolas, monospace;
    font-size: .82rem;
    color: #3fb950;
    margin: 0;
}
.ops-readiness-mode-desc {
    font-size: .78rem;
    color: #8b949e;
    padding: .35rem .6rem;
    background: #161b22;
    border-radius: 4px;
    border: 1px solid #21262d;
}
.ops-readiness-note {
    font-size: .76rem;
    color: var(--text-2);
    border-top: 1px solid #21262d;
    padding-top: .6rem;
}

/* ── AI Configuration Center ─────────────────────────────────────────────────── */

.ai-default-banner {
    background: #1a1000;
    border: 1px solid #bb800966;
    border-radius: 6px;
    padding: .5rem .9rem;
    font-size: .82rem;
    color: #c9d1d9;
    margin-bottom: 1.25rem;
}
.ai-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.ai-provider-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: .85rem 1rem;
    transition: border-color .15s;
}
.ai-provider-card:hover { border-color: #388bfd55; }
.ai-provider-card--default { border-color: #bb800966; }
.ai-provider-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: .65rem;
}
.ai-provider-name { font-weight: 600; color: #e6edf3; font-size: .9rem; }
.ai-provider-model { font-size: .78rem; color: var(--text-2); margin-top: .1rem; }
.ai-provider-meta {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    font-size: .78rem;
    color: #8b949e;
    margin-bottom: .7rem;
    border-top: 1px solid #21262d;
    padding-top: .6rem;
}
.ai-meta-label { color: var(--text-2); font-size: .72rem; }
.ai-provider-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    border-top: 1px solid #21262d;
    padding-top: .6rem;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
    .kpi-row { grid-template-columns: repeat(4, 1fr); }
    .dash-panels { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .sidebar { width: 48px; min-width: 48px; }
    .sb-brand, .sb-section, .si span, .sb-foot-ver { display: none; }
    .si { justify-content: center; padding: .55rem; }
    .sb-logo { justify-content: center; padding: .75rem; }
    .sb-logomark { margin: 0; }
    .sb-logo-img { width: 32px; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .dash-panels { grid-template-columns: 1fr; }
    .emp-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── Sidebar badge ───────────────────────────────────────────────────────────── */
.sb-badge {
    margin-left: auto;
    background: #1f6feb;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1f6feb;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    margin-left: .3rem;
}

/* ── Page header ─────────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header h2 { font-size: 1.3rem; font-weight: 700; color: #e6edf3; margin-bottom: .25rem; }
.page-sub { color: #8b949e; font-size: .83rem; }
.btn-primary  { background:#1f6feb;color:#fff;border:none;padding:.45rem 1rem;border-radius:6px;cursor:pointer;font-size:.83rem; }
.btn-secondary{ background:#21262d;color:#e6edf3;border:1px solid #30363d;padding:.45rem 1rem;border-radius:6px;cursor:pointer;font-size:.83rem; }
.btn-primary:hover   { background:#388bfd; }
.btn-secondary:hover { background:#30363d; }

/* ── Executive Inbox ─────────────────────────────────────────────────────────── */
.inbox-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #21262d;
    padding-bottom: .75rem;
}
.inbox-tab {
    background: none;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: .4rem .9rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .82rem;
    display: flex;
    align-items: center;
}
.inbox-tab.active { background: #1f6feb22; border-color: #1f6feb; color: #58a6ff; }
.inbox-tab:hover  { border-color: #58a6ff; color: #e6edf3; }

.inbox-list { display: flex; flex-direction: column; gap: .75rem; }
.inbox-empty { color: var(--text-2); padding: 2rem; text-align: center; }

.inbox-item {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 1rem 1.1rem;
}
.inbox-item.pri-critical { border-left: 3px solid #f85149; }
.inbox-item.pri-high     { border-left: 3px solid #d29922; }
.inbox-item.pri-normal   { border-left: 3px solid #3fb950; }

.inbox-item-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .6rem;
    flex-wrap: wrap;
}
.inbox-priority { font-weight: 700; font-size: .75rem; letter-spacing: .03em; }
.inbox-category {
    background: #21262d;
    color: #8b949e;
    font-size: .72rem;
    padding: .15rem .55rem;
    border-radius: 10px;
}
.inbox-from   { color: #8b949e; font-size: .78rem; }
.inbox-time   { color: var(--text-2); font-size: .75rem; margin-left: auto; }
.inbox-status {
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 10px;
}
.inbox-status.status-pending            { background:#1f6feb22;color:#58a6ff; }
.inbox-status.status-approved           { background:#1f4a2a;color:#3fb950; }
.inbox-status.status-rejected           { background:#3d1a1a;color:#f85149; }
.inbox-status.status-revision_requested { background:#3d2f00;color:#d29922; }

.inbox-summary { font-size: .92rem; color: #e6edf3; margin-bottom: .5rem; font-weight: 500; }
.inbox-rec { font-size: .82rem; color: #8b949e; margin-bottom: .5rem; }
.inbox-rec-label { font-size: .72rem; font-weight: 600; color: var(--text-2); margin-right: .35rem; text-transform: uppercase; }

.inbox-evidence { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .65rem; }
.inbox-ev-tag {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #8b949e;
    font-size: .72rem;
    padding: .15rem .5rem;
    border-radius: 4px;
}
.inbox-actions { display: flex; gap: .5rem; margin-top: .75rem; }
.btn-approve { background:#1f4a2a;color:#3fb950;border:1px solid #2ea04355;padding:.35rem .85rem;border-radius:6px;cursor:pointer;font-size:.82rem;font-weight:600; }
.btn-reject  { background:#3d1a1a;color:#f85149;border:1px solid #f8514955;padding:.35rem .85rem;border-radius:6px;cursor:pointer;font-size:.82rem;font-weight:600; }
.btn-revise  { background:#21262d;color:#d29922;border:1px solid #d2992255;padding:.35rem .85rem;border-radius:6px;cursor:pointer;font-size:.82rem;font-weight:600; }
.inbox-reviewer-note { font-size: .8rem; color: var(--text-2); margin-top: .65rem; font-style: italic; }
.inbox-intel-row { display:flex; gap:.75rem; margin-top:.75rem; padding:.6rem .75rem; background:#0d1117; border-radius:6px; border:1px solid #21262d; flex-wrap:wrap; }
.inbox-intel-block { flex:1; min-width:100px; }
.inbox-intel-label { font-size:.68rem; color:var(--text-2); text-transform:uppercase; letter-spacing:.04em; margin-bottom:.2rem; }
.inbox-intel-val { font-size:.82rem; font-weight:600; line-height:1.3; }

/* ── Notifications ───────────────────────────────────────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: .5rem; }

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: .85rem 1rem;
    cursor: pointer;
    transition: border-color .15s;
}
.notif-item:hover { border-color: #30363d; }
.notif-item.notif-read { opacity: .55; }

.notif-icon { font-size: 1.1rem; flex-shrink: 0; padding-top: .1rem; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: .9rem; color: #e6edf3; font-weight: 500; margin-bottom: .2rem; }
.notif-text  { font-size: .82rem; color: #8b949e; margin-bottom: .3rem; }
.notif-meta  { font-size: .75rem; color: var(--text-2); }
.notif-cat-badge {
    font-size: .68rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 10px;
    flex-shrink: 0;
    align-self: center;
}

/* ── Organizational Memory ───────────────────────────────────────────────────── */
.memory-search-bar {
    display: flex;
    gap: .65rem;
    margin-bottom: 1.25rem;
    align-items: center;
}
.memory-list { display: flex; flex-direction: column; gap: .6rem; }

.memory-entry {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: .85rem 1rem;
}
.memory-type {
    display: inline-block;
    font-size: .69rem;
    font-weight: 700;
    padding: .15rem .55rem;
    border-radius: 10px;
    margin-bottom: .45rem;
    letter-spacing: .03em;
}
.memory-title { font-size: .9rem; color: #e6edf3; font-weight: 500; margin-bottom: .3rem; }
.memory-body  { font-size: .82rem; color: #8b949e; margin-bottom: .4rem; }
.memory-meta  { font-size: .75rem; color: var(--text-2); display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.memory-tag {
    background: #21262d;
    color: var(--text-2);
    font-size: .68rem;
    padding: .1rem .4rem;
    border-radius: 3px;
}

/* ── Executive Chat Console ──────────────────────────────────────────────────── */
.chat-shell {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 260px);
    overflow: hidden;
}
.chat-examples {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    border-bottom: 1px solid #21262d;
    align-items: center;
}
.chat-ex-label { font-size: .75rem; color: var(--text-2); flex-shrink: 0; }
.chat-example {
    background: none;
    border: 1px solid #30363d;
    color: #8b949e;
    font-size: .75rem;
    padding: .25rem .65rem;
    border-radius: 12px;
    cursor: pointer;
}
.chat-example:hover { border-color: #1f6feb; color: #58a6ff; }

.chat-transcript {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.chat-welcome { color: var(--text-2); font-size: .85rem; text-align: center; padding: 1rem; }

.chat-bubble { max-width: 90%; }
.chat-cmd  { align-self: flex-end; }
.chat-resp { align-self: flex-start; }

.chat-cmd  { background: #1f3a5f; color: #e6edf3; padding: .55rem .85rem; border-radius: 12px 12px 2px 12px; font-size: .87rem; display: flex; gap: .5rem; align-items: center; }
.chat-resp { background: #161b22; border: 1px solid #21262d; padding: .65rem .9rem; border-radius: 2px 12px 12px 12px; font-size: .85rem; }
.chat-prompt { color: #1f6feb; font-weight: 700; flex-shrink: 0; }
.chat-answer { color: #e6edf3; margin-bottom: .35rem; }
.chat-items { padding-left: 1.1rem; color: #8b949e; font-size: .82rem; line-height: 1.7; list-style: disc; }

.chat-input-row {
    display: flex;
    gap: .65rem;
    padding: .75rem 1rem;
    border-top: 1px solid #21262d;
    background: #0d1117;
}
.chat-input {
    flex: 1;
    background: #161b22;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: .5rem .85rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: .87rem;
    outline: none;
}
.chat-input:focus { border-color: #1f6feb; }

/* ═══════════════════════════════════════════════════════════════════════
   EXECUTIVE BRIEFING
═══════════════════════════════════════════════════════════════════════ */

.briefing-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    border: 1px solid #30363d;
    border-radius: 10px;
}
.briefing-salutation {
    font-size: .9rem;
    color: #8b949e;
    margin-bottom: .15rem;
    font-weight: 500;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.briefing-orgname {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e6edf3;
    line-height: 1.1;
}
.briefing-subtitle {
    font-size: .78rem;
    color: var(--text-2);
    margin-top: .35rem;
}
.briefing-health-panel {
    text-align: right;
    min-width: 140px;
}
.health-score-label {
    font-size: .72rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .25rem;
}
.health-score-big {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
}
.health-score-bar {
    height: 4px;
    background: #21262d;
    border-radius: 4px;
    margin: .5rem 0 .3rem;
    overflow: hidden;
}
.health-score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .6s ease;
}
.health-score-status {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* Stat chips */
.stat-chips {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .75rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 1200px) { .stat-chips { grid-template-columns: repeat(3,1fr); } }
.stat-chip {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: .85rem 1rem;
    cursor: pointer;
    transition: border-color .15s;
}
.stat-chip:hover { border-color: #1f6feb; }
.stat-chip-val   { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-chip-label { font-size: .72rem; color: #8b949e; margin-top: .15rem; }
.stat-chip-sub   { font-size: .68rem; color: var(--text-2); margin-top: .05rem; }

/* All-clear panel */
.briefing-all-clear {
    text-align: center;
    padding: 2rem;
    background: #0d1117;
    border: 1px solid #1a7f3766;
    border-radius: 8px;
}
.all-clear-icon  { font-size: 2rem; color: #3fb950; margin-bottom: .5rem; }
.all-clear-label { font-size: 1.1rem; font-weight: 700; color: #3fb950; }
.all-clear-sub   { font-size: .82rem; color: var(--text-2); margin-top: .25rem; }

/* Section header link button */
.section-link {
    background: none;
    border: none;
    color: #1f6feb;
    font-size: .78rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.section-link:hover { color: #58a6ff; }

/* Two-column layout */
.dash-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 900px) { .dash-two-col { grid-template-columns: 1fr; } }

/* Pending approvals quick view */
.pend-list {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.pend-item {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: .75rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.pend-item-header {
    display: flex;
    gap: .65rem;
    align-items: center;
    font-size: .72rem;
}
.pend-item-summary { font-size: .82rem; color: #e6edf3; }

/* Predictions */
.pred-list { display: flex; flex-direction: column; gap: .75rem; }
.pred-item {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: .75rem;
}
.pred-title { font-size: .85rem; color: #e6edf3; margin-bottom: .5rem; }
.pred-meta  { display: flex; align-items: center; gap: .65rem; font-size: .72rem; }
.pred-bar   { flex: 1; height: 4px; background: #21262d; border-radius: 4px; overflow: hidden; }
.pred-fill  { height: 100%; background: #1f6feb; border-radius: 4px; }
.pred-conf  { color: #79c0ff; white-space: nowrap; }
.pred-horizon { color: var(--text-2); }

/* Autonomous Org Diagram */
.org-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 1rem;
}
.org-node {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: .85rem 1.25rem;
    min-width: 200px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s;
}
.org-node:hover { border-color: #1f6feb; }
.org-node.coo-node { background: #0d2340; border-color: #1f6feb; cursor: default; }
.org-node.coo-node:hover { border-color: #58a6ff; }
.org-node-badge {
    display: inline-block;
    background: #1f6feb22;
    color: #79c0ff;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: 3px;
    margin-bottom: .3rem;
    letter-spacing: .06em;
}
.org-node-name  { font-size: .87rem; font-weight: 600; color: #e6edf3; }
.org-node-sub   { font-size: .72rem; color: var(--text-2); margin-top: .15rem; }
.org-node-status { font-size: .72rem; font-weight: 600; margin-bottom: .2rem; }
.org-arrow-down  { font-size: 1.3rem; color: #30363d; line-height: 1; padding: .25rem 0; }
.org-split-row   { width: 100%; display: flex; flex-direction: column; align-items: center; }
.org-split-line  { width: 2px; height: 24px; background: #30363d; }
.org-split-children {
    display: flex;
    gap: 1.5rem;
    padding-top: 0;
    position: relative;
}
.org-split-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 220px);
    height: 1px;
    background: #30363d;
    top: -1px;
}

/* ═══════════════════════════════════════════════════════════════════════
   RECOMMENDATION CARDS
═══════════════════════════════════════════════════════════════════════ */

.rec-card-list { display: flex; flex-direction: column; gap: .65rem; }
.rec-card {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: .85rem 1rem;
    transition: opacity .3s;
}
.rec-card.rec-critical { border-left: 3px solid #f85149; }
.rec-card.rec-high     { border-left: 3px solid #d29922; }
.rec-card.rec-normal   { border-left: 3px solid #3fb950; }
.rec-card.rec-low      { border-left: 3px solid #484f58; }
.rec-card-left  { flex-shrink: 0; padding-top: .15rem; }
.rec-priority {
    font-size: .65rem;
    font-weight: 700;
    padding: .2rem .45rem;
    border-radius: 3px;
    letter-spacing: .06em;
    white-space: nowrap;
}
.rec-card-body { flex: 1; min-width: 0; }
.rec-title    { font-size: .88rem; font-weight: 600; color: #e6edf3; margin-bottom: .2rem; }
.rec-desc     { font-size: .78rem; color: #8b949e; }
.rec-evidence { font-size: .72rem; color: var(--text-2); margin-top: .3rem; }
.rec-card-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    align-items: flex-end;
}

/* Small button variants */
.btn-sm { padding: .3rem .7rem !important; font-size: .75rem !important; }
.btn-ghost {
    background: none;
    border: 1px solid #30363d;
    color: var(--text-2);
    padding: .4rem .85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .82rem;
    font-family: inherit;
}
.btn-ghost:hover { border-color: var(--text-2); color: #8b949e; }

/* ═══════════════════════════════════════════════════════════════════════
   INTELLIGENCE CENTER
═══════════════════════════════════════════════════════════════════════ */

.intel-health-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    align-items: start;
}
.intel-health-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}
.intel-score {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: .35rem;
}
.intel-score-label  { font-size: .72rem; color: #8b949e; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.intel-score-bar    { height: 6px; background: #21262d; border-radius: 4px; overflow: hidden; margin: .5rem 0; }
.intel-score-status { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: .35rem; }
.intel-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    align-content: start;
}
.intel-stat {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: .75rem;
    text-align: center;
}
.intel-stat-val   { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.intel-stat-label { font-size: .7rem; color: var(--text-2); margin-top: .2rem; }

/* ═══════════════════════════════════════════════════════════════════════
   COST CENTER
═══════════════════════════════════════════════════════════════════════ */

.cost-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.cost-card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}
.cost-card-val   { font-size: 1.6rem; font-weight: 700; color: #e6edf3; }
.cost-card-label { font-size: .73rem; color: var(--text-2); margin-top: .25rem; }
.cost-insights { background: #161b22; border: 1px solid #30363d; border-radius: 6px; padding: 1rem; }
.cost-insight-item { font-size: .85rem; color: #8b949e; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════════
   WORKFORCE INTELLIGENCE (Employee Detail)
═══════════════════════════════════════════════════════════════════════ */

.emp-intel-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .65rem;
    margin-bottom: .75rem;
}
.emp-intel-kpi {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: .65rem;
    text-align: center;
}
.emp-intel-val   { font-size: 1.1rem; font-weight: 700; color: #e6edf3; }
.emp-intel-label { font-size: .68rem; color: var(--text-2); margin-top: .15rem; }
.intel-note {
    padding: .5rem .75rem;
    border-radius: 5px;
    font-size: .78rem;
    margin-top: .4rem;
}
.intel-warn { background: #2d151522; border: 1px solid #da363344; color: #ff7b72; }
.intel-info { background: #0d234022; border: 1px solid #1f6feb44; color: #79c0ff; }
.intel-ok   { background: #0d221522; border: 1px solid #1a7f3744; color: #56d364; }

/* ── Islamic Executive Experience ────────────────────────────────────────────── */
.islamic-reminder {
    background: linear-gradient(135deg, #0d1117 0%, #101820 100%);
    border: 1px solid #1f3a5033;
    border-left: 3px solid #1f6feb55;
    border-radius: 6px;
    padding: .55rem 1rem;
    font-size: .8rem;
    color: #8b949e;
    font-style: italic;
    margin-bottom: 1rem;
    letter-spacing: .01em;
}
.briefing-arabic {
    font-size: 1.05rem;
    color: #79c0ff;
    font-family: 'Segoe UI', 'Arial Unicode MS', sans-serif;
    direction: rtl;
    text-align: right;
    margin-bottom: .35rem;
    letter-spacing: .03em;
}
.briefing-dua {
    font-size: .78rem;
    color: #79c0ff88;
    margin-top: .4rem;
    font-style: italic;
}
.chat-islamic-welcome {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #8b949e;
}
.chat-islamic-arabic {
    font-size: 1.3rem;
    color: #58a6ff;
    font-family: 'Segoe UI', 'Arial Unicode MS', sans-serif;
    direction: rtl;
    margin-bottom: .6rem;
    letter-spacing: .03em;
}
.chat-islamic-line2 {
    font-size: 1rem;
    color: #e6edf3;
    font-weight: 600;
    margin-bottom: .35rem;
}
.chat-islamic-dua {
    font-size: .82rem;
    color: #79c0ff88;
    font-style: italic;
}

/* ── Product card actions ─────────────────────────────────────────────────────── */
.prod-card-actions {
    display: flex;
    gap: .4rem;
    margin-top: .65rem;
    padding-top: .6rem;
    border-top: 1px solid #21262d;
}
.prod-act-btn {
    background: #21262d;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: .25rem .6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.prod-act-btn:hover        { background: #30363d; color: #e6edf3; }
.prod-act-archive          { color: #d29922 !important; border-color: #d2992233; }
.prod-act-archive:hover    { background: #21262d; color: #d29922 !important; }
.prod-act-delete           { color: #f85149 !important; border-color: #f8514933; }
.prod-act-delete:hover     { background: #3d1a1a; color: #f85149 !important; }

/* ── Development Inventory ────────────────────────────────────────────────────── */
.dev-lc-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    padding: .15rem .55rem;
    border-radius: 10px;
}
.dev-ready-banner {
    background: #1a4a2a;
    border: 1px solid #3fb95044;
    border-radius: 6px;
    padding: .6rem .85rem;
    font-size: .82rem;
    font-weight: 700;
    color: #3fb950;
}
.dev-not-ready-banner {
    background: #3d1a1a22;
    border: 1px solid #f8514944;
    border-radius: 6px;
    padding: .6rem .85rem;
    font-size: .82rem;
    font-weight: 700;
    color: #f85149;
}
.dev-checklist-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem 0;
    border-bottom: 1px solid #21262d;
    font-size: .8rem;
}
.dev-scan-btn {
    background: #21262d;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: .35rem .85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .78rem;
    transition: background .15s;
}
.dev-scan-btn:hover { background: #30363d; color: #e6edf3; }
.prod-archived             { filter: grayscale(.3); }

/* ── Infrastructure ──────────────────────────────────────────────────────── */
.infra-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .75rem;
}
.infra-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: .85rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.infra-card:hover { border-color: #58a6ff; background: #1c2128; }
.infra-card-header { display: flex; align-items: flex-start; gap: .6rem; }
.infra-type-icon { font-size: 1.25rem; line-height: 1; flex-shrink: 0; }
.infra-card-name { font-size: .85rem; font-weight: 600; color: #e6edf3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.infra-card-type { font-size: .68rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-top: .1rem; }
.infra-env-badge { font-size: .68rem; font-weight: 600; padding: .15rem .45rem; border-radius: 3px; border: 1px solid; white-space: nowrap; flex-shrink: 0; text-transform: uppercase; }
.infra-card-meta { display: flex; flex-direction: column; gap: .2rem; }
.infra-meta-row { display: flex; align-items: center; gap: .5rem; font-size: .73rem; }
.infra-meta-label { color: var(--text-2); min-width: 3.5rem; }
.infra-card-status { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

.infra-target-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .65rem;
    border: 1px solid #21262d;
    border-radius: 6px;
    cursor: pointer;
    transition: background .12s;
}
.infra-target-row:hover { background: #1c2128; border-color: #30363d; }

.infra-detail-row { display: flex; gap: .75rem; padding: .35rem 0; border-bottom: 1px solid #21262d; font-size: .82rem; align-items: baseline; }
.infra-detail-row:last-child { border-bottom: none; }
.infra-detail-label { color: var(--text-2); min-width: 8rem; flex-shrink: 0; font-size: .75rem; }
.infra-detail-value { color: #e6edf3; }
.infra-detail-value code { background: #0d1117; border: 1px solid #21262d; border-radius: 3px; padding: .05rem .35rem; font-size: .78rem; color: #79c0ff; }
.infra-pre { background: #0d1117; border: 1px solid #21262d; border-radius: 4px; padding: .5rem; font-size: .75rem; color: #e6edf3; overflow-x: auto; white-space: pre; }

.infra-form { display: flex; flex-direction: column; gap: 0; }
.infra-form-label { display: block; font-size: .75rem; color: #8b949e; margin-bottom: .25rem; margin-top: .6rem; }
.infra-form-input {
    width: 100%;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 5px;
    color: #e6edf3;
    padding: .45rem .65rem;
    font-size: .83rem;
    font-family: inherit;
    transition: border-color .15s;
}
.infra-form-input:focus { outline: none; border-color: #58a6ff; }
.infra-form-input[type="checkbox"] { width: auto; }
select.infra-form-input { cursor: pointer; }
textarea.infra-form-input { resize: vertical; font-family: 'SFMono-Regular', Consolas, monospace; }

/* ── Infrastructure v2: Risk badges ─────────────────────────────────────────── */
.risk-badge { font-size: .65rem; font-weight: 700; padding: .15rem .45rem; border-radius: 3px; letter-spacing: .04em; }
.risk-low     { background: #0d2215; color: #3fb950; border: 1px solid #1a7f3766; }
.risk-medium  { background: #2d1f0a; color: #d29922; border: 1px solid #d2992266; }
.risk-high    { background: #3d1a1a; color: #f85149; border: 1px solid #f8514966; }
.risk-unknown { background: #161b22; color: var(--text-2); border: 1px solid #30363d; }

/* ── Infrastructure v2: Certification badges ─────────────────────────────────── */
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.cert-badge {
    display: flex; align-items: center; gap: .4rem; padding: .5rem .7rem;
    border-radius: 6px; border: 1px solid #21262d; background: #0d1117; font-size: .8rem;
}
.cert-badge span:first-child { font-size: .9rem; flex-shrink: 0; }
.cert-verified  { border-color: #1a7f3766; color: #3fb950; }
.cert-verified span:first-child { color: #3fb950; }
.cert-failed    { border-color: #f8514966; color: #f85149; }
.cert-failed span:first-child { color: #f85149; }
.cert-pending   { border-color: #d2992266; color: #d29922; }
.cert-pending span:first-child { color: #d29922; }
.cert-na        { border-color: #21262d; color: var(--text-2); }
.cert-uncertified { border-color: #21262d; color: var(--text-2); }

/* ── Infrastructure v2: Connection test row ──────────────────────────────────── */
.conn-test-row {
    display: flex; align-items: flex-start; gap: .5rem; padding: .35rem .5rem;
    background: #0d1117; border-radius: 4px; border: 1px solid #21262d;
}

/* ── Infrastructure v2: Template picker ─────────────────────────────────────── */
.template-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.template-card {
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    padding: .65rem .4rem; background: #0d1117; border: 1px solid #21262d;
    border-radius: 6px; cursor: pointer; transition: border-color .15s, background .15s;
}
.template-card:hover { background: #161b22; border-color: #30363d; }
.template-card-active { border-color: #1a7f37 !important; background: #0d2215 !important; }
.template-card-name { font-size: .78rem; color: #e6edf3; font-weight: 600; text-align: center; }
.template-card-type { font-size: .65rem; color: var(--text-2); text-align: center; }

/* ── Workflow Control Center ─────────────────────────────────────────────────── */
.stat-card {
    background: linear-gradient(160deg, #1a2029 0%, #14181f 100%);
    border: 1px solid #2a313c;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    transition: border-color .18s, transform .18s, box-shadow .18s;
}
.stat-card:hover {
    border-color: #3d6fd6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.badge-grey { background: #21262d; color: #8b949e; }

/* ═══════════════════════════════════════════════════════════════════════════
   POLISH LAYER v3 — premium glass design system.
   Appended last so it wins the cascade; visual only, zero data/markup change.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Ambient stage: aurora glow + faint engineering dot-grid ─────────────── */
.main-content {
    background:
        radial-gradient(1100px 560px at 85% -12%, rgba(76,141,255,.10), transparent 62%),
        radial-gradient(900px 540px at -8% 8%, rgba(163,113,247,.08), transparent 58%),
        radial-gradient(700px 500px at 55% 115%, rgba(34,211,238,.05), transparent 60%),
        radial-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
        #0a0d13;
    background-size: auto, auto, auto, 26px 26px, auto;
}

/* Page entrance — content is re-rendered on navigate, so this re-triggers */
@keyframes pageIn {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: none; }
}
.main-content > * { animation: pageIn .32s cubic-bezier(.22,.8,.36,1) both; }
@media (prefers-reduced-motion: reduce) {
    .main-content > * { animation: none; }
}

::selection { background: rgba(76,141,255,.35); color: #fff; }
:focus-visible { outline: 2px solid rgba(76,141,255,.6); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }

/* ── Unified glass surface for every card-like element ───────────────────── */
.panel, .card, .kpi-card, .wf-emp-card, .emp-card, .detail-section,
.stat-card, .stat-chip, .cost-card, .intel-health-card, .emp-detail-header,
.rec-card, .inbox-item, .infra-card, .ck-banner, .pred-item, .pend-item {
    background:
        linear-gradient(165deg, rgba(30,37,50,.72) 0%, rgba(16,20,29,.88) 100%);
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.045),
        0 1px 2px rgba(0,0,0,.35),
        0 10px 30px -18px rgba(0,0,0,.7);
    backdrop-filter: blur(6px);
}
.kpi-card:hover, .wf-emp-card:hover, .stat-card:hover, .emp-card:hover,
.rec-card:hover, .infra-card:hover {
    border-color: rgba(96,150,255,.42);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 0 0 1px rgba(76,141,255,.12),
        0 14px 34px -14px rgba(0,0,0,.75),
        0 0 24px -6px rgba(76,141,255,.18);
}
.detail-section, .panel { transition: border-color .2s; }
.detail-section:hover, .panel:hover { border-color: rgba(255,255,255,.11); }

/* ── Typography & numbers ────────────────────────────────────────────────── */
.page-title {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
    background: linear-gradient(92deg, #f2f6fc 30%, #b9c8e8 75%, #9fb4e6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.kpi-val, .stat-chip-val, .intel-stat-val, .cost-card-val, .card-value,
.emp-metric-val, .emp-intel-val {
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
}
.kpi-val { font-size: 1.62rem; }

/* ── Live status dots: breathing glow ────────────────────────────────────── */
@keyframes dotPulse {
    0%, 100% { text-shadow: 0 0 4px currentColor; opacity: 1; }
    50%      { text-shadow: 0 0 10px currentColor, 0 0 18px currentColor; opacity: .82; }
}
.dot.ok { animation: dotPulse 2.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .dot.ok { animation: none; } }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, #2f7bff 0%, #6a5cff 100%);
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 10px -2px rgba(63,110,255,.55), inset 0 1px 0 rgba(255,255,255,.18);
    transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 4px 18px -2px rgba(63,110,255,.65), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-secondary, .back-btn, .prod-act-btn, .dev-scan-btn, .emp-qa-btn {
    border-radius: 8px;
    transition: transform .15s, border-color .15s, color .15s, background .15s;
}
.btn-secondary:hover, .back-btn:hover { transform: translateY(-1px); border-color: rgba(96,150,255,.5); }
.btn-approve, .btn-reject, .btn-revise { border-radius: 8px; transition: transform .15s, filter .15s; }
.btn-approve:hover, .btn-reject:hover, .btn-revise:hover { transform: translateY(-1px); filter: brightness(1.12); }
.icon-btn { border-radius: 8px; }

/* ── Tables: command-log look ────────────────────────────────────────────── */
.list-table th, .health-table th {
    color: #8291a5;
    font-size: .68rem;
    letter-spacing: .09em;
    border-bottom: 1px solid rgba(255,255,255,.09);
    padding-top: .6rem; padding-bottom: .6rem;
}
.list-table td, .health-table td { border-bottom: 1px solid rgba(255,255,255,.045); }
.list-table tbody tr:hover, .health-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(76,141,255,.07), rgba(76,141,255,.02) 60%, transparent);
    box-shadow: inset 2px 0 0 rgba(76,141,255,.55);
}

/* ── Tab bar: glowing underline ──────────────────────────────────────────── */
.tab-bar { gap: .3rem; border-bottom-color: rgba(255,255,255,.08); }
.pd-tab { border-radius: 8px 8px 0 0; padding: .55rem 1rem; }
.pd-tab:hover { background: rgba(255,255,255,.035); }
.pd-tab.active {
    background: linear-gradient(180deg, rgba(76,141,255,.10), transparent);
    box-shadow: 0 1px 0 var(--accent), 0 6px 16px -10px rgba(76,141,255,.8);
    border-bottom-color: var(--accent);
}

/* ── Sidebar: motion + depth ─────────────────────────────────────────────── */
.sidebar {
    background: linear-gradient(180deg, #0d1119 0%, #080b11 100%);
    box-shadow: inset -1px 0 0 rgba(255,255,255,.03);
}
.si { transition: background .14s, color .14s, box-shadow .14s, transform .14s; }
.si:hover:not(.muted):not(.active) { transform: translateX(2px); }
.si.active {
    background: linear-gradient(90deg, rgba(76,141,255,.20), rgba(106,92,255,.07));
    box-shadow: inset 2px 0 0 var(--accent), 0 0 18px -6px rgba(76,141,255,.5);
}
.sb-gem { box-shadow: 0 0 18px rgba(96,120,255,.35), inset 0 1px 0 rgba(255,255,255,.15); }
.sb-identity {
    background: linear-gradient(165deg, rgba(76,141,255,.06), rgba(163,113,247,.04));
    margin: .55rem;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    padding: .75rem .85rem;
}

/* ── Header: floating glass bar ──────────────────────────────────────────── */
.top-header {
    background: rgba(9,12,18,.78);
    backdrop-filter: blur(14px) saturate(1.3);
    box-shadow: 0 1px 0 rgba(255,255,255,.04);
}
.sys-status { box-shadow: 0 0 16px -6px rgba(63,185,80,.5); }
.hdr-avatar { box-shadow: 0 2px 10px -2px rgba(106,92,255,.6), inset 0 1px 0 rgba(255,255,255,.25); }

/* ── Status badges: translucent glow set ─────────────────────────────────── */
.status-badge.operational { background: rgba(63,185,80,.13); color: #4ecb60; border: 1px solid rgba(63,185,80,.3); }
.status-badge.degraded    { background: rgba(210,153,34,.13); color: #e3b341; border: 1px solid rgba(210,153,34,.3); }
.status-badge.offline     { background: rgba(248,81,73,.13);  color: #ff7b72; border: 1px solid rgba(248,81,73,.3); }
.status-badge.in-progress { background: rgba(76,141,255,.13); color: #79b0ff; border: 1px solid rgba(76,141,255,.3); }

/* ── Progress bars: gradient + glow ──────────────────────────────────────── */
.progress-fill, .wf-progress-fill, .health-score-fill, .pred-fill {
    background: linear-gradient(90deg, #2f7bff, #6a5cff 60%, #a371f7);
    box-shadow: 0 0 8px rgba(88,120,255,.55);
}

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.infra-form-input, .chat-input {
    background: rgba(8,11,17,.8);
    border-radius: 8px;
    transition: border-color .15s, box-shadow .15s;
}
.infra-form-input:focus, .chat-input:focus {
    border-color: rgba(96,150,255,.65);
    box-shadow: 0 0 0 3px rgba(76,141,255,.14);
}

/* ── Empty / loading states ──────────────────────────────────────────────── */
.spinner { border-color: rgba(255,255,255,.08); border-top-color: #6a9dff; }
.empty-state, .inbox-empty, .placeholder-page { color: #5c6a7d; }

/* ── CCDR Executive Infrastructure dashboard (boxed cards, high-contrast) ─── */
.ccdr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.ccdr-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 960px) { .ccdr-grid { grid-template-columns: 1fr; } .ccdr-grid .span2 { grid-column: auto; } }

/* Fixed single-viewport AI Infrastructure page — page never scrolls; dense cards
   scroll internally if needed (same pattern as the cockpit). The fit box fills the
   main content area via flex (robust to viewport/100vh quirks). */
.main-content:has(> .infra-fit),
.main-content:has(> .sh-fit),
.main-content:has(> .emp-fit),
.main-content:has(> .wf-fit),
.main-content:has(> .pd-fit) { display: flex; flex-direction: column; overflow: hidden; }

/* Website detail — pinned banner + tab bar, scrollable tab content */
.pd-fit { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .5rem; overflow: hidden; }
.pd-banner { padding: .5rem 1rem; flex-shrink: 0; }
.pd-scroll { flex: 1; min-height: 0; overflow-y: auto; }
@media (max-width: 900px) {
    .main-content:has(> .pd-fit) { display: block; overflow: visible; }
    .pd-fit { overflow: visible; }
    .pd-scroll { overflow: visible; }
}

/* Workflow Control Center — pinned banner + stats, scrollable table region */
.wf-fit { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .5rem; overflow: hidden; }
.wf-banner { padding: .55rem 1rem; flex-shrink: 0; }
.wf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; flex-shrink: 0; }
.wf-stats .stat-card { padding: .55rem .8rem; }
.wf-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .8rem; }
@media (max-width: 900px) {
    .main-content:has(> .wf-fit) { display: block; overflow: visible; }
    .wf-fit { overflow: visible; }
    .wf-stats { grid-template-columns: repeat(2, 1fr); }
    .wf-scroll { overflow: visible; }
}

/* Employee detail — fixed-viewport, two internally-scrolling columns */
.emp-fit { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .6rem; overflow: hidden; }
.emp-banner { padding: .55rem 1rem; flex-shrink: 0; }
.emp-kpi { flex-shrink: 0; margin-bottom: 0 !important; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.emp-kpi .kpi-card { padding: .6rem .75rem; }
.emp-kpi .kpi-val { font-size: 1.35rem; }
.emp-mid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.emp-col { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; }
.emp-col > .detail-section, .emp-col > div > .detail-section { margin: 0; }
.emp-col > #emp-infra-targets { flex-shrink: 0; }
@media (max-width: 900px) {
    .main-content:has(> .emp-fit) { display: block; overflow: visible; }
    .emp-fit { overflow: visible; }
    .emp-kpi { grid-template-columns: repeat(2, 1fr); }
    .emp-mid { grid-template-columns: 1fr; }
    .emp-col { overflow: visible; }
}
.infra-fit {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column; gap: .6rem; overflow: hidden;
}

/* System Health — same fixed-viewport pattern */
.sh-fit { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .6rem; overflow: hidden; }
.sh-banner { padding: .6rem 1.1rem; flex-shrink: 0; }
.sh-kpi { flex-shrink: 0; margin-bottom: 0 !important; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.sh-kpi .kpi-card { padding: .55rem .7rem; }
.sh-kpi .kpi-val { font-size: 1.2rem; }
.sh-mid {
    flex: 1; min-height: 0;
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: .6rem;
}
.sh-scroll { min-height: 0; overflow: auto; }
@media (max-width: 900px) {
    .main-content:has(> .sh-fit) { display: block; overflow: visible; }
    .sh-fit { overflow: visible; }
    .sh-kpi { grid-template-columns: repeat(2, 1fr); }
    .sh-mid { grid-template-columns: 1fr; grid-template-rows: none; }
    .sh-scroll { overflow: visible; }
}
.infra-banner { padding: .6rem 1.1rem; flex-shrink: 0; }
.ccdr-fit { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; }
.ccdr-exec { flex-shrink: 0; }
.ccdr-mid {
    flex: none; min-height: 300px;
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: .6rem;
}
.ccdr-scroll { min-height: 0; overflow: auto; }
.ccdr-future-strip {
    flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; padding: .55rem .85rem;
}
.ccdr-future-chips { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
@media (max-width: 900px) {
    .infra-fit { height: auto; overflow: visible; }
    .ccdr-mid { grid-template-columns: 1fr; grid-template-rows: none; }
    .ccdr-scroll { overflow: visible; }
}

.ccdr-card {
    background: linear-gradient(165deg, rgba(32,40,54,.75) 0%, rgba(18,23,32,.9) 100%);
    border: 1px solid rgba(255,255,255,.085);
    border-radius: 10px;
    padding: .75rem .85rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 22px -20px rgba(0,0,0,.8);
}
.ccdr-card-title {
    font-size: .74rem; font-weight: 700; color: #eaf0f7; margin-bottom: .6rem;
    text-transform: uppercase; letter-spacing: .04em;
    display: flex; align-items: center; gap: .45rem;
}
.ccdr-card-title::before {
    content: ""; width: 3px; height: .9em; border-radius: 2px;
    background: linear-gradient(#58a6ff, #a371f7);
}
/* readable inner tiles — labels are light, never near-background gray */
.ccdr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: .4rem; }
.ccdr-tile {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px; padding: .5rem .6rem;
}
.ccdr-lbl { font-size: .62rem; font-weight: 600; color: #aab6c4; text-transform: uppercase; letter-spacing: .03em; line-height: 1.25; }
.ccdr-val { font-size: 1.1rem; font-weight: 800; color: #f0f4f9; margin-top: .1rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ccdr-sub { font-size: .62rem; color: #9aa6b4; margin-top: .1rem; }

/* trend table — readable header + rows */
.ccdr-trend { width: 100%; border-collapse: collapse; }
.ccdr-trend th, .ccdr-trend td { padding: .35rem .45rem; text-align: right; font-size: .78rem; font-variant-numeric: tabular-nums; }
.ccdr-trend th { color: #aab6c4; font-weight: 600; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid rgba(255,255,255,.09); }
.ccdr-trend th:first-child, .ccdr-trend td:first-child { text-align: left; color: #dbe3ec; font-weight: 600; }
.ccdr-trend td { color: #e6edf3; border-bottom: 1px solid rgba(255,255,255,.045); }
.ccdr-trend tr:last-child td { border-bottom: none; }

/* top-tools ranked rows */
.ccdr-rank { display: flex; align-items: center; gap: .7rem; padding: .38rem 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.ccdr-rank:last-child { border-bottom: none; }
.ccdr-rank-n { width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; color: #cfe0ff; background: rgba(76,141,255,.16); border: 1px solid rgba(76,141,255,.3); }
.ccdr-rank-name { flex: 1; min-width: 0; font-size: .85rem; color: #eaf0f7; font-weight: 600; }
.ccdr-rank-meta { font-size: .72rem; color: #9aa6b4; text-align: right; white-space: nowrap; }
.ccdr-rank-meta b { color: #79b0ff; font-weight: 700; }

/* future-ready placeholders — dimmed but still readable */
.ccdr-future-row { display: flex; align-items: center; justify-content: space-between; padding: .45rem .1rem; border-bottom: 1px solid rgba(255,255,255,.04); }
.ccdr-future-row:last-child { border-bottom: none; }
.ccdr-future-name { font-size: .82rem; color: #b6c1cf; }
.ccdr-future-badge { font-size: .66rem; font-weight: 600; color: #9aa6b4; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: .12rem .6rem; }

.ccdr-note { font-size: .7rem; color: #9aa6b4; margin-top: .3rem; line-height: 1.5; }
.ccdr-kv { display: flex; justify-content: space-between; padding: .32rem 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .8rem; }
.ccdr-kv:last-child { border-bottom: none; }
.ccdr-kv .k { color: #aab6c4; }
.ccdr-kv .v { color: #eaf0f7; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Website detail: KPI cards with sparklines (mockup layout) ───────────── */
.ws-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .7rem;
    margin-bottom: 1rem;
}
@media (max-width: 1100px) { .ws-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.ws-kpi {
    position: relative;
    background: linear-gradient(165deg, rgba(30,37,50,.72) 0%, rgba(16,20,29,.9) 100%);
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 12px;
    padding: .85rem .95rem 0;
    height: 118px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 10px 30px -20px rgba(0,0,0,.8);
    transition: border-color .18s, transform .18s;
}
.ws-kpi:hover { border-color: rgba(96,150,255,.4); transform: translateY(-2px); }
.ws-kpi-label { font-size: .7rem; color: var(--muted); font-weight: 600; }
.ws-kpi-val { font-size: 1.7rem; font-weight: 800; color: var(--text); line-height: 1.15; margin-top: .1rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ws-kpi-delta { font-size: .72rem; font-weight: 700; }
.ws-kpi-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40px; }

.ws-perf-cols {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 1000px) { .ws-perf-cols { grid-template-columns: 1fr; } }
.ws-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: .75rem;
}
.ws-legend { display: flex; gap: .85rem; font-size: .72rem; font-weight: 500; color: var(--text-2); }
.ws-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.ws-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.ws-status-strip {
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
    padding: .7rem 1.1rem;
    background: linear-gradient(165deg, rgba(30,37,50,.6), rgba(16,20,29,.85));
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    font-size: .78rem; color: var(--text-2);
}
.ws-status-strip b { color: var(--text); font-weight: 600; }
