:root {
    --navy: #13243a;
    --navy-soft: #203852;
    --red: #e23a3a;
    --red-dark: #b92727;
    --cream: #f7f4ee;
    --white: #ffffff;
    --ink: #17202b;
    --muted: #657180;
    --line: #dfe4e8;
    --green: #087a55;
    --amber: #a85d00;
    --shadow: 0 14px 38px rgba(19, 36, 58, .09);
}

* { box-sizing: border-box; }
html { font-size: 18px; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid #1f74d1; outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: white; color: black; padding: .75rem 1rem; border-radius: .4rem; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.6rem 1.1rem; background: var(--navy); color: white; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; gap: .8rem; align-items: center; padding: .35rem .45rem 1.7rem; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--red); font-weight: 900; letter-spacing: -.08em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.12rem; }
.brand small { color: #b9c6d3; }
.sidebar-nav { display: grid; gap: .35rem; }
.nav-link { display: flex; align-items: center; gap: .75rem; padding: .72rem .8rem; border-radius: .55rem; text-decoration: none; color: #d8e1e9; font-weight: 650; }
.nav-link span { width: 1.2rem; text-align: center; }
.nav-link:hover, .nav-link.is-active { background: var(--navy-soft); color: white; }
.sidebar-footer { margin-top: auto; padding: 1rem .5rem 0; display: flex; gap: .55rem; align-items: center; color: #b9c6d3; font-size: .84rem; }
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #4cd39d; flex: 0 0 auto; }
.main-column { min-width: 0; }
.topbar { min-height: 74px; padding: .8rem 2.2rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.topbar-title { font-weight: 700; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.language-selector { display: flex; gap: .15rem; padding: .18rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.language-selector a { min-width: 2.4rem; padding: .35rem .5rem; border-radius: 999px; color: var(--muted); font-size: .74rem; font-weight: 900; text-align: center; text-decoration: none; }
.language-selector a[aria-current="true"] { background: var(--navy); color: var(--white); }
.icon-button, .menu-button { border: 0; cursor: pointer; }
.icon-button { width: 42px; height: 42px; border-radius: 50%; background: #f1e6e4; color: var(--red-dark); font-weight: 800; }
.avatar { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: white; font-size: .86rem; font-weight: 800; }
.menu-button { display: none; background: transparent; font-size: 1.5rem; }
.content { max-width: 1500px; padding: 2.4rem; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 1.7rem; }
.page-heading h1 { margin: .1rem 0 .3rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.15rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; }
.lead { max-width: 760px; margin: 0; color: var(--muted); font-size: 1.08rem; }
.eyebrow { margin: 0; color: var(--red-dark); font-size: .76rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .7rem 1rem; border-radius: .48rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.primary-button { background: var(--red); color: white; border: 2px solid var(--red); }
.primary-button:hover { background: var(--red-dark); border-color: var(--red-dark); }
.secondary-button { background: white; color: var(--navy); border: 2px solid var(--navy); }
.secondary-button:disabled { opacity: .7; }
.attention-card { padding: 1.25rem; margin-bottom: 2rem; border: 1px solid #ecc2be; border-left: 7px solid var(--red); border-radius: .7rem; background: #fff8f7; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 1rem; align-items: center; box-shadow: var(--shadow); }
.attention-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: white; font-weight: 900; font-size: 1.4rem; }
.attention-card h2 { margin: .1rem 0; font-size: 1.25rem; }
.attention-card p:last-child { margin: 0; color: var(--muted); }
.section-heading, .panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.section-heading { margin-bottom: .9rem; }
.section-heading h2, .panel-heading h2 { margin: .1rem 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; }
.section-heading > p { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; margin-bottom: 1.3rem; }
.metric-card { min-height: 190px; padding: 1.15rem; border: 1px solid var(--line); border-radius: .7rem; background: white; text-decoration: none; display: flex; flex-direction: column; box-shadow: 0 6px 22px rgba(19,36,58,.05); transition: transform .15s ease, box-shadow .15s ease; }
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.metric-card strong { margin: .3rem 0 .1rem; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 2.25rem; line-height: 1.1; }
.metric-label { color: var(--muted); font-size: .87rem; font-weight: 750; }
.positive { color: var(--green); font-weight: 700; }
.warning { color: var(--amber); font-weight: 700; }
.card-link { margin-top: auto; padding-top: 1rem; color: var(--red-dark); font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.panel { padding: 1.25rem; border: 1px solid var(--line); border-radius: .7rem; background: white; box-shadow: 0 6px 22px rgba(19,36,58,.05); }
.panel-wide { grid-column: 1 / -1; }
.panel-heading { margin-bottom: 1rem; }
.panel-heading a { color: var(--red-dark); font-weight: 800; text-decoration: none; }
.source-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; padding: 1rem; margin-bottom: 1rem; background: #f6f8fa; border-radius: .6rem; }
.source-summary strong, .source-summary span { display: block; }
.source-summary strong { font-size: 1.25rem; color: var(--navy); }
.bar-chart { display: grid; gap: .7rem; }
.bar-row { display: grid; grid-template-columns: 110px minmax(100px,1fr) 48px; gap: .8rem; align-items: center; }
.bar-track { height: 13px; background: #e9edf0; border-radius: 999px; overflow: hidden; }
.bar-track span, .progress span { display: block; height: 100%; background: var(--red); border-radius: inherit; }
.task-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.task-list li { display: grid; grid-template-columns: 78px 1fr; gap: .7rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.task-priority { padding: .22rem .45rem; border-radius: 999px; font-size: .73rem; font-weight: 850; text-align: center; }
.task-priority.high { color: #942020; background: #fbe0dd; }
.task-priority.medium { color: #805100; background: #fff0c9; }
.task-priority.low { color: #225f4d; background: #dff5eb; }
.large-number, .support-status strong { color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 4rem; line-height: 1; }
.mini-stats { display: flex; gap: 1.5rem; margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.mini-stats span, .support-status span { color: var(--muted); }
.mini-stats strong { color: var(--ink); }
.support-status { display: flex; align-items: baseline; gap: .6rem; margin-bottom: 1.1rem; }
.progress-row { display: flex; justify-content: space-between; gap: 1rem; }
.progress { height: 11px; margin: .45rem 0 1rem; background: #e9edf0; border-radius: 999px; overflow: hidden; }
.back-link { display: inline-block; margin-bottom: 1rem; color: var(--red-dark); font-weight: 800; text-decoration: none; }
.detail-heading { margin-bottom: 1rem; }
.summary-banner { padding: 1rem 1.2rem; margin-bottom: 1rem; border-radius: .65rem; background: var(--navy); color: white; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.summary-banner span { color: #c5d2df; }
.summary-banner strong { font-size: 1.15rem; }
.static-card:hover { transform: none; box-shadow: 0 6px 22px rgba(19,36,58,.05); }
.detail-metrics .metric-card { min-height: 155px; }
.table-panel { margin-top: .4rem; }
.search-field input { width: min(280px, 100%); min-height: 44px; padding: .55rem .7rem; border: 1px solid #aeb8c2; border-radius: .45rem; background: white; color: var(--ink); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .85rem .7rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:hover { background: #f8fafb; }

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 230px minmax(0,1fr); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 780px) {
    html { font-size: 17px; }
    .app-shell { display: block; }
    .sidebar { position: fixed; left: -290px; width: 280px; transition: left .2s ease; box-shadow: var(--shadow); }
    .sidebar.is-open { left: 0; }
    .menu-button { display: inline-block; }
    .topbar { padding: .7rem 1rem; }
    .topbar-title { font-size: .86rem; }
    .content { padding: 1.3rem 1rem 2.5rem; }
    .page-heading, .attention-card, .summary-banner { align-items: stretch; flex-direction: column; }
    .page-heading { display: flex; }
    .attention-card { display: flex; }
    .attention-card .primary-button { align-self: stretch; }
    .metric-grid, .dashboard-grid, .source-summary { grid-template-columns: 1fr; }
    .panel-wide { grid-column: auto; }
    .bar-row { grid-template-columns: 82px minmax(80px,1fr) 42px; font-size: .84rem; }
    .panel-heading { align-items: stretch; flex-direction: column; }
    .search-field input { width: 100%; }
}

@media (max-width: 560px) {
    .topbar-title { display: none; }
    .topbar { gap: .6rem; }
    .topbar-actions { margin-left: auto; gap: .45rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
