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

/* ─── ALPINE: скрыть до инициализации ────────────── */
[x-cloak] { display: none !important; }

/* ─── SKELETON LOADER ────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #1f1f1f 25%, #2a2a2a 50%, #1f1f1f 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
.skeleton-text  { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 36px; width: 220px; margin-bottom: 16px; }
.skeleton-card  { height: 100px; border-radius: 12px; }
.skeleton-row   { height: 48px; border-radius: 6px; margin-bottom: 4px; }

/* ─── ERROR STATE ────────────────────────────────── */
.error-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 48px;
  color: var(--destructive); text-align: center;
}
.error-state p { font-size: 13px; color: var(--muted-fg); max-width: 320px; }

/* ─── SPINNER ────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

:root {
  --bg: #111111;
  --card: #1A1A1A;
  --border: #2E2E2E;
  --primary: #FF8400;
  --primary-dark: #cc6a00;
  --foreground: #FFFFFF;
  --muted: #2E2E2E;
  --muted-fg: #B8B9B6;
  --sidebar: #18181b;
  --sidebar-accent: #2a2a30;
  --sidebar-border: rgba(255,255,255,0.1);
  --destructive: #FF5C33;
  --success: #B6FFCE;
  --success-bg: #222924;
  --input-bg: #1f1f1f;
  --radius: 12px;
  --radius-sm: 8px;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Geist', 'Inter', sans-serif;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--foreground);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }

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

/* ─── SIDEBAR ────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 4px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 20px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
}

.sidebar-logo .logo-icon {
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted-fg);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--sidebar-accent);
  color: var(--foreground);
}

.nav-item.active {
  background: var(--sidebar-accent);
  color: var(--foreground);
}

.nav-item svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-spacer { flex: 1; }

/* ─── MAIN CONTENT ───────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 32px;
  min-height: 100vh;
  max-width: calc(100vw - 220px);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title h1 {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.1;
}

.page-title p {
  color: var(--muted-fg);
  font-size: 13px;
  margin-top: 4px;
}

.page-date {
  color: var(--muted-fg);
  font-size: 13px;
  font-family: var(--font-mono);
}

/* ─── CARDS ──────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.card-sm { padding: 16px 20px; }

/* ─── STATS GRID ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--foreground);
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  margin-top: 8px;
}

.badge-up { background: #1a3d2a; color: #4ade80; }
.badge-down { background: #3d1a1a; color: #f87171; }
.badge-neutral { background: var(--muted); color: var(--muted-fg); }

/* ─── BUTTONS ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #111;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #3a3a3a; }

.btn-ghost {
  background: transparent;
  color: var(--muted-fg);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--muted); color: var(--foreground); }

.btn-danger {
  background: transparent;
  color: var(--destructive);
  border: 1px solid var(--destructive);
}
.btn-danger:hover { background: rgba(255,92,51,0.1); }

.btn svg {
  width: 15px; height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── FORM ELEMENTS ──────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  color: var(--muted-fg);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--foreground);
  font-size: 14px;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-input::placeholder { color: var(--muted-fg); }

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted-fg);
  cursor: pointer;
}

.input-icon svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── TABLE ──────────────────────────────────────── */
.table-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--foreground);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.amount-pos { color: #4ade80; font-family: var(--font-mono); font-weight: 600; }
.amount-neg { color: #f87171; font-family: var(--font-mono); font-weight: 600; }
.amount-neutral { font-family: var(--font-mono); }

/* ─── CATEGORY DOT ───────────────────────────────── */
.cat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── TAG / BADGE ────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.tag-income { background: var(--success-bg); color: #4ade80; }
.tag-expense { background: #3d1a1a; color: #f87171; }

/* ─── PROGRESS BAR ───────────────────────────────── */
.progress-bar-wrap {
  background: var(--muted);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  flex: 1;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width 0.3s;
}

.progress-bar.over { background: var(--destructive); }
.progress-bar.warn { background: #FF8400; }
.progress-bar.ok { background: #4ade80; }

/* ─── FILTERS BAR ────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip.active { background: var(--primary); color: #111; border-color: var(--primary); }
.filter-chip:hover:not(.active) { background: #3a3a3a; }

.filter-chip svg {
  width: 13px; height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── PAGINATION ─────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: transparent;
  color: var(--muted-fg);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.page-btn.active { background: var(--primary); color: #111; border-color: var(--primary); }
.page-btn:hover:not(.active) { background: var(--muted); color: var(--foreground); }

/* ─── TOGGLE / TYPE SWITCH ───────────────────────── */
.type-toggle {
  display: inline-flex;
  background: var(--muted);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.toggle-opt {
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-fg);
  transition: all 0.15s;
  cursor: pointer;
}

.toggle-opt.active {
  background: var(--primary);
  color: #111;
}

/* ─── SECTION HEADER ─────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── TOTAL BALANCE CARD ─────────────────────────── */
.balance-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
}

.balance-label {
  font-size: 13px;
  color: var(--muted-fg);
  margin-bottom: 8px;
}

.balance-value {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1;
}

/* ─── ACCOUNT ITEM ───────────────────────────────── */
.account-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--card);
  transition: border-color 0.15s;
}

.account-item:hover { border-color: #444; }

.account-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.account-info { flex: 1; }
.account-name { font-weight: 600; font-size: 14px; }
.account-type { font-size: 12px; color: var(--muted-fg); margin-top: 2px; }
.account-amount { font-family: var(--font-mono); font-size: 15px; font-weight: 700; }

.account-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--muted-fg);
  transition: all 0.15s;
}
.icon-btn:hover { background: #3a3a3a; color: var(--foreground); }
.icon-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── RECURRING ITEM ─────────────────────────────── */
.recurring-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--card);
}

.recurring-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.recurring-info { flex: 1; }
.recurring-name { font-weight: 600; font-size: 14px; }
.recurring-desc { font-size: 12px; color: var(--muted-fg); margin-top: 2px; }
.recurring-amount { font-family: var(--font-mono); font-weight: 700; font-size: 15px; margin-right: 16px; }

/* ─── CATEGORY ITEM ──────────────────────────────── */
.category-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.category-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
}

