/* ==========================================================================
   HASAN STORE.ID — Emerald Green & White iOS SF Pro Design System
   ========================================================================== */

@font-face {
  font-family: 'SF Pro Display';
  src: url('../fonts/SFProDisplay-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SF Pro Display';
  src: url('../fonts/SFProDisplay-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SF Pro Display';
  src: url('../fonts/SFProDisplay-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SF Pro Display';
  src: url('../fonts/SFProDisplay-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SF Pro Display';
  src: url('../fonts/SFProDisplay-Heavy.woff2') format('woff2');
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-ios: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;

  /* Green & White Gradient Surfaces */
  --bg-app: linear-gradient(180deg, #e6f9ef 0%, #f3fdf8 34%, #ffffff 100%);
  --bg-solid: #f3fdf8;
  --bg-card: #ffffff;
  --bg-card-grad: linear-gradient(180deg, #f9fffc 0%, #ffffff 42%);
  --bg-subtle: #ecfdf5;
  --bg-hover: #e6f9ef;
  --bg-sidebar: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);

  /* Typography Colors */
  --text-primary: #064e3b;
  --text-secondary: #1e5645;
  --text-muted: #5b7c70;

  /* Borders */
  --border-subtle: #d1fae5;
  --border-strong: #a7f3d0;

  /* Emerald Accents & Gradients */
  --accent: #059669;
  --accent-light: #10b981;
  --accent-hover: #047857;
  --accent-soft: rgba(16, 185, 129, 0.13);
  --grad-green: linear-gradient(135deg, #047857 0%, #059669 48%, #10b981 85%, #34d399 100%);
  --grad-green-soft: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
  --grad-btn: linear-gradient(135deg, #059669 0%, #10b981 100%);

  /* Semantic */
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.13);
  --info: #0d9488;
  --info-soft: rgba(13, 148, 136, 0.13);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.14);
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.12);

  /* Elevation */
  --shadow-xs: 0 1px 3px rgba(5, 150, 105, 0.06);
  --shadow-sm: 0 4px 14px -4px rgba(5, 150, 105, 0.10), 0 1px 3px rgba(6, 78, 59, 0.04);
  --shadow-md: 0 10px 28px -8px rgba(5, 150, 105, 0.18), 0 4px 10px -4px rgba(6, 78, 59, 0.06);
  --shadow-hero: 0 16px 36px -10px rgba(5, 150, 105, 0.42);
  --shadow-lg: 0 24px 50px -12px rgba(6, 78, 59, 0.24);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --sidebar-w: 256px;
  --header-h: 62px;
  --bottom-nav-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

[data-theme='dark'] {
  --bg-app: linear-gradient(180deg, #031710 0%, #052017 45%, #071913 100%);
  --bg-solid: #051c14;
  --bg-card: #0a291f;
  --bg-card-grad: linear-gradient(180deg, #0d3226 0%, #0a291f 45%);
  --bg-subtle: #0f382b;
  --bg-hover: #134435;
  --bg-sidebar: linear-gradient(180deg, #061d15 0%, #09271d 100%);

  --text-primary: #ecfdf5;
  --text-secondary: #a7f3d0;
  --text-muted: #6ee7b7;

  --border-subtle: #144535;
  --border-strong: #1e5e49;

  --accent: #10b981;
  --accent-light: #34d399;
  --accent-hover: #34d399;
  --accent-soft: rgba(16, 185, 129, 0.20);
  --grad-green: linear-gradient(135deg, #065f46 0%, #059669 52%, #10b981 100%);
  --grad-green-soft: linear-gradient(135deg, #0d3226 0%, #0a291f 100%);
  --grad-btn: linear-gradient(135deg, #059669 0%, #10b981 100%);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 4px 16px -4px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 12px 30px -8px rgba(0, 0, 0, 0.55);
  --shadow-hero: 0 16px 36px -10px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 24px 55px -12px rgba(0, 0, 0, 0.72);
}

/* ---------- Animations ---------- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scalePop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

@keyframes floatOrb {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-10px, 8px) scale(1.07);
  }
}

@keyframes shimmerSweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(220%);
  }
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.48);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.anim-enter {
  animation: fadeSlideUp 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stagger-1 { animation-delay: 0.04s; }
.stagger-2 { animation-delay: 0.09s; }
.stagger-3 { animation-delay: 0.14s; }
.stagger-4 { animation-delay: 0.19s; }
.stagger-5 { animation-delay: 0.24s; }
.stagger-6 { animation-delay: 0.29s; }

@media (prefers-reduced-motion: reduce) {
  .anim-enter,
  .hero-orb,
  .progress-fill::after,
  .sync-dot {
    animation: none !important;
  }
}

/* ---------- Base Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-ios);
  background: var(--bg-solid);
  background-image: var(--bg-app);
  background-attachment: fixed;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.48;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.num {
  font-variant-numeric: tabular-nums;
}

button,
input,
select,
textarea {
  font-family: var(--font-ios);
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

/* ---------- Layout Shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Desktop Sidebar (Fresh White-to-Mint Gradient) */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  background: var(--bg-sidebar);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  z-index: 45;
  border-right: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--grad-green);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.30);
}

.brand-logo.sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

.brand-text strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 12px 4px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}

.nav-item.active {
  background: var(--grad-btn);
  color: #ffffff;
  box-shadow: 0 6px 16px -4px rgba(5, 150, 105, 0.42);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.nav-badge.alert {
  background: var(--danger-soft);
  color: var(--danger);
}

.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid var(--border-subtle);
}

.sync-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  animation: pulseRing 2.2s infinite;
  flex-shrink: 0;
}

.sync-dot.local {
  background: #f59e0b;
  animation: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 78, 59, 0.36);
  backdrop-filter: blur(3px);
  z-index: 40;
}

.sidebar-backdrop.open {
  display: block;
}

/* ---------- Main Area & Clean Topbar ---------- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: calc(var(--header-h) + var(--safe-top));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: calc(var(--safe-top) + 6px) calc(22px + var(--safe-right)) 8px calc(22px + var(--safe-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

[data-theme='dark'] .topbar {
  background: rgba(10, 41, 31, 0.94);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.mobile-brand-mark {
  display: none;
}

.page-heading {
  min-width: 0;
}

.page-heading h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-heading p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 230px;
  padding: 8px 12px 8px 34px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  font-size: 13px;
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Mobile Expandable Search Drawer */
.mobile-search-bar {
  display: none;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  animation: fadeSlideUp 0.2s ease;
}

.mobile-search-bar.open {
  display: block;
}

.mobile-search-bar input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  font-size: 14px;
}

.mobile-search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
}

.mobile-only {
  display: none !important;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--accent);
  border-color: var(--border-strong);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--grad-btn);
  color: #ffffff;
  box-shadow: 0 6px 16px -4px rgba(5, 150, 105, 0.45);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(5, 150, 105, 0.52);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--accent);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-danger-soft:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: 8px;
}

