/* =========================================================================
   Vida de Técnico — Caixa
   Tokens: azul de confiança + neutros de ardósia + semânticos financeiros.
   Tipografia: Manrope (números e títulos) + Inter (texto corrido/UI).
   ========================================================================= */

:root {
  /* --- Marca --- */
  --blue-700: #16389B;
  --blue-600: #1E4FDE;
  --blue-500: #3E6BFF;
  --blue-100: #E4EAFE;
  --blue-50:  #F2F5FF;

  --ink-900: #12141A;
  --ink-700: #30343E;
  --ink-500: #5B6472;
  --ink-300: #9AA2AF;
  --ink-150: #DDE1E7;
  --ink-100: #EDEFF3;

  --surface: #F5F6F9;
  --white: #FFFFFF;

  /* --- Semânticos financeiros --- */
  --green-600: #14804A;
  --green-500: #1C9957;
  --green-50:  #E7F6EE;

  --red-600: #C22E27;
  --red-500: #D8443C;
  --red-50:  #FBEAE9;

  --amber-700: #92600A;
  --amber-500: #C4870F;
  --amber-50:  #FBF1DF;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(18, 20, 26, 0.06), 0 1px 1px rgba(18, 20, 26, 0.04);
  --shadow-md: 0 6px 20px rgba(18, 20, 26, 0.08);
  --shadow-lg: 0 16px 40px rgba(18, 20, 26, 0.14);

  --font-display: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --nav-w: 224px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink-900);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body { font-size: 15px; line-height: 1.5; }

h1, h2, h3, .num {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

::selection { background: var(--blue-100); }

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

/* =========================================================================
   Layout raiz
   ========================================================================= */

#app {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar (desktop) --- */
.sidebar {
  width: var(--nav-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--ink-100);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
}

.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(155deg, var(--blue-600), var(--blue-700));
  display: flex; align-items: center; justify-content: center;
  color: white; font-family: var(--font-display); font-weight: 800; font-size: 15px;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-family: var(--font-display); font-size: 14.5px; font-weight: 800; }
.brand-text span { font-size: 11.5px; color: var(--ink-500); }

.nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-500);
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

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

.nav-item:hover { background: var(--ink-100); color: var(--ink-900); }

.nav-item.active {
  background: var(--blue-50);
  color: var(--blue-700);
}

.sidebar-foot {
  font-size: 11.5px;
  color: var(--ink-300);
  padding: 10px 12px 2px;
}

/* --- Main --- */
.main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 100px;
  max-width: 1180px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.greeting h1 { font-size: 22px; margin: 0 0 10px; color: var(--ink-900); }

.month-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.month-picker button.arrow {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 999px;
  color: var(--ink-500);
}
.month-picker button.arrow:hover { background: var(--ink-100); color: var(--ink-900); }

.month-picker .label {
  font-weight: 700;
  font-size: 13.5px;
  padding: 0 6px;
  min-width: 118px;
  text-align: center;
  text-transform: capitalize;
}

.btn-today {
  border: 1px solid var(--ink-150);
  background: var(--white);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
}
.btn-today:hover { border-color: var(--blue-500); color: var(--blue-600); }

.quick-actions { display: flex; gap: 10px; }

