/* ══════════════════════════════════════════════════════════════════════════════
   URCOD Enterprise Theme — Charcoal + Single Green Accent
   Applied via body.theme-enterprise class. Does NOT touch legacy CSS.
   
   Palette:
     --ent-bg:           #0F1620      Screen background
     --ent-bg-card:      #1A2333      Card surface
     --ent-bg-card-elev: #1F2A3D      Hover/focus surface
     --ent-text:         #F5F7FA      Numbers, headers
     --ent-text-sec:     #9CA3AF      Labels, captions
     --ent-text-tert:    #6B7280      Footnotes, hints
     --ent-border:       rgba(245,247,250,0.08)
     --ent-border-strong:rgba(245,247,250,0.14)
     --ent-green:        #00A651      Single accent
     --ent-green-70:     rgba(0,166,81,0.70)
     --ent-green-40:     rgba(0,166,81,0.40)
     --ent-green-20:     rgba(0,166,81,0.20)
     --ent-amber:        #A87A12      Attention only
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise {
    --ent-bg: #0F1620;
    --ent-bg-card: #1A2333;
    --ent-bg-card-elev: #1F2A3D;
    --ent-text: #F5F7FA;
    --ent-text-sec: #9CA3AF;
    --ent-text-tert: #6B7280;
    --ent-border: rgba(245,247,250,0.08);
    --ent-border-strong: rgba(245,247,250,0.14);
    --ent-green: #00A651;
    --ent-green-70: rgba(0,166,81,0.70);
    --ent-green-40: rgba(0,166,81,0.40);
    --ent-green-20: rgba(0,166,81,0.20);
    --ent-amber: #A87A12;
    --ent-amber-30: rgba(168,122,18,0.30);
    --ent-amber-12: rgba(168,122,18,0.12);
}

/* ── GLOBAL: tabular numerals ──────────────────────────────────────────────── */
body.theme-enterprise .rd-kpi-val,
body.theme-enterprise .rd-pipe-count,
body.theme-enterprise .rd-pipe-stat-val,
body.theme-enterprise .rd-stat-value,
body.theme-enterprise .rd-alert-count,
body.theme-enterprise .rd-act-col-count,
body.theme-enterprise .rd-plan-col-count,
body.theme-enterprise .rd-bv-block-stats,
body.theme-enterprise .ent-tnum {
    font-feature-settings: 'tnum' 1;
    font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════════════════════════
   READINESS HEADER
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .readiness-header .screen-title {
    color: var(--ent-text);
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ── BUTTONS — flat, no gradients ──────────────────────────────────────────── */
body.theme-enterprise .rd-btn-primary {
    background: var(--ent-green);
    color: #fff;
    border: none;
    box-shadow: none;
}
body.theme-enterprise .rd-btn-primary:hover {
    background: var(--ent-green-70);
    transform: none;
    box-shadow: none;
}
body.theme-enterprise .rd-btn-outline {
    background: transparent;
    color: var(--ent-text-sec);
    border: 1px solid var(--ent-border-strong);
}
body.theme-enterprise .rd-btn-outline:hover {
    background: var(--ent-bg-card-elev);
    color: var(--ent-text);
}
body.theme-enterprise .rd-btn-danger {
    background: rgba(220,53,69,0.15);
    color: #DC3545;
    border: 1px solid rgba(220,53,69,0.3);
}
body.theme-enterprise .rd-btn-danger:hover {
    background: rgba(220,53,69,0.25);
}

/* ── SUB-TABS — green accent, no blue ──────────────────────────────────────── */
body.theme-enterprise .readiness-subtabs {
    border-bottom: 1px solid var(--ent-border-strong);
}
body.theme-enterprise .rd-subtab {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-subtab:hover {
    color: var(--ent-text);
    background: transparent;
}
body.theme-enterprise .rd-subtab.active {
    color: var(--ent-green);
    border-bottom-color: var(--ent-green);
}

/* ══════════════════════════════════════════════════════════════════════════════
   1. KPI STRIP — Five tiles, single row, hairline borders, green accent line
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .rd-kpi-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    margin-bottom: 24px;
    border: 1px solid var(--ent-border);
    border-radius: 8px;
    overflow: hidden;
}

body.theme-enterprise .rd-kpi {
    background: var(--ent-bg-card);
    border: none;
    border-radius: 0;
    border-right: 1px solid var(--ent-border);
    padding: 20px 16px;
    text-align: left;
    position: relative;
    transition: background 0.15s;
}
body.theme-enterprise .rd-kpi:last-child {
    border-right: none;
}
body.theme-enterprise .rd-kpi::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 16px;
    width: 30px;
    height: 2px;
    background: var(--ent-green);
    opacity: 1;
    border-radius: 1px;
}
body.theme-enterprise .rd-kpi:hover {
    background: var(--ent-bg-card-elev);
    transform: none;
    box-shadow: none;
}

body.theme-enterprise .rd-kpi-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--ent-text);
    letter-spacing: -0.02em;
    margin-top: 10px;
}

body.theme-enterprise .rd-kpi-lbl {
    font-size: 0.65rem;
    color: var(--ent-text-sec);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
    font-weight: 600;
}

/* Remove per-KPI color overrides — all numerals white */
body.theme-enterprise .rd-kpi-accent .rd-kpi-val {
    color: var(--ent-text) !important;
}
body.theme-enterprise .rd-kpi-accent::before {
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════════════════════════
   2. STATUS DISTRIBUTION — Stacked bar replaces donut
   ══════════════════════════════════════════════════════════════════════════════ */

/* Enterprise mode: chart canvas not emitted in DOM (handled by JS template conditional).
   No display:none hack needed — no canvas, no Chart.js instance, no memory leak. */

/* The stacked bar is injected via JS when theme=enterprise.
   These styles handle it. */
body.theme-enterprise .ent-status-bar-wrap {
    padding: 0;
}
body.theme-enterprise .ent-status-bar-wrap h4 {
    margin: 0 0 12px;
    font-size: 0.65rem;
    color: var(--ent-text-sec);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
body.theme-enterprise .ent-status-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}
body.theme-enterprise .ent-status-bar-seg {
    min-width: 4px;
    transition: width 0.4s ease;
}
body.theme-enterprise .ent-status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
body.theme-enterprise .ent-status-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--ent-text-sec);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
body.theme-enterprise .ent-status-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}
body.theme-enterprise .ent-status-legend-count {
    color: var(--ent-text);
    font-weight: 800;
    font-feature-settings: 'tnum' 1;
}

/* ══════════════════════════════════════════════════════════════════════════════
   3. READINESS PIPELINE — Horizontal flow with chevrons
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .rd-dash-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

body.theme-enterprise .rd-dash-card {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-radius: 8px;
    padding: 20px;
}
body.theme-enterprise .rd-dash-card h4 {
    color: var(--ent-text-sec);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    font-weight: 700;
}

body.theme-enterprise .rd-pipeline {
    gap: 12px;
}
body.theme-enterprise .rd-pipe-stage {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-radius: 6px;
    border-bottom: none;
    padding: 14px 16px;
    min-width: 90px;
}
body.theme-enterprise .rd-pipe-stage:hover {
    background: var(--ent-bg-card-elev);
    transform: none;
}
body.theme-enterprise .rd-pipe-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ent-text);
}
body.theme-enterprise .rd-pipe-label {
    font-size: 0.6rem;
    color: var(--ent-text-sec);
    letter-spacing: 0.06em;
}
body.theme-enterprise .rd-pipe-arrow {
    color: var(--ent-green-40);
    opacity: 1;
    font-size: 1.2rem;
}

body.theme-enterprise .rd-pipeline-summary {
    border-top: 1px solid var(--ent-border);
    padding-top: 14px;
}
body.theme-enterprise .rd-pipe-stat-val {
    color: var(--ent-text);
    font-size: 1.1rem;
}
body.theme-enterprise .rd-pipe-stat {
    color: var(--ent-text-sec);
    font-size: 0.65rem;
    letter-spacing: 0.06em;
}

/* ══════════════════════════════════════════════════════════════════════════════
   5. BLOCK SUMMARY — Inline strip, not card
   ══════════════════════════════════════════════════════════════════════════════ */

/* Handled by pipeline summary overrides above */

/* ══════════════════════════════════════════════════════════════════════════════
   4. ALERT CARDS — Ready Now / Coming Soon / Attention
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .rd-alert-row {
    grid-template-columns: repeat(3, 1fr);
}

body.theme-enterprise .rd-alert-card {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-radius: 8px;
    border-top: none;
}
body.theme-enterprise .rd-alert-card h4 {
    font-size: 0.72rem;
    color: var(--ent-text);
}

/* Ready Now — green */
body.theme-enterprise .rd-alert-green {
    border-top: none;
}
body.theme-enterprise .rd-alert-green h4 .rd-indicator {
    background: var(--ent-green);
    box-shadow: none;
}

/* Coming Soon — green-20 */
body.theme-enterprise .rd-alert-yellow {
    border-top: none;
}
body.theme-enterprise .rd-alert-yellow h4 .rd-indicator {
    background: var(--ent-green-40);
    box-shadow: none;
}

/* Attention — amber */
body.theme-enterprise .rd-alert-red {
    border-top: none;
}
body.theme-enterprise .rd-alert-red h4 .rd-indicator {
    background: var(--ent-amber);
    box-shadow: none;
}

body.theme-enterprise .rd-alert-item {
    background: transparent;
    border: 1px solid var(--ent-border);
    border-left: none;
    border-radius: 6px;
    padding: 8px 12px;
}
body.theme-enterprise .rd-alert-item:hover {
    background: var(--ent-bg-card-elev);
}
body.theme-enterprise .rd-alert-name {
    color: var(--ent-text);
}
body.theme-enterprise .rd-alert-loc {
    color: var(--ent-text-tert);
}

/* Status badges — green opacity scale */
body.theme-enterprise .rd-alert-badge {
    border-radius: 4px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
body.theme-enterprise .rd-alert-green .rd-alert-badge {
    background: var(--ent-green) !important;
    color: #fff;
}
body.theme-enterprise .rd-alert-yellow .rd-alert-badge {
    background: var(--ent-green-20) !important;
    color: var(--ent-green) !important;
    border: 1px solid var(--ent-green-40);
}
body.theme-enterprise .rd-alert-red .rd-alert-badge {
    background: var(--ent-amber-12) !important;
    color: var(--ent-amber) !important;
    border: 1px solid var(--ent-amber-30);
}

body.theme-enterprise .rd-alert-days {
    color: var(--ent-text-sec);
    background: transparent;
    font-weight: 600;
}
body.theme-enterprise .rd-alert-warn {
    color: var(--ent-amber);
    background: var(--ent-amber-12);
}
body.theme-enterprise .rd-alert-count {
    background: var(--ent-bg-card-elev);
    color: var(--ent-text);
}
body.theme-enterprise .rd-indicator-green {
    background: var(--ent-green);
    box-shadow: none;
}
body.theme-enterprise .rd-indicator-yellow {
    background: var(--ent-green-40);
    box-shadow: none;
}
body.theme-enterprise .rd-indicator-red {
    background: var(--ent-amber);
    box-shadow: none;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ACTION BOARD — Enterprise palette
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .rd-act-col {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-radius: 8px;
    border-top: none;
}
body.theme-enterprise .rd-act-col-head {
    background: transparent;
    border-bottom: 1px solid var(--ent-border);
    font-size: 0.72rem;
    color: var(--ent-text);
}
body.theme-enterprise .rd-act-col-green {
    border-top: 2px solid var(--ent-green);
}
body.theme-enterprise .rd-act-col-yellow {
    border-top: 2px solid var(--ent-green-40);
}
body.theme-enterprise .rd-act-col-red {
    border-top: 2px solid var(--ent-amber);
}

body.theme-enterprise .rd-act-card {
    background: transparent;
    border: 1px solid var(--ent-border);
    border-left: 2px solid var(--ent-green-40);
    border-radius: 6px;
}
body.theme-enterprise .rd-act-card:hover {
    background: var(--ent-bg-card-elev);
    transform: none;
}
body.theme-enterprise .rd-act-badge {
    border-radius: 4px;
}
body.theme-enterprise .rd-act-eta {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-act-stuck {
    color: var(--ent-amber);
}

/* ══════════════════════════════════════════════════════════════════════════════
   MAP VIEW — Enterprise palette
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .rd-summary-bar .rd-stat-card {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-radius: 8px;
}
body.theme-enterprise .rd-summary-bar .rd-stat-card:hover {
    transform: none;
    box-shadow: none;
}
body.theme-enterprise .rd-summary-bar .rd-stat-value {
    color: var(--ent-text);
}

body.theme-enterprise .rd-legend-bar {
    border-bottom: 1px solid var(--ent-border);
}
body.theme-enterprise .rd-legend-count {
    background: var(--ent-bg-card-elev);
}

body.theme-enterprise .rd-select:focus,
body.theme-enterprise .rd-input:focus {
    border-color: var(--ent-green);
    box-shadow: none;
}

body.theme-enterprise .rd-block-header {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-left: 3px solid var(--ent-green);
    border-radius: 6px;
}

body.theme-enterprise .rd-pad-card {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-radius: 8px;
}
body.theme-enterprise .rd-pad-card:hover {
    box-shadow: none;
}
body.theme-enterprise .rd-pad-header {
    background: transparent;
    border-bottom: 1px solid var(--ent-border);
}
body.theme-enterprise .rd-well-node {
    background: transparent;
    border: 1px solid var(--ent-border);
    border-radius: 6px;
    border-left: 2px solid var(--ent-green-40);
}
body.theme-enterprise .rd-well-node:hover {
    background: var(--ent-bg-card-elev);
    transform: none;
}
body.theme-enterprise .rd-well-badge {
    border-radius: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   BLOCK VIEW — Enterprise palette
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .rd-bv-block {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-radius: 8px;
}
body.theme-enterprise .rd-bv-block-head:hover {
    background: var(--ent-bg-card-elev);
}
body.theme-enterprise .rd-bv-pct-ring {
    background: conic-gradient(var(--ent-green) calc(var(--pct) * 1%), rgba(245,247,250,0.06) 0);
}
body.theme-enterprise .rd-bv-pct-ring span {
    background: var(--ent-bg-card);
}
body.theme-enterprise .rd-bv-pill {
    background: transparent;
    border: 1px solid var(--ent-border);
    color: var(--ent-text-sec);
}

/* ══════════════════════════════════════════════════════════════════════════════
   PLANNING BOARD — Enterprise palette
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .rd-plan-top5 {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-left: 3px solid var(--ent-green);
    border-radius: 8px;
}
body.theme-enterprise .rd-plan-col {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-radius: 8px;
}
body.theme-enterprise .rd-plan-col-head {
    background: transparent;
}
body.theme-enterprise .rd-plan-card {
    background: transparent;
    border: 1px solid var(--ent-border);
    border-radius: 6px;
}
body.theme-enterprise .rd-plan-card:hover {
    background: var(--ent-bg-card-elev);
    box-shadow: none;
}
body.theme-enterprise .rd-plan-prio-btn:hover {
    background: var(--ent-amber-12);
    color: var(--ent-amber);
    border-color: var(--ent-amber);
}
body.theme-enterprise .rd-plan-prio-btn.rd-prio-active {
    background: var(--ent-amber-12);
    color: var(--ent-amber);
    border-color: var(--ent-amber);
}
body.theme-enterprise .rd-plan-rank-btn:hover {
    background: var(--ent-green-20);
    color: var(--ent-green);
}
body.theme-enterprise .rd-plan-note:focus {
    border-color: var(--ent-green);
    background: rgba(0,166,81,0.04);
}

/* ══════════════════════════════════════════════════════════════════════════════
   DETAIL PANEL — Enterprise palette
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .rd-detail-card {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
    border-radius: 8px;
}
body.theme-enterprise .rd-detail-header {
    background: transparent;
}

/* ══════════════════════════════════════════════════════════════════════════════
   SETTINGS — Remove gradients from tiles, use enterprise palette
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .settings-tile-icon {
    background: var(--ent-green-20) !important;
}
body.theme-enterprise .settings-tile-icon svg {
    stroke: var(--ent-green) !important;
}
body.theme-enterprise .settings-tile {
    border: 1px solid var(--ent-border);
}
body.theme-enterprise .settings-tile:hover {
    border-color: var(--ent-border-strong);
    background: var(--ent-bg-card-elev);
}

/* ── Form elements ── */
body.theme-enterprise .backup-btn {
    background: var(--ent-bg-card) !important;
    border: 1px solid var(--ent-border) !important;
    box-shadow: none !important;
    color: var(--ent-text) !important;
}
body.theme-enterprise .backup-btn:hover {
    background: var(--ent-bg-card-elev) !important;
    border-color: var(--ent-green) !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   READINESS USER MANAGEMENT — Enterprise palette
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .rd-user-row {
    background: var(--ent-bg-card);
    border: 1px solid var(--ent-border);
}
body.theme-enterprise .rd-user-role {
    background: var(--ent-green-20);
    color: var(--ent-green);
}
body.theme-enterprise .rd-user-badge.active {
    background: var(--ent-green-20);
    color: var(--ent-green);
}
body.theme-enterprise .rd-user-badge.inactive {
    background: var(--ent-amber-12);
    color: var(--ent-amber);
}

/* ══════════════════════════════════════════════════════════════════════════════
   6. ROW ACTIONS — muted grey icons, hover to white
   ══════════════════════════════════════════════════════════════════════════════ */

body.theme-enterprise .rd-well-edit {
    color: var(--ent-text-tert);
    transition: color 0.15s;
}
body.theme-enterprise .rd-well-edit:hover {
    color: var(--ent-text);
    background: transparent;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — ≤640px: 2-up KPIs, vertical pipeline, 1-col status
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    body.theme-enterprise .rd-kpi-row {
        grid-template-columns: repeat(3, 1fr) !important;
        border-radius: 6px;
    }
    body.theme-enterprise .rd-kpi:nth-child(5) {
        grid-column: span 2;
    }
    body.theme-enterprise .rd-kpi-val {
        font-size: 1.4rem !important;
    }
    body.theme-enterprise .rd-kpi-lbl {
        font-size: 0.58rem !important;
    }
    
    body.theme-enterprise .rd-dash-row {
        grid-template-columns: 1fr !important;
    }
    body.theme-enterprise .rd-alert-row {
        grid-template-columns: 1fr !important;
    }
    body.theme-enterprise .rd-action-board {
        grid-template-columns: 1fr !important;
    }
    
    body.theme-enterprise .rd-pipeline {
        flex-direction: column;
        align-items: center;
    }
    body.theme-enterprise .rd-pipe-arrow {
        transform: rotate(90deg);
    }
    body.theme-enterprise .rd-pipe-stage {
        width: 100%;
        max-width: 200px;
    }
    
    body.theme-enterprise .rd-plan-board {
        grid-template-columns: 1fr !important;
    }
    
    body.theme-enterprise .ent-status-legend {
        gap: 8px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   COLOR LEAK FIXES — Legacy bright colors overridden to enterprise palette
   ══════════════════════════════════════════════════════════════════════════════ */

/* Overdue / No-date well cards — amber instead of red/yellow */
body.theme-enterprise .rd-overdue {
    border-color: var(--ent-amber) !important;
    background: var(--ent-amber-12) !important;
}
body.theme-enterprise .rd-nodate {
    border-color: var(--ent-amber) !important;
    background: var(--ent-amber-12) !important;
}

/* Planning board overdue/nodate tags */
body.theme-enterprise .rd-plan-overdue-tag {
    color: var(--ent-amber) !important;
    background: var(--ent-amber-12) !important;
}
body.theme-enterprise .rd-plan-nodate-tag {
    color: var(--ent-amber) !important;
    background: var(--ent-amber-12) !important;
}

/* Star priority icons — amber instead of yellow */
body.theme-enterprise .rd-plan-star,
body.theme-enterprise .rd-plan-star-ro {
    color: var(--ent-amber) !important;
}

/* Auto-tracking badge — green instead of lime */
body.theme-enterprise .rd-tracking-auto {
    background: var(--ent-green-20) !important;
    color: var(--ent-green) !important;
}

/* Source badge — green instead of blue */
body.theme-enterprise .rd-source-badge {
    color: var(--ent-green) !important;
}

/* Planning board date and rank — enterprise palette */
body.theme-enterprise .rd-plan-top5-date {
    color: var(--ent-amber) !important;
}
body.theme-enterprise .rd-plan-top5-rank {
    color: var(--ent-green) !important;
}

/* Legend colors in map view — use enterprise text */
body.theme-enterprise .rd-legend-label {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-stat-label {
    color: var(--ent-text-sec);
}

/* Empty states — muted text */
body.theme-enterprise .rd-empty,
body.theme-enterprise .rd-empty-small,
body.theme-enterprise .rd-alert-empty,
body.theme-enterprise .rd-act-empty,
body.theme-enterprise .rd-plan-empty {
    color: var(--ent-text-tert);
}

/* Loading spinner */
body.theme-enterprise .rd-loading {
    color: var(--ent-text-sec);
}

/* History panel */
body.theme-enterprise .rd-history-row {
    border-color: var(--ent-border);
}
body.theme-enterprise .rd-history-badge {
    border-radius: 4px;
}
body.theme-enterprise .rd-history-meta {
    color: var(--ent-text-tert);
}

/* Detail panel sub-elements */
body.theme-enterprise .rd-detail-label {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-detail-sub {
    color: var(--ent-text-tert);
}
body.theme-enterprise .rd-detail-notes {
    color: var(--ent-text-sec);
}

/* Block view sub-elements */
body.theme-enterprise .rd-bv-block-name {
    color: var(--ent-text);
}
body.theme-enterprise .rd-bv-pad {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-bv-pad-cnt {
    color: var(--ent-text-tert);
}

/* Map view pad elements */
body.theme-enterprise .rd-pad-name {
    color: var(--ent-text);
}
body.theme-enterprise .rd-pad-count {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-pad-chevron,
body.theme-enterprise .rd-pad-toggle {
    color: var(--ent-text-tert);
}

/* Well elements */
body.theme-enterprise .rd-well-name {
    color: var(--ent-text);
}
body.theme-enterprise .rd-well-meta {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-well-since {
    color: var(--ent-text-tert);
}

/* Planning board sub-elements */
body.theme-enterprise .rd-plan-loc {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-plan-date {
    color: var(--ent-text-tert);
}
body.theme-enterprise .rd-plan-col-desc {
    color: var(--ent-text-tert);
}
body.theme-enterprise .rd-plan-info-row {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-plan-updated {
    color: var(--ent-text-tert);
}
body.theme-enterprise .rd-plan-note-disp {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-plan-stat {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-plan-status {
    border-radius: 4px;
}
body.theme-enterprise .rd-plan-top5-name {
    color: var(--ent-text);
}
body.theme-enterprise .rd-plan-top5-loc {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-plan-top5-badge {
    border-radius: 4px;
}
body.theme-enterprise .rd-plan-top5-item {
    border-color: var(--ent-border);
}

/* Action board sub-elements */
body.theme-enterprise .rd-act-loc {
    color: var(--ent-text-sec);
}

/* Form elements in readiness */
body.theme-enterprise .rd-textarea {
    background: var(--ent-bg-card);
    border-color: var(--ent-border);
    color: var(--ent-text);
}
body.theme-enterprise .rd-textarea:focus {
    border-color: var(--ent-green);
}
body.theme-enterprise .rd-plan-rank-input {
    background: var(--ent-bg-card);
    border-color: var(--ent-border);
    color: var(--ent-text);
}
body.theme-enterprise .rd-plan-sel {
    background: var(--ent-bg-card);
    border-color: var(--ent-border);
    color: var(--ent-text);
}

/* Tracking rows */
body.theme-enterprise .rd-tracking-row {
    border-color: var(--ent-border);
}
body.theme-enterprise .rd-tracking-header {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-tracking-lbl {
    color: var(--ent-text-sec);
}
body.theme-enterprise .rd-tracking-field {
    color: var(--ent-text);
}

/* Status reference items */
body.theme-enterprise .rd-status-ref-item {
    border-color: var(--ent-border);
}

/* ══════════════════════════════════════════════════════════════════════════════
   PRINT — hide decorative elements
   ══════════════════════════════════════════════════════════════════════════════ */

@media print {
    body.theme-enterprise .rd-kpi::before { display: none; }
    body.theme-enterprise .rd-kpi-row { border: 1px solid #ccc; }
    body.theme-enterprise .rd-kpi { border-right: 1px solid #ccc; }
}

/* ── Backfill Modal — Enterprise Theme ───── */
body.theme-enterprise .backfill-modal {
    background: var(--ent-bg-card);
    border-top-color: var(--ent-border);
}
body.theme-enterprise .backfill-header {
    background: var(--ent-bg-card);
    border-bottom-color: var(--ent-border);
}
body.theme-enterprise .backfill-header h3 { color: var(--ent-text); }
body.theme-enterprise .bf-close {
    background: rgba(255,255,255,0.04);
    color: var(--ent-text-sec);
}
body.theme-enterprise .bf-label { color: var(--ent-text-sec); }
body.theme-enterprise .bf-chip {
    background: var(--ent-bg); border-color: var(--ent-border);
    color: var(--ent-text-sec);
}
body.theme-enterprise .bf-chip.active {
    border-color: var(--ent-accent);
    background: rgba(16,185,129,0.08);
    color: var(--ent-accent);
}
body.theme-enterprise .bf-seg-control { background: rgba(255,255,255,0.02); }
body.theme-enterprise .bf-seg { color: var(--ent-text-sec); }
body.theme-enterprise .bf-seg.active {
    background: rgba(255,255,255,0.06);
    color: var(--ent-text);
}
body.theme-enterprise .bf-summary-line {
    background: rgba(255,255,255,0.02);
    border-color: var(--ent-border);
    color: var(--ent-text);
}
body.theme-enterprise .bf-date-input,
body.theme-enterprise .bf-note-input,
body.theme-enterprise .bf-select {
    background: var(--ent-bg); border-color: var(--ent-border);
    color: var(--ent-text);
}
body.theme-enterprise .bf-date-input:focus,
body.theme-enterprise .bf-note-input:focus,
body.theme-enterprise .bf-select:focus { border-color: var(--ent-accent); }
body.theme-enterprise .bf-step-btn {
    background: var(--ent-bg); color: var(--ent-text);
}
body.theme-enterprise .bf-step-input {
    background: var(--ent-bg-card-elev);
    border-color: var(--ent-border); color: var(--ent-text);
}
body.theme-enterprise .backfill-footer { border-top-color: var(--ent-border); }
body.theme-enterprise .bf-btn-cancel {
    border-color: var(--ent-border); color: var(--ent-text-sec);
}
body.theme-enterprise .bf-btn-primary {
    background: var(--ent-accent); color: #fff;
}
body.theme-enterprise .backfill-confirm-icon {
    background: rgba(16,185,129,0.1); color: var(--ent-accent);
}
body.theme-enterprise .backfill-confirm-text { color: var(--ent-text); }
body.theme-enterprise .bf-btn-text { color: var(--ent-text-sec); }
body.theme-enterprise .bf-btn-text:hover { color: var(--ent-text); }
body.theme-enterprise .btn-backfill-stages { color: var(--ent-text-sec); }
body.theme-enterprise .btn-backfill-stages:hover { color: var(--ent-accent); }
