/* ─────────────────────────────────────────────────────────────────────────
 * Adaptive type — base html font-size scales with viewport width so the
 * UI feels right on a phone, a laptop, and a 4K monitor. The user can
 * also nudge the scale up or down via a toggle in the topbar; their
 * choice is stored in localStorage via --text-scale.
 *
 * Math: 0.4vw + 12px gives ~15px at 768w, 17px at 1280w, 20px at 1920w,
 * and is clamped at 15px on the low end (phones) and 22px on the high
 * end (anything past ~2500px). Multiply by --text-scale (0.85 / 1 / 1.15)
 * for the S/M/L user toggle.
 * ──────────────────────────────────────────────────────────────────────── */

:root {
    --text-scale: 1;
}

html {
    font-size: calc(clamp(15px, calc(0.4vw + 12px), 22px) * var(--text-scale));
}

/* ─────────────────────────────────────────────────────────────────────────
 * Executive Console — design system for the BlueSky Administrator suite.
 *
 * Everything is scoped under `.exc-console` so it cannot leak to the
 * marketing site, and (more importantly) the marketing site's loud
 * stylesheet cannot leak INTO us — the new admin layout deliberately
 * does NOT load BlueSky-en.css.
 *
 * Layer order:
 *   1. tokens          — colour, type, spacing, radius, elevation vars
 *   2. reset           — scoped reset that doesn't touch anything outside .exc-console
 *   3. shell           — top-level grid (rail + topbar + content)
 *   4. components      — card, table, badge, led, button, input, tab, etc.
 *   5. surfaces        — dashboard / projects / marketing-specific tweaks
 * ──────────────────────────────────────────────────────────────────────── */


/* ── 1. Tokens ─────────────────────────────────────────────────────────── */

.exc-console {
    /* Backgrounds — dark navy stack, deeper at page edge */
    --exc-bg-0: #07101a;
    --exc-bg-1: #0d1826;
    --exc-bg-2: #14223a;
    --exc-bg-3: #1a2d4d;
    --exc-bg-hover: rgba(31, 147, 208, 0.10);
    --exc-bg-active: rgba(31, 147, 208, 0.18);

    /* Borders */
    --exc-border: rgba(255, 255, 255, 0.08);
    --exc-border-strong: rgba(255, 255, 255, 0.16);

    /* Text */
    --exc-text-1: #f5f9ff;
    --exc-text-2: rgba(245, 249, 255, 0.72);
    --exc-text-3: rgba(245, 249, 255, 0.48);
    --exc-text-dim: rgba(245, 249, 255, 0.32);

    /* Brand */
    --exc-brand: #1f93d0;
    --exc-brand-2: #4ec1ff;
    --exc-brand-deep: #0d2848;

    /* Status palette */
    --exc-success: #27c084;
    --exc-warn:    #f5a524;
    --exc-danger:  #ef4444;
    --exc-info:    #4ec1ff;
    --exc-neutral: #8a99b0;

    /* Spacing (4px base) */
    --exc-s-1: 4px;
    --exc-s-2: 8px;
    --exc-s-3: 12px;
    --exc-s-4: 16px;
    --exc-s-5: 24px;
    --exc-s-6: 32px;
    --exc-s-7: 48px;
    --exc-s-8: 64px;

    /* Type */
    --exc-font:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --exc-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --exc-f-display: 2.5rem;
    --exc-f-h1:      1.75rem;
    --exc-f-h2:      1.375rem;
    --exc-f-h3:      1.0625rem;
    --exc-f-body:    0.9375rem;
    --exc-f-cap:     0.8125rem;
    --exc-f-micro:   0.6875rem;

    /* Radius */
    --exc-r-1: 6px;
    --exc-r-2: 10px;
    --exc-r-3: 14px;
    --exc-r-pill: 999px;

    /* Elevation */
    --exc-e-1: 0 1px 2px rgba(0, 0, 0, 0.30);
    --exc-e-2: 0 4px 12px rgba(0, 0, 0, 0.35);
    --exc-e-3: 0 12px 32px rgba(0, 0, 0, 0.45);

    /* Rail + topbar dimensions */
    --exc-rail-w:   240px;
    --exc-topbar-h: 60px;

    /* Default everything */
    font-family: var(--exc-font);
    font-size:   var(--exc-f-body);
    color:       var(--exc-text-1);
    background:  var(--exc-bg-0);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ── 2. Scoped reset ───────────────────────────────────────────────────── */

.exc-console,
.exc-console *,
.exc-console *::before,
.exc-console *::after {
    box-sizing: border-box;
}

.exc-console h1,
.exc-console h2,
.exc-console h3,
.exc-console h4,
.exc-console p,
.exc-console ul,
.exc-console ol,
.exc-console figure {
    margin: 0;
    padding: 0;
    font-weight: inherit;
}

.exc-console ul,
.exc-console ol { list-style: none; }

.exc-console a {
    color: inherit;
    text-decoration: none;
}

.exc-console button,
.exc-console input,
.exc-console select,
.exc-console textarea {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

.exc-console code {
    font-family: var(--exc-font-mono);
    font-size: 0.875em;
}


/* ── 3. Shell layout ───────────────────────────────────────────────────── */

/* The whole page IS the .exc-console root. Inside:
 *  ┌──────────┬──────────────────────────────────────┐
 *  │          │   topbar                              │
 *  │  rail    ├──────────────────────────────────────┤
 *  │          │   content (scrolls)                   │
 *  │          │                                       │
 *  └──────────┴──────────────────────────────────────┘ */

.exc-console {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--exc-rail-w) 1fr;
    grid-template-rows: var(--exc-topbar-h) 1fr;
    grid-template-areas:
        "rail topbar"
        "rail content";
}

/* Rail */
.exc-rail {
    grid-area: rail;
    background: var(--exc-bg-1);
    border-right: 1px solid var(--exc-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 20;
}

.exc-rail-brand {
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
    padding: var(--exc-s-5) var(--exc-s-5) var(--exc-s-5);
    border-bottom: 1px solid var(--exc-border);
}

.exc-rail-brand-logo {
    width: 32px;
    height: 32px;
    color: var(--exc-brand);
    flex-shrink: 0;
}

.exc-rail-brand-name {
    font-weight: 700;
    font-size: var(--exc-f-h3);
    letter-spacing: 0.01em;
}

.exc-rail-brand-name em {
    display: block;
    font-style: normal;
    font-weight: 500;
    font-size: var(--exc-f-cap);
    color: var(--exc-text-2);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.exc-rail-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--exc-s-4) var(--exc-s-3);
    display: flex;
    flex-direction: column;
    gap: var(--exc-s-1);
}

.exc-rail-group-label {
    padding: var(--exc-s-4) var(--exc-s-3) var(--exc-s-2);
    font-size: var(--exc-f-micro);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--exc-text-3);
    font-weight: 600;
}

