:root {
  --bg: #f6f5f1;
  --bg-gradient: linear-gradient(165deg, #f6f5f1 0%, #edeae3 40%, #f2f0eb 100%);
  --glass: rgba(255,255,255,0.72);
  --glass-border: rgba(0,0,0,0.05);
  --glass-hover: rgba(255,255,255,0.88);
  --text: #1b1b1b;
  --text-secondary: #555;
  --text-muted: #999;
  --accent: #2d5be3;
  --accent-light: #4a73f5;
  --accent-soft: rgba(45,91,227,0.08);
  --accent-glow: rgba(45,91,227,0.15);
  --success: #1a9a5c;
  --success-soft: rgba(26,154,92,0.08);
  --danger: #dc3b3b;
  --danger-soft: rgba(220,59,59,0.08);
  --warning: #d4851e;
  --warning-soft: rgba(212,133,30,0.08);
  --sidebar-bg: rgba(255,255,255,0.55);
  --sidebar-active: rgba(45,91,227,0.06);
  --input-bg: rgba(0,0,0,0.025);
  --input-border: rgba(0,0,0,0.08);
  --input-focus: rgba(45,91,227,0.18);
  --divider: rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 6px 24px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.05), 0 20px 48px rgba(0,0,0,0.08);
  --blur: blur(28px);
  --modal-bg: rgba(255,255,255,0.97);
  --card-radius: 16px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* Ambient bg blobs */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}
body::before {
  width: 700px; height: 700px; right: -200px; top: -200px;
  background: radial-gradient(circle, rgba(45,91,227,0.04), transparent 65%);
}
body::after {
  width: 600px; height: 600px; left: -100px; bottom: -200px;
  background: radial-gradient(circle, rgba(26,154,92,0.035), transparent 65%);
}

#app { position: relative; z-index: 1; min-height: 100vh; overflow-x: hidden; }

/* ─── LAYOUT SHELL ───────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ────────────────────────────── */
.sidebar {
  width: 256px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-right: 1px solid var(--glass-border);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  margin-bottom: 32px;
}

.brand-badge, .avatar-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.brand-badge {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  font-size: 16px;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 8px rgba(45,91,227,0.25);
}

.avatar-badge {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(45,91,227,0.2);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 1px;
}

/* Nav buttons */
.nav-btn, .ghost-btn, .primary-btn, .danger-btn, .icon-btn, .tab-btn, .theme-btn {
  border: none;
  transition: all var(--transition);
}

.nav-btn {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.nav-btn:hover { background: var(--sidebar-active); color: var(--text); }
.nav-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-btn .nav-icon {
  width: 22px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-spacer { flex: 1; }

.side-footer {
  border-top: 1px solid var(--divider);
  padding-top: 14px;
  margin-top: 14px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin-bottom: 8px;
  min-width: 0;
}
.profile-row > div:last-child {
  min-width: 0;
}
.profile-row > div:last-child > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── MAIN ───────────────────────────────── */
.main {
  flex: 1;
  margin-left: 256px;
  padding: 28px 32px 40px;
  min-width: 0;
  max-width: 100%;
}

.topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
  font-weight: 400;
}

/* ─── GRID ───────────────────────────────── */
.grid { display: grid; gap: 14px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ─── GLASS CARDS ────────────────────────── */
.glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.card { padding: 20px; }

/* Stats */
.stat-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.stat-sub {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 8px;
  font-weight: 500;
}

.section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}

.section-note {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  margin: -2px 0 14px;
}

/* ─── BUTTONS ────────────────────────────── */
.primary-btn, .theme-btn, .ghost-btn, .danger-btn {
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(45,91,227,0.2);
}
.primary-btn:hover {
  box-shadow: 0 4px 16px rgba(45,91,227,0.3);
  transform: translateY(-1px);
}
.primary-btn:active { transform: translateY(0); }

.ghost-btn {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--glass-border);
}
.ghost-btn:hover { background: rgba(0,0,0,0.05); }

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
}
.danger-btn:hover { background: rgba(220,59,59,0.14); }