.category-section-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}

.category-count {
  font-size: 12px;
  color: var(--muted-fg);
  background: var(--muted);
  padding: 2px 8px;
  border-radius: 20px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.category-item:hover { background: rgba(255,255,255,0.02); }

.cat-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.cat-name { flex: 1; font-size: 14px; }
.cat-actions { display: flex; gap: 6px; }

/* ─── CHART CONTAINER ────────────────────────────── */
.chart-container {
  position: relative;
  height: 200px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted-fg);
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
}

/* ─── GLOWING ORBS (404) ─────────────────────────── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

/* ─── LOGIN PAGE ─────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.auth-card {
  width: 380px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.auth-logo .logo-icon {
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--muted-fg);
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted-fg);
}

.auth-footer a { color: var(--primary); }

.forgot-link {
  float: right;
  font-size: 12px;
  color: var(--primary);
}

.form-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* ─── DASHBOARD TWO-COL ──────────────────────────── */
.dashboard-cols {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.dashboard-left { min-width: 0; }
.dashboard-right { min-width: 0; }

/* ─── TRANSACTION ROW ────────────────────────────── */
.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.tx-row:last-child { border-bottom: none; }

.tx-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.tx-info { flex: 1; min-width: 0; }
.tx-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-cat { font-size: 12px; color: var(--muted-fg); }
.tx-amount { font-family: var(--font-mono); font-weight: 700; font-size: 14px; flex-shrink: 0; }

/* ─── DIVIDER ────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ─── SCROLLBAR ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-cols { grid-template-columns: 1fr; }
}

/* ─── TABLET (769–900px) ─────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 180px; }
  .main-content { margin-left: 180px; padding: 24px; max-width: calc(100vw - 180px); }
}

/* ─── MOBILE: sidebar → bottom tab bar ──────────── */
@media (max-width: 768px) {
  /* ── Bottom tab bar (горизонтальный скролл) ── */
  .sidebar {
    width: 100%;
    height: 62px;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    gap: 0;
    border-right: none;
    border-top: 1px solid var(--sidebar-border);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 200;
    align-items: stretch;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .sidebar::-webkit-scrollbar { display: none; }

  /* Скрываем logo, spacer и кнопку Выйти */
  .sidebar-logo,
  .sidebar-spacer { display: none !important; }

  .sidebar > *:nth-child(11) { display: none !important; }

  /* Каждый пункт — фиксированная ширина, иконка + подпись */
  .nav-item {
    flex: 0 0 64px;
    flex-direction: column;
    padding: 8px 4px 5px;
    gap: 3px;
    justify-content: center;
    align-items: center;
    border-radius: 0;
    color: #666;
    position: relative;
    transition: color 0.15s;
  }

  .nav-item:hover { background: transparent; color: var(--muted-fg); }

  /* Оранжевая полоска сверху у активного */
  .nav-item.active {
    color: var(--primary);
    background: transparent;
  }
  .nav-item.active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
  }

  /* Иконки */
  .nav-item svg { width: 20px; height: 20px; }

  /* Подписи — маленькие */
  .nav-item span {
    display: block !important;
    font-size: 9px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
  }

  /* ── Контент ── */
  .main-content {
    margin-left: 0;
    padding: 16px 16px calc(62px + env(safe-area-inset-bottom) + 20px);
    max-width: 100vw;
  }

  /* ── Page header — вертикально ── */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }
  .page-header > div { width: 100%; }
  .page-title h1 { font-size: 22px; }
  .page-title p { font-size: 12px; }

  /* Кнопка действия — полная ширина */
  .page-header .btn-primary {
    width: 100%;
    justify-content: center;
  }

  /* ── Сетки ── */
  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .dashboard-cols { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr !important; }

  /* ── Размеры цифр баланса ── */
  .balance-value { font-size: 26px; }
  .total-value { font-size: 26px !important; }
  .stat-value { font-size: 20px; }

  /* ── Карточки — меньше padding ── */
  .card { padding: 14px 16px; }
  .stat-card { padding: 14px 16px; }
  .balance-card { padding: 18px 16px; }

  /* ── Account item — стек на мобиле ── */
  .account-amount { font-size: 14px; }

  /* ── Auth ── */
  .auth-card {
    width: calc(100% - 32px);
    padding: 24px 20px;
  }

  /* ── Таблицы — горизонтальный скролл ── */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: 480px; }

  /* ── Модалки — bottom sheet ── */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-overlay > div {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    max-height: 92vh;
    overflow-y: auto;
  }

  /* ── Фильтры ── */
  .filters-bar { gap: 6px; }
  .filter-chip { font-size: 12px; padding: 5px 10px; }

  /* ── Reports ── */
  .reports-grid { grid-template-columns: 1fr !important; }

  /* ── Settings form ── */
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }
}

/* ─── SMALL PHONES (≤ 375px) ─────────────────────── */
@media (max-width: 375px) {
  .main-content { padding: 12px 12px calc(62px + env(safe-area-inset-bottom) + 20px); }
  .page-title h1 { font-size: 20px; }
}
