@layer reset, base, layout, components, utilities;

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
  }
  :root {
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  }
  body {
    margin: 0;
    min-height: 100vh;
  }
}

@layer base {
  :root {
    --bg: #0f131c;
    --surface: #161c28;
    --panel: rgba(20, 26, 36, 0.85);
    --border: rgba(255, 255, 255, 0.06);
    --text: #e2e6ef;
    --muted: #a4acc1;
    --accent: #5f7fa9;
    --accent-strong: #4f678a;
    --secondary: #232a38;
    --danger: #e57373;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    --card-blur: 12px;
  }
  body.light {
    --bg: #f2f4f7;
    --surface: #ffffff;
    --panel: rgba(255, 255, 255, 0.9);
    --border: rgba(12, 22, 42, 0.08);
    --text: #1f2a3a;
    --muted: #6a7488;
    --accent: #5a76a0;
    --accent-strong: #4b6488;
    --secondary: #e6e9ef;
    --danger: #d75f68;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    --card-blur: 6px;
  }

  body {
    background: radial-gradient(circle at 20% 20%, rgba(90, 110, 140, 0.08), transparent 30%),
      radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.04), transparent 28%), var(--bg);
    color: var(--text);
    user-select: none;
    transition: background 0.25s ease, color 0.25s ease;
    padding-top: env(safe-area-inset-top);
  }

  .intro {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: grid;
    place-items: center;
    z-index: 200;
    pointer-events: none;
  }

  .intro.hidden {
    display: none;
  }

.introShape {
  position: absolute;
  width: 148px;
  height: 148px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, var(--secondary) 30%);
  opacity: 0;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.35));
  will-change: transform, border-radius, opacity;
  transform: translateZ(0) scale(0.9);
  animation: introShapeAnim 0.5s forwards;
}

.introBadge {
  width: 148px;
  height: 148px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  will-change: transform, opacity;
  transform: translateZ(0) scale(0.9);
  animation: introBadgeAnim 0.5s forwards;
}

.intro-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: opacity;
}

  @media (prefers-reduced-motion: reduce) {
    .introShape,
    .introLogo,
    .introBadge {
      animation: none;
      opacity: 0;
    }
  }

@keyframes introShapeAnim {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(0);
    border-radius: 999px;
    animation-timing-function: cubic-bezier(0.22, 0.95, 0.25, 1);
  }
  60% {
    opacity: 1;
    transform: scale(1.12) translateY(-4px);
    border-radius: 36px;
    animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
  }
  100% {
    opacity: 0;
    transform: scale(0.7) translateY(-18px);
    border-radius: 999px;
  }
}

  @keyframes introBadgeAnim {
  0% {
    opacity: 0;
    transform: scale(0.9);
    animation-timing-function: cubic-bezier(0.22, 0.95, 0.25, 1);
  }
  60% {
    opacity: 1;
    transform: scale(1.12) translateY(-4px);
    animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
  }
  100% {
    opacity: 0;
    transform: scale(0.7) translateY(-18px);
  }
}

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  p {
    margin: 0;
  }

  input,
  select,
  button,
  textarea {
    font: inherit;
    user-select: text;
  }
}

@layer layout {
  .top-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--panel);
    backdrop-filter: blur(var(--card-blur));
    border-bottom: 1px solid var(--border);
  }

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

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--secondary);
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0.02em;
  }

  .brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .brand-title {
    font-weight: 700;
  }

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

  .top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .page {
    max-width: 1400px;
    margin: 0 auto 30px auto;
    padding: 20px 16px calc(140px + env(safe-area-inset-bottom));
  }

  .nav-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin: 10px 0 18px 0;
  }

  .mobile-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    display: none;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
    z-index: 100;
  }

  .mobile-nav-btn {
    flex: 1;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--secondary) 70%, transparent);
    color: var(--text);
    font-weight: 700;
  }

  .mobile-nav-btn.active {
    background: color-mix(in srgb, var(--accent) 28%, transparent);
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  }

  .screen {
    display: none;
  }

  .screen.active {
    display: block;
  }

  .welcome-hero {
    padding: 10px 0 18px 0;
    display: grid;
    gap: 14px;
  }

  .welcome-title {
    font-size: 30px;
    font-weight: 800;
  }

  .welcome-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
  }

  .welcome-month {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 15px;
  }

  .welcome-earn {
    font-size: 18px;
    font-weight: 800;
  }

  .welcome-actions {
    display: grid;
    gap: 12px;
  }

  .welcome-btn {
    width: 100%;
    min-height: 56px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
    background: color-mix(in srgb, var(--secondary) 75%, transparent);
    color: var(--text);
    font-weight: 700;
  }

  .welcome-btn.primary {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  }

  .welcome-recent {
    margin-top: 22px;
  }

  .accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--secondary) 70%, transparent);
    color: var(--text);
  }

  .chevron {
    font-weight: 700;
    transition: transform 0.15s ease;
  }

  .accordion-toggle[aria-expanded="true"] .chevron {
    transform: rotate(90deg);
  }

  .accordion-body {
    margin-top: 10px;
  }

  .grid {
    display: grid;
    gap: 14px;
  }

  .grid.two {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
    width: auto;
    box-sizing: border-box;
  }

  .card.wide {
    max-width: 820px;
    margin: 0 auto 18px auto;
  }

  .card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
  }
}