.theme-btn {
  width: 100%;
  text-align: left;
  background: var(--input-bg);
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.theme-btn:hover { background: rgba(0,0,0,0.05); }

.eye-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}

/* ─── DESKTOP TABLE (hidden on mobile) ───── */
.table-desktop { display: block; }

.table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table th, .table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.glass.card, .table-desktop, .cards-mobile, .inline-actions {
  min-width: 0;
}
.inline-actions {
  max-width: 100%;
}

.table th, .table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  font-size: 13px;
}
.table th {
  color: var(--text-muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding-bottom: 10px;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(0,0,0,0.015); }
.table tbody tr:last-child td { border-bottom: none; }

/* ─── MOBILE CARDS (hidden on desktop) ───── */
.cards-mobile { display: none; }

.item-card {
  padding: 16px;
  border-bottom: 1px solid var(--divider);
}
.item-card:last-child { border-bottom: none; }

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.item-card-title {
  font-weight: 700;
  font-size: 14px;
  min-width: 0;
  word-break: break-word;
}
.item-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--text-secondary);
}
.item-card-meta .meta-label {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.item-card-meta .meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ─── BADGES ─────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ─── PROGRESS BARS ──────────────────────── */
.bar {
  width: 100%;
  height: 6px;
  background: var(--input-bg);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── KPI MINI ───────────────────────────── */
.kpis-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.kpi-mini {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--input-bg);
  transition: background var(--transition);
  min-width: 0;
}
.kpi-mini .k {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.kpi-mini .v {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-word;
}


.section-note {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  margin: -4px 0 14px;
}

.finance-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
  gap: 14px;
}

.finance-grid-subscriptions {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 14px;
}

.finance-card-wide,
.finance-card-side {
  min-width: 0;
}

.finance-card-wide .table th:nth-child(1),
.finance-card-wide .table td:nth-child(1) { width: 28%; }
.finance-card-wide .table th:nth-child(2),
.finance-card-wide .table td:nth-child(2) { width: 18%; }
.finance-card-wide .table th:nth-child(3),
.finance-card-wide .table td:nth-child(3) { width: 10%; text-align: center; }
.finance-card-wide .table th:nth-child(4),
.finance-card-wide .table td:nth-child(4) { width: 14%; }
.finance-card-wide .table th:nth-child(5),
.finance-card-wide .table td:nth-child(5) { width: 16%; white-space: nowrap; }
.finance-card-wide .table th:nth-child(6),
.finance-card-wide .table td:nth-child(6) { width: 14%; }

.finance-card-wide .table td,
.finance-card-wide .table th {
  vertical-align: middle;
}

.finance-card-wide .badge {
  white-space: nowrap;
}

.finance-card-wide .inline-actions {
  flex-wrap: nowrap;
}

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

@media (max-width: 1180px) {
  .finance-grid-2,
  .finance-grid-subscriptions {
    grid-template-columns: 1fr;
  }
}

/* ─── FORMS ──────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  font-size: 16px; /* 16px prevents iOS zoom on focus */
  transition: all var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus);
  background: rgba(255,255,255,0.6);
}
.field textarea { min-height: 86px; resize: vertical; }

/* ─── AUTH ────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 42px 38px;
}

.auth-head { text-align: center; margin-bottom: 32px; }
.auth-head h1 {
  font-family: var(--font-display);
  margin: 14px 0 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.auth-head p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── ALERTS ─────────────────────────────── */
.error-box, .success-box {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.3s ease;
  word-break: break-word;
}
.error-box { background: var(--danger-soft); color: var(--danger); }
.success-box { background: var(--success-soft); color: var(--success); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── MODAL ──────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow: auto;
  padding: 28px;
  background: var(--modal-bg);
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-overflow-scrolling: touch;
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ─── UTILITY ────────────────────────────── */
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ─── MOBILE TOP ─────────────────────────── */
.mobile-top { display: none; }

/* ═══════════════════════════════════════════
   TABLET (≤ 1024px)
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .main { padding: 24px 20px 36px; }
  .grid.cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

/* ═══════════════════════════════════════════
   MOBILE (≤ 860px) — sidebar hidden, drawer nav
   ═══════════════════════════════════════════ */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px 16px 32px; }

  .mobile-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--divider);
  }

  .page-title { font-size: 22px; }
  .topline { gap: 8px; }

  .grid.stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid.cards { grid-template-columns: 1fr; }
  .finance-grid-2, .finance-grid-subscriptions { grid-template-columns: 1fr; }
  .stat-value { font-size: 22px; }

  /* Switch tables to mobile cards */
  .table-desktop { display: none !important; }
  .cards-mobile { display: block !important; }

  .kpis-mini { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }

  /* Modal takes more space on mobile */
  .modal {
    max-height: 95vh;
    max-height: 95dvh;
    padding: 24px 20px;
    border-radius: 20px 20px 0 0;
  }
}