/* ---------- Page Body & Tidy Collapsible Filter Strip ---------- */
.page-body {
  padding: 18px 22px 36px;
  max-width: 1460px;
  width: 100%;
  margin: 0 auto;
}

.filter-shell {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-quick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preset-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 1px;
  flex: 1;
}

.preset-scroll::-webkit-scrollbar {
  display: none;
}

.preset-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-xs);
}

.preset-btn:hover {
  border-color: var(--accent-light);
  color: var(--accent);
}

.preset-btn.active {
  background: var(--grad-btn);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 5px 14px -4px rgba(5, 150, 105, 0.45);
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  transition: all 0.18s ease;
}

.filter-toggle-btn.has-active,
.filter-toggle-btn.open {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-count-dot {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}

.filter-drawer {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideUp 0.22s ease;
}

.filter-drawer.open {
  display: block;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

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

.filter-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-select,
.filter-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  font-size: 13px;
  color: var(--text-primary);
  min-height: 36px;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.active-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

.chip button {
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ---------- Hero Revenue Banner (Emerald Green Gradient) ---------- */
.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--grad-green);
  color: #ffffff;
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-hero);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0) 70%);
  animation: floatOrb 7s ease-in-out infinite;
}

.hero-orb.orb-1 {
  width: 240px;
  height: 240px;
  top: -80px;
  right: -40px;
}

.hero-orb.orb-2 {
  width: 180px;
  height: 180px;
  bottom: -90px;
  left: 22%;
  animation-delay: -3s;
}

.hero-main {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.hero-amount {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 10px;
  text-shadow: 0 2px 10px rgba(4, 120, 87, 0.22);
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.hero-target-box {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 15px 16px;
}

.hero-target-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 12.5px;
}

.hero-target-pct {
  font-size: 22px;
  font-weight: 800;
}

.hero-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  overflow: hidden;
  position: relative;
}

.hero-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff 0%, #d1fae5 100%);
  position: relative;
  overflow: hidden;
  transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-fill::after,
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmerSweep 2.6s ease-in-out infinite;
}

.hero-target-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.9);
}

