:root {
    /* Theme: GVC Hub (light warm paper, GVC brand orange + navy ink,
       Titillium Web / Open Sans). Brand sampled from the GVC logo:
       orange #ff8c00, navy #112337. Still token-driven — re-theme from here. */
    --bg:        #f7f4ee;   /* warm paper */
    --bg-elev:   #ffffff;   /* clean card surface */
    --bg-soft:   #f1ece2;   /* warm inset / hover */
    --line:      #e6dfd2;   /* warm hairline border */
    --text:      #112337;   /* GVC brand navy */
    --muted:     #5f6b79;   /* navy-leaning muted */
    --dim:       #9aa3ad;   /* dim */
    --amber:     #e07c00;   /* GVC orange, darkened a step for contrast on white */
    --amber-soft: rgba(255, 140, 0, 0.12);
    --brand-orange: #ff8c00; /* pure logo orange — fills/graphics only, not text */
    --green:     #0f9d63;   /* status green (readable on light) */
    --yellow:    #c2790a;   /* status warning amber (readable on light) */
    --red:       #d92d20;   /* status red */
    --blue:      #2563eb;   /* links / info */
    --display: "Titillium Web", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --serif: "Source Serif Pro", "Source Serif 4", Georgia, "Times New Roman", serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
    --sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code { font-family: var(--mono); background: var(--bg-soft); padding: 1px 5px; border-radius: 3px; font-size: 0.92em; }

/* Typography: Titillium Web headings (hub), serif wordmark (flow nod), Open Sans body */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.kpi-figure, .tile-figure, .dev-figure { font-family: var(--display); }
.brand .title { font-family: var(--serif); font-weight: 700; letter-spacing: 0; }

/* Topbar */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--brand-orange); box-shadow: 0 0 12px var(--brand-orange);
}
.brand img.logo { height: 28px; width: 28px; display: block; }
.brand .title {
    font-family: var(--display);
    font-size: 17px; font-weight: 700; letter-spacing: 0.01em;
}
.brand .subtitle { color: var(--muted); font-size: 13px; }
.brand .back { font-family: var(--mono); font-size: 14px; }
.topbar .meta { color: var(--muted); font-size: 12.5px; font-family: var(--mono); display: flex; align-items: center; gap: 14px; }
.topbar .meta strong { color: var(--text); }

.btn {
    display: inline-block;
    border: 1px solid var(--line);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-family: var(--mono);
    transition: border-color 0.15s, background 0.15s;
}
.btn:hover { background: var(--bg-elev); border-color: var(--amber); text-decoration: none; }

/* Team tabs */
.team-tabs {
    max-width: 1280px; margin: 0 auto;
    padding: 14px 28px 0;
    display: flex; gap: 4px;
    border-bottom: 1px solid var(--line);
}
.team-tabs .tab {
    color: var(--muted);
    font-family: var(--mono); font-size: 12.5px;
    text-transform: uppercase; letter-spacing: 1px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-bottom: -1px;  /* sit on the bottom border */
    transition: color 0.15s, background 0.15s;
}
.team-tabs .tab:hover { color: var(--text); text-decoration: none; }
.team-tabs .tab.active {
    color: var(--text);
    background: var(--bg-elev);
    border-color: var(--line);
    border-bottom: 1px solid var(--bg-elev);
}

/* Layout */
main { max-width: 1280px; margin: 0 auto; padding: 28px; display: flex; flex-direction: column; gap: 24px; }

.empty {
    text-align: center; padding: 80px 28px; color: var(--muted);
}
.empty h1 { color: var(--text); font-weight: 500; margin-bottom: 8px; }

/* Tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.tile {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
}
.tile.primary { border-color: var(--amber); background: linear-gradient(180deg, var(--amber-soft), var(--bg-elev)); }
.tile-label { font-family: var(--mono); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.tile-figure {
    font-family: var(--mono);
    font-size: 56px; font-weight: 500; line-height: 1; margin: 8px 0 6px;
    letter-spacing: -2px;
}
.tile-figure .pct { font-size: 30px; color: var(--muted); margin-left: 2px; }
.tile-sub { font-family: var(--mono); color: var(--muted); font-size: 12.5px; }

.delta { display: inline-block; margin-left: 6px; font-size: 11.5px; padding: 1px 6px; border-radius: 4px; font-family: var(--mono); }
.delta.neutral { color: var(--dim); background: var(--bg-soft); }
.delta.down { color: var(--green); background: rgba(74, 222, 128, 0.1); }
.delta.up { color: var(--red); background: rgba(248, 113, 113, 0.1); }

/* Cards */
.card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 24px;
    box-shadow: 0 1px 2px rgba(17, 35, 55, 0.04);
}
.card h2 {
    margin: 0 0 14px;
    font-size: 13px; font-family: var(--mono); font-weight: 500;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--muted);
}
.muted { color: var(--muted); }

/* Trend chart container — fixed height stops Chart.js resize feedback loop */
.trend-wrap { position: relative; height: 280px; width: 100%; }

