/**
 * Tujuan    : Tema terang AN Dashboard — kartu putih, aksen biru/navy, bayangan lembut.
 * Dipakai   : includes/header.php (setelah fonts-inter.css & tailwind).
 * Dependensi: fonts-inter.css, tailwind opsional.
 * Fungsi    : Variabel warna, sidebar, topbar, kartu, KPI, tabel, form, tombol, login, bottom nav.
 * Side FX   : Styling global aplikasi.
 */
:root {
  --an-bg: #e8edf5;
  --an-surface: #ffffff;
  --an-primary: #2563eb;
  --an-primary-bright: #3b82f6;
  --an-primary-dark: #1d4ed8;
  --an-navy: #1e3a5f;
  --an-accent-sky: #0ea5e9;
  --an-success: #0284c7;
  --an-danger: #dc2626;
  --an-text: #132238;
  --an-muted: #5a6b85;
  --an-line: rgba(30, 58, 95, 0.12);
  --an-glass: #ffffff;
  --an-glass-strong: #f4f7fc;
  --an-blur: blur(14px);
  --an-radius: 20px;
  --an-shadow: 0 8px 32px rgba(30, 58, 95, 0.08);
  --an-shadow-lg: 0 16px 48px rgba(30, 58, 95, 0.1);
  --primary: var(--an-primary);
  --primary-dark: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.12);
  --accent: #3b82f6;
  --success: var(--an-success);
  --warning: #d97706;
  --danger: var(--an-danger);
  --ink: var(--an-text);
  --muted: var(--an-muted);
  --line: var(--an-line);
  --bg: var(--an-bg);
  --card: var(--an-glass);
  --radius: var(--an-radius);
  --shadow: var(--an-shadow);
  --page-sticky-top: 88px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--an-text);
  background: var(--an-bg);
  background-image:
    radial-gradient(ellipse 100% 70% at 0% -15%, rgba(37, 99, 235, 0.14), transparent 52%),
    radial-gradient(ellipse 85% 55% at 100% 0%, rgba(14, 165, 233, 0.12), transparent 48%),
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(30, 58, 95, 0.06), transparent 55%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* Jangan pakai height:auto pada semua svg — ikon Lucide di tombol jadi hilang di mobile */
svg.lucide,
svg[class^="lucide"] {
  flex-shrink: 0;
}

canvas {
  max-width: 100%;
  display: block;
}

.app-shell {
  min-height: 100vh;
  max-width: 100%;
}

/* —— Permukaan kartu / topbar (tema terang) —— */
.card,
.topbar,
.login-card,
.table-wrap,
.filter-bar,
.mobile-bottom-nav,
.user-pill {
  background: var(--an-surface);
  backdrop-filter: var(--an-blur);
  -webkit-backdrop-filter: var(--an-blur);
  border: 1px solid var(--an-line);
  box-shadow: var(--an-shadow);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 270px;
  height: 100vh;
  z-index: 30;
  padding: 22px 14px 28px;
  color: var(--an-text);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--an-line);
  box-shadow: 4px 0 36px rgba(30, 58, 95, 0.07);
  border-radius: 0 22px 22px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid var(--an-line);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-title {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.15;
  color: var(--an-text);
}

.brand-sub {
  font-size: 12px;
  color: var(--an-muted);
  margin-top: 3px;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 18px;
  color: var(--an-muted);
  font-size: 14px;
  font-weight: 650;
  transition: 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
}

.nav-link span {
  overflow-wrap: anywhere;
}

.nav-link:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--an-navy);
  border-color: rgba(37, 99, 235, 0.12);
  transform: translateX(3px);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0.05));
  color: var(--an-navy);
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.12);
}

.nav-link [data-lucide] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  padding: 9px;
  border-radius: 14px;
  box-sizing: content-box;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.1);
  stroke-width: 2.15;
  opacity: 0.88;
  color: var(--an-primary);
}

.nav-link:hover [data-lucide] {
  opacity: 1;
  background: rgba(37, 99, 235, 0.16);
}