.hero-target-foot a {
  color: #ffffff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- KPI Grid (Symmetrical 4-card Desktop / 2x2 Mobile) ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg-card-grad);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--bg-subtle);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 15px;
  height: 15px;
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.kpi-delta.up {
  background: var(--success-soft);
  color: var(--success);
}

.kpi-delta.down {
  background: var(--danger-soft);
  color: var(--danger);
}

.kpi-delta.neutral {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.kpi-sparkline {
  width: 64px;
  height: 24px;
  flex-shrink: 0;
}

.progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--border-subtle);
  overflow: hidden;
}

.progress-fill {
  position: relative;
  overflow: hidden;
  height: 100%;
  border-radius: 999px;
  background: var(--grad-btn);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Cards & Grids ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.card-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.grid-main-side {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.seg-group {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.16s ease;
}

.seg-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.legend-item:hover,
.legend-item.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- Smart Insights Strip ---------- */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.insight-card {
  background: var(--grad-green-soft);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-xs);
}

.insight-card.success { border-left-color: #16a34a; }
.insight-card.warning { border-left-color: var(--warning); }
.insight-card.danger { border-left-color: var(--danger); }
.insight-card.info { border-left-color: var(--info); }

.insight-tag {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: var(--accent);
}

.insight-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Desktop Tables & Mobile Native Cards ---------- */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 760px;
}

table.data-table.compact {
  min-width: 560px;
}

table.data-table th {
  text-align: left;
  padding: 11px 12px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  user-select: none;
}

table.data-table th.sortable {
  cursor: pointer;
}

table.data-table th.sortable:hover {
  color: var(--accent);
}

table.data-table th.right,
table.data-table td.right {
  text-align: right;
}

table.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

table.data-table tbody tr {
  transition: background 0.14s ease;
}

table.data-table tbody tr:hover {
  background: var(--bg-hover);
}

table.data-table tbody tr.selected {
  background: var(--accent-soft);
}

table.data-table tbody tr:last-child td {
  border-bottom: none;
}

.cell-main {
  font-weight: 700;
  color: var(--text-primary);
}

.cell-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-icon:hover {
  border-color: var(--border-strong);
  color: var(--accent);
}

.action-icon.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Mobile Card Lists (Hidden on desktop, shown cleanly on HP!) */
.mobile-card-list {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.m-card {
  background: var(--bg-card-grad);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.m-card:active {
  transform: scale(0.99);
  border-color: var(--accent-light);
}

.m-card.selected {
  border-color: var(--accent);
  background: var(--bg-subtle);
}

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

.m-card-title {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.3;
}

.m-card-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.m-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.m-meta-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 999px;
}

.m-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--border-subtle);
}

.m-card-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
}