.btn-entrada, .btn-saida {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.btn-entrada { background: var(--green-600); color: white; }
.btn-entrada:hover { background: var(--green-500); }

.btn-saida { background: var(--red-600); color: white; }
.btn-saida:hover { background: var(--red-500); }

/* =========================================================================
   Cards & KPIs
   ========================================================================= */

.card {
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.kpi-hero {
  padding: 24px 26px;
  margin-bottom: 14px;
  background: linear-gradient(155deg, var(--blue-700), var(--blue-600));
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.kpi-hero::after {
  content: "";
  position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.kpi-hero .kpi-label { color: rgba(255,255,255,0.75); font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
.kpi-hero .kpi-value { font-size: 40px; margin-top: 6px; color: white; }
.kpi-hero .kpi-sub { color: rgba(255,255,255,0.65); font-size: 12.5px; margin-top: 8px; display: flex; align-items: center; gap: 6px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.kpi-card { padding: 16px 18px; }
.kpi-card .kpi-label { font-size: 12.5px; color: var(--ink-500); font-weight: 700; }
.kpi-card .kpi-value { font-size: 20px; margin-top: 8px; }
.kpi-card .kpi-value.positive { color: var(--green-600); }
.kpi-card .kpi-value.negative { color: var(--red-600); }
.kpi-card .kpi-value.neutral-amber { color: var(--amber-700); }

.section-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 4px;
}
.card-head h3 { font-size: 15px; margin: 0; }
.card-body { padding: 8px 20px 20px; }

.pill-toggle {
  display: inline-flex;
  background: var(--ink-100);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.pill-toggle button {
  border: none; background: none; padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--ink-500);
}
.pill-toggle button.active { background: var(--white); color: var(--ink-900); box-shadow: var(--shadow-sm); }

.link-more { font-size: 13px; font-weight: 700; color: var(--blue-600); }
.link-more:hover { text-decoration: underline; }

/* --- Movimentações recentes --- */
.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ink-100);
}
.tx-row:last-child { border-bottom: none; }

.tx-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 15px; font-weight: 800;
}
.tx-icon.in { background: var(--green-50); color: var(--green-600); }
.tx-icon.out { background: var(--red-50); color: var(--red-600); }

.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-size: 13.5px; font-weight: 700; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { font-size: 12px; color: var(--ink-500); margin-top: 1px; }

.tx-value { font-family: var(--font-display); font-weight: 800; font-size: 14.5px; white-space: nowrap; }
.tx-value.in { color: var(--green-600); }
.tx-value.out { color: var(--red-600); }

.status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  margin-left: 6px;
}
.status-chip.recebido, .status-chip.pago { background: var(--green-50); color: var(--green-600); }
.status-chip.a_receber, .status-chip.a_pagar { background: var(--amber-50); color: var(--amber-700); }
.status-chip.atrasado { background: var(--red-50); color: var(--red-600); }

/* --- Próximos compromissos --- */
.compromisso-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--ink-100); font-size: 13.5px; }
.compromisso-line:last-child { border-bottom: none; }
.compromisso-line span:first-child { color: var(--ink-500); }
.compromisso-line b { font-family: var(--font-display); }

.alert-box {
  margin-top: 12px;
  background: var(--red-50);
  color: var(--red-600);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

/* =========================================================================
   Gráfico (SVG simples, sem dependências)
   ========================================================================= */

.chart-wrap { width: 100%; overflow: hidden; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-500); margin-bottom: 6px; }
.chart-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* =========================================================================
   Movimentações (tabela / cartões)
   ========================================================================= */

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--ink-150);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  background: var(--white);
}

.filter-chip-group { display: inline-flex; background: var(--ink-100); border-radius: 999px; padding: 3px; }
.filter-chip-group button { border: none; background: none; padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--ink-500); }
.filter-chip-group button.active { background: var(--white); color: var(--ink-900); box-shadow: var(--shadow-sm); }

.select-sm, select.select-sm {
  border: 1px solid var(--ink-150);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12.5px;
  background: var(--white);
  color: var(--ink-700);
  font-weight: 600;
}

.btn-ghost {
  border: 1px solid var(--ink-150);
  background: var(--white);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-700);
}
.btn-ghost:hover { border-color: var(--blue-500); color: var(--blue-600); }

details.more-filters { margin-bottom: 4px; }
details.more-filters summary { list-style: none; cursor: pointer; }
details.more-filters summary::-webkit-details-marker { display: none; }
.more-filters-body { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 0 2px; }

.tx-table { width: 100%; border-collapse: collapse; }
.tx-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--ink-300); font-weight: 700; padding: 0 10px 10px;
  border-bottom: 1px solid var(--ink-100);
}
.tx-table td { padding: 12px 10px; border-bottom: 1px solid var(--ink-100); font-size: 13.5px; vertical-align: middle; }
.tx-table tr:last-child td { border-bottom: none; }
.tx-table tr:hover td { background: var(--surface); }

.tx-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .1s; }
.tx-table tr:hover .tx-actions { opacity: 1; }
.icon-btn {
  width: 28px; height: 28px; border: none; background: var(--ink-100); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--ink-500);
}
.icon-btn:hover { background: var(--blue-100); color: var(--blue-700); }
.icon-btn.danger:hover { background: var(--red-50); color: var(--red-600); }