.exc-rail-link {
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
    padding: var(--exc-s-3);
    border-radius: var(--exc-r-2);
    color: var(--exc-text-2);
    font-size: var(--exc-f-body);
    transition: background 100ms ease, color 100ms ease;
    cursor: pointer;
    position: relative;
}

.exc-rail-link:hover {
    background: var(--exc-bg-hover);
    color: var(--exc-text-1);
}

.exc-rail-link.is-active {
    background: var(--exc-bg-active);
    color: var(--exc-text-1);
    font-weight: 500;
}

.exc-rail-link.is-active::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--exc-brand);
    border-radius: 0 var(--exc-r-1) var(--exc-r-1) 0;
}

.exc-rail-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.exc-rail-link-badge {
    margin-left: auto;
    font-size: var(--exc-f-micro);
    background: var(--exc-bg-3);
    color: var(--exc-text-2);
    padding: 2px var(--exc-s-2);
    border-radius: var(--exc-r-pill);
    min-width: 22px;
    text-align: center;
}

.exc-rail-link.is-stub {
    opacity: 0.55;
    cursor: not-allowed;
}

.exc-rail-link.is-stub:hover { background: transparent; color: var(--exc-text-2); }

.exc-rail-user {
    border-top: 1px solid var(--exc-border);
    padding: var(--exc-s-4) var(--exc-s-4);
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
}

.exc-rail-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--avatar-hue, 210), 70%, 55%), hsl(calc(var(--avatar-hue, 210) + 30), 65%, 45%));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    color: #fff;
}

.exc-rail-user-meta { min-width: 0; flex: 1; }

.exc-rail-user-name {
    font-size: var(--exc-f-cap);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exc-rail-user-role {
    font-size: var(--exc-f-micro);
    color: var(--exc-text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exc-rail-user-signout {
    color: var(--exc-text-3);
    padding: var(--exc-s-2);
    border-radius: var(--exc-r-1);
    transition: background 100ms, color 100ms;
}

.exc-rail-user-signout:hover {
    background: rgba(239, 68, 68, 0.10);
    color: var(--exc-danger);
}

.exc-rail-user-signout svg { width: 16px; height: 16px; display: block; }


/* Topbar */
.exc-topbar {
    grid-area: topbar;
    background: var(--exc-bg-0);
    border-bottom: 1px solid var(--exc-border);
    display: flex;
    align-items: center;
    gap: var(--exc-s-4);
    padding: 0 var(--exc-s-6);
    position: sticky;
    top: 0;
    z-index: 15;
}

.exc-topbar-title {
    font-size: var(--exc-f-h2);
    font-weight: 600;
    margin: 0;
}

.exc-topbar-crumb {
    color: var(--exc-text-3);
    font-size: var(--exc-f-cap);
    margin-top: 2px;
}

.exc-topbar-spacer { flex: 1; }

.exc-topbar-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--exc-r-1);
    color: var(--exc-text-2);
    cursor: pointer;
    transition: background 100ms, color 100ms;
    position: relative;
}

.exc-topbar-tool:hover {
    background: var(--exc-bg-2);
    color: var(--exc-text-1);
}

.exc-topbar-tool svg { width: 18px; height: 18px; }

.exc-topbar-tool-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--exc-warn);
    border: 2px solid var(--exc-bg-0);
}


/* Content area */
.exc-content {
    grid-area: content;
    overflow-y: auto;
    /* Viewport-relative side padding so the admin surface stretches across
       big monitors instead of pooling at a fixed width. */
    padding: var(--exc-s-6) clamp(var(--exc-s-5), 2.5vw, var(--exc-s-8));
    background: var(--exc-bg-0);
}

.exc-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--exc-s-5);
    margin-bottom: var(--exc-s-6);
}

.exc-page-head h1 {
    font-size: var(--exc-f-h1);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.exc-page-head p {
    color: var(--exc-text-3);
    font-size: var(--exc-f-cap);
    margin-top: var(--exc-s-2);
}

.exc-page-actions {
    display: flex;
    align-items: center;
    gap: var(--exc-s-2);
}


/* ── 4. Components ─────────────────────────────────────────────────────── */

/* Grid — responsive column packer */
.exc-grid {
    display: grid;
    gap: var(--exc-s-4);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.exc-grid.is-2col { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.exc-grid.is-fixed-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) {
    .exc-grid.is-fixed-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .exc-grid.is-fixed-4 { grid-template-columns: 1fr; }
}

/* Card */
.exc-card {
    background: var(--exc-bg-1);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    padding: var(--exc-s-5);
    box-shadow: var(--exc-e-1);
}

.exc-card.is-elevated {
    background: var(--exc-bg-2);
    box-shadow: var(--exc-e-2);
}

.exc-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--exc-s-3);
    margin-bottom: var(--exc-s-4);
}

.exc-card-title {
    font-size: var(--exc-f-h3);
    font-weight: 600;
}

.exc-card-sub {
    font-size: var(--exc-f-cap);
    color: var(--exc-text-3);
    margin-top: 2px;
}


/* KPI card — big number, small label, optional delta */
.exc-kpi {
    background: var(--exc-bg-1);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    padding: var(--exc-s-5);
    position: relative;
    overflow: hidden;
}

.exc-kpi::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, var(--exc-brand), transparent);
    opacity: 0.7;
}

.exc-kpi.is-success::before { background: linear-gradient(90deg, var(--exc-success), transparent); }
.exc-kpi.is-warn::before    { background: linear-gradient(90deg, var(--exc-warn),    transparent); }
.exc-kpi.is-danger::before  { background: linear-gradient(90deg, var(--exc-danger),  transparent); }

.exc-kpi-label {
    font-size: var(--exc-f-micro);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--exc-text-3);
    font-weight: 600;
    margin-bottom: var(--exc-s-3);
}

.exc-kpi-num {
    font-size: var(--exc-f-display);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.exc-kpi-unit {
    font-size: var(--exc-f-h3);
    color: var(--exc-text-3);
    font-weight: 500;
    margin-left: var(--exc-s-1);
}

.exc-kpi-foot {
    margin-top: var(--exc-s-4);
    display: flex;
    align-items: center;
    gap: var(--exc-s-2);
    font-size: var(--exc-f-cap);
    color: var(--exc-text-3);
}

.exc-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px var(--exc-s-2);
    border-radius: var(--exc-r-pill);
    font-size: var(--exc-f-micro);
    font-weight: 600;
}

.exc-kpi-trend.is-up   { background: rgba(39, 192, 132, 0.15); color: var(--exc-success); }
.exc-kpi-trend.is-down { background: rgba(239,  68,  68, 0.15); color: var(--exc-danger); }
.exc-kpi-trend.is-flat { background: rgba(138, 153, 176, 0.15); color: var(--exc-neutral); }