@layer components {
  .muted {
    color: var(--muted);
  }

  .muted.small {
    font-size: 12px;
  }

  .ghost-btn,
  button {
    border: 1px solid var(--border);
    background: var(--secondary);
    color: var(--text);
    border-radius: 10px;
    padding: 9px 12px;
    cursor: pointer;
    transition: border 0.15s ease, background 0.15s ease, transform 0.15s ease;
  }

  button:hover {
    transform: translateY(-1px);
    background: color-mix(in srgb, var(--secondary) 90%, var(--text) 10%);
  }

  button:active {
    transform: translateY(0);
  }

  button:disabled,
  .ghost-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
  }

  .primary {
    background: var(--accent);
    border-color: var(--accent-strong);
    color: #0f1623;
    font-weight: 700;
  }

  button.small,
  .ghost-btn.small {
    padding: 7px 10px;
    font-size: 13px;
  }

  .danger {
    border-color: rgba(241, 107, 111, 0.4);
    color: var(--danger);
  }

  input,
  select,
  textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    transition: border 0.15s ease, background 0.15s ease;
  }

  input:focus,
  select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
  }

  label {
    font-size: 13px;
    color: var(--muted);
  }

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

  .form-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
  }

  .time-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 6px;
  }

  .time-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .time-label {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.01em;
  }

  .time-row select {
    width: 100%;
    min-height: 54px;
    font-size: 17px;
  }

  .time-field {
    grid-column: 1 / -1;
  }

  .entry-list-card.collapsed .entry-list-body {
    display: none;
  }

  .nav-btn {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
  }

  .nav-btn.active {
    background: color-mix(in srgb, var(--accent) 60%, transparent);
    color: var(--text);
    border-color: var(--accent-strong);
  }

  .tab-row {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
  }

  .tab {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 9px 14px;
    cursor: pointer;
  }

  .tab.active {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--text);
    font-weight: 700;
    border-bottom: 2px solid var(--accent-strong);
  }

  .summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }

  .summary-card {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 90%, var(--secondary) 10%);
  }

  .summary-card .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
  }

  .summary-card .value {
    font-size: 24px;
    font-weight: 700;
    margin: 6px 0;
  }

  .list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .list-item {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: color-mix(in srgb, var(--surface) 95%, var(--secondary) 5%);
  }

  .list-item .meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .list-item .inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .pill {
    padding: 4px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    font-size: 12px;
  }

  .badge {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px dashed var(--border);
    color: var(--muted);
    font-size: 12px;
  }

  .inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .inline-form input {
    flex: 1;
  }

  .empty {
    text-align: center;
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
  }

  .info-box {
    padding: 10px 12px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 90%, var(--secondary) 10%);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
  }

  .divider {
    border-bottom: 1px solid var(--border);
    margin: 12px 0;
  }

  .loading {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: grid;
    place-items: center;
    z-index: 20;
  }

  .spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  #toast-container {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: grid;
    gap: 8px;
    z-index: 30;
  }

  .toast {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 10px;
    min-width: 180px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.2s ease;
  }

  .toast.success {
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  }

  .toast.error {
    border-color: color-mix(in srgb, var(--danger) 70%, transparent);
  }

  @keyframes fadeIn {
    from {
      transform: translateY(6px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

@layer utilities {
  .hidden {
    display: none !important;
  }

  .mobile-only {
    display: none;
  }

  #mobile-nav {
    display: none;
  }
}

@media (max-width: 900px) {
  .page {
    max-width: 100%;
    padding: 16px 12px calc(130px + env(safe-area-inset-bottom));
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 14px;
  }

  .entry-form-card {
    order: 1;
  }

  .entry-list-card {
    order: 2;
  }

  .entry-list-card.collapsed .entry-list-body {
    display: none;
  }

  .time-row {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: 10px;
  }

  .time-row select {
    min-height: 52px;
    font-size: 16px;
  }

  .stats-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .desktop-nav {
    display: none;
  }

  #mobile-nav {
    display: flex;
  }

  .quick-filter-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .stats-charts .charts-body {
    grid-template-columns: 1fr;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .stats-top-grid,
  .stats-detail-grid,
  .stats-mid-grid,
  .stats-spot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .desktop-nav {
    display: none;
  }

  #mobile-nav {
    display: flex;
  }
}

@media (max-width: 480px) {
  .kpi-grid,
  .stats-top-grid,
  .stats-detail-grid,
  .stats-mid-grid,
  .stats-spot-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card,
  .kpi-card {
    padding: 10px;
  }

  .stat-value {
    font-size: 17px;
  }
}

/* Stats */
.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.stats-filter {
  margin-bottom: 14px;
  position: relative;
}

.stats-section {
  margin-bottom: 18px;
}

.stats-section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.stats-section-head h4 {
  margin: 0;
  font-size: 16px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--secondary) 70%, transparent);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.stats-filter-body {
  margin-top: 10px;
  position: relative;
  z-index: 2;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.quick-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.kpi-grid,
.stats-top-grid,
.stats-mid-grid,
.stats-detail-grid,
.stats-spot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  grid-auto-rows: 1fr;
  align-items: stretch;
}