.tx-card-list { display: none; flex-direction: column; gap: 10px; }
.tx-card {
  background: var(--white); border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  padding: 13px 14px; box-shadow: var(--shadow-sm);
}
.tx-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tx-card-desc { font-weight: 700; font-size: 14px; }
.tx-card-meta { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.tx-card-value { font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.tx-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

.empty-state { text-align: center; padding: 46px 20px; color: var(--ink-500); }
.empty-state .icon { font-size: 30px; margin-bottom: 8px; }

/* =========================================================================
   DRE
   ========================================================================= */

.dre-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.dre-summary .kpi-card .kpi-value { font-size: 18px; }

.dre-line {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 4px; border-bottom: 1px solid var(--ink-100); cursor: default;
}
.dre-line.subtract .dre-line-label { color: var(--ink-500); }
.dre-line.subtract .dre-line-value { color: var(--red-600); }
.dre-line.total { font-weight: 800; }
.dre-line.total .dre-line-value { font-family: var(--font-display); }
.dre-line.grand-total { background: var(--blue-50); border-radius: var(--radius-sm); padding: 14px 12px; border-bottom: none; margin: 4px 0; }
.dre-line.expandable { cursor: pointer; }
.dre-line.expandable:hover { background: var(--surface); border-radius: 8px; }
.dre-line-label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.dre-line-value { font-weight: 700; font-size: 14px; }
.dre-caret { font-size: 10px; color: var(--ink-300); transition: transform .12s; }
.dre-caret.open { transform: rotate(90deg); }

.dre-detail { padding: 2px 4px 10px 20px; display: none; }
.dre-detail.open { display: block; }
.dre-detail-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-500); padding: 5px 0; }

/* =========================================================================
   Configurações
   ========================================================================= */

.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.settings-tile {
  padding: 18px; cursor: pointer;
}
.settings-tile:hover { border-color: var(--blue-500); }
.settings-tile .tile-icon { font-size: 20px; margin-bottom: 8px; }
.settings-tile h4 { font-size: 14px; margin: 0 0 4px; }
.settings-tile p { font-size: 12.5px; color: var(--ink-500); margin: 0; }

.registry-list { display: flex; flex-direction: column; }
.registry-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 4px; border-bottom: 1px solid var(--ink-100); font-size: 13.5px;
}
.registry-row:last-child { border-bottom: none; }
.registry-row .badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--ink-100); color: var(--ink-500); font-weight: 700; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-700); margin-bottom: 6px; }
.form-row input[type=text], .form-row input[type=number], .form-row input[type=date],
.form-row select, .form-row textarea {
  width: 100%; border: 1px solid var(--ink-150); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; font-family: inherit; background: var(--white); color: var(--ink-900);
}
.form-row textarea { resize: vertical; min-height: 60px; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.value-input { position: relative; }
.value-input .prefix { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-500); font-weight: 700; font-size: 14px; }
.value-input input { padding-left: 34px !important; font-family: var(--font-display); font-weight: 700; font-size: 17px !important; }

.status-toggle { display: flex; gap: 8px; }
.status-toggle button {
  flex: 1; border: 1px solid var(--ink-150); background: var(--white); border-radius: var(--radius-sm);
  padding: 10px; font-weight: 700; font-size: 13px; color: var(--ink-700);
}
.status-toggle button.active.in { border-color: var(--green-600); background: var(--green-50); color: var(--green-600); }
.status-toggle button.active.out { border-color: var(--red-600); background: var(--red-50); color: var(--red-600); }

.link-toggle { background: none; border: none; color: var(--blue-600); font-weight: 700; font-size: 13px; padding: 4px 0; }
.link-toggle:hover { text-decoration: underline; }

.extra-fields { display: none; padding-top: 6px; border-top: 1px dashed var(--ink-150); margin-top: 4px; }
.extra-fields.open { display: block; }

/* =========================================================================
   Modais / Drawers
   ========================================================================= */

.overlay {
  position: fixed; inset: 0; background: rgba(15, 18, 26, 0.42);
  display: none; align-items: center; justify-content: center; z-index: 60;
  padding: 20px;
}
.overlay.open { display: flex; }

.modal {
  background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 460px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modal.wide { max-width: 640px; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--ink-100);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: var(--ink-100); width: 30px; height: 30px; border-radius: 50%; color: var(--ink-500); font-size: 15px; }
