:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #112235;
  --muted: #63758a;
  --line: #dbe4ef;
  --primary: #2767ff;
  --primary-soft: #e8f0ff;
  --success: #139668;
  --success-soft: #e8f8f1;
  --warning: #dd8c18;
  --warning-soft: #fff5e5;
  --danger: #cf3759;
  --danger-soft: #fff0f3;
  --shadow: 0 18px 40px rgba(20, 45, 90, 0.08);
  --radius: 22px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef4fb 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 20px 28px; position: sticky; top: 0; z-index: 5;
  background: rgba(244,247,251,0.88); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(219,228,239,0.7);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), #5a8cff);
  color: white; display: grid; place-items: center; font-weight: 800; font-size: 22px;
  box-shadow: 0 10px 24px rgba(39,103,255,.25);
}
.brand h1 { margin: 0; font-size: 22px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
.nav-link {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: #fff;
}
.nav-link.active { background: var(--primary); color: #fff; border-color: transparent; }
.page.shell { max-width: 1480px; margin: 0 auto; padding: 26px; display: grid; gap: 20px; }
.card {
  background: var(--card); border: 1px solid rgba(219,228,239,0.9); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px;
}
.wide-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.hero h2, .card h3 { margin: 0 0 8px; }
.hero p, .muted { color: var(--muted); margin: 0; line-height: 1.5; }
.hero-actions, .actions { display: flex; gap: 12px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.dashboard-grid { align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 8px; font-weight: 600; }
.field span { color: var(--muted); font-size: 14px; }
input[type="file"], .search-input {
  width: 100%; padding: 14px 16px; border: 1px dashed #bfd0e8; border-radius: 16px; background: #fbfdff; color: var(--text);
}
.search-input { border-style: solid; }
.full-width { grid-column: 1 / -1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 13px 18px; cursor: pointer; font-weight: 700; transition: .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.secondary { background: #eef4fb; color: var(--text); }
.btn.success { background: var(--success); color: #fff; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 10px 14px; font-size: 14px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700;
}
.pill.neutral { background: #eef3fa; color: #415268; }
.pill.success { background: var(--success-soft); color: var(--success); }
.pill.warning { background: var(--warning-soft); color: var(--warning); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.status-card pre {
  margin: 0; white-space: pre-wrap; font-family: inherit; background: #fbfdff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; line-height: 1.55;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.split-head { align-items: start; }
.date-columns-box { display: flex; flex-wrap: wrap; gap: 12px; }
.date-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 999px; border: 1px solid var(--line); background: #f8fbff; font-weight: 600;
}
.top-gap { margin-top: 16px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.table-shell { overflow: auto; border: 1px solid var(--line); border-radius: 18px; }
.large-shell { max-height: 520px; }
.detail-shell { max-height: 620px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
.table th:last-child, .table td:last-child { border-right: 0; }
.table thead th { position: sticky; top: 0; background: #f7fafe; z-index: 1; text-align: left; }
.table tbody tr:nth-child(even) { background: #fbfdff; }
.clean-table .auto-ok td { background: #f4fbf8; }
.clean-table .not-found td { background: #fff8f8; }
.hidden-row { display: none; }
.empty-state { padding: 18px; border-radius: 16px; background: #fbfdff; border: 1px dashed var(--line); color: var(--muted); }
.empty-state.error { color: var(--danger); }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi-card { display: grid; gap: 8px; }
.kpi-card span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card strong { font-size: 26px; }
.chart-box { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 92px; gap: 10px; align-items: center; }
.bar-label { font-size: 13px; color: var(--muted); }
.bar-track { background: #edf3fb; border-radius: 999px; overflow: hidden; height: 12px; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #69a0ff); }
.bar-value { font-weight: 700; text-align: right; }
.line-chart { width: 100%; height: auto; }
.line-chart line { stroke: #c6d5ea; stroke-width: 1; }
.line-chart polyline { stroke: var(--primary); stroke-width: 4; }
.line-chart circle { fill: var(--primary); }
.line-chart text { fill: var(--muted); font-size: 12px; }
.mini-kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.mini-kpi { padding: 12px 14px; border-radius: 16px; background: #f8fbff; border: 1px solid var(--line); display: grid; gap: 4px; }
.mini-kpi span { color: var(--muted); font-size: 13px; }
.inline-tools { display: flex; gap: 10px; align-items: center; }
.disabled-link { pointer-events: none; opacity: .45; }
@media (max-width: 1180px) {
  .grid-2, .form-grid, .kpi-grid { grid-template-columns: 1fr; }
  .wide-card, .topbar { flex-direction: column; align-items: stretch; }
}