/* Status LED */
.exc-led {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--exc-neutral);
    box-shadow: 0 0 0 2px rgba(138, 153, 176, 0.15);
}

.exc-led.is-success { background: var(--exc-success); box-shadow: 0 0 0 2px rgba(39, 192, 132, 0.20); }
.exc-led.is-warn    { background: var(--exc-warn);    box-shadow: 0 0 0 2px rgba(245, 165, 36, 0.20); }
.exc-led.is-danger  { background: var(--exc-danger);  box-shadow: 0 0 0 2px rgba(239,  68,  68, 0.20); }
.exc-led.is-info    { background: var(--exc-info);    box-shadow: 0 0 0 2px rgba( 78, 193, 255, 0.20); }


/* Badge */
.exc-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--exc-s-1);
    padding: 2px var(--exc-s-2);
    border-radius: var(--exc-r-pill);
    font-size: var(--exc-f-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--exc-bg-3);
    color: var(--exc-text-2);
}

.exc-badge.is-success { background: rgba(39, 192, 132, 0.15); color: var(--exc-success); }
.exc-badge.is-warn    { background: rgba(245, 165, 36, 0.15); color: var(--exc-warn); }
.exc-badge.is-danger  { background: rgba(239,  68,  68, 0.15); color: var(--exc-danger); }
.exc-badge.is-info    { background: rgba( 78, 193, 255, 0.15); color: var(--exc-info); }
.exc-badge.is-brand   { background: rgba( 31, 147, 208, 0.18); color: var(--exc-brand-2); }


/* Button */
.exc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--exc-s-2);
    padding: var(--exc-s-2) var(--exc-s-4);
    border-radius: var(--exc-r-1);
    font-size: var(--exc-f-cap);
    font-weight: 600;
    cursor: pointer;
    background: var(--exc-bg-2);
    color: var(--exc-text-1);
    border: 1px solid var(--exc-border-strong);
    transition: background 100ms, border-color 100ms, transform 80ms;
    min-height: 34px;
}

.exc-btn:hover  { background: var(--exc-bg-3); }
.exc-btn:active { transform: scale(0.98); }

.exc-btn.is-primary {
    background: var(--exc-brand);
    border-color: var(--exc-brand);
    color: #fff;
}

.exc-btn.is-primary:hover { background: #2aa7e8; border-color: #2aa7e8; }

.exc-btn.is-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--exc-text-2);
}

.exc-btn.is-ghost:hover { background: var(--exc-bg-2); color: var(--exc-text-1); }

.exc-btn.is-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--exc-danger);
    color: var(--exc-danger);
}

.exc-btn svg { width: 14px; height: 14px; }


/* Input */
.exc-input {
    display: block;
    width: 100%;
    padding: var(--exc-s-2) var(--exc-s-3);
    background: var(--exc-bg-2);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-1);
    color: var(--exc-text-1);
    font-size: var(--exc-f-body);
    transition: border-color 100ms, background 100ms;
}

.exc-input:focus {
    border-color: var(--exc-brand);
    background: var(--exc-bg-1);
}

.exc-input::placeholder { color: var(--exc-text-3); }


/* Table — dense, actionable */
.exc-table-wrap {
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    overflow: hidden;
    background: var(--exc-bg-1);
}

.exc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--exc-f-cap);
}

.exc-table thead th {
    text-align: left;
    padding: var(--exc-s-3) var(--exc-s-4);
    font-size: var(--exc-f-micro);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--exc-text-3);
    background: var(--exc-bg-1);
    border-bottom: 1px solid var(--exc-border);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.exc-table tbody td {
    padding: var(--exc-s-3) var(--exc-s-4);
    border-bottom: 1px solid var(--exc-border);
    color: var(--exc-text-2);
    vertical-align: middle;
}

.exc-table tbody tr:last-child td { border-bottom: none; }
.exc-table tbody tr:hover { background: var(--exc-bg-2); }
.exc-table tbody tr:hover td { color: var(--exc-text-1); }

.exc-table td strong { color: var(--exc-text-1); font-weight: 600; }


/* Activity feed */
.exc-activity {
    display: flex;
    flex-direction: column;
}

.exc-activity-item {
    display: flex;
    gap: var(--exc-s-3);
    padding: var(--exc-s-3) 0;
    border-bottom: 1px solid var(--exc-border);
    font-size: var(--exc-f-cap);
}

.exc-activity-item:last-child { border-bottom: none; }

.exc-activity-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--exc-bg-2);
    color: var(--exc-brand-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.exc-activity-icon svg { width: 14px; height: 14px; }

.exc-activity-body { flex: 1; min-width: 0; }
.exc-activity-text { color: var(--exc-text-1); }
.exc-activity-text strong { font-weight: 600; }
.exc-activity-meta {
    font-size: var(--exc-f-micro);
    color: var(--exc-text-3);
    margin-top: 2px;
}


/* Empty state */
.exc-empty {
    text-align: center;
    padding: var(--exc-s-7) var(--exc-s-5);
    color: var(--exc-text-3);
}

.exc-empty-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--exc-bg-2);
    color: var(--exc-text-3);
    align-items: center;
    justify-content: center;
    margin-bottom: var(--exc-s-3);
}

.exc-empty h3 {
    font-size: var(--exc-f-h3);
    color: var(--exc-text-2);
    margin-bottom: var(--exc-s-1);
}


/* Project status heatmap — simple grid of count cells */
.exc-heatmap {
    display: grid;
    grid-template-columns: auto repeat(4, 1fr);
    gap: 1px;
    background: var(--exc-border);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    overflow: hidden;
}

.exc-heatmap-cell {
    background: var(--exc-bg-1);
    padding: var(--exc-s-3);
    font-size: var(--exc-f-cap);
}

.exc-heatmap-cell.is-head {
    color: var(--exc-text-3);
    font-size: var(--exc-f-micro);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.exc-heatmap-cell-num {
    font-size: var(--exc-f-h2);
    font-weight: 700;
}

.exc-heatmap-cell.is-zero .exc-heatmap-cell-num { color: var(--exc-text-dim); }


/* Stub page for unbuilt nav surfaces */
.exc-stub-page {
    max-width: 540px;
    margin: var(--exc-s-8) auto;
    text-align: center;
    background: var(--exc-bg-1);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-3);
    padding: var(--exc-s-7) var(--exc-s-6);
}

.exc-stub-page h2 { font-size: var(--exc-f-h1); margin-bottom: var(--exc-s-2); }
.exc-stub-page p  { color: var(--exc-text-3); }
.exc-stub-page-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--exc-bg-2);
    color: var(--exc-brand-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--exc-s-4);
}