.modal-close:hover { background: var(--ink-150); }

.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--ink-100); display: flex; justify-content: flex-end; gap: 10px; }

.btn-primary {
  border: none; background: var(--blue-600); color: white; border-radius: 999px;
  padding: 11px 20px; font-weight: 700; font-size: 14px;
}
.btn-primary:hover { background: var(--blue-700); }
.btn-primary.green { background: var(--green-600); }
.btn-primary.green:hover { background: var(--green-500); }
.btn-primary.red { background: var(--red-600); }
.btn-primary.red:hover { background: var(--red-500); }

.btn-secondary {
  border: 1px solid var(--ink-150); background: var(--white); color: var(--ink-700); border-radius: 999px;
  padding: 11px 18px; font-weight: 700; font-size: 14px;
}
.btn-secondary:hover { border-color: var(--ink-300); }

.toast-area { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink-900); color: white; padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toast-in .15s ease-out;
}
.toast.error { background: var(--red-600); }
.toast.success { background: var(--green-600); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Bater caixa */
.bater-caixa-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--ink-100); }
.bater-caixa-row:last-child { border-bottom: none; }
.bater-caixa-result { text-align: center; padding: 18px; border-radius: var(--radius-md); margin-top: 6px; }
.bater-caixa-result.ok { background: var(--green-50); color: var(--green-600); }
.bater-caixa-result.diff { background: var(--amber-50); color: var(--amber-700); }

/* =========================================================================
   Tutorial guiado
   ========================================================================= */

.tour-overlay {
  position: fixed; inset: 0; z-index: 200;
  pointer-events: none;
}

.tour-spotlight {
  position: fixed;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(15, 18, 26, 0.62);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
  pointer-events: none;
}

.tour-tooltip {
  position: fixed;
  z-index: 201;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 18px 20px;
  pointer-events: auto;
  transition: top .25s ease, left .25s ease;
}

.tour-progress {
  display: flex; gap: 5px; margin-bottom: 12px;
}
.tour-progress span {
  height: 4px; flex: 1; background: var(--ink-100); border-radius: 999px;
}
.tour-progress span.done { background: var(--blue-600); }

.tour-tooltip h4 { font-size: 15.5px; margin: 0 0 6px; }
.tour-tooltip p { font-size: 13.5px; color: var(--ink-500); margin: 0; line-height: 1.5; }

.tour-actions {
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
}
.tour-actions .btn-primary, .tour-actions .btn-secondary { padding: 8px 16px; font-size: 13px; }

.tour-link {
  border: none; background: none; color: var(--ink-300); font-size: 12.5px; font-weight: 600; padding: 6px 0;
}
.tour-link:hover { color: var(--ink-500); text-decoration: underline; }

@media (max-width: 680px) {
  .tour-tooltip {
    left: 16px !important; right: 16px; width: auto;
    top: auto !important; bottom: 16px !important;
  }
  .tour-spotlight { box-shadow: 0 0 0 9999px rgba(15, 18, 26, 0.68); }
}

/* =========================================================================
   Mobile
   ========================================================================= */

.bottom-nav { display: none; }

@media (max-width: 880px) {
  .sidebar { display: none; }
  .main { padding: 18px 16px 96px; max-width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .section-row { grid-template-columns: 1fr; }
  .dre-summary { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { display: none; }
  .topbar { flex-direction: column; }

  .tx-table { display: none; }
  .tx-card-list { display: flex; }

  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--white); border-top: 1px solid var(--ink-100);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 50;
    justify-content: space-around;
  }
  .bottom-nav button {
    border: none; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--ink-300); font-size: 10.5px; font-weight: 700; padding: 4px 8px; flex: 1;
  }
  .bottom-nav button svg { width: 21px; height: 21px; }
  .bottom-nav button.active { color: var(--blue-600); }

  .fab-row {
    position: fixed; left: 16px; right: 16px; bottom: 68px; z-index: 55;
    display: flex; gap: 10px;
  }
  .fab-row button { flex: 1; justify-content: center; padding: 13px; font-size: 14.5px; }
}

@media (min-width: 881px) {
  .fab-row { display: none; }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dre-summary { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .form-row.two-col { grid-template-columns: 1fr; }
  .kpi-hero .kpi-value { font-size: 32px; }
}
