:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #697789;
  --brand: #1463b8;
  --brand-2: #1b8a70;
  --line: #dbe4ef;
  --soft: #eef5ff;
  --sidebar: #10243d;
  --sidebar-2: #173454;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}
a { text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 292px;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 18px 0 44px rgba(16, 36, 61, .14);
  z-index: 10;
}
.sidebar-brand {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 22px 20px 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-brand span,
.brand-mark {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  background: #ffd166;
  color: #10243d;
  font-weight: 900;
  border-radius: 8px;
  letter-spacing: .4px;
}
.sidebar-brand strong { display: block; line-height: 1.1; font-size: 15px; }
.sidebar-brand small { color: rgba(255,255,255,.62); }
.sidebar nav { padding: 14px 12px 6px; }
.menu-group { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.menu-group:last-child { border-bottom: 0; }
.menu-title {
  padding: 8px 10px 7px;
  color: rgba(255,255,255,.5);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sidebar nav a,
.logout-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 10px 12px;
  color: rgba(255,255,255,.82);
  border-radius: 8px;
  font-weight: 650;
}
.sidebar nav a i,
.logout-link i {
  width: 22px;
  text-align: center;
  font-size: 16px;
}
.sidebar nav a:hover,
.logout-link:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.sidebar nav a.active {
  background: #fff;
  color: var(--sidebar);
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
}
.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 4px;
  height: 26px;
  border-radius: 0 6px 6px 0;
  background: #ffd166;
}
.logout-link { margin: auto 12px 16px; }
.app-main {
  width: calc(100% - 292px);
  min-height: 100vh;
  margin-left: 292px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 86px;
  padding: 18px 28px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  backdrop-filter: blur(12px);
}
.topbar h1 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
}
.breadcrumb-text {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.user-chip {
  min-width: 220px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  text-align: right;
}
.user-chip .avatar {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--brand);
  font-weight: 900;
}
.user-chip span:not(.avatar) { display: block; font-weight: 800; }
.user-chip small { color: var(--muted); }
.content-wrap { padding: 24px 28px 46px; }
.alert { border-radius: 8px; }
.btn { border-radius: 8px; font-weight: 700; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: #0d539e; border-color: #0d539e; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stat-card,
.chart-card,
.table-card,
.form-card,
.detail-card,
.filter-card,
.report-card,
.report-document {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(16,36,61,.07);
}
.stat-card {
  min-height: 130px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}
.stat-card i { color: var(--brand); font-size: 28px; }
.stat-card span { color: var(--muted); font-weight: 700; }
.stat-card strong { font-size: 32px; line-height: 1; }
.chart-card,
.table-card,
.form-card,
.detail-card,
.filter-card,
.report-document { padding: 18px; }
.chart-card h2,
.table-card h2,
.section-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 850;
}
.chart-card > div { min-height: 292px; }
.page-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.table-card { overflow-x: auto; }
.table { color: var(--ink); }
.table thead th {
  background: #f6f9fd;
  color: #39465a;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.table td, .table th { vertical-align: middle; }
.action-cell { white-space: nowrap; }
.form-card .form-label,
.filter-card .form-label { font-weight: 750; color: #37445a; }
.form-control,
.form-select {
  border-color: #cfd9e6;
  border-radius: 8px;
  min-height: 42px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(20,99,184,.14);
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.detail-card dl { margin-bottom: 0; }
.detail-card dt { color: var(--muted); }
.fact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.fact-item {
  display: flex;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.fact-item small { display: block; color: var(--muted); margin-top: 4px; }
.result-banner {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #cfe2ff;
  border-radius: 8px;
  background: linear-gradient(135deg, #eaf4ff, #f7fbff);
}
.result-banner span { color: var(--brand); font-weight: 900; }
.result-banner h2 { margin: 6px 0; font-size: 24px; }
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.report-card {
  min-height: 96px;
  padding: 22px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
}
.report-card:hover { border-color: #a8c7ee; transform: translateY(-1px); }
.report-card i { color: var(--brand-2); font-size: 28px; }
.report-kop {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 3px double #1f2937;
  text-align: center;
}
.report-logo {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand);
  border-radius: 8px;
  color: var(--brand);
  font-weight: 900;
}
.report-kop h2 { margin: 0; font-size: 20px; font-weight: 900; text-transform: uppercase; }
.report-kop p { margin: 3px 0 0; color: #49566a; }
.report-meta {
  margin: 14px 0;
  padding: 12px;
  background: #f7f9fd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
}
.report-footer {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: end;
}
.signature-box {
  text-align: center;
  min-height: 132px;
  display: grid;
  align-content: space-between;
}
.print-note { color: var(--muted); font-size: 12px; }
.login-page {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 15%, rgba(255,209,102,.24), transparent 32%), linear-gradient(135deg, #0f3f76, #1b746d);
}
.login-panel { width: min(460px, 100%); }
.login-card {
  padding: 30px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}
.login-card h1 { margin: 16px 0 8px; font-size: 26px; font-weight: 900; }
.login-card p { color: var(--muted); }
.demo-box {
  margin-top: 18px;
  padding: 12px;
  display: grid;
  gap: 4px;
  background: #f6f8fc;
  color: var(--muted);
  border-radius: 8px;
  font-size: 13px;
}
@media print {
  .sidebar, .topbar, .page-actions, .filter-card, .dt-buttons, .dt-search, .dt-length, .dt-info, .dt-paging { display: none !important; }
  .app-main { width: 100%; margin-left: 0; }
  .content-wrap { padding: 0; }
  .report-document, .table-card { box-shadow: none; border: 0; padding: 0; }
}
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .app-shell { display: block; }
  .sidebar {
    position: static;
    width: 100%;
    max-height: 360px;
  }
  .app-main { width: 100%; margin-left: 0; }
  .topbar { position: static; align-items: flex-start; flex-direction: column; }
  .user-chip { justify-content: flex-start; text-align: left; }
  .content-wrap { padding: 18px; }
  .fact-list, .report-grid, .report-meta, .report-footer { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 20px; }
  .page-actions { justify-content: stretch; }
  .page-actions .btn { flex: 1 1 auto; }
  .report-kop { grid-template-columns: 1fr; }
}
