:root {
  --green-50: #ECFAF2;
  --green-100: #CFF1DF;
  --green-200: #A2E4C2;
  --green-300: #66D09E;
  --green-400: #2FB57C;
  --green-500: #129563;
  --green-600: #0C7B52;
  --green-700: #0A6143;
  --green-800: #094E37;
  --green-900: #073D2C;
  --tangerine-50: #FEF2EC;
  --tangerine-500: #E2531F;
  --tangerine-600: #C44017;
  --slate-0: #FFFFFF;
  --slate-50: #F6F7F8;
  --slate-100: #EDEFF1;
  --slate-200: #DEE2E6;
  --slate-300: #C7CDD3;
  --slate-400: #9BA4AD;
  --slate-500: #6E7882;
  --slate-600: #515A63;
  --slate-700: #3C434B;
  --slate-800: #272C32;
  --slate-900: #171B1F;
  --red-50: #FDECEE;
  --red-600: #BE1F30;
  --red-700: #971826;
  --amber-50: #FDF3E3;
  --amber-600: #C2780A;
  --amber-700: #945C09;
  --blue-50: #EAF1FE;
  --blue-600: #1D4FD0;
  --brand: var(--green-600);
  --brand-hover: var(--green-700);
  --brand-subtle: var(--green-50);
  --accent: var(--tangerine-500);
  --accent-hover: var(--tangerine-600);
  --accent-subtle: var(--tangerine-50);
  --surface-app: var(--slate-50);
  --surface-card: var(--slate-0);
  --surface-sunken: var(--slate-100);
  --text-strong: var(--slate-900);
  --text-body: var(--slate-700);
  --text-muted: var(--slate-500);
  --text-faint: var(--slate-400);
  --border-subtle: var(--slate-200);
  --border-default: var(--slate-300);
  --ring: color-mix(in srgb, var(--green-600) 35%, transparent);
  --success: var(--green-600);
  --success-subtle: var(--green-50);
  --danger: var(--red-600);
  --danger-text: var(--red-700);
  --danger-subtle: var(--red-50);
  --warning: var(--amber-600);
  --warning-text: var(--amber-700);
  --warning-subtle: var(--amber-50);
  --info: var(--blue-600);
  --info-subtle: var(--blue-50);
  --mov-entrada: var(--green-600);
  --mov-venda: var(--blue-600);
  --mov-transfer: var(--tangerine-500);
  --mov-perda: var(--red-600);
  --font-sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --shadow-sm: 0 1px 2px rgba(11, 14, 16, 0.06), 0 2px 4px rgba(11, 14, 16, 0.04);
  --shadow-md: 0 2px 4px rgba(11, 14, 16, 0.05), 0 6px 12px rgba(11, 14, 16, 0.07);
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-app);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--green-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--text-strong);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

svg {
  display: block;
}

.mono,
[data-num] {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1, 'lnum' 1, 'zero' 1;
  font-variant-numeric: tabular-nums;
}

.app-loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.loader {
  display: grid;
  gap: 14px;
  justify-items: center;
  color: var(--text-muted);
  font-weight: 700;
}

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.brand-mark span {
  display: block;
  width: 34px;
  height: 9px;
  border-radius: 4px;
}

.brand-mark span:nth-child(1) { background: var(--green-200); }
.brand-mark span:nth-child(2) { background: var(--green-500); }
.brand-mark span:nth-child(3) { background: var(--green-800); }

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-height: 100vh;
  padding: 44px;
  background: linear-gradient(160deg, var(--green-700), var(--green-900));
  color: var(--slate-0);
}

.auth-brand .brand-mark span:nth-child(3) {
  background: var(--slate-0);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-copy {
  max-width: 460px;
}

.auth-copy h1 {
  color: var(--slate-0);
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800;
}

.auth-copy p {
  margin-top: 14px;
  max-width: 420px;
  color: var(--green-100);
  font-size: 16px;
}

.auth-points {
  display: grid;
  gap: 10px;
  max-width: 430px;
}

.auth-point {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green-100);
  font-size: 14px;
}

.auth-point i {
  color: var(--green-200);
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(100%, 430px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--surface-card);
  box-shadow: var(--shadow-md);
  padding: 28px;
}

.auth-card h2 {
  font-size: 24px;
  font-weight: 800;
}

.auth-card p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
}

.form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-strong);
  outline: none;
  padding: 10px 12px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}

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

.error-box,
.notice-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border-radius: var(--radius-md);
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 600;
}

.error-box {
  border: 1px solid color-mix(in srgb, var(--danger) 25%, white);
  background: var(--danger-subtle);
  color: var(--danger-text);
}