.nav-link.active [data-lucide] {
  opacity: 1;
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--an-primary-dark);
}

.nav-link > svg.lucide {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  padding: 9px;
  border-radius: 14px;
  box-sizing: content-box;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.1);
  stroke-width: 2.15;
  opacity: 0.88;
  color: var(--an-primary);
}

.nav-link:hover > svg.lucide {
  opacity: 1;
  background: rgba(37, 99, 235, 0.16);
}

.nav-link.active > svg.lucide {
  opacity: 1;
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--an-primary-dark);
}

.nav-link .bi {
  width: 24px;
  height: 24px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 10px;
}

.main {
  margin-left: 270px;
  min-height: 100vh;
  max-width: 100%;
  padding: 20px 24px 92px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-radius: var(--an-radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.topbar > .flex {
  min-width: 0;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--an-line);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  background: #f8fafc;
}

.hamburger {
  display: none;
  border: 0;
  background: rgba(37, 99, 235, 0.12);
  color: var(--an-navy);
  border-radius: 13px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  backdrop-filter: blur(8px);
}

.hamburger svg.lucide {
  width: 22px;
  height: 22px;
  display: block;
  margin: 0 auto;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--an-text);
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--an-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.user-pill {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  max-width: 100%;
  color: var(--an-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-pill span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--an-text);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--an-primary), var(--an-accent-sky));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.col-12 {
  grid-column: span 12;
}
.col-8 {
  grid-column: span 8;
}
.col-6 {
  grid-column: span 6;
}
.col-4 {
  grid-column: span 4;
}
.col-3 {
  grid-column: span 3;
}

.card {
  border-radius: var(--an-radius);
  padding: 18px;
  max-width: 100%;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--an-text);
}

/* —— KPI kartu warna (teks putih di atas latar terang) —— */
.kpi {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--an-radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 16px 14px;
  box-shadow: var(--an-shadow-lg);
}

.kpi::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.88);
  position: relative;
  z-index: 1;
}

.kpi-value {
  font-size: 24px;
  font-weight: 900;
  margin-top: 8px;
  position: relative;
  z-index: 1;
  color: #ffffff;
}