/* ── 5. Utilities ──────────────────────────────────────────────────────── */

.exc-mt-4 { margin-top: var(--exc-s-4); }
.exc-mt-5 { margin-top: var(--exc-s-5); }
.exc-mt-6 { margin-top: var(--exc-s-6); }

.exc-text-2 { color: var(--exc-text-2); }
.exc-text-3 { color: var(--exc-text-3); }

.exc-row    { display: flex; align-items: center; gap: var(--exc-s-2); }
.exc-row.gap-3 { gap: var(--exc-s-3); }
.exc-row.gap-4 { gap: var(--exc-s-4); }

/* Toast (matches existing parseApiResponse-style messaging) */
.exc-toast-root {
    position: fixed;
    bottom: var(--exc-s-5);
    right: var(--exc-s-5);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: var(--exc-s-2);
    pointer-events: none;
}

.exc-toast {
    background: var(--exc-bg-2);
    border: 1px solid var(--exc-border-strong);
    border-radius: var(--exc-r-2);
    padding: var(--exc-s-3) var(--exc-s-4);
    box-shadow: var(--exc-e-3);
    color: var(--exc-text-1);
    font-size: var(--exc-f-cap);
    max-width: 360px;
    pointer-events: auto;
    animation: exc-toast-in 180ms ease-out;
}

.exc-toast.is-success { border-left: 3px solid var(--exc-success); }
.exc-toast.is-danger  { border-left: 3px solid var(--exc-danger); }
.exc-toast.is-warn    { border-left: 3px solid var(--exc-warn); }

@keyframes exc-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ── Projects Hub: filter bar ──────────────────────────────────────────── */

.exc-filters {
    display: flex;
    align-items: center;
    gap: var(--exc-s-2);
    margin-bottom: var(--exc-s-4);
    padding: var(--exc-s-3);
    background: var(--exc-bg-1);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    flex-wrap: wrap;
}

.exc-filters .exc-input {
    width: auto;
    flex: 1 1 200px;
    min-width: 160px;
    max-width: 320px;
}

.exc-filters select.exc-input {
    flex: 0 0 auto;
    min-width: 160px;
    max-width: 220px;
    /* Re-style the native select arrow so it reads on dark */
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8b4cb' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 32px;
}

.exc-filters select.exc-input option {
    background: var(--exc-bg-2);
    color: var(--exc-text-1);
}


/* ── Project workspace: tab strip ──────────────────────────────────────── */

.exc-tab-strip {
    display: flex;
    align-items: stretch;
    gap: var(--exc-s-1);
    border-bottom: 1px solid var(--exc-border);
    margin-bottom: var(--exc-s-4);
    margin-top: var(--exc-s-5);
}

.exc-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--exc-s-2);
    padding: var(--exc-s-3) var(--exc-s-4);
    color: var(--exc-text-3);
    font-size: var(--exc-f-cap);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 100ms, border-color 100ms, background 100ms;
    border-top-left-radius: var(--exc-r-1);
    border-top-right-radius: var(--exc-r-1);
}

.exc-tab:hover {
    color: var(--exc-text-1);
    background: var(--exc-bg-2);
}

.exc-tab.is-active {
    color: var(--exc-text-1);
    border-bottom-color: var(--exc-brand);
}

.exc-tab svg { width: 16px; height: 16px; }


.exc-tab-panel {
    /* Tab panels are flow containers — no special framing,
       individual cards inside provide the surfaces. */
}


/* ── Plan tab: milestone list + progress bar ───────────────────────────── */

.exc-milestone-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--exc-border);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    overflow: hidden;
}

.exc-milestone-row {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    align-items: center;
    gap: var(--exc-s-3);
    padding: var(--exc-s-3) var(--exc-s-4);
    background: var(--exc-bg-1);
}

.exc-milestone-row .exc-led { margin-top: 2px; }

.exc-milestone-body strong { display: block; font-size: var(--exc-f-body); }

.exc-milestone-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--exc-s-2);
    align-items: center;
    margin-top: 4px;
    font-size: var(--exc-f-cap);
    color: var(--exc-text-2);
}

.exc-milestone-actions { display: flex; gap: var(--exc-s-1); }


.exc-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--exc-bg-2);
    border-radius: var(--exc-r-pill);
    overflow: hidden;
}

.exc-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--exc-brand), var(--exc-brand-2));
    border-radius: var(--exc-r-pill);
    transition: width 220ms ease;
}


/* ── Dashboard tab: iframe stage ───────────────────────────────────────── */

.exc-dashboard-frame {
    margin: 0;
    border-radius: var(--exc-r-2);
    overflow: hidden;
    background: var(--exc-bg-0);
    border: 1px solid var(--exc-border);
    min-height: 540px;
    height: clamp(540px, 70vh, 900px);
}

.exc-dashboard-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}


/* ── Native <dialog> modal ─────────────────────────────────────────────── */

.exc-modal {
    background: var(--exc-bg-2);
    border: 1px solid var(--exc-border-strong);
    border-radius: var(--exc-r-3);
    padding: var(--exc-s-5);
    color: var(--exc-text-1);
    width: min(460px, 92vw);
    box-shadow: var(--exc-e-3);
    max-height: 90vh;
    overflow-y: auto;
}

.exc-modal::backdrop { background: rgba(7, 16, 26, 0.72); }

.exc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--exc-s-4);
}

.exc-modal-head h2 {
    font-size: var(--exc-f-h2);
    font-weight: 600;
    margin: 0;
}

.exc-modal-close {
    background: none;
    border: none;
    color: var(--exc-text-3);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: var(--exc-r-1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.exc-modal-close:hover { background: var(--exc-bg-3); color: var(--exc-text-1); }

.exc-modal-form > label {
    display: block;
    margin-bottom: var(--exc-s-3);
}

.exc-modal-form > label > span,
.exc-modal-form fieldset legend {
    display: block;
    font-size: var(--exc-f-cap);
    color: var(--exc-text-2);
    margin-bottom: var(--exc-s-1);
    font-weight: 500;
}

.exc-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: var(--exc-s-2);
    margin-top: var(--exc-s-5);
}

.exc-radio {
    display: flex;
    gap: var(--exc-s-2);
    align-items: center;
    padding: var(--exc-s-2);
    border-radius: var(--exc-r-1);
    cursor: pointer;
    margin-bottom: 4px;
}

.exc-radio:hover { background: var(--exc-bg-3); }

.exc-radio input[type="radio"] { margin: 0; accent-color: var(--exc-brand); }


/* Native date input — make the picker indicator visible on dark */
.exc-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
}


/* ── Company tabs (Projects Hub): tab + count badge ────────────────────── */

