:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #e6e9f0;
  --surface: #ffffff;
  --page: #f3f5f9;
  --purple: #6738ee;
  --purple-dark: #4f26c9;
  --red: #b42318;
  --amber: #b54708;
  --green: #067647;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input { font: inherit; }
.shell { width: min(1600px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.04em; }
h2 { margin-bottom: 8px; font-size: 21px; }
.subtitle, .login-copy p { color: var(--muted); margin-bottom: 0; }
.eyebrow { margin-bottom: 8px; color: var(--purple); font-size: 12px; font-weight: 800; letter-spacing: .09em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.freshness { color: var(--muted); font-size: 13px; white-space: nowrap; }
.button { border: 1px solid transparent; border-radius: 9px; padding: 10px 16px; cursor: pointer; font-weight: 700; }
.button.primary { background: var(--purple); color: #fff; }
.button.primary:hover { background: var(--purple-dark); }
.button.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.panel, .login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 30px rgba(38, 49, 75, .05); }
.login-card { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; max-width: 900px; margin: 80px auto; padding: 42px; }
.login-form { align-self: center; }
.login-form label, .search-label span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.password-row { display: flex; gap: 10px; }
input { width: 100%; border: 1px solid #cfd4df; border-radius: 9px; padding: 11px 12px; background: #fff; color: var(--ink); outline: none; }
input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(103, 56, 238, .12); }
.error, .page-error { color: var(--red); margin: 10px 0 0; }
.dashboard-overview { margin-bottom: 16px; }
.overview-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.overview-heading h2 { margin-bottom: 4px; font-size: 24px; }
.overview-tools { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.period-picker { display: flex; align-items: flex-end; gap: 7px; flex-wrap: wrap; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.period-picker label { color: var(--muted); font-size: 11px; font-weight: 700; }
.period-picker input { display: block; width: 145px; margin-top: 4px; padding: 7px 9px; font-size: 12px; }
.button.compact { padding: 8px 10px; font-size: 12px; }
.source-badge { color: var(--purple); background: #eee9ff; border: 1px solid #ddd3ff; border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 800; }
.dashboard-cards { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 8px; }
.dashboard-card { min-height: 198px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid #dfe3ea; border-radius: 6px; box-shadow: 0 2px 5px rgba(16, 24, 40, .09); padding: 16px 16px 12px; }
.card-title { display: flex; justify-content: space-between; gap: 12px; color: #7a7f89; font-size: 13px; }
.info-dot { width: 17px; height: 17px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid #aeb4bf; border-radius: 50%; font-size: 10px; font-weight: 800; }
.card-value { margin: 9px 0 7px; font-size: 25px; line-height: 1.1; font-weight: 750; letter-spacing: -.025em; }
.card-note { min-height: 30px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.card-details { margin-top: auto; }
.card-row { display: flex; justify-content: space-between; gap: 14px; padding-top: 9px; margin-top: 9px; border-top: 1px solid rgba(16, 24, 40, .1); color: #555d6b; font-size: 12px; }
.card-row strong { color: #434957; text-align: right; font-weight: 650; }
.card-row .good-text { color: var(--green); }
.card-row .warn-text { color: var(--amber); }
.card-row .bad-text { color: var(--red); }
.dashboard-card.tone-cost { background: #fffbef; }
.dashboard-card.tone-risk { background: #fff8f4; }
.dashboard-card.tone-danger { background: #fff3f2; }
.dashboard-card.tone-positive { background: #edfbf2; border-color: #b7e8c9; }
.dashboard-card.tone-neutral { background: #f8fafc; }
.dashboard-card.tone-pending { background: #f8f9fb; }
.dashboard-card.tone-pending .card-value { color: #787f8b; font-size: 20px; }
.finance-note { color: var(--muted); font-size: 12px; margin-top: 8px; padding: 10px 13px; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; }
.missing-costs { display: flex; align-items: flex-start; gap: 16px; margin-top: 8px; padding: 12px 13px; color: #7a2e0e; background: #fff6ed; border: 1px solid #f4c9a5; border-radius: 6px; font-size: 12px; }
.missing-costs-title { flex: 0 0 auto; font-weight: 800; }
.missing-cost-list { display: flex; flex-wrap: wrap; gap: 7px; }
.missing-cost-list span { padding: 4px 7px; background: #fff; border: 1px solid #f1d7c1; border-radius: 5px; }
.quality-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 24px; margin-bottom: 16px; background: #fffaf0; border-color: #f3d8a4; }
.quality-panel h2 { margin-bottom: 0; }
.quality-details { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.chip { border-radius: 999px; padding: 7px 10px; background: #fff; border: 1px solid #efddb9; font-size: 13px; white-space: nowrap; }
.queue-panel { padding: 22px 0 0; overflow: hidden; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 0 24px 18px; }
.section-heading h2 { margin-bottom: 0; }
.search-label { width: min(440px, 45vw); }
.table-wrap { overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; min-width: 1350px; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; padding: 11px 10px; text-align: left; color: var(--muted); background: #f8f9fb; border-bottom: 1px solid var(--line); font-weight: 700; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #faf9ff; }
.risk { display: inline-block; border-radius: 999px; padding: 4px 8px; font-weight: 700; }
.risk.critical { color: var(--red); background: #fee4e2; }
.risk.warning { color: var(--amber); background: #ffead5; }
.risk.watch { color: var(--green); background: #dcfae6; }
.copy-button { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 6px 9px; cursor: pointer; }
.copy-button:hover { border-color: var(--purple); color: var(--purple); }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.page-error { background: #fee4e2; border: 1px solid #fda29b; border-radius: 10px; padding: 12px; }
.hidden { display: none !important; }
@media (max-width: 980px) {
  .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
  .quality-panel, .topbar, .section-heading { align-items: stretch; flex-direction: column; }
  .quality-details { justify-content: flex-start; }
  .search-label { width: 100%; }
  .login-card { grid-template-columns: 1fr; gap: 25px; margin-top: 30px; }
  .top-actions { flex-wrap: wrap; }
  .overview-heading { align-items: stretch; flex-direction: column; }
  .overview-tools { align-items: stretch; justify-content: flex-start; flex-direction: column; }
  .period-picker { align-items: stretch; }
  .source-badge { align-self: flex-start; }
  .missing-costs { flex-direction: column; }
}
@media (max-width: 580px) {
  .shell { width: min(100% - 22px, 1600px); padding-top: 18px; }
  .dashboard-cards { grid-template-columns: 1fr; }
  .password-row { flex-direction: column; }
}