.kpi-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.kpi-blue {
  background: linear-gradient(135deg, #1e4db8 0%, #2563eb 38%, #60a5fa 100%);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 36px rgba(37, 99, 235, 0.35);
}

.kpi-green {
  background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 35%, #0ea5e9 70%, #38bdf8 100%);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 34px rgba(14, 165, 233, 0.32);
}

.kpi-orange {
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 40%, #fb923c 100%);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 32px rgba(234, 88, 12, 0.25);
}

.kpi-purple {
  background: linear-gradient(135deg, #3730a3 0%, #4f46e5 42%, #818cf8 100%);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 32px rgba(79, 70, 229, 0.28);
}

.kpi-red {
  background: linear-gradient(135deg, #991b1b 0%, #dc2626 45%, #f87171 100%);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 28px rgba(220, 38, 38, 0.22);
}

.kpi-cyan {
  background: linear-gradient(135deg, #155e75 0%, #0891b2 40%, #22d3ee 100%);
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 8px 30px rgba(8, 145, 178, 0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
  font-size: 13px;
  line-height: 1.2;
  max-width: 100%;
  font-family: inherit;
}

.btn svg,
a.btn svg,
button.btn svg {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex-shrink: 0;
  display: block;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-primary {
  background: linear-gradient(135deg, var(--an-primary), var(--an-primary-bright));
  color: #fff;
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.35);
}

.btn-soft {
  background: rgba(37, 99, 235, 0.1);
  color: var(--an-navy);
  border: 1px solid rgba(37, 99, 235, 0.22);
  backdrop-filter: blur(8px);
}

.btn-danger {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.35);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.btn-success {
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--an-line);
  color: var(--an-text);
  backdrop-filter: blur(8px);
}

.btn-sm {
  padding: 5px 8px;
  border-radius: 9px;
  font-size: 12px;
  gap: 5px;
}

.btn-sm svg,
a.btn-sm svg,
button.btn-sm svg {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.field {
  grid-column: span 4;
}
.field-6 {
  grid-column: span 6;
}
.field-12 {
  grid-column: span 12;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 4px;
  color: var(--an-muted);
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--an-line);
  background: #f8fafc;
  border-radius: 10px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  color: var(--an-text);
  outline: none;
  backdrop-filter: blur(6px);
}

input[type="date"],
input[type="number"],
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
select {
  min-height: 0;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #ffffff;
}

.table-wrap {
  overflow: auto;
  border-radius: 20px;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.page-list-sticky {
  position: sticky;
  top: var(--page-sticky-top, 88px);
  z-index: 11;
  margin: -6px -6px 14px;
  padding: 12px 6px 14px;
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--an-line);
  box-shadow: 0 8px 24px rgba(30, 58, 95, 0.06);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--an-line);
  font-size: 13px;
  vertical-align: middle;
}

th {
  background: #f1f5f9;
  color: var(--an-muted);
  text-align: left;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:hover td {
  background: rgba(37, 99, 235, 0.06);
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge-active {
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.badge-closed {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.badge-matured {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.32);
}

.badge-blue {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.28);
}

.badge-gray {
  background: #f1f5f9;
  color: var(--an-muted);
  border: 1px solid var(--an-line);
}

.alert {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  backdrop-filter: blur(12px);
}

.alert-success {
  background: rgba(14, 165, 233, 0.1);
  color: #0c4a6e;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.alert-error {
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.28);
}

.mobile-bottom-nav {
  display: none;
}

.mobile-drawer-backdrop {
  display: none;
}

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--an-muted);
}

.kpi-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
  min-height: 40px;
}

.kpi-icon-wrap [data-lucide] {
  width: 20px;
  height: 20px;
  stroke-width: 2.1;
  opacity: 0.55;
  color: rgba(255, 255, 255, 0.95);
  padding: 10px;
  border-radius: 50%;
  box-sizing: content-box;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.kpi-blue .kpi-icon-wrap [data-lucide] {
  background: rgba(255, 255, 255, 0.22);
  opacity: 0.5;
}

.kpi-purple .kpi-icon-wrap [data-lucide] {
  background: rgba(255, 255, 255, 0.2);
  opacity: 0.5;
}

.kpi-green .kpi-icon-wrap [data-lucide] {
  background: rgba(255, 255, 255, 0.2);
  opacity: 0.5;
}

.kpi-orange .kpi-icon-wrap [data-lucide] {
  background: rgba(255, 255, 255, 0.18);
  opacity: 0.5;
}

.kpi-red .kpi-icon-wrap [data-lucide] {
  background: rgba(255, 255, 255, 0.18);
  opacity: 0.5;
}

.kpi-cyan .kpi-icon-wrap [data-lucide] {
  background: rgba(255, 255, 255, 0.2);
  opacity: 0.5;
}

.chart-wrap {
  width: 100%;
  height: 300px;
  min-height: 260px;
  position: relative;
}

.chart-wrap--short {
  height: 280px;
  min-height: 240px;
}

.chart-wrap .chart-box {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}

.chart-box {
  height: 295px !important;
  max-height: 295px;
  min-height: 295px;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: min(440px, 100%);
  max-width: 100%;
  border-radius: 22px;
  padding: 26px 22px;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  background: linear-gradient(145deg, #f8fafc, #e2e8f0);
  border: 1px solid var(--an-line);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.15);
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  border-radius: 14px;
  padding: 10px 11px;
}

.filter-bar > * {
  min-width: 132px;
}

/* Dashboard utama: tahun + tab segment (gaya ini selalu dimuat — tidak bergantung dashboard-asset.css) */
.dashboard-filter-card {
  padding: 0;
  overflow: hidden;
}

.dashboard-filter-inner {
  padding: 16px 18px 18px;
}

.dashboard-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.dashboard-filter-row .filter-bar {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dashboard-seg-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--an-line);
}

.dashboard-seg-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--an-muted);
  border: 1px solid var(--an-line);
  background: #f8fafc;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.dashboard-seg-tabs a:hover {
  color: var(--an-navy);
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.08);
}

