/* ==========================================
   AGILE COMMAND CENTER v2 - PREMIUM STYLES
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;700;800&display=swap');

:root {
    /* Deep OLED / Sleek Graphite Theme */
    --bg: #09090b;
    --surface: #121214;
    --surface-hover: #1f1f22;
    --border: #27272a;
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --accent: #38bdf8;

    /* Protected status colors */
    --danger: #f43f5e;
    --danger-bg: rgba(244, 63, 94, 0.1);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: #fbbf24;

    --test-color: #8b5cf6;
    --test-bg: rgba(139, 92, 246, 0.1);
    --ship-color: #f97316;          /* orange — deliverables burn */
    --ship-bg: rgba(249, 115, 22, 0.1);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 30px 20px;
    -webkit-font-smoothing: antialiased;
}

.kpi-value, .audit-pts, .epic-stats, .td-numeric, .ledger-score, .timeline-date, .ring-num, .verdict-date {
    font-family: 'JetBrains Mono', monospace;
}

.container { max-width: 1000px; margin: 0 auto; }

h1 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 800;
}
h1 span { color: var(--accent); }

.nav-tabs { display: flex; gap: 20px; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
.nav-tabs a {
    padding: 12px 0; text-decoration: none; color: var(--muted);
    font-weight: 600; text-transform: uppercase; font-size: 0.85rem;
    letter-spacing: 1.5px; border-bottom: 2px solid transparent; transition: all 0.2s ease;
}
.nav-tabs a.active, .nav-tabs a:hover { color: var(--text); border-bottom: 2px solid var(--accent); }

.search-input {
    width: 100%; background: var(--surface); border: 1px solid var(--border);
    color: var(--text); padding: 15px 20px; border-radius: 8px;
    font-size: 1rem; box-sizing: border-box; margin-bottom: 25px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(56,189,248,0.2); }

.chart-container, .kpi-box, .drilldown-panel, .backlog-zone {
    background: var(--surface); padding: 25px; border: 1px solid var(--border);
    border-radius: 12px; margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

/* ------------------------------------------
   SIGNATURE 1: THE DAY RING (Execution Deck hero)
   ------------------------------------------ */
.day-hero {
    display: flex; align-items: center; gap: 30px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 25px 30px; margin-bottom: 25px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    position: relative; overflow: hidden;
}
.day-hero.cleared { border-color: var(--success); box-shadow: 0 0 40px rgba(16,185,129,0.18), 0 8px 30px rgba(0,0,0,0.4); }

.ring-wrap { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--border); stroke-width: 11; }
.ring-fill  { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round;
              transition: stroke-dashoffset 0.7s cubic-bezier(0.4,0,0.2,1), stroke 0.4s; }
.day-hero.cleared .ring-fill { stroke: var(--success); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.ring-sub { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 4px; }

.hero-main { flex-grow: 1; min-width: 230px; }
.hero-date { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }
.hero-status { font-size: 1.45rem; font-weight: 800; margin: 6px 0 10px; letter-spacing: 0.5px; }
.hero-status .ok { color: var(--success); }
.hero-status .at-risk { color: var(--warning); }
.hero-detail { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.hero-detail b { color: var(--text); font-family: 'JetBrains Mono', monospace; }

.hero-side { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.streak-chip {
    display: flex; align-items: center; gap: 8px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px;
    font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 1rem;
}
.streak-chip.hot { border-color: var(--warning); color: var(--warning-light); box-shadow: 0 0 14px rgba(245,158,11,0.25); }
.debt-chip {
    font-size: 0.78rem; padding: 6px 14px; border-radius: 999px; font-weight: 800;
    letter-spacing: 1px; font-family: 'JetBrains Mono', monospace;
}
.debt-chip.zero { color: var(--success); border: 1px solid var(--success); }
.debt-chip.owed { color: var(--danger); border: 1px solid var(--danger); background: var(--danger-bg); }

/* Day-section headers in the deck */
.day-section-title {
    display: flex; align-items: center; gap: 12px; margin: 30px 0 14px;
    font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--muted);
}
.day-section-title.fire { color: var(--danger); }
.day-section-title.today-t { color: var(--warning); }
.day-section-title::after { content: ''; flex-grow: 1; height: 1px; background: var(--border); }

/* Task cards */
.timeline-item { display: flex; align-items: stretch; margin-bottom: 13px; }
.timeline-date { width: 100px; flex-shrink: 0; text-align: right; padding-right: 18px; font-weight: 700; color: var(--muted); font-size: 0.82rem; padding-top: 15px; text-transform: uppercase; }
.timeline-line { position: relative; width: 2px; background: var(--border); margin-right: 18px; }
.timeline-node { position: absolute; left: -6px; top: 16px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); z-index: 1; }
.task-card { flex-grow: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; transition: border-color 0.2s, transform 0.15s; }
.task-card:hover { border-color: #3f3f46; }
.task-left { display: flex; align-items: center; gap: 14px; flex-grow: 1; }
.task-title { font-weight: 500; font-size: 0.95rem; }
.task-meta { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; display: flex; gap: 14px; align-items: center; flex-shrink: 0; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--success); cursor: pointer; flex-shrink: 0; }
.completed-text { text-decoration: line-through; color: var(--muted); }

/* Just-completed pulse — make "done" felt */
@keyframes donePulse {
    0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.55); }
    100% { box-shadow: 0 0 0 16px rgba(16,185,129,0); }
}
.task-card.just-done { border-color: var(--success); animation: donePulse 0.9s ease-out; }

