:root {
  color-scheme: dark;
  --bg: #111827;
  --sidebar: #1b2739;
  --surface: #1d2a3f;
  --surface-hover: #263650;
  --border: #34435b;
  --text: #f7f9fd;
  --muted: #adbacd;
  --accent: #f5c45d;
  --positive: #61d8a3;
  --danger: #f29aa0;
  --radius: 7px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.app { min-height: 100vh; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 28px; border-bottom: 1px solid #2b3950; background: #182334; }
.brand { font-size: 22px; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; }
.brand span { font-weight: 430; }
.topbar-right { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 14px; }
.data-status { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.data-status::before { content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--accent); }
.data-status.fresh::before { background: var(--positive); }
.data-status.error::before { background: var(--danger); }
.logout-button { border: 0; background: transparent; color: var(--muted); padding: 8px 0; font-size: 14px; }
.logout-button:hover { color: var(--text); }
.app-body { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar { padding: 16px 0; background: var(--sidebar); border-right: 1px solid #2c3b51; }
.nav-section { padding: 18px 22px 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 20px; width: 100%; height: 70px; border: 0; border-left: 4px solid transparent; background: transparent; color: var(--muted); text-align: left; padding: 0 22px; font-size: 16px; font-weight: 470; transition: color .15s, background .15s; }
.nav-item:hover { color: var(--text); background: #263348; }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); font-weight: 650; background: #1f2c3f; }
.nav-item svg, .button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.main { padding: 28px 28px 64px; min-width: 0; max-width: 1680px; width: 100%; margin: 0 auto; }
h1 { font-size: clamp(28px, 2.7vw, 43px); line-height: 1.14; letter-spacing: -.035em; margin: 0 0 28px; font-weight: 750; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; margin-bottom: 28px; }
.toolbar label { color: var(--text); font-weight: 550; }
.toolbar input { width: 194px; min-height: 51px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 16px; }
.toolbar select { min-height: 51px; margin-left: 8px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.toolbar input::-webkit-calendar-picker-indicator { filter: invert(.84); cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 51px; padding: 0 22px; border-radius: var(--radius); font-size: 16px; font-weight: 650; white-space: nowrap; }
.button svg { width: 19px; height: 19px; }
.button-primary { color: #1d2532; background: var(--accent); border: 1px solid var(--accent); }
.button-primary:hover { background: #ffd67e; }
.button-outline { color: var(--text); background: transparent; border: 1px solid #66758b; }
.button-outline:hover { background: var(--surface-hover); }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric { min-height: 134px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.metric-label { display: block; color: var(--muted); font-size: 15px; line-height: 1.4; }
.metric-value { display: block; margin-top: 8px; font-size: clamp(21px, 2vw, 33px); line-height: 1.2; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }
.metric-note { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.table-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.catalog-pages { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; table-layout: fixed; }
th, td { padding: 18px 18px; border-bottom: 1px solid var(--border); border-right: 1px solid #2b3950; text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
th:last-child, td:last-child { border-right: 0; }
th { color: #d4ddeb; font-size: 15px; font-weight: 650; }
td { font-size: 16px; }
tbody tr:hover { background: #25364d; }
tfoot td { font-weight: 750; border-bottom: 0; }
.empty-row td { text-align: center; color: var(--muted); padding: 42px 18px; }
.dash { color: #97a5b9; }
.coverage-note { color: var(--muted); font-size: 14px; margin: 16px 0 0; line-height: 1.5; }
.limitation-note { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin: 22px 0 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: #c3cedf; line-height: 1.5; }
.limitation-note span { color: var(--accent); font-size: 25px; line-height: 1; }
.load-error { padding: 13px 16px; border: 1px solid #7c3e47; border-radius: var(--radius); color: #ffd2d6; background: #3c2630; }
.report-panel { margin-top: 24px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.report-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.report-actions h2 { margin: 0; font-size: 20px; }
.report-panel pre { white-space: pre-wrap; font: 15px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin-bottom: 0; }
.login-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-panel { display: flex; flex-direction: column; width: min(100%, 420px); padding: 36px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.login-panel h1 { font-size: 29px; margin: 38px 0 6px; }
.login-panel p { color: var(--muted); margin: 0 0 25px; }
.login-panel label { color: #d9e1ee; margin: 12px 0 7px; font-size: 14px; font-weight: 600; }
.login-panel input { height: 48px; padding: 0 13px; border: 1px solid var(--border); border-radius: var(--radius); background: #172236; color: var(--text); }
.login-panel .button { margin-top: 24px; }
.form-error { min-height: 20px; color: var(--danger); font-size: 14px; margin-top: 13px; }
@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar-right { gap: 12px; }
  .updated-at { display: none; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .brand { font-size: 18px; }
  .topbar-right { font-size: 12px; }
  .app-body { display: block; }
  .sidebar { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 0; }
  .nav-item { flex: none; width: auto; height: 56px; gap: 8px; padding: 0 14px; border-left: 0; border-bottom: 3px solid transparent; font-size: 14px; }
  .nav-item.active { border-bottom-color: var(--accent); border-left-color: transparent; }
  .nav-item svg { width: 17px; height: 17px; }
  .main { padding: 24px 16px 48px; }
  h1 { margin-bottom: 21px; }
  .toolbar { gap: 10px; }
  .toolbar input { width: calc(50% - 32px); min-width: 130px; flex: 1; }
  .toolbar .button { flex: 1; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { min-height: 112px; padding: 15px; }
  .metric-value { font-size: 23px; }
}
@media (max-width: 440px) {
  .topbar-right { gap: 9px; }
  .data-status { max-width: 115px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-label { font-size: 13px; }
  .metric-value { font-size: 20px; }
  .toolbar .button { width: 100%; flex-basis: 100%; }
  .login-panel { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