.exc-tab-strip .exc-tab .exc-rail-link-badge {
    margin-left: var(--exc-s-2);
    margin-right: 0;
    background: rgba(255, 255, 255, 0.06);
}

.exc-tab-strip .exc-tab.is-active .exc-rail-link-badge {
    background: rgba(31, 147, 208, 0.20);
    color: var(--exc-brand-2);
}


/* ── Marketing area ──────────────────────────────────────────────────── */

.exc-marketing-hero {
    position: relative;
    border-radius: var(--exc-r-3);
    padding: var(--exc-s-7) var(--exc-s-6);
    overflow: hidden;
    background:
        radial-gradient(900px circle at 90% -10%, rgba(31, 147, 208, 0.35), transparent 60%),
        radial-gradient(700px circle at 0% 110%, rgba(78, 193, 255, 0.18), transparent 55%),
        linear-gradient(135deg, var(--exc-brand-deep), var(--exc-bg-1) 70%);
    border: 1px solid var(--exc-border);
    box-shadow: var(--exc-e-2);
}

.exc-marketing-hero-eyebrow {
    font-size: var(--exc-f-cap);
    color: var(--exc-brand-2);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: var(--exc-s-3);
}

.exc-marketing-hero-title {
    font-size: clamp(1.75rem, 2.6vw + 1rem, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 var(--exc-s-4) 0;
    max-width: 720px;
}

.exc-marketing-hero-sub {
    color: var(--exc-text-2);
    font-size: var(--exc-f-h3);
    max-width: 640px;
    margin-bottom: var(--exc-s-6);
}

.exc-marketing-hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--exc-s-5);
    padding-top: var(--exc-s-4);
    border-top: 1px solid var(--exc-border);
    max-width: 720px;
}

.exc-marketing-hero-stat-num {
    font-size: var(--exc-f-display);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.exc-marketing-hero-stat-lbl {
    margin-top: var(--exc-s-2);
    font-size: var(--exc-f-cap);
    color: var(--exc-text-3);
    letter-spacing: 0.04em;
}


.exc-section {
    margin-top: var(--exc-s-6);
}

.exc-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--exc-s-5);
    margin-bottom: var(--exc-s-4);
}

.exc-section-title {
    font-size: var(--exc-f-h2);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.exc-section-sub {
    color: var(--exc-text-3);
    font-size: var(--exc-f-cap);
    margin-top: 4px;
}


/* Capabilities matrix */
.exc-cap-grid {
    gap: var(--exc-s-3);
}

.exc-cap-card {
    background: var(--exc-bg-1);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    padding: var(--exc-s-4);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    gap: var(--exc-s-3);
    position: relative;
    overflow: hidden;
    transition: border-color 120ms;
}

.exc-cap-card:hover {
    border-color: var(--exc-border-strong);
}

.exc-cap-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, var(--exc-brand-2), transparent);
    opacity: 0.55;
}

.exc-cap-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--exc-s-2);
}

.exc-cap-badge {
    font-size: var(--exc-f-cap);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--exc-brand-2);
}

.exc-cap-count {
    font-size: var(--exc-f-micro);
    color: var(--exc-text-3);
}

.exc-cap-feature {
    color: var(--exc-text-2);
}


/* Featured projects grid */
.exc-mkt-feature-grid { gap: var(--exc-s-3); }

.exc-mkt-feature {
    background: var(--exc-bg-1);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    overflow: hidden;
    transition: border-color 120ms, transform 120ms;
}

.exc-mkt-feature:hover {
    border-color: var(--exc-brand);
    transform: translateY(-1px);
}

.exc-mkt-feature-link {
    display: block;
    padding: var(--exc-s-4);
    color: inherit;
}

.exc-mkt-feature-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--exc-s-3);
    margin-bottom: var(--exc-s-2);
}

.exc-mkt-feature-head h3 {
    font-size: var(--exc-f-h3);
    font-weight: 600;
    line-height: 1.25;
}

.exc-mkt-feature-meta {
    font-size: var(--exc-f-cap);
    color: var(--exc-text-2);
    margin-bottom: var(--exc-s-4);
}

.exc-mkt-feature-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--exc-s-3);
}

.exc-mkt-feature-value {
    font-weight: 700;
    color: var(--exc-brand-2);
    font-size: var(--exc-f-h3);
}


/* Marketing file list */
.exc-mkt-file-list {
    display: flex;
    flex-direction: column;
    gap: var(--exc-s-1);
}

.exc-mkt-file {
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
    padding: var(--exc-s-3);
    border-radius: var(--exc-r-1);
    transition: background 100ms;
}

.exc-mkt-file:hover {
    background: var(--exc-bg-2);
}

.exc-mkt-file-icon {
    color: var(--exc-danger);   /* PDF red */
    flex-shrink: 0;
}

.exc-mkt-file-body { flex: 1; min-width: 0; }

.exc-mkt-file-body strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ── Reports & Analytics: bars ───────────────────────────────────────── */

.exc-report-bars {
    display: flex;
    flex-direction: column;
    gap: var(--exc-s-3);
}

.exc-report-bar {
    display: flex;
    flex-direction: column;
    gap: var(--exc-s-1);
}

.exc-report-bar-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--exc-s-2);
}

.exc-report-bar-label {
    font-size: var(--exc-f-cap);
    text-transform: capitalize;
}

.exc-report-bar-value {
    font-size: var(--exc-f-cap);
    color: var(--exc-text-2);
    font-weight: 600;
}