.notice-box {
  border: 1px solid color-mix(in srgb, var(--brand) 20%, white);
  background: var(--brand-subtle);
  color: var(--green-800);
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  transition: background 180ms var(--ease-out), border 180ms var(--ease-out), color 180ms var(--ease-out), transform 120ms var(--ease-out);
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

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

.btn-primary {
  background: var(--brand);
  color: var(--slate-0);
}

.btn-primary:hover {
  background: var(--brand-hover);
  text-decoration: none;
}

.btn-secondary {
  border-color: var(--border-default);
  background: var(--surface-card);
  color: var(--text-strong);
}

.btn-secondary:hover {
  background: var(--slate-50);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-body);
}

.btn-ghost:hover {
  background: var(--slate-100);
  text-decoration: none;
}

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

.btn-icon {
  background: none;
  border: none;
  padding: 4px 5px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.75;
  transition: opacity .15s, background .15s;
}
.btn-icon:hover {
  opacity: 1;
  background: var(--slate-100);
}

.btn-block {
  width: 100%;
}

.shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 256px 1fr;
  isolation: isolate;
  position: relative;
  z-index: 0;
}

.sidebar {
  display: flex;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  background: var(--surface-card);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 14px;
  color: var(--text-strong);
  font-size: 22px;
  font-weight: 800;
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 16px;
}

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

.nav-section-label {
  padding: 0 10px 6px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-body);
  padding: 9px 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}

.nav-link i {
  color: var(--text-muted);
}

.nav-link:hover {
  background: var(--slate-50);
}

.nav-link.active {
  background: var(--brand-subtle);
  color: var(--green-800);
}

.nav-link.active i {
  color: var(--brand);
}

.account-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border-subtle);
  padding: 13px 16px;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: var(--slate-0);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
}

.account-meta {
  min-width: 0;
}

.account-meta strong,
.account-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-meta strong {
  color: var(--text-strong);
  font-size: 13px;
}

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

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-card) 92%, transparent);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  font-size: 22px;
  font-weight: 800;
}

.topbar-title p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.content {
  width: min(100%, 1248px);
  margin: 0 auto;
  padding: 24px;
}

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

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.card-pad {
  padding: 18px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 18px;
}

.card-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.card-head p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.stat {
  display: grid;
  gap: 10px;
  min-height: 132px;
  padding: 16px;
}

.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  color: var(--text-strong);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.05;
}

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

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  content: "";
}

.badge-success {
  background: var(--success-subtle);
  color: var(--green-800);
}

.badge-success::before {
  background: var(--success);
}

.badge-warning {
  background: var(--warning-subtle);
  color: var(--warning-text);
}

.badge-warning::before {
  background: var(--warning);
}

.badge-danger {
  background: var(--danger-subtle);
  color: var(--danger-text);
}

.badge-danger::before {
  background: var(--danger);
}

.badge-info {
  background: var(--info-subtle);
  color: var(--blue-600);
}

.badge-info::before {
  background: var(--info);
}

.badge-neutral {
  background: var(--slate-100);
  color: var(--slate-700);
}

.badge-neutral::before {
  background: var(--slate-400);
}

.chart-list {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.chart-row {
  display: grid;
  gap: 7px;
}

.chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
}

.bar-track {
  height: 18px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-sunken);
}

.bar-total,
.bar-value {
  height: 100%;
  border-radius: 6px;
}

.bar-total {
  background: var(--green-100);
}