.m-card-profit {
  font-size: 11.5px;
  font-weight: 600;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.no-dot::before {
  display: none;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--bg-subtle); color: var(--text-secondary); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.page-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.page-btn.active {
  background: var(--grad-btn);
  color: #ffffff;
  border-color: transparent;
}

.page-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* ---------- Heatmap & Simulator ---------- */
.heatmap-grid {
  display: grid;
  grid-template-columns: 44px repeat(6, 1fr);
  gap: 5px;
  align-items: center;
}

.hm-head {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.hm-day {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.hm-cell {
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  transition: transform 0.14s ease;
}

.hm-cell:hover {
  transform: scale(1.08);
}

.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.slider-group input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

.sim-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.sim-box {
  background: var(--grad-green-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.sim-box span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.sim-box strong {
  font-size: 15px;
  display: block;
  margin-top: 2px;
}

/* ---------- Mobile Bottom Navigation Bar & FAB ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  min-height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding: 6px calc(6px + var(--safe-right)) calc(var(--safe-bottom) + 6px) calc(6px + var(--safe-left));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -6px 24px rgba(5, 150, 105, 0.10);
  z-index: 38;
  grid-template-columns: repeat(5, 1fr);
  align-items: start;
}

[data-theme='dark'] .bottom-nav {
  background: rgba(8, 34, 25, 0.97);
}

.bnav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px 4px;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 700;
  position: relative;
  transition: color 0.18s ease;
}

.bnav-item svg {
  width: 21px;
  height: 21px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.bnav-item.active {
  color: var(--accent);
}

.bnav-item.active svg {
  transform: translateY(-2px) scale(1.08);
}

.bnav-item.active::after {
  content: '';
  position: absolute;
  top: -6px;
  width: 26px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--grad-btn);
}

.fab-add {
  display: none;
  position: fixed;
  right: calc(16px + var(--safe-right));
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 18px);
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: none;
  background: var(--grad-green);
  color: #ffffff;
  box-shadow: 0 12px 26px -6px rgba(5, 150, 105, 0.62);
  place-items: center;
  cursor: pointer;
  z-index: 39;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fab-add:active {
  transform: scale(0.92);
}

/* ---------- Modals & Bottom-Sheet Drawers ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 78, 59, 0.45);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: scalePop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  font-size: 13.5px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.calc-preview {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--grad-green-soft);
  border: 1px solid var(--border-strong);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calc-item span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.calc-item strong {
  font-size: 13.5px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 78, 59, 0.45);
  backdrop-filter: blur(3px);
  z-index: 65;
  display: none;
  justify-content: flex-end;
}

.drawer-overlay.open {
  display: flex;
}

.drawer-panel {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--border-subtle);
  animation: scalePop 0.22s ease;
}

.invoice-box {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--grad-green-soft);
}

.invoice-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  gap: 10px;
}

.invoice-row.total {
  border-top: 1px solid var(--border-strong);
  margin-top: 8px;
  padding-top: 10px;
  font-size: 15px;
  font-weight: 800;
}

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 26px 16px;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: all 0.18s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Chart Tooltip ---------- */
.chart-tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  background: rgba(6, 78, 59, 0.96);
  color: #ecfdf5;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  min-width: 170px;
  box-shadow: 0 12px 28px rgba(4, 120, 87, 0.35);
  border: 1px solid rgba(167, 243, 208, 0.22);
}

.tt-title {
  font-weight: 800;
  margin-bottom: 6px;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  padding-bottom: 4px;
}

.tt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 0;
}

.tt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}

.tt-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  color: #a7f3d0;
}

.tt-hint {
  margin-top: 4px;
  font-size: 10.5px;
  color: #6ee7b7;
  font-weight: 700;
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  background: #064e3b;
  color: #ffffff;
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid #34d399;
  animation: fadeSlideUp 0.22s ease;
}

.toast.warning { border-left-color: #fbbf24; }
.toast.danger { border-left-color: #fb7185; }

/* ---------- Responsive (Tablet & Mobile HP First-Class) ---------- */
@media (max-width: 1180px) {
  .insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  :root {
    --safe-top: max(env(safe-area-inset-top, 0px), 46px);
    --safe-bottom: max(env(safe-area-inset-bottom, 0px), 56px);
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .mobile-brand-mark {
    display: grid;
  }
  .bottom-nav {
    display: grid;
  }
  .fab-add {
    display: grid;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: grid !important;
  }
  .page-body {
    padding: 14px calc(14px + var(--safe-right)) calc(var(--bottom-nav-h) + var(--safe-bottom) + 92px) calc(14px + var(--safe-left));
  }
  .grid-main-side,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .hero-banner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }
  .toast-container {
    left: 14px;
    right: 14px;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 18px);
    max-width: none;
  }
}

@media (max-width: 768px) {
  .topbar {
    height: auto;
    min-height: calc(56px + var(--safe-top));
    padding: calc(var(--safe-top) + 8px) calc(14px + var(--safe-right)) 10px calc(14px + var(--safe-left));
  }
  .page-heading h1 {
    font-size: 15.5px;
  }
  .page-heading p {
    display: none;
  }
  .hero-amount {
    font-size: 26px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi-card {
    padding: 12px 13px;
  }
  .kpi-value {
    font-size: 17px;
  }
  .insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card {
    padding: 15px 14px;
    border-radius: 16px;
  }

  /* Switch bulky tables to sleek mobile card lists */
  .desktop-table-wrap {
    display: none;
  }
  .mobile-card-list {
    display: flex;
  }

  /* Native Android-style bottom sheets with safe-area guards */
  .modal-overlay {
    align-items: flex-end;
    padding: calc(var(--safe-top) + 12px) 0 0;
  }
  .modal-dialog {
    max-width: 100%;
    max-height: calc(100dvh - var(--safe-top) - 12px);
    border-radius: 22px 22px 0 0;
    animation: sheetSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .drawer-overlay {
    align-items: flex-end;
    padding-top: calc(var(--safe-top) + 12px);
  }
  .drawer-panel {
    max-width: 100%;
    height: auto;
    max-height: calc(100dvh - var(--safe-top) - 12px);
    border-left: none;
    border-radius: 22px 22px 0 0;
    animation: sheetSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .modal-footer {
    padding: 14px 18px calc(14px + var(--safe-bottom));
  }
  .form-grid,
  .calc-preview,
  .sim-result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }
  .kpi-sparkline {
    display: none;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .sidebar,
  .topbar,
  .filter-shell,
  .bottom-nav,
  .fab-add,
  .no-print,
  .toast-container,
  .chart-tooltip {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
  }
  .page-body {
    padding: 0 !important;
  }
  .desktop-table-wrap {
    display: block !important;
  }
  .mobile-card-list {
    display: none !important;
  }
  body {
    background: #ffffff !important;
  }
}