/* Ship tasks */
.task-card.ship-card { border-left: 4px solid var(--ship-color); }
.ship-tag { color: var(--ship-color); font-weight: 800; font-size: 0.68rem; letter-spacing: 1.5px; border: 1px solid var(--ship-color); padding: 2px 7px; border-radius: 5px; }
.evidence-row { width: 100%; display: flex; gap: 10px; margin-top: 10px; }
.evidence-input { flex-grow: 1; background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 5px; font-size: 0.85rem; font-family: 'JetBrains Mono', monospace; }
.evidence-input:focus { outline: none; border-color: var(--ship-color); }
.ship-btn { background: var(--ship-color); color: #fff; border: none; padding: 8px 16px; border-radius: 5px; cursor: pointer; font-weight: 800; }
.evidence-link-view { font-size: 0.78rem; color: var(--ship-color); text-decoration: none; word-break: break-all; }

/* Assessment Ledgers */
.task-card.test-card { border-color: var(--test-color); background: var(--surface); flex-direction: column; align-items: flex-start; gap: 14px; }
.test-header { display: flex; justify-content: space-between; width: 100%; align-items: center; }
.test-ledger-input { width: 100%; display: flex; flex-wrap: wrap; gap: 10px; background: var(--bg); padding: 14px; border-radius: 6px; border: 1px solid var(--border); }
.ledger-input { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 4px; font-size: 0.85rem; flex-grow: 1; }
.ledger-score { width: 80px; text-align: center; font-weight: bold; }
.test-btn { background: var(--test-color); color: #fff; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* Urgency Nodes */
.timeline-item.delayed .timeline-date { color: var(--danger); font-weight: 900; }
.timeline-item.delayed .timeline-node { background: var(--danger); border-color: var(--danger); box-shadow: 0 0 12px var(--danger); }
.task-card.delayed { border-left: 4px solid var(--danger); background: linear-gradient(90deg, var(--danger-bg) 0%, var(--bg) 15%); }
.timeline-item.today .timeline-date { color: var(--warning); font-weight: 800; }
.timeline-item.today .timeline-node { background: var(--warning); border-color: var(--warning); box-shadow: 0 0 8px var(--warning); }

.badge-delayed { color: var(--danger); font-weight: 800; font-size: 0.72rem; letter-spacing: 1px; border: 1px solid var(--danger); padding: 3px 8px; border-radius: 6px; }
.badge-today { color: var(--warning); font-weight: 800; font-size: 0.72rem; letter-spacing: 1px; border: 1px solid var(--warning); padding: 3px 8px; border-radius: 6px; }

details { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 18px; overflow: hidden; }
summary { padding: 14px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: #18181b; font-weight: 700; font-size: 1.02rem; list-style: none; border-bottom: 1px solid var(--border); }
summary::-webkit-details-marker { display: none; }
.epic-stats { font-size: 0.85rem; color: var(--accent); background: rgba(56,189,248,0.1); padding: 4px 10px; border-radius: 4px; }
.timeline-container { padding: 20px 20px 6px 0; }

/* ------------------------------------------
   SIGNATURE 2: THE VERDICT (Velocity hero)
   ------------------------------------------ */
.verdict {
    border-radius: 16px; padding: 28px 30px; margin-bottom: 25px;
    border: 1px solid var(--border); background: var(--surface);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.verdict.good { border-color: var(--success); }
.verdict.risk { border-color: var(--warning); }
.verdict.miss { border-color: var(--danger); background: linear-gradient(135deg, var(--danger-bg) 0%, var(--surface) 45%); }
.verdict-eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2.5px; color: var(--muted); margin-bottom: 10px; }
.verdict-line { font-size: 1.5rem; font-weight: 800; line-height: 1.35; }
.verdict-line .verdict-date { padding: 0 2px; }
.verdict.good .verdict-date { color: var(--success); }
.verdict.risk .verdict-date { color: var(--warning); }
.verdict.miss .verdict-date { color: var(--danger); }
.verdict-sub { margin-top: 10px; color: var(--muted); font-size: 0.92rem; }
.verdict-sub b { color: var(--text); font-family: 'JetBrains Mono', monospace; }

.replan-banner {
    border: 1px solid var(--danger); background: var(--danger-bg); color: var(--danger);
    border-radius: 10px; padding: 14px 20px; margin-bottom: 25px;
    font-weight: 800; letter-spacing: 0.5px; font-size: 0.9rem;
}

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 30px; }
.kpi-box { padding: 18px 20px; margin-bottom: 0; }
.kpi-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1.8px; color: var(--muted); margin-bottom: 8px; }
.kpi-value { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.kpi-foot { font-size: 0.75rem; color: var(--muted); margin-top: 7px; }

/* Epic bars */
.epic-chart-wrapper { position: relative; padding: 15px 0; border-left: 1px solid rgba(255,255,255,0.1); margin-left: 140px; }
.epic-bar-row { display: flex; align-items: center; margin-bottom: 16px; position: relative; z-index: 2; transform: translateX(-140px); width: calc(100% + 140px); }
.epic-bar-label { width: 130px; text-align: right; padding-right: 15px; font-weight: 600; font-size: 0.85rem; flex-shrink: 0; }
.epic-bar-container { flex-grow: 1; display: flex; align-items: center; }
.epic-bar-track { position: relative; height: 24px; border-radius: 4px; background: rgba(255,255,255,0.05); overflow: hidden; }
.epic-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; opacity: 0.28; }
.epic-bar-done { position: absolute; inset: 0 auto 0 0; border-radius: 4px; box-shadow: inset 0 2px 4px rgba(255,255,255,0.15); transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.epic-bar-data { padding-left: 15px; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.epic-bar-data strong { font-weight: 800; font-size: 0.95rem; color: var(--text); font-family: 'JetBrains Mono', monospace; }

/* Drilldown buttons */
.epic-btn-group { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.epic-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 10px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: all 0.2s; flex-grow: 1; text-align: center; }
.epic-btn:hover { filter: brightness(1.25); }
.drilldown-panel { display: none; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 0.73rem; text-transform: uppercase; letter-spacing: 1.5px; background: rgba(0,0,0,0.2); }
tbody tr:hover { background: rgba(255,255,255,0.02); }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-box { background: var(--surface); border: 1px solid var(--danger); border-radius: 8px; padding: 30px; max-width: 420px; text-align: center; }
.btn-cancel { background: transparent; border: 1px solid var(--border); color: var(--text); padding: 10px 20px; border-radius: 6px; cursor: pointer; }
.btn-danger { background: var(--danger); border: none; color: #fff; padding: 10px 20px; border-radius: 6px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
    .ring-fill, .task-card, .epic-bar-done { transition: none; }
    .task-card.just-done { animation: none; }
}
@media (max-width: 640px) {
    .day-hero { flex-direction: column; align-items: stretch; text-align: center; }
    .ring-wrap { margin: 0 auto; }
    .hero-side { align-items: center; }
    .timeline-date { width: 70px; font-size: 0.72rem; }
}