/* Color overrides for progress bar fills used in reports */
.exc-progress-bar-fill.is-success { background: linear-gradient(90deg, var(--exc-success), #2ddb95); }
.exc-progress-bar-fill.is-warn    { background: linear-gradient(90deg, var(--exc-warn),    #ffc15c); }
.exc-progress-bar-fill.is-danger  { background: linear-gradient(90deg, var(--exc-danger),  #ff6464); }
.exc-progress-bar-fill.is-info    { background: linear-gradient(90deg, var(--exc-info),    #74d4ff); }
.exc-progress-bar-fill.is-neutral { background: linear-gradient(90deg, var(--exc-neutral), #a8b4cb); }
.exc-progress-bar-fill.is-brand   { background: linear-gradient(90deg, var(--exc-brand),   var(--exc-brand-2)); }


.exc-report-placeholder {
    background: var(--exc-bg-1);
    border-style: dashed;
}


/* ── Project Documents: sidebar + file list ──────────────────────────── */

.exc-doc-folders {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exc-doc-folder {
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
    padding: var(--exc-s-3);
    border-radius: var(--exc-r-1);
    color: var(--exc-text-2);
    transition: background 100ms, color 100ms;
}

.exc-doc-folder:hover {
    background: var(--exc-bg-hover);
    color: var(--exc-text-1);
}

.exc-doc-folder.is-active {
    background: var(--exc-bg-active);
    color: var(--exc-text-1);
}

.exc-doc-folder-label {
    flex: 1;
    font-size: var(--exc-f-body);
}


.exc-doc-files {
    display: flex;
    flex-direction: column;
    gap: var(--exc-s-1);
}

.exc-doc-file {
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
    padding: var(--exc-s-3);
    border-radius: var(--exc-r-1);
    transition: background 100ms;
}

.exc-doc-file:hover {
    background: var(--exc-bg-2);
}

.exc-doc-file-icon {
    color: var(--exc-text-2);
    flex-shrink: 0;
}

.exc-doc-file-icon.is-pdf   { color: var(--exc-danger); }
.exc-doc-file-icon.is-image { color: var(--exc-brand-2); }
.exc-doc-file-icon.is-doc   { color: var(--exc-info); }
.exc-doc-file-icon.is-sheet { color: var(--exc-success); }
.exc-doc-file-icon.is-slide { color: var(--exc-warn); }
.exc-doc-file-icon.is-cad   { color: var(--exc-neutral); }

.exc-doc-file-body { flex: 1; min-width: 0; }

.exc-doc-file-body strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ── Data Room (public) ────────────────────────────────────────────────── */

body.data-room {
    /* Override the .exc-console grid since the Data Room is a flow layout
       (topbar + main + footer), no left rail. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--exc-bg-0);
    grid-template-columns: none;
    grid-template-rows: none;
    grid-template-areas: none;
}

.dr-topbar {
    display: flex;
    align-items: center;
    gap: var(--exc-s-4);
    padding: var(--exc-s-3) var(--exc-s-6);
    background: var(--exc-bg-1);
    border-bottom: 1px solid var(--exc-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.dr-brand { display: flex; align-items: center; gap: var(--exc-s-3); }
.dr-brand-logo { width: 28px; height: 28px; color: var(--exc-brand); }
.dr-brand-text { display: flex; flex-direction: column; line-height: 1; }
.dr-brand-name { font-weight: 700; font-size: var(--exc-f-h3); }
.dr-brand-sub  { font-style: normal; font-size: var(--exc-f-micro); color: var(--exc-brand-2);
                 letter-spacing: 0.10em; text-transform: uppercase; margin-top: 3px; font-weight: 600; }

.dr-topbar-spacer { flex: 1; }
.dr-user { display: flex; align-items: center; gap: var(--exc-s-3); }
.dr-user-name { font-size: var(--exc-f-cap); color: var(--exc-text-2); }

.dr-main {
    flex: 1;
    /* On big monitors, expand to fill: viewport-padding adapts so content
       stretches almost edge-to-edge but never reads as a single 4K-wide
       wall of text. */
    padding: var(--exc-s-6) clamp(var(--exc-s-5), 3.5vw, var(--exc-s-8));
    max-width: none;
    width: 100%;
    margin: 0;
}
.dr-footer {
    padding: var(--exc-s-4) var(--exc-s-6);
    border-top: 1px solid var(--exc-border);
    color: var(--exc-text-3);
    font-size: var(--exc-f-micro);
    text-align: center;
}


/* Login card */
.dr-login-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.dr-login-card {
    background: var(--exc-bg-1);
    border: 1px solid var(--exc-border-strong);
    border-radius: var(--exc-r-3);
    padding: var(--exc-s-6);
    width: min(420px, 92vw);
    box-shadow: var(--exc-e-3);
    position: relative;
    overflow: hidden;
}
.dr-login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--exc-brand), var(--exc-brand-2), transparent);
}
.dr-login-eyebrow {
    font-size: var(--exc-f-micro);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--exc-brand-2);
    font-weight: 600;
    margin-bottom: var(--exc-s-3);
}
.dr-login-card h1 { font-size: var(--exc-f-h1); margin-bottom: var(--exc-s-2); }
.dr-login-sub { color: var(--exc-text-3); font-size: var(--exc-f-cap); margin-bottom: var(--exc-s-5); }
.dr-login-card form label { display: block; margin-bottom: var(--exc-s-3); }
.dr-login-card form label > span { display: block; font-size: var(--exc-f-cap); color: var(--exc-text-2); margin-bottom: var(--exc-s-1); }
.dr-login-help { font-size: var(--exc-f-micro); color: var(--exc-text-3); text-align: center; margin-top: var(--exc-s-4); }


/* Browse page */
.dr-page { display: flex; flex-direction: column; gap: var(--exc-s-5); }

.dr-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--exc-s-2);
    padding: var(--exc-s-3) var(--exc-s-4);
    background: var(--exc-bg-1);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
}
.dr-crumb { color: var(--exc-text-2); font-size: var(--exc-f-cap); padding: 2px 6px; border-radius: var(--exc-r-1); transition: background 100ms, color 100ms; }
.dr-crumb:hover { background: var(--exc-bg-2); color: var(--exc-text-1); }
.dr-crumb.is-current { color: var(--exc-text-1); font-weight: 600; }
.dr-crumb-sep { color: var(--exc-text-dim); font-size: var(--exc-f-cap); }

.dr-folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--exc-s-3); }
.dr-folder {
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
    padding: var(--exc-s-4);
    background: var(--exc-bg-1);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    color: var(--exc-text-1);
    transition: border-color 120ms, transform 120ms, background 120ms;
}
.dr-folder:hover { background: var(--exc-bg-2); border-color: var(--exc-brand); transform: translateY(-1px); }
.dr-folder-icon { color: var(--exc-brand-2); flex-shrink: 0; }
.dr-folder-name {
    font-weight: 600;
    /* Allow long folder names to wrap to two lines instead of truncating. */
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* "Syncing Dropbox" banner — shown when a background sync is in progress. */
.dr-sync-banner {
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
    padding: var(--exc-s-3) var(--exc-s-4);
    background: rgba(31, 147, 208, 0.10);
    border: 1px solid var(--exc-brand);
    color: var(--exc-text-1);
    border-radius: var(--exc-r-2);
    font-size: var(--exc-f-cap);
}

.dr-sync-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.20);
    border-top-color: var(--exc-brand-2);
    border-radius: 50%;
    animation: dr-sync-spin 700ms linear infinite;
    flex-shrink: 0;
}

@keyframes dr-sync-spin { to { transform: rotate(360deg); } }

.dr-sync-meta {
    font-size: var(--exc-f-micro);
    color: var(--exc-text-3);
    padding: 2px var(--exc-s-2);
}

.dr-files { background: var(--exc-bg-1); border: 1px solid var(--exc-border); border-radius: var(--exc-r-2); overflow: hidden; }
.dr-files-head { display: flex; align-items: center; justify-content: space-between; padding: var(--exc-s-4); border-bottom: 1px solid var(--exc-border); }
.dr-files-head h2 { font-size: var(--exc-f-h3); font-weight: 600; }
.dr-file-list { display: flex; flex-direction: column; }
.dr-file:not(:last-child) { border-bottom: 1px solid var(--exc-border); }
.dr-file-link { display: flex; align-items: center; gap: var(--exc-s-3); padding: var(--exc-s-3) var(--exc-s-4); color: inherit; transition: background 100ms; }
.dr-file-link:hover { background: var(--exc-bg-2); }
.dr-file-icon          { color: var(--exc-text-2); flex-shrink: 0; }
.dr-file-icon.is-pdf      { color: var(--exc-danger); }
.dr-file-icon.is-image    { color: var(--exc-brand-2); }
.dr-file-icon.is-video    { color: var(--exc-info); }
.dr-file-icon.is-audio    { color: var(--exc-warn); }
.dr-file-icon.is-doc      { color: var(--exc-info); }
.dr-file-icon.is-sheet    { color: var(--exc-success); }
.dr-file-icon.is-slide    { color: var(--exc-warn); }
.dr-file-icon.is-archive  { color: var(--exc-neutral); }
.dr-file-icon.is-cad      { color: var(--exc-neutral); }
.dr-file-icon.is-text     { color: var(--exc-text-2); }
.dr-file-body { flex: 1; min-width: 0; }
.dr-file-body strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-file-arrow { color: var(--exc-text-3); flex-shrink: 0; }


/* ── Data Room admin (user mgmt) ───────────────────────────────────────── */

.dr-admin-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--exc-s-5);
}