/* ═══════════════════════════════════════════
   SMALL PHONES (≤ 480px)
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
  .main { padding: 14px 14px 28px; }
  .grid.stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 16px; }
  .stat-value { font-size: 20px; }
  .auth-card { padding: 28px 20px; }
  .auth-head h1 { font-size: 24px; }
  .primary-btn, .ghost-btn, .danger-btn { padding: 10px 14px; font-size: 12px; }
  .kpis-mini { gap: 8px; }
  .kpi-mini { padding: 10px 12px; }
  .kpi-mini .v { font-size: 13px; }
}

/* ═══════════════════════════════════════════
   DESKTOP — modal centered (not bottom sheet)
   ═══════════════════════════════════════════ */
@media (min-width: 861px) {
  .overlay { align-items: center; padding: 16px; }
  .modal { border-radius: 20px; }
  @keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* ─── MOBILE NAV DRAWER ──────────────────── */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
}
.mobile-nav-overlay.open { display: block; }

.mobile-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 270px;
  max-width: 80vw;
  z-index: 51;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  background: var(--modal-bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-sidebar.open { transform: translateX(0); }

/* ─── SCROLLBAR ──────────────────────────── */
::-webkit-scrollbar { width: 0; height: 0; }

/* ─── SAFE AREA (notch phones) ───────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .main { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .modal { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .mobile-sidebar { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ─── DARK MODE ──────────────────────────── */
body.dark {
  --bg: #111113;
  --bg-gradient: linear-gradient(165deg, #111113 0%, #17171b 40%, #111113 100%);
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.06);
  --glass-hover: rgba(255,255,255,0.07);
  --text: #eaeaea;
  --text-secondary: #aaa;
  --text-muted: #666;
  --accent: #6b8aff;
  --accent-light: #8aa4ff;
  --accent-soft: rgba(107,138,255,0.1);
  --accent-glow: rgba(107,138,255,0.15);
  --success: #4ade80;
  --success-soft: rgba(74,222,128,0.08);
  --danger: #f87171;
  --danger-soft: rgba(248,113,113,0.08);
  --warning: #fbbf24;
  --warning-soft: rgba(251,191,36,0.08);
  --sidebar-bg: rgba(255,255,255,0.025);
  --sidebar-active: rgba(107,138,255,0.08);
  --input-bg: rgba(255,255,255,0.04);
  --input-border: rgba(255,255,255,0.08);
  --input-focus: rgba(107,138,255,0.18);
  --divider: rgba(255,255,255,0.05);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 6px 24px rgba(0,0,0,0.15);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.3), 0 20px 48px rgba(0,0,0,0.3);
  --modal-bg: rgba(20,20,24,0.98);
}
body.dark .field input:focus, body.dark .field select:focus, body.dark .field textarea:focus {
  background: rgba(255,255,255,0.06);
}


/* Ajustes de contenção para evitar scroll lateral sem alterar o design */
.glass.card, .item-card, .kpi-mini, .table-desktop, .inline-actions, .flex-between { min-width: 0; }
.table { table-layout: fixed; }
.table th, .table td { overflow-wrap: anywhere; word-break: break-word; }
.inline-actions { align-items: center; }
.item-card-header > div:first-child, .flex-between > div:first-child { min-width: 0; }

.stat-card { position: relative; padding-top: 28px; }
.section-header-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}
.kpi-mini-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.card-eye-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.card-eye-btn.small {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.card-eye-btn:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}