/* Per-dev cards */
.dev-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.dev-card { padding: 18px 20px; }
.dev-name { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.dev-figure { font-family: var(--mono); font-size: 38px; font-weight: 500; margin: 4px 0; letter-spacing: -1px; }
.dev-figure .muted { font-size: 22px; }
.dev-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Kanban sprint tabs */
.kanban-tabs {
    display: flex; flex-wrap: wrap; gap: 4px;
    padding-bottom: 14px; margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.kanban-tab {
    background: transparent; border: 1px solid transparent; border-bottom: none;
    color: var(--muted);
    font-family: var(--mono); font-size: 11.5px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    margin-bottom: -15px;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    display: inline-flex; align-items: center; gap: 6px;
}
.kanban-tab:hover { color: var(--text); }
.kanban-tab.active {
    color: var(--text);
    background: var(--bg-soft);
    border-color: var(--line);
    border-bottom: 1px solid var(--bg-soft);
}
.kanban-tab .tab-count {
    background: var(--bg-soft); color: var(--muted);
    padding: 1px 7px; border-radius: 10px; font-size: 10.5px;
}
.kanban-tab.active .tab-count { background: var(--bg); color: var(--text); }

/* Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.column {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    min-width: 240px;
    flex: 1;
}
.column-header {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 10px; margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.column-title { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.column-count { font-family: var(--mono); font-size: 12px; color: var(--text); background: var(--bg-soft); padding: 1px 8px; border-radius: 10px; }
.column-body { display: flex; flex-direction: column; gap: 8px; }
.empty-col { color: var(--dim); font-family: var(--mono); font-size: 12px; padding: 4px; }

.ticket-card {
    display: block;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 11px;
    color: var(--text);
    transition: border-color 0.15s;
}
.ticket-card:hover { border-color: var(--amber); text-decoration: none; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; }
.ticket-head .key { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.comment-badge {
    font-family: var(--mono); font-size: 10.5px;
    padding: 1px 7px; border-radius: 10px; min-width: 18px; text-align: center;
}
.comment-badge.silent { background: rgba(248, 113, 113, 0.18); color: var(--red); }
.comment-badge.has { background: rgba(74, 222, 128, 0.15); color: var(--green); }
.ticket-summary { font-size: 13px; line-height: 1.4; margin: 6px 0 8px; color: var(--text); }
.ticket-foot { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.initial {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--bg-soft); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10.5px; font-weight: 600;
}
.silent-days { margin-left: auto; }

/* Nudge table */
.nudge-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nudge-table th { text-align: left; padding: 8px 10px; color: var(--muted); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.nudge-table td { padding: 10px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; }
.nudge-table tr:last-child td { border-bottom: none; }
.nudge-table a { color: var(--amber); }
.nudge-title {
    max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: var(--sans); color: var(--text);
}

.pill { padding: 2px 8px; border-radius: 10px; font-size: 11.5px; }
.pill.green { background: rgba(74, 222, 128, 0.15); color: var(--green); }
.pill.yellow { background: rgba(250, 204, 21, 0.15); color: var(--yellow); }
.pill.red { background: rgba(248, 113, 113, 0.15); color: var(--red); }

/* Metric tables (cycle time, sp medians) */
.metric-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 14px; }
.metric-table th { text-align: left; padding: 8px 10px; color: var(--muted); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.metric-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; }
.metric-table tr:last-child td { border-bottom: none; }

/* Side-by-side card pair: collapses to single column on narrow screens */
.side-by-side {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 24px;
    align-items: stretch;
}
.side-by-side > .card { min-width: 0; }
.side-by-side > .sizing-col { min-width: 0; }

/* Dev-vs-reasoned sizing */
.sizing-col .col-h { font-size: 13px; font-weight: 500; margin: 4px 0 0; font-family: var(--mono); }
.sizing-col .metric-table { margin-top: 8px; }
.ppt-cell { display: flex; align-items: center; gap: 8px; }
.ppt-bar { display: inline-block; height: 8px; border-radius: 4px; flex: 0 0 auto; }
.ppt-bar.dev { background: var(--muted); opacity: 0.55; }
.ppt-bar.rea { background: var(--yellow); opacity: 0.9; }
.rt-headline .rt-num { font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: -0.5px; }

/* R&T lag headline */
.rt-headline { display: flex; gap: 36px; padding: 8px 0 4px; flex-wrap: wrap; }
.rt-headline > div { display: flex; flex-direction: column; }
.rt-stat-label { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.rt-stat-value { font-family: var(--mono); font-size: 28px; font-weight: 500; letter-spacing: -1px; margin-top: 2px; }

/* Working hours heatmap */
.heatmap-wrap { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.heatmap-dev { display: flex; align-items: center; gap: 14px; }
.heatmap-name { font-family: var(--mono); font-size: 12px; color: var(--text); width: 70px; flex-shrink: 0; }
.heatmap-grid {
    display: grid;
    grid-template-columns: 32px repeat(24, 1fr);
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.heatmap-corner { }
.heatmap-hour-label { font-family: var(--mono); font-size: 9.5px; color: var(--dim); text-align: center; }
.heatmap-dow-label { font-family: var(--mono); font-size: 9.5px; color: var(--muted); padding-right: 6px; text-align: right; line-height: 16px; }
.heatmap-cell {
    height: 16px; border-radius: 2px;
    background: var(--bg-soft);
    border: 1px solid transparent;
    transition: outline 0.1s;
}
.heatmap-cell:hover { outline: 1px solid var(--amber); }
.heatmap-cell.weekend { box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.18); }

/* Reopen */
.reopen-headline { display: flex; align-items: baseline; gap: 16px; padding: 8px 0 16px; }
.reopen-pct { font-family: var(--mono); font-size: 44px; font-weight: 500; letter-spacing: -1px; }
.reopen-pct .pct { font-size: 22px; color: var(--muted); margin-left: 2px; }
.reopen-sub { color: var(--muted); font-size: 13px; }
.reopen-list { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: 13px; }
.reopen-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.reopen-list li:last-child { border-bottom: none; }

/* Movement */
.movement-list { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: 13px; }
.movement-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.movement-list li:last-child { border-bottom: none; }
.m-up { color: var(--green); }
.m-down { color: var(--red); }
.m-move { color: var(--blue); }
.movement-list strong { color: var(--text); }
.movement-list em { color: var(--muted); font-style: normal; }

/* Report archive */
.report-archive { list-style: none; padding: 0; margin: 0; }
.report-archive li {
    display: flex; align-items: center; gap: 14px;
    padding: 8px 0; border-bottom: 1px solid var(--line);
    font-family: var(--mono); font-size: 13px;
}
.report-archive li:last-child { border-bottom: none; }
.archive-date { color: var(--muted); min-width: 110px; }

.footer { text-align: center; color: var(--dim); font-family: var(--mono); font-size: 11px; padding: 28px; letter-spacing: 1px; }

/* Report page */
.report-page main { max-width: 920px; }
.report {
    max-width: 920px; margin: 28px auto; padding: 0 28px 60px;
    line-height: 1.65;
}
.report h1 { font-size: 26px; font-weight: 600; margin: 0 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.report h2 {
    font-family: var(--mono);
    font-size: 13px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--muted);
    margin: 32px 0 12px;
}
.report h3 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; }
.report p { margin: 8px 0; }
.report ul { padding-left: 22px; }
.report li { margin: 4px 0; }
.report-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.report-table th { text-align: left; padding: 8px 10px; color: var(--muted); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.report-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); font-family: var(--mono); }

/* Report print header (only shown in print mode) */
.report-print-header { display: none; padding: 14mm 12mm 6mm; border-bottom: 1px solid #ccc; }
.report-print-header .title { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: 0.5px; }

body.print-mode .report-print-header { display: block; background: white; color: #111; }

/* Print mode (works for ?print=1 view + browser Print to PDF) */
@media print {
    body { background: white !important; color: #111; }
    .topbar, .footer, .team-tabs { display: none !important; }
    .report-print-header { display: block; }
    main { max-width: 100% !important; padding: 0 12mm 12mm !important; }
    a { color: #0a4f9e !important; text-decoration: none; }
    .card, .tile, .ticket-card, .column {
        background: white !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid; break-inside: avoid;
    }
    .tile.primary { background: white !important; }
    .tile-figure, .ticket-summary, .nudge-table td, .movement-list li,
    .dev-figure, .report h1, .report h2, .report h3, .report p, .report li { color: #111 !important; }
    .tile-label, .tile-sub, .dev-name, .dev-sub,
    .column-title, .ticket-head .key, .nudge-table th,
    .muted, .ticket-foot, .archive-date, h2, .delta.neutral { color: #555 !important; background: transparent !important; }
    .column-count, .initial { background: #eee !important; color: #111 !important; }
    .comment-badge.silent { background: #fee2e2 !important; color: #991b1b !important; }
    .comment-badge.has { background: #dcfce7 !important; color: #166534 !important; }
    .delta.down { color: #16a34a !important; background: transparent !important; }
    .delta.up { color: #dc2626 !important; background: transparent !important; }
    .pill.green { background: #dcfce7 !important; color: #166534 !important; }
    .pill.yellow { background: #fef9c3 !important; color: #854d0e !important; }
    .pill.red { background: #fee2e2 !important; color: #991b1b !important; }
    .m-up { color: #16a34a !important; }
    .m-down { color: #dc2626 !important; }
    .m-move { color: #2563eb !important; }
    .kanban { flex-wrap: wrap; overflow: visible; gap: 8px; }
    .column { min-width: 200px; flex: 0 0 calc(33% - 8px); }
    .trend-wrap { height: 220px; }
}

/* ── Small screens, platform-wide ──────────────────────────────────────────── */
@media (max-width: 700px) {
    .card { padding: 14px 14px; border-radius: 10px; }
    .card h2 { font-size: 16px; }
    main, .shell-content > main { padding: 12px; }
    .report h1 { font-size: 21px; }
}

/* Kanban: real status of a card folded into the To Do column */
.ticket-substatus { display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 999px;
    font-size: 10px; font-weight: 600; letter-spacing: .03em; color: var(--muted);
    border: 1px solid var(--line); background: var(--bg-soft); }