@media (max-width: 1100px) {
    .dr-admin-grid { grid-template-columns: 1fr; }
}

.dr-cred-banner {
    background: rgba(31, 147, 208, 0.10);
    border: 1px solid var(--exc-brand);
    border-radius: var(--exc-r-2);
    padding: var(--exc-s-4);
    margin-bottom: var(--exc-s-4);
}

.dr-cred-banner h3 {
    font-size: var(--exc-f-h3);
    margin-bottom: var(--exc-s-2);
}

.dr-cred-row {
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
    background: var(--exc-bg-0);
    padding: var(--exc-s-3);
    border-radius: var(--exc-r-1);
    font-family: var(--exc-font-mono);
    font-size: var(--exc-f-body);
    margin-top: var(--exc-s-2);
}

.dr-cred-label {
    color: var(--exc-text-3);
    font-family: var(--exc-font);
    font-size: var(--exc-f-cap);
    width: 90px;
    flex-shrink: 0;
}

.dr-cred-value {
    color: var(--exc-text-1);
    flex: 1;
    user-select: all;
    word-break: break-all;
}


/* ── Data Room polish: bigger fonts + real logo + inline viewer ──────── */

/* Bump the base type scale just for the Data Room — file names + crumbs
   were a step too small for client-facing screen shares. */
body.data-room {
    --exc-f-body: 1rem;        /* 16px (was 15px) */
    --exc-f-cap:  0.9375rem;   /* 15px (was 13px) */
    --exc-f-h3:   1.1875rem;   /* 19px */
    --exc-f-h2:   1.5rem;      /* 24px */
    --exc-f-h1:   2rem;        /* 32px */
    font-size: var(--exc-f-body);
}

/* Real BlueSky logo (SVG asset from the marketing site) */
img.dr-brand-logo {
    height: 36px;
    width: auto;
    display: block;
}

/* Larger filename + folder name */
.dr-folder-name      { font-size: 1rem; }
.dr-file-body strong { font-size: 1rem; }
.dr-folder           { padding: var(--exc-s-5); min-height: 72px; }
.dr-file-link        { padding: var(--exc-s-4); }

/* Inline file viewer */
.dr-viewer-card {
    background: var(--exc-bg-1);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dr-viewer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--exc-s-4);
    padding: var(--exc-s-4) var(--exc-s-5);
    border-bottom: 1px solid var(--exc-border);
    background: var(--exc-bg-2);
}

.dr-viewer-meta h2 {
    font-size: var(--exc-f-h2);
    font-weight: 600;
    word-break: break-word;
}

.dr-viewer-actions {
    display: flex;
    align-items: center;
    gap: var(--exc-s-2);
    flex-shrink: 0;
}

.dr-viewer-stage {
    margin: 0;
    background: var(--exc-bg-0);
    min-height: clamp(540px, 75vh, 900px);
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.dr-viewer-stage iframe {
    width: 100%;
    height: clamp(540px, 82vh, 1400px);
    border: 0;
    display: block;
    background: var(--exc-bg-0);
}

.dr-viewer-image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--exc-s-5);
    width: 100%;
    background:
        linear-gradient(45deg, rgba(255,255,255,0.02) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.02) 75%) 0 0 / 24px 24px,
        linear-gradient(45deg, rgba(255,255,255,0.02) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.02) 75%) 12px 12px / 24px 24px,
        var(--exc-bg-0);
}

.dr-viewer-image img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    border-radius: var(--exc-r-2);
    box-shadow: var(--exc-e-2);
}

.dr-viewer-stage video {
    width: 100%;
    max-height: 80vh;
    background: #000;
}

.dr-viewer-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--exc-s-6);
}

.dr-viewer-audio audio { width: min(640px, 90%); }


/* ── Text-size toggle (S · M · L) ──────────────────────────────────────── */

.exc-text-size {
    display: inline-flex;
    align-items: stretch;
    background: var(--exc-bg-2);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-1);
    padding: 2px;
    gap: 2px;
}

.exc-text-size button {
    border: 0;
    background: transparent;
    color: var(--exc-text-2);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    line-height: 1;
    transition: background 100ms, color 100ms;
    min-width: 30px;
}

.exc-text-size button:hover { background: var(--exc-bg-3); color: var(--exc-text-1); }

.exc-text-size button.is-active {
    background: var(--exc-brand);
    color: #fff;
}

/* The three sizes have visually different "Aa" labels so the affordance
   communicates "this changes type size". */
.exc-text-size button[data-text-size="0.85"] { font-size: 0.75rem; }
.exc-text-size button[data-text-size="1"]    { font-size: 0.9375rem; }
.exc-text-size button[data-text-size="1.15"] { font-size: 1.125rem; }


/* ── Responsive: collapse the admin rail on small viewports ──────────── */

