:root {
    --bg: #edf1f4;
    --panel: #ffffff;
    --panel-soft: #f7f9fa;
    --ink: #152236;
    --muted: #667487;
    --border: #d7dfe7;
    --border-strong: #bdc9d5;
    --navy: #17324f;
    --navy-dark: #0d2238;
    --navy-soft: #203f5f;
    --signal: #d99a2b;
    --signal-dark: #9b6410;
    --signal-bg: #fff4dc;
    --green: #2f7652;
    --green-bg: #e8f5ed;
    --blue: #2f6f98;
    --blue-bg: #e8f2f8;
    --late: #6d5f8d;
    --late-bg: #efecf7;
    --red: #a33d33;
    --red-bg: #fcebea;
    --shadow: 0 12px 30px rgba(13, 34, 56, 0.07);
    --shadow-soft: 0 4px 14px rgba(13, 34, 56, 0.05);
    --radius: 14px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .92em; overflow-wrap: anywhere; }

.site-header {
    min-height: 88px;
    padding: 14px clamp(20px, 4vw, 64px);
    background: var(--navy-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-lockup { display: inline-flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand-lockup:hover { text-decoration: none; }
.brand-mark {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(217,154,43,.48);
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(217,154,43,.08);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.brand-mark svg { width: 39px; height: 39px; fill: none; stroke: var(--signal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark circle { fill: var(--signal); stroke: none; }
.brand-copy { display: flex; align-items: center; gap: 15px; }
.brand-copy strong { font-size: 28px; line-height: 1; letter-spacing: .07em; }
.brand-copy span { color: #b9c6d3; font-size: 12px; line-height: 1.28; letter-spacing: .035em; text-transform: uppercase; }
.header-tools { display: flex; align-items: center; gap: 22px; }
.pilot-indicator { display: inline-flex; align-items: center; gap: 8px; color: #d5dde5; font-size: 12px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
.pilot-indicator span { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px rgba(217,154,43,.13); }
.user-box { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.user-initials { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #294865; color: #fff; font-weight: 800; }
.user-name { color: #d6e0e9; font-weight: 650; }
.user-box a { color: #fff; border: 1px solid #60758a; padding: 7px 12px; border-radius: 8px; font-weight: 700; }
.user-box a:hover { border-color: var(--signal); text-decoration: none; }

.main-nav { background: var(--navy); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.nav-inner { max-width: 1536px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px); display: flex; gap: 4px; overflow-x: auto; }
.main-nav a { color: #d7e0e9; padding: 13px 15px 12px; white-space: nowrap; border-bottom: 3px solid transparent; font-weight: 700; font-size: 14px; }
.main-nav a:hover, .main-nav a.active { color: #fff; text-decoration: none; border-bottom-color: var(--signal); background: rgba(255,255,255,.025); }
.system-strip { background: #fff; border-bottom: 1px solid var(--border); }
.system-strip-inner { max-width: 1536px; margin: 0 auto; padding: 8px clamp(20px, 4vw, 64px); display: flex; gap: 20px; align-items: center; color: #5d6a7b; font-size: 12px; font-weight: 650; overflow-x: auto; white-space: nowrap; }
.system-strip-inner span { display: inline-flex; align-items: center; gap: 7px; }
.system-version { margin-left: auto; color: #7b8796; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #9da8b4; }
.status-dot.amber { background: var(--signal); }
.status-dot.green { background: var(--green); }
.status-dot.muted { background: #aeb8c2; }

.page-shell { max-width: 1536px; margin: 0 auto; padding: 36px clamp(20px, 4vw, 64px) 70px; }
.page-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(32px, 4vw, 52px); line-height: 1.08; margin: 0 0 10px; letter-spacing: -.03em; max-width: 1050px; }
.eyebrow { margin: 0 0 7px; color: var(--signal-dark); text-transform: uppercase; letter-spacing: .11em; font-size: 12px; font-weight: 850; }
.intro { color: var(--muted); margin: 0; max-width: 880px; font-size: 18px; }
.page-actions { flex: 0 0 auto; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 22px; }
.panel h2 { margin: 0 0 18px; font-size: 21px; letter-spacing: -.01em; }
.panel h3 { margin: 22px 0 10px; }
.panel-kicker { margin: 0 0 4px; color: var(--signal-dark); text-transform: uppercase; font-size: 11px; font-weight: 850; letter-spacing: .1em; }
.inset-panel { margin: 0; box-shadow: none; background: var(--panel-soft); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 21px 20px 20px; box-shadow: var(--shadow); }
.stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--signal); }
.stat-card:nth-child(2)::before { background: var(--blue); }
.stat-card:nth-child(3)::before { background: var(--green); }
.stat-card:nth-child(4)::before { background: var(--late); }
.stat-card strong { display: block; font-size: 35px; line-height: 1; margin-bottom: 9px; letter-spacing: -.03em; }
.stat-card span { color: var(--muted); font-size: 14px; font-weight: 700; }

.callout { border-left: 5px solid var(--signal); background: #fffaf0; padding: 17px 20px; border-radius: 10px; margin-bottom: 22px; }
.signal-callout { border: 1px solid #ead5a8; border-left: 5px solid var(--signal); box-shadow: var(--shadow-soft); }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.two-column.wide-left { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(310px, .8fr); gap: 22px; align-items: start; }
.detail-side { position: sticky; top: 18px; }

.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 10px; }
.section-heading h2 { margin: 0; }
.item-list { display: flex; flex-direction: column; }
.item-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 15px 0; border-top: 1px solid var(--border); color: var(--ink); }
.item-row:first-child { border-top: 0; }
.item-row:hover { text-decoration: none; }
.item-row strong { display: block; }
.item-row span, .item-row small { display: block; color: var(--muted); margin-top: 3px; }
.item-meta { text-align: right; flex: 0 0 auto; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; }
.button:hover { text-decoration: none; }
.button.primary { background: var(--navy); color: #fff; }
.button.primary:hover { background: var(--navy-dark); }
.button.signal { background: var(--signal); color: #1f2b37; border-color: #c98c1e; }
.button.signal:hover { background: #e4a83c; }
.button.secondary { background: #fff; color: var(--navy); border-color: #9aa9ba; }
.button.secondary:hover { border-color: var(--navy); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.danger-button { background: var(--red); color: #fff; }
.text-link { display: inline-block; margin-top: 14px; font-weight: 700; }
.external-link { font-weight: 750; }

.flash { padding: 13px 16px; margin-bottom: 20px; border-radius: 9px; border: 1px solid var(--border); background: #f7f8fa; }
.flash.success { background: var(--green-bg); border-color: #acd5bd; color: #195f38; }
.flash.danger { background: var(--red-bg); border-color: #e7b5b0; color: var(--red); }
.flash.info { background: var(--blue-bg); border-color: #b6d2e4; color: var(--blue); }

.badge { display: inline-flex; align-items: center; max-width: 100%; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 820; line-height: 1.25; }
.badge.neutral { background: #edf0f4; color: #455269; }
.badge.success { background: var(--green-bg); color: var(--green); }
.badge.info { background: var(--blue-bg); color: var(--blue); }
.badge.warning { background: var(--signal-bg); color: var(--signal-dark); }
.badge.late { background: var(--late-bg); color: var(--late); }
.badge.danger { background: var(--red-bg); color: var(--red); }
.badge-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }

.form-stack { display: flex; flex-direction: column; gap: 15px; }
.form-stack.compact { gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { border-bottom: 1px solid var(--border); padding-top: 8px; }
.form-section h2 { margin-bottom: 12px; }
label { display: flex; flex-direction: column; gap: 6px; color: #33425a; font-weight: 720; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid #aeb9c7; background: #fff; color: var(--ink); border-radius: 8px; padding: 10px 11px; font: inherit; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(217,154,43,.2); border-color: var(--signal-dark); }
input[type="file"] { padding: 12px; background: var(--panel-soft); }
textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; justify-content: flex-end; align-items: end; gap: 10px; padding-top: 8px; }
.filter-panel { padding: 16px 20px; }
.filter-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.filter-form label { min-width: 220px; }

.table-panel { padding: 0; overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 15px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f2f5f8; color: #48566c; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
td { font-size: 14px; }
td small, .table-title + small { display: block; color: var(--muted); margin-top: 4px; }
.table-title { color: var(--ink); font-weight: 760; }

.detail-list { display: grid; grid-template-columns: minmax(160px, .4fr) minmax(0, 1fr); gap: 10px 20px; margin: 22px 0; }
.detail-list dt { font-weight: 760; color: #44536a; }
.detail-list dd { margin: 0; }
.detail-list.horizontal { grid-template-columns: repeat(4, auto 1fr); gap: 8px 16px; }
.prose { font-size: 17px; line-height: 1.65; }
.compact-prose { max-width: 1000px; margin-top: 4px; }
blockquote { margin: 18px 0 0; padding: 16px 18px; border-left: 4px solid #9aabbc; background: #f4f6f8; color: #3e4b5f; }

.timeline { position: relative; }
.timeline article { display: grid; grid-template-columns: 125px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border); }
.timeline article:first-child { border-top: 0; padding-top: 0; }
.timeline time { color: var(--muted); font-size: 13px; font-weight: 700; }
.timeline p { margin: 5px 0; }
.timeline small { color: var(--muted); }

.check-list { display: flex; flex-direction: column; }
.check-row { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-top: 1px solid var(--border); }
.check-row:first-child { border-top: 0; }
.muted { color: var(--muted); }
.empty-state { padding: 30px 10px; color: var(--muted); text-align: center; }
.link-list { padding-left: 20px; }

.login-shell { min-height: 62vh; display: grid; place-items: center; }
.login-panel { width: min(100%, 520px); padding: 34px; }
.login-panel h1 { font-size: 38px; margin: 0 0 10px; }
.setup-grid { margin-top: 8px; }

.update-upload-panel { max-width: 920px; }
.update-stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin: 22px 0; }
.update-stat-grid article { background: var(--panel-soft); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.update-stat-grid strong { display: block; font-size: 26px; line-height: 1; margin-bottom: 7px; }
.update-stat-grid span { color: var(--muted); font-size: 12px; font-weight: 700; }
.update-details { grid-template-columns: 120px 1fr; }
.update-file-table { border: 1px solid var(--border); border-radius: 10px; margin: 18px 0 22px; }
.update-confirm-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.danger-zone { border-color: #e7b5b0; background: #fffafa; }

.site-footer { max-width: 1536px; margin: 0 auto; padding: 22px clamp(20px, 4vw, 64px) 40px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 20px; }
.site-footer strong { color: #425168; }

@media (max-width: 1080px) {
    .brand-copy span { display: none; }
    .update-stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 980px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-column, .two-column.wide-left, .detail-grid, .update-confirm-grid { grid-template-columns: 1fr; }
    .detail-side { position: static; }
    .detail-list.horizontal { grid-template-columns: minmax(140px, .4fr) 1fr; }
    .pilot-indicator { display: none; }
}
@media (max-width: 680px) {
    .site-header { align-items: center; min-height: 76px; padding-block: 12px; }
    .brand-mark { width: 42px; height: 42px; }
    .brand-copy { gap: 0; }
    .brand-copy strong { font-size: 24px; }
    .user-name { display: none; }
    .user-box { gap: 7px; }
    .user-box a { padding: 7px 9px; }
    .page-heading { flex-direction: column; }
    .page-heading h1 { font-size: 36px; }
    .stat-grid, .form-grid, .update-stat-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: auto; }
    .timeline article { grid-template-columns: 1fr; gap: 4px; }
    .site-footer { flex-direction: column; }
    .system-strip-inner { gap: 14px; }
    .system-version { margin-left: 0; }
}