.dashboard-seg-tabs a.is-active {
  color: #ffffff;
  border-color: rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, #1e4db8, #2563eb 45%, #3b82f6);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.28);
}

.dashboard-filter-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--an-muted);
  max-width: 48rem;
}

@media (max-width: 640px) {
  .dashboard-seg-tabs {
    gap: 6px;
  }

  .dashboard-seg-tabs a {
    padding: 8px 12px;
    font-size: 11px;
  }
}

.preview-frame {
  width: 100%;
  height: 76vh;
  border: 0;
  background: #f1f5f9;
  border-radius: 12px;
}

.file-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--an-line);
  background: #f8fafc;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--an-navy);
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .col-3,
  .col-4,
  .col-6,
  .col-8 {
    grid-column: span 12;
  }
  .field,
  .field-6 {
    grid-column: span 6;
  }

  .content-grid.kpi-grid-mobile > .col-3 {
    grid-column: span 6 !important;
  }
}

@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-110%);
    transition: 0.22s ease;
    max-width: 86vw;
  }

  .sidebar.open {
    transform: translateX(0);
    border-radius: 0 24px 24px 0;
  }

  .mobile-drawer-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 10, 0.65);
    backdrop-filter: blur(4px);
    z-index: 25;
  }

  .main {
    margin-left: 0;
    padding: 14px 12px 92px;
  }

  .hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .topbar {
    border-radius: 22px;
    padding: 12px;
  }

  .topbar-logo {
    display: none !important;
  }

  body.sidebar-drawer-open .mobile-bottom-nav {
    display: none !important;
  }

  :root {
    --page-sticky-top: 74px;
  }

  .page-title {
    font-size: 20px;
    line-height: 1.25;
  }

  .page-subtitle {
    font-size: 12px;
    line-height: 1.35;
  }

  .user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: min(52vw, 220px);
    flex-shrink: 1;
  }

  .user-pill span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .page-list-sticky {
    margin: -4px -4px 12px;
    padding: 10px 4px 12px;
    border-radius: 16px 16px 0 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .field,
  .field-6,
  .field-12 {
    grid-column: span 1;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-bar > * {
    min-width: 0;
  }

  .mobile-bottom-nav {
    display: grid;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    z-index: 45;
    border-radius: 0;
    border-top: 1px solid var(--an-line);
    border-left: none;
    border-right: none;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .mobile-bottom-nav a {
    padding: 10px 4px;
    text-align: center;
    color: var(--an-muted);
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav a.active {
    color: var(--an-primary);
    font-weight: 800;
    background: rgba(37, 99, 235, 0.1);
  }

  .mobile-bottom-nav .bi {
    display: block;
    margin: 0 auto 3px;
    font-size: 17px;
  }

  .card {
    padding: 14px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .chart-box {
    height: 245px !important;
    max-height: 245px;
    min-height: 245px;
  }

  table {
    min-width: 680px;
  }

  .table-wrap table th,
  .table-wrap table td {
    white-space: nowrap;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
  }

  .table-wrap table td.flex,
  .table-wrap table td.flex.gap-2 {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 12px 10px 92px;
  }

  .topbar {
    padding: 10px 11px;
  }

  .page-title {
    font-size: 18px;
  }

  .card {
    padding: 12px;
  }

  .kpi-value {
    font-size: 18px;
  }

  .chart-box {
    height: 210px !important;
    max-height: 210px;
    min-height: 210px;
  }

  table {
    min-width: 620px;
  }

  .table-wrap table th,
  .table-wrap table td {
    white-space: nowrap;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
  }

  .table-wrap table td.flex,
  .table-wrap table td.flex.gap-2 {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }
}