@media (min-width: 1200px) {
  .stat-card.top,
  .stat-card.small {
    min-height: 140px;
  }
}

.stats-block {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.stat-card,
.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 96%, var(--secondary) 4%);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  margin: 0;
  width: auto;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.stat-card.top {
  padding: 16px;
  min-height: 120px;
}

.stat-card.small {
  padding: 12px;
  min-height: 110px;
}

.stat-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
}

.stat-card.spot {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}

.stat-card.spot.spot-pos {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

.stat-card.spot.spot-neg {
  border-color: color-mix(in srgb, var(--danger) 25%, var(--border));
  background: color-mix(in srgb, var(--danger) 4%, var(--surface));
}

.stat-card::after,
.kpi-card::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 6px;
  width: 4px;
  height: calc(100% - 16px);
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, transparent), color-mix(in srgb, var(--accent) 55%, transparent));
  opacity: 0.75;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
}

.chart-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.stat-canvas {
  width: 100%;
  min-height: 280px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--secondary) 8%);
}

.chart-empty {
  position: absolute;
  inset: 60px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  color: var(--muted);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, var(--secondary) 4%);
  pointer-events: none;
}

.stats-branches .segment {
  display: inline-flex;
  background: color-mix(in srgb, var(--secondary) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.segment-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
}

.segment-btn.active {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--text);
  font-weight: 700;
}

.branch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.branch-row {
  position: relative;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 90%, var(--secondary) 10%);
  border: 1px solid var(--border);
  overflow: hidden;
}

.branch-bar {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  opacity: 0.6;
}

.branch-meta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
}

.branch-more {
  margin-top: 8px;
  align-self: flex-start;
}

.stats-charts .charts-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.mini-chart {
  padding-top: 4px;
}

.chart-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chart-line {
  width: 100%;
  height: 90px;
  margin-bottom: 8px;
}

.chart-line svg {
  width: 100%;
  height: 100%;
}

.chart-path {
  stroke: color-mix(in srgb, var(--accent) 80%, transparent);
  stroke-width: 1.5;
}

.chart-dot {
  fill: var(--accent);
}

.bar-row {
  position: relative;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 90%, var(--secondary) 10%);
  border: 1px solid var(--border);
  overflow: hidden;
}

.bar-row.compact {
  padding: 6px 8px;
}

.bar {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  opacity: 0.5;
}

.bar-meta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.bar-meta strong {
  font-size: 14px;
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-block {
    gap: 14px;
  }

  .stat-card,
  .kpi-card {
    padding: 12px;
  }

  .stat-title {
    font-size: 11px;
  }

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

  .chart-card h3 {
    font-size: 16px;
  }

  .chart-card p.small,
  .chart-card .muted.small {
    font-size: 12px;
  }

  .stat-canvas {
    min-height: 240px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .card-head h3 {
    font-size: 16px;
  }

  .card-head .muted {
    font-size: 12px;
  }
}
.filter-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  z-index: 1;
}

  .stats-filter-body.drawer-open {
    position: fixed;
    inset: 12px;
    inset-bottom: calc(90px + env(safe-area-inset-bottom));
    max-height: calc(100vh - 140px);
    overflow: auto;
    z-index: 3;
    width: auto;
  }

.filter-backdrop.hidden {
  display: none;
}