.bar-value {
  background: var(--brand);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  max-height: 70vh;
  overflow-y: auto;
}
.table-wrap th {
  position: sticky;
  top: 0;
  background: var(--surface-card, #fff);
  z-index: 2;
}

.table-wrap-compact {
  overflow-x: visible;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.table-compact {
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: var(--text-body);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.td-strong {
  color: var(--text-strong);
  font-weight: 800;
}

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

.row-actions-end {
  justify-content: flex-end;
}

.cell-actions {
  width: 220px;
  text-align: right;
  white-space: nowrap;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

/* Dialog nativo: renderiza na top layer, imune a stacking context. */
.rev-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(600px, 90vw);
  max-width: 600px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  color: var(--text-strong, #1a1a1a);
}
.rev-dialog::backdrop {
  background: rgba(0,0,0,0.5);
}
.rev-dialog .modal-body select,
.rev-dialog .modal-body input {
  min-height: 38px;
  border: 1px solid var(--border-default, #d4d4d4);
  border-radius: var(--radius-md, 8px);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text-strong, #1a1a1a);
  outline: none;
  box-sizing: border-box;
}
.rev-dialog .modal-body input:focus {
  border-color: var(--brand, #0C7B52);
  box-shadow: 0 0 0 3px var(--ring, rgba(12,123,82,0.15));
}
.modal {
  position: relative;
  z-index: 100000;
  background: #fff;
  border-radius: 12px;
  padding: 0;
  width: min(420px, 90vw);
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-subtle, #eee);
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.modal-close {
  flex: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted, #6e7882);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover {
  background: var(--surface-sunken, #f1f3f5);
  color: var(--text-strong, #1a1a1a);
}
.modal-body {
  padding: 16px 20px 20px;
}
.modal-body select,
.modal-body input {
  min-height: 38px;
  border: 1px solid var(--border-default, #d4d4d4);
  border-radius: var(--radius-md, 8px);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface-card, #fff);
  color: var(--text-strong, #1a1a1a);
  outline: none;
  box-sizing: border-box;
}
.modal-body select:focus,
.modal-body input:focus {
  border-color: var(--brand, #0C7B52);
  box-shadow: 0 0 0 3px var(--ring, rgba(12,123,82,0.15));
}

.segmented {
  display: flex;
  border: 1px solid var(--border-default, #d4d4d4);
  border-radius: 8px;
  overflow: hidden;
}
.seg-btn {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: var(--surface-card, #fff);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted, #666);
  border-right: 1px solid var(--border-default, #d4d4d4);
  transition: background 0.15s, color 0.15s;
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: var(--green-50, #ecfaf2); }
.seg-btn.active {
  background: var(--green-600, #0C7B52);
  color: #fff;
}

.embalagem-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.embalagem-row .emb-nome {
  width: 110px;
  min-height: 38px;
  border: 1px solid var(--border-default, #d4d4d4);
  border-radius: var(--radius-md, 8px);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface-card, #fff);
  color: var(--text-strong, #1a1a1a);
}
.embalagem-row .emb-fator {
  min-height: 38px;
  border: 1px solid var(--border-default, #d4d4d4);
  border-radius: var(--radius-md, 8px);
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  background: var(--surface-card, #fff);
  color: var(--text-strong, #1a1a1a);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.embalagem-row .emb-nome:focus,
.embalagem-row .emb-fator:focus {
  border-color: var(--brand, #0C7B52);
  box-shadow: 0 0 0 3px var(--ring, rgba(12,123,82,0.15));
}
.emb-order {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.emb-order button {
  border: 1px solid var(--border-default, #d4d4d4);
  background: var(--surface-card, #fff);
  cursor: pointer;
  padding: 1px 4px;
  line-height: 1;
  color: var(--text-muted, #666);
  display: flex;
  align-items: center;
}
.emb-order button:first-child { border-radius: 6px 6px 0 0; border-bottom: none; }
.emb-order button:last-child { border-radius: 0 0 6px 6px; }
.emb-order button:hover { background: var(--green-50, #ecfaf2); color: var(--green-600, #0C7B52); }

.input-suffix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-suffix-wrap input {
  flex: 1;
  padding-right: 40px;
}
.input-suffix {
  position: absolute;
  right: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted, #888);
  pointer-events: none;
}

.inline-edit-input {
  min-height: 38px;
  width: min(100%, 320px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-strong);
  outline: none;
  padding: 8px 10px;
  font-weight: 700;
}

.inline-edit-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}

.inline-edit-select {
  min-height: 38px;
  width: 100%;
  max-width: 180px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-strong);
  outline: none;
  padding: 8px 10px;
  background: var(--surface-card, #fff);
  font-family: inherit;
  font-size: 14px;
}
.inline-edit-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 16px 18px;
}

.toolbar .field {
  min-width: 220px;
}

.empty {
  display: grid;
  min-height: 170px;
  place-items: center;
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
}

.empty strong {
  display: block;
  color: var(--text-strong);
  margin-bottom: 4px;
}

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

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.line-items {
  display: grid;
  gap: 10px;
}

.line-item {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.7fr auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.summary-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.summary-row span:first-child {
  color: var(--text-muted);
  font-size: 13px;
}

.summary-row strong {
  color: var(--text-strong);
}

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

.toast {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 20;
  display: flex;
  max-width: min(420px, calc(100vw - 36px));
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-md);
  padding: 13px 14px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.toast.success i {
  color: var(--success);
}

.toast.error i {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: auto;
    padding: 26px 20px;
  }

  .auth-copy h1 {
    font-size: 34px;
  }

  .auth-points {
    display: none;
  }

  .auth-panel {
    padding: 20px;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 8;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sidebar-brand {
    padding: 14px 16px 8px;
  }

  .nav-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 12px 12px;
  }

  .nav-section {
    display: flex;
    gap: 8px;
    margin: 0;
  }

  .nav-section-label,
  .account-box {
    display: none;
  }

  .nav-link {
    width: auto;
    flex: none;
    white-space: nowrap;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    padding: 16px;
  }

  .content {
    padding: 16px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .line-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions .btn {
    flex: 1;
  }

  .card-head,
  .toolbar,
  .card-pad,
  .summary-list,
  .chart-list {
    padding-left: 14px;
    padding-right: 14px;
  }
}