@media (max-width: 900px) {
    .exc-console {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        grid-template-areas:
            "topbar"
            "rail"
            "content";
    }

    .exc-rail {
        position: static;
        height: auto;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--exc-border);
    }

    .exc-rail-brand { display: none; }   /* topbar already shows brand context */

    .exc-rail-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: var(--exc-s-2);
        gap: var(--exc-s-1);
    }

    .exc-rail-group-label { display: none; }

    .exc-rail-link {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .exc-rail-link.is-active::before { display: none; }

    .exc-rail-user {
        border-top: 1px solid var(--exc-border);
        padding: var(--exc-s-3) var(--exc-s-4);
    }

    .exc-topbar {
        padding: 0 var(--exc-s-4);
        gap: var(--exc-s-2);
    }

    .exc-topbar-title { font-size: var(--exc-f-h3); }
    .exc-topbar-crumb { display: none; }

    .exc-content { padding: var(--exc-s-4); }

    .exc-page-head {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Tables get a horizontal scroll instead of breaking layout. */
    .exc-table-wrap { overflow-x: auto; }
}

/* Data Room: stack topbar items vertically on narrow viewports. */
@media (max-width: 720px) {
    .dr-topbar {
        padding: var(--exc-s-3) var(--exc-s-3);
        gap: var(--exc-s-2);
    }
    .dr-main { padding: var(--exc-s-4); }

    .dr-viewer-head {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--exc-s-3);
    }
    .dr-viewer-actions { width: 100%; flex-wrap: wrap; }
}


/* ── Audit-log filter UX (Data Room admin → Audit) ──────────────────── */

.dr-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--exc-s-2);
    padding: var(--exc-s-2) 0;
    border-top: 1px solid var(--exc-border);
}
.dr-filter-row:first-of-type { border-top: 0; padding-top: 0; }

.dr-filter-label {
    flex: 0 0 80px;
    font-size: var(--exc-f-cap);
    color: var(--exc-text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.dr-filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px var(--exc-s-3);
    border-radius: var(--exc-r-pill);
    background: var(--exc-bg-2);
    border: 1px solid var(--exc-border);
    color: var(--exc-text-2);
    font-size: var(--exc-f-cap);
    font-weight: 500;
    transition: background 100ms, color 100ms, border-color 100ms;
    white-space: nowrap;
}
.dr-filter-pill:hover {
    background: var(--exc-bg-3);
    color: var(--exc-text-1);
    border-color: var(--exc-border-strong);
}
.dr-filter-pill.is-active {
    background: var(--exc-brand);
    border-color: var(--exc-brand);
    color: #fff;
}


/* Active-filter chips row */
.dr-filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--exc-s-2);
    padding: var(--exc-s-3);
    margin-top: var(--exc-s-3);
    background: rgba(31, 147, 208, 0.08);
    border: 1px solid var(--exc-brand);
    border-radius: var(--exc-r-2);
}

.dr-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--exc-s-2);
    padding: 4px var(--exc-s-2) 4px var(--exc-s-3);
    border-radius: var(--exc-r-pill);
    background: var(--exc-bg-2);
    border: 1px solid var(--exc-border-strong);
    color: var(--exc-text-1);
    font-size: var(--exc-f-cap);
    transition: background 100ms;
}
.dr-chip:hover { background: var(--exc-bg-3); }

.dr-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--exc-bg-3);
    color: var(--exc-text-2);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}
.dr-chip:hover .dr-chip-x { background: var(--exc-danger); color: #fff; }


/* Summary cards under the filter */
.dr-summary {
    margin-top: var(--exc-s-4);
    padding: var(--exc-s-4);
    background: var(--exc-bg-2);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
}

.dr-summary h3 {
    font-size: var(--exc-f-h3);
    font-weight: 600;
    margin-bottom: var(--exc-s-3);
}

.dr-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--exc-s-3);
}

.dr-summary-stats > div {
    display: flex;
    flex-direction: column;
}

.dr-summary-num {
    font-size: var(--exc-f-h2);
    font-weight: 700;
    line-height: 1;
    color: var(--exc-brand-2);
}

.dr-summary-stats > div > span:last-child {
    margin-top: 4px;
    font-size: var(--exc-f-micro);
    color: var(--exc-text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* ── Per-user permission editor (admin) ────────────────────────────────── */

/* Active-grants list at top of the page */
.dr-grant-list {
    display: flex;
    flex-direction: column;
    margin-top: var(--exc-s-3);
}

.dr-grant-row {
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
    padding: var(--exc-s-3) var(--exc-s-4);
    border-top: 1px solid var(--exc-border);
}
.dr-grant-row:first-child { border-top: 0; }

.dr-grant-icon {
    color: var(--exc-brand-2);
    flex-shrink: 0;
}

.dr-grant-body {
    flex: 1;
    min-width: 0;
}

.dr-grant-body strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Folder-tree breadcrumb (in the Grant tree) */
.dr-perm-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--exc-s-2);
    padding: var(--exc-s-3) var(--exc-s-4);
    background: var(--exc-bg-2);
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    margin: var(--exc-s-4) 0 var(--exc-s-3);
}


/* "This folder is covered by an ancestor grant" banner */
.dr-perm-coverage {
    display: flex;
    align-items: center;
    gap: var(--exc-s-3);
    padding: var(--exc-s-3) var(--exc-s-4);
    background: rgba(39, 192, 132, 0.08);
    border: 1px solid var(--exc-success);
    border-radius: var(--exc-r-2);
    margin-bottom: var(--exc-s-3);
    color: var(--exc-text-1);
    font-size: var(--exc-f-cap);
}
.dr-perm-coverage svg { color: var(--exc-success); flex-shrink: 0; }


/* The drill-down tree itself */
.dr-perm-tree {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--exc-border);
    border-radius: var(--exc-r-2);
    overflow: hidden;
    background: var(--exc-bg-1);
}

.dr-perm-item {
    display: grid;
    grid-template-columns: 28px 1fr auto auto;
    align-items: center;
    column-gap: var(--exc-s-3);
    padding: var(--exc-s-3) var(--exc-s-4);
    border-top: 1px solid var(--exc-border);
    transition: background 100ms;
}
.dr-perm-item:first-child { border-top: 0; }
.dr-perm-item:hover { background: var(--exc-bg-2); }

.dr-perm-icon { color: var(--exc-text-2); display: inline-flex; }
.dr-perm-item:hover .dr-perm-icon { color: var(--exc-brand-2); }

.dr-perm-body {
    min-width: 0;
}

.dr-perm-name {
    color: var(--exc-text-1);
    font-weight: 600;
    font-size: var(--exc-f-body);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
a.dr-perm-name:hover { color: var(--exc-brand-2); text-decoration: underline; }

.dr-perm-state {
    display: flex;
    align-items: center;
    gap: var(--exc-s-2);
}

.dr-perm-actions {
    display: flex;
    align-items: center;
    gap: var(--exc-s-2);
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .dr-perm-item {
        grid-template-columns: 28px 1fr;
        grid-template-rows: auto auto;
        row-gap: var(--exc-s-2);
    }
    .dr-perm-state, .dr-perm-actions {
        grid-column: 2;
    }
}
