:root {
  color-scheme: light;
  --tx-lime: #ccff00;
  --tx-lime-soft: #efffb8;
  --tx-lime-muted: #f6ffd8;
  --tx-bg: #f5f7f8;
  --tx-surface: #ffffff;
  --tx-surface-muted: #f8fafb;
  --tx-dark: #071426;
  --tx-dark-2: #0d1b2e;
  --tx-dark-3: #111d2e;
  --tx-text: #111827;
  --tx-text-muted: #64748b;
  --tx-border: #e3e8ec;
  --tx-success: #16a34a;
  --tx-info: #2563eb;
  --tx-warning: #d97706;
  --tx-high: #ea580c;
  --tx-danger: #dc2626;
  --tx-neutral: #6b7280;
  --tx-radius-control: 10px;
  --tx-radius-card: 16px;
  --tx-radius-panel: 18px;
  --tx-sidebar-width: 284px;
  --tx-sidebar-collapsed: 84px;
  --tx-z-sidebar: 18;
  --tx-z-overlay: 17;
  --tx-z-popover: 25;
  --ink: var(--tx-text);
  --muted: var(--tx-text-muted);
  --line: var(--tx-border);
  --paper: var(--tx-bg);
  --surface: var(--tx-surface);
  --brand: #0f172a;
  --brand-accent: var(--tx-lime);
  --brand-dark: var(--tx-dark);
  --warn: var(--tx-warning);
  --danger: var(--tx-danger);
  --blue: var(--tx-info);
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
  --elevated-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
  overflow-x: hidden;
}

body.mobile-nav-open {
  overflow: hidden;
}

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

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--tx-sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
  width: 100%;
  max-width: 100vw;
}

.shell.sidebar-collapsed {
  grid-template-columns: var(--tx-sidebar-collapsed) minmax(0, 1fr);
}

.sidebar {
  background:
    radial-gradient(circle at 50% -20%, rgba(204, 255, 0, 0.18), transparent 34%),
    linear-gradient(180deg, var(--tx-dark) 0%, #03101f 100%);
  color: white;
  padding: 22px 16px;
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--tx-sidebar-width);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: var(--tx-z-sidebar);
  box-shadow: 16px 0 44px rgba(7, 20, 38, 0.12);
  overflow: hidden;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  margin-bottom: 6px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--tx-lime);
  color: #071426;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 12px 28px rgba(204, 255, 0, 0.18);
}

.brand-copy {
  min-width: 0;
}

.brand small {
  display: block;
  color: #9caec2;
  font-weight: 680;
}

.brand strong {
  letter-spacing: -0.02em;
}

.nav {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group-footer {
  margin-top: 10px;
}

.nav-group-label {
  padding: 0 12px 4px;
  color: #8498ad;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #d7e0eb;
  text-align: left;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  font-weight: 760;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-item.active {
  background: var(--tx-lime);
  color: #071426;
  box-shadow: 0 14px 30px rgba(204, 255, 0, 0.2);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 5px;
  width: 4px;
  height: 20px;
  border-radius: 999px;
  background: #071426;
}

.nav-icon,
.shell-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
}

.nav-icon svg,
.shell-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.nav-icon svg path,
.shell-icon svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-collapse {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d7e0eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.sidebar-user-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(204, 255, 0, 0.45);
  color: var(--tx-lime);
  font-weight: 950;
}

.sidebar-user-copy {
  min-width: 0;
}

.sidebar-user-copy strong,
.sidebar-user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy strong {
  color: white;
  font-size: 0.84rem;
}

.sidebar-user-copy small {
  color: #9caec2;
  font-size: 0.76rem;
}

.shell.sidebar-collapsed .sidebar {
  padding-inline: 14px;
  width: var(--tx-sidebar-collapsed);
}

.shell.sidebar-collapsed .brand-copy,
.shell.sidebar-collapsed .nav-group-label,
.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .sidebar-user-copy {
  display: none;
}

.shell.sidebar-collapsed .brand,
.shell.sidebar-collapsed .nav-item,
.shell.sidebar-collapsed .sidebar-user {
  justify-content: center;
}

.shell.sidebar-collapsed .nav-item {
  padding: 0;
}

.shell.sidebar-collapsed .sidebar-collapse .shell-icon {
  transform: rotate(180deg);
}

.main {
  grid-column: 2;
  padding: 28px 32px 36px;
  min-width: 0;
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  margin-bottom: 24px;
  position: relative;
  z-index: 5;
}

.page-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-heading h1 {
  margin: 0;
}

.page-description {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  font-weight: 800;
}

.storage-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.85rem, 3vw, 2.35rem); letter-spacing: -0.035em; }
h2 { font-size: 1.12rem; margin-bottom: 14px; letter-spacing: -0.02em; }
h3 { font-size: 1rem; margin-bottom: 8px; }

.top-actions, .actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

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

button.primary, button.secondary, a.secondary, .icon-button {
  border: 1px solid transparent;
  border-radius: var(--tx-radius-control);
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 750;
}

a.secondary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(204, 255, 0, 0.5);
  outline-offset: 2px;
}

button.primary {
  background: var(--tx-lime);
  color: #071426;
  border-color: var(--tx-lime);
}

button.secondary, a.secondary, .icon-button {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 1.1rem;
}

.mobile-menu-button {
  display: none;
}

.top-popover-wrap {
  position: relative;
}

.connection-chip,
.user-menu-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  box-shadow: none;
  font-weight: 760;
}

.connection-chip.error {
  border-color: #f0b4ae;
  color: var(--danger);
}

.connection-chip.online .status-dot {
  background: var(--tx-success);
}

.connection-chip.local .status-dot,
.connection-chip.syncing .status-dot {
  background: var(--tx-lime);
}

.connection-chip.error .status-dot {
  background: var(--tx-danger);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--tx-neutral);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #071426;
  color: var(--tx-lime);
  font-size: 0.72rem;
  font-weight: 900;
}

.top-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 25;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--elevated-shadow);
}

.top-popover p {
  margin: 0;
}

.user-menu {
  width: 260px;
}

.view { display: none; }
.view.active { display: block; }

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--tx-z-overlay);
  background: rgba(7, 20, 38, 0.5);
}

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

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

.stat, .panel, .table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
}

.stat {
  border-radius: var(--tx-radius-card);
  padding: 16px;
}

.stat span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
}

.stat-button {
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.stat-button:hover {
  border-color: var(--tx-lime);
}

.panel {
  border-radius: var(--tx-radius-card);
  padding: 18px;
}

.table-wrap.flush {
  margin-top: 12px;
  box-shadow: none;
}

.alert-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.alert-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.alert-item em {
  margin-left: auto;
  color: var(--brand-dark);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.alert-item.danger {
  border-color: #efb2ac;
  background: #fff8f7;
}

.alert-item.warn {
  border-color: #efcf86;
  background: #fffaf0;
}

.alert-item.info {
  border-color: #b8d0ef;
  background: #f5f9ff;
}

.alert-item.ok {
  border-color: #9ed9b7;
  background: #ecf8f1;
}

.dashboard-page {
  display: grid;
  gap: 20px;
  max-width: 1500px;
  margin: 0 auto;
}

.dashboard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 0;
}

.dashboard-toolbar .form-grid {
  flex: 1;
  margin: 0;
}

.period-card {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-chip {
  min-height: 44px;
  display: grid;
  gap: 4px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.filter-chip label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.filter-chip input {
  min-height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 780;
}

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

.metric-card {
  min-height: 126px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--tx-radius-panel);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.metric-card:hover {
  border-color: rgba(204, 255, 0, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.08);
}

.metric-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--tx-lime);
  color: #071426;
}

.metric-card.dark .metric-icon {
  background: #071426;
  color: white;
}

.metric-icon svg {
  width: 22px;
  height: 22px;
}

.metric-icon svg path {
  stroke-width: 1.9;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  letter-spacing: -0.035em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-context {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.dashboard-priorities {
  padding: 18px;
  border: 1px solid rgba(204, 255, 0, 0.85);
  border-radius: var(--tx-radius-panel);
  background:
    radial-gradient(circle at 12% 12%, rgba(204, 255, 0, 0.18), transparent 28%),
    linear-gradient(90deg, #fbfff0, #ffffff);
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.dashboard-priority-card {
  min-height: 82px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 14px 10px 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.dashboard-priority-card:last-child {
  border-right: 0;
}

.priority-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--tx-lime-muted);
  color: #071426;
  font-weight: 900;
}

.dashboard-priority-card.danger .priority-icon {
  background: #fee2e2;
  color: var(--tx-danger);
}

.dashboard-priority-card.warn .priority-icon {
  background: #fef3c7;
  color: var(--tx-warning);
}

.dashboard-priority-card.info .priority-icon {
  background: #dbeafe;
  color: var(--tx-info);
}

.dashboard-priority-card.ok {
  cursor: default;
}

.dashboard-priority-card h3 {
  margin: 0 0 3px;
  font-size: 0.94rem;
}

.dashboard-priority-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.priority-action {
  color: var(--brand-dark);
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.dashboard-grid.three {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr) minmax(300px, 0.95fr);
}

.dashboard-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--tx-radius-panel);
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.055);
}

.dashboard-card .section-head button {
  white-space: nowrap;
  max-width: 100%;
  min-height: 34px;
  padding-inline: 10px;
  font-size: 0.78rem;
}

.dashboard-card .table-wrap {
  border: 0;
  border-radius: 0;
}

.dashboard-card table {
  min-width: 0;
}

.sales-chart {
  min-height: 244px;
  display: flex;
  align-items: end;
  gap: 7px;
  padding: 18px 4px 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.sales-bar {
  width: 18px;
  min-width: 18px;
  display: grid;
  align-items: end;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.sales-bar i {
  display: block;
  min-height: 4px;
  border-radius: 999px 999px 4px 4px;
  background: #071426;
}

.sales-bar.highlight i {
  background: var(--tx-lime);
}

.chart-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.chart-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
}

.account-list,
.receivable-list,
.bucket-list {
  display: grid;
  gap: 12px;
}

.account-row,
.receivable-row,
.bucket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.account-row:last-child,
.receivable-row:last-child,
.bucket-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.row-title {
  display: block;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.row-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.money-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dashboard-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-weight: 900;
}

.dashboard-total strong {
  white-space: nowrap;
}

.donut-layout {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--tx-lime) 0deg, var(--tx-lime) 360deg);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: white;
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}

.donut-center strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.bucket-color {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
}

.status-badge.income,
.status-badge.ok {
  background: #dcfce7;
  color: #166534;
}

.status-badge.expense,
.status-badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge.transfer,
.status-badge.info {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.warn {
  background: #fef3c7;
  color: #92400e;
}

.empty-state {
  min-height: 116px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .main {
    padding: 24px;
  }
  .dashboard-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid,
  .dashboard-grid.three {
    grid-template-columns: 1fr;
  }
  .donut-layout {
    grid-template-columns: 160px minmax(0, 1fr);
  }
  .donut {
    width: 160px;
    height: 160px;
  }
}

.audit-card-list {
  display: none;
}

.audit-card {
  display: grid;
  gap: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.audit-card small,
.audit-card span {
  color: var(--muted);
}

.audit-detail {
  width: min(840px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.audit-detail-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 14px;
  background: white;
  border-bottom: 1px solid var(--line);
}

.audit-detail-body {
  overflow: auto;
  padding-top: 14px;
}

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

.audit-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfb;
}

.audit-summary span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.audit-summary strong {
  display: block;
  font-size: 0.94rem;
}

.audit-detail-section,
.technical-panel,
.audit-detail-footer {
  margin-top: 16px;
}

.audit-field-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.audit-field-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.audit-field-list span {
  color: var(--muted);
}

.audit-change-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.audit-change-head,
.audit-change-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.audit-change-head {
  background: #f2f7f3;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.audit-change-row:last-child {
  border-bottom: 0;
}

.automation-detail {
  width: min(1160px, calc(100vw - 32px));
  max-height: 92vh;
  overflow: auto;
  padding-bottom: 0;
}

.automation-review-header,
.automation-review-card,
.automation-review-form,
.automation-extra-details,
.automation-technical-details,
.automation-reject-details,
.automation-save-summary {
  margin-top: 12px;
}

.automation-review-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 0;
}

.compact-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button {
  min-width: 36px;
  padding-left: 0;
  padding-right: 0;
}

.automation-review-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--tx-radius-card);
  padding: 16px;
}

.automation-review-card h3 {
  margin: 0 0 12px;
}

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

.automation-support-summary blockquote {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  margin: 12px 0;
  padding: 12px;
  white-space: pre-wrap;
}

.automation-support-file {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding-top: 10px;
}

.automation-support-file span {
  color: var(--muted);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-review-form {
  display: grid;
  gap: 12px;
}

.automation-amount-field input {
  min-height: 56px;
  font-size: 1.55rem;
}

.automation-technical-content {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.automation-technical-details .automation-document-panel {
  margin-top: 0 !important;
}

.automation-reject-inline {
  display: none;
}

.automation-save-summary {
  background: #f7ffe2;
  border: 1px solid var(--tx-lime);
  border-radius: 14px;
  padding: 12px 14px;
}

.automation-save-summary p {
  color: var(--muted);
  margin: 4px 0 0;
}

.automation-action-bar {
  align-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-top: 1px solid var(--line);
  bottom: 0;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 0 -24px;
  padding: 14px 24px;
  position: sticky;
  z-index: 2;
}

.automation-action-bar .primary {
  min-width: 190px;
}

.automation-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.automation-preview {
  align-items: center;
  background: #f8fafb;
  border: 1px dashed var(--line);
  border-radius: 18px;
  display: flex;
  justify-content: center;
  min-height: 320px;
  overflow: hidden;
  padding: 16px;
}

.automation-preview img {
  border-radius: 12px;
  max-height: 520px;
  max-width: 100%;
  object-fit: contain;
}

.automation-detail .soft {
  box-shadow: none;
}

.automation-original-text {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-family: inherit;
  margin: 12px 0 0;
  max-height: 180px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.automation-proposal-meta {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.automation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.automation-tags span {
  background: var(--tx-surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 9px;
}

.automation-document-panel .audit-field-list {
  margin-top: 12px;
}

.automation-comparison {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.automation-comparison-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 0.75fr repeat(3, minmax(0, 1fr));
  padding: 10px 12px;
}

.automation-comparison-row + .automation-comparison-row {
  border-top: 1px solid var(--line);
}

.automation-comparison-head {
  background: #f2f7f3;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.automation-candidates {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.automation-candidate {
  align-items: flex-start;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}

.automation-candidate.selected {
  border-color: var(--tx-lime);
}

.automation-candidate span {
  display: grid;
  gap: 3px;
}

.automation-candidate small,
.automation-candidate em {
  color: var(--muted);
  font-style: normal;
}

.automation-apply-fields {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.automation-checkbox-grid {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 14px;
}

.automation-checkbox-grid label {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-weight: 750;
  gap: 8px;
}

.ocr-progress {
  align-items: center;
  background: #f2f7f3;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 12px;
}

.ocr-progress span,
.ocr-progress small {
  color: var(--muted);
  font-weight: 800;
}

.panel.ok {
  border-color: #9bd9b5;
}

.panel.danger {
  border-color: #f0b4ae;
}

details.panel summary {
  cursor: pointer;
  font-weight: 800;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.auth-email {
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(247, 250, 246, 0.94);
}

body.auth-required .shell {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.channel-panel {
  box-shadow: none;
}

.entry-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.entry-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.subtotal {
  display: block;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  border-radius: 8px;
  overflow: auto;
}

.table-wrap > h2 {
  margin: 0 0 8px;
  padding: 18px 18px 12px;
}

.table-wrap > h2 + table {
  border-top: 1px solid var(--line);
}

.table-wrap > .hint,
.table-wrap > .grid {
  margin-left: 18px;
  margin-right: 18px;
}

.balance-detail-panel > h2 {
  padding-bottom: 4px;
}

.balance-detail-panel .hint {
  margin-top: 4px;
  margin-bottom: 16px;
}

.balance-detail-stats {
  margin-top: 0;
  margin-bottom: 16px;
}

.balance-detail-panel table {
  margin-top: 2px;
}

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

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

table.compact-table th,
table.compact-table td {
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: middle;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.row-actions .small {
  min-height: 28px;
  padding: 0 8px;
}

th {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
}

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

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

.field label {
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--muted);
}

.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 10px;
  min-width: 0;
}

.field textarea { min-height: 76px; resize: vertical; }
.wide { grid-column: 1 / -1; }

.movement-entry-shell {
  display: grid;
  gap: 20px;
  margin: 0 auto;
  max-width: 1380px;
  width: 100%;
}

.movement-entry-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.85fr);
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.movement-form-layout {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.movement-form-section,
.movement-summary-card,
.movement-support-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--tx-radius-card);
  padding: 22px;
}

.movement-form-section {
  display: grid;
  gap: 18px;
}

.movement-entry-form-card {
  min-width: 0;
}

.movement-form-section h3,
.movement-summary-card h3,
.movement-support-card h3 {
  margin: 0;
}

.movement-two-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(150px, 0.75fr);
  gap: 12px;
}

.movement-field-grid {
  display: grid;
  gap: 16px 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.concept-search-group {
  display: grid;
  gap: 8px;
}

.concept-search-group .hint {
  margin: 0;
}

.inline-create-panel {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fbfdfc;
}

.money-field input {
  min-height: 52px;
  font-size: 1.4rem;
  font-weight: 850;
  color: var(--ink);
}

.movement-value-field input {
  font-size: 1.55rem;
  min-height: 58px;
}

.money-field small,
.suggestion-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.suggestion-hint {
  display: inline-flex;
  margin-left: 4px;
  color: var(--brand-dark);
}

.movement-support-card {
  max-width: 100%;
}

.movement-support-preview {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  min-height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fbfdfc;
}

.movement-support-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.support-preview-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.support-preview-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.support-preview-heading strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.support-preview-frame {
  align-items: center;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  min-height: 180px;
  overflow: hidden;
  place-items: center;
}

.support-preview-frame img,
.support-preview-frame iframe {
  border: 0;
  display: block;
  width: 100%;
}

.support-preview-frame img {
  max-height: 300px;
  object-fit: contain;
}

.support-preview-frame iframe {
  height: 320px;
}

.support-preview-block.compact .support-preview-frame {
  min-height: 150px;
}

.support-preview-block.compact .support-preview-frame img {
  max-height: 240px;
}

.support-preview-block.compact .support-preview-frame iframe {
  height: 260px;
}

.support-preview-empty {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.automation-inline-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.automation-supplier-field .hint,
.automation-supplier-field .danger-text {
  margin-top: 4px;
}

.telegram-message-preview {
  white-space: pre-wrap;
  background: #f6f8f7;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--ink);
  font-family: inherit;
}

.support-file-chip {
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 800;
}

.support-meta,
.movement-summary-card dl {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 0;
}

.support-meta li,
.movement-summary-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.support-meta li {
  list-style: none;
}

.movement-summary-card {
  align-self: start;
  min-width: 300px;
  position: sticky;
  top: 88px;
}

.movement-summary-card dt,
.support-meta span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.movement-summary-card dd,
.support-meta strong {
  margin: 0;
  text-align: right;
  font-weight: 850;
}

.movement-summary-card dl div:nth-child(6) dd {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.1;
}

.movement-summary-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.movement-summary-actions .primary,
.movement-summary-actions .secondary {
  width: 100%;
}

.movement-advanced {
  display: grid;
  gap: 12px;
}

.movement-accordion {
  padding: 0;
}

.movement-accordion summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 850;
  justify-content: space-between;
  min-height: 46px;
  padding: 12px 16px;
}

.movement-accordion > :not(summary) {
  margin-left: 16px;
  margin-right: 16px;
}

.movement-accordion > :last-child {
  margin-bottom: 16px;
}

.missing-summary {
  border-radius: 12px;
  background: #fff8e8;
  border: 1px solid #f3d28b;
  padding: 12px;
}

.missing-summary ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.ok-text {
  color: var(--brand-dark);
  font-weight: 850;
}

.compact-details {
  padding: 0;
}

.compact-details summary {
  padding: 14px 16px;
}

.compact-details > :not(summary) {
  padding-left: 16px;
  padding-right: 16px;
}

.compact-details > :last-child {
  padding-bottom: 16px;
}

.movement-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 0 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #e9f7ef;
  color: var(--brand-dark);
  white-space: nowrap;
}

.badge.warn { background: #fff3df; color: var(--warn); }
.badge.danger { background: #fde9e7; color: var(--danger); }
.badge.blue { background: #e7f0fb; color: var(--blue); }

.priority-cards {
  display: grid;
  gap: 0;
  margin: 18px 0;
}

.priority-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 86px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow: visible;
}

.priority-card:last-child {
  border-bottom: 0;
}

.priority-card:hover .priority-card-arrow,
.priority-card:focus-visible .priority-card-arrow {
  transform: translateX(3px);
}

.priority-card.active {
  margin-inline: -10px;
  padding-inline: 10px;
  border-radius: 14px;
  background: rgba(204, 255, 0, 0.16);
}

.priority-card:focus-visible {
  outline: 3px solid rgba(204, 255, 0, 0.72);
  outline-offset: 3px;
  border-radius: 14px;
}

.priority-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.priority-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.priority-card-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.priority-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--tx-lime-muted);
  color: #071426;
  font-size: 1.2rem;
  font-weight: 950;
}

.priority-card.critical .priority-card-icon {
  background: #fee2e2;
  color: var(--danger);
}

.priority-card.high .priority-card-icon,
.priority-card.upcoming .priority-card-icon {
  background: #fef3c7;
  color: var(--warn);
}

.priority-card-copy {
  min-width: 0;
}

.priority-card-arrow {
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 950;
  transition: transform 160ms ease;
}

.payment-priority {
  border-color: rgba(204, 255, 0, 0.85);
  background:
    radial-gradient(circle at 8% 14%, rgba(204, 255, 0, 0.14), transparent 30%),
    linear-gradient(90deg, #fbfff0, #ffffff);
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
  border: 1px solid transparent;
}

.priority-pill.critical { background: #fde9e7; border-color: #f0b4ae; color: var(--danger); }
.priority-pill.high { background: #fff3df; border-color: #f0c487; color: var(--warn); }
.priority-pill.upcoming { background: #fff9d9; border-color: #ead16a; color: #806000; }
.priority-pill.current { background: #e9f7ef; border-color: #9bd9b5; color: var(--brand-dark); }
.priority-pill.gray { background: #eef2ef; border-color: var(--line); color: var(--muted); }

.priority-row.critical { background: #fff8f7; }
.priority-row.high { background: #fffaf2; }
.priority-row.upcoming { background: #fffdf2; }
.priority-row.current { background: #fbfefc; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow: auto;
  max-width: 100%;
}

.tab {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.tab.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.compact-list {
  margin-top: 12px;
}

.compact-list li {
  align-items: center;
  gap: 12px;
}

.compact-list li > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mini-chart {
  height: 220px;
  display: grid;
  align-items: end;
  grid-auto-flow: column;
  gap: 8px;
  padding-top: 16px;
}

.bar {
  background: linear-gradient(180deg, #44b786, #107352);
  border-radius: 5px 5px 0 0;
  min-height: 4px;
  position: relative;
}

.bar span {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #10251d;
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 0.2s ease;
  max-width: min(420px, calc(100vw - 40px));
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 37, 29, 0.32);
}

.modal-card {
  width: min(520px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

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

.two-col-list {
  display: grid;
  gap: 0;
}

.two-col-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.two-col-row > :last-child {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.two-col-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.two-col-head {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.two-col-total {
  border-bottom: 0;
  font-weight: 900;
}

@media (max-width: 1100px) {
  #movements {
    min-width: 0;
    overflow-x: clip;
  }
  #movements .movement-entry-shell {
    max-width: none;
  }
  #movements .movement-entry-layout {
    grid-template-columns: 1fr;
  }
  #movements .movement-summary-card {
    min-width: 0;
    position: static;
  }
}

@media (max-width: 980px) {
  .shell,
  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(312px, 88vw);
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--elevated-shadow);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .shell.sidebar-collapsed .brand-copy,
  .shell.sidebar-collapsed .nav-group-label,
  .shell.sidebar-collapsed .nav-label,
  .shell.sidebar-collapsed .sidebar-user-copy {
    display: initial;
  }
  .shell.sidebar-collapsed .brand,
  .shell.sidebar-collapsed .nav-item,
  .shell.sidebar-collapsed .sidebar-user {
    justify-content: flex-start;
  }
  .shell.sidebar-collapsed .nav-item {
    padding: 0 12px;
  }
  .sidebar-collapse {
    display: none;
  }
  .mobile-menu-button {
    display: inline-grid;
    place-items: center;
  }
  .main { padding: 18px; }
  .main { grid-column: 1; }
  .cols-2, .cols-3, .cols-4, .form-grid { grid-template-columns: 1fr; }
  .movement-entry-shell,
  .movement-entry-layout,
  .movement-form-layout,
  .movement-field-grid,
  .movement-two-fields {
    grid-template-columns: 1fr;
  }
  .movement-summary-card,
  .movement-support-card {
    position: static;
    min-width: 0;
  }
  .support-preview-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .support-preview-frame {
    min-height: 160px;
  }
  .support-preview-frame img {
    max-height: 240px;
  }
  .support-preview-frame iframe {
    height: 280px;
  }
  .support-meta li,
  .movement-summary-card dl div {
    align-items: flex-start;
  }
  .dashboard-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid,
  .dashboard-grid.three { grid-template-columns: 1fr; }
  .dashboard-grid > .dashboard-card:first-child {
    grid-column: 1 / -1;
  }
  .priority-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-priority-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
  }
  .dashboard-priority-card:last-child {
    border-bottom: 0;
  }
  .priority-cards { grid-template-columns: 1fr; }
  .automation-comparison-row {
    grid-template-columns: 1fr 1fr;
  }
  .automation-review-header,
  .automation-action-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .automation-review-grid {
    grid-template-columns: 1fr;
  }
  .automation-support-file {
    align-items: flex-start;
    flex-direction: column;
  }
  .automation-action-bar .primary {
    width: 100%;
  }
  .automation-comparison-head {
    display: none;
  }
  .automation-checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topbar {
    align-items: flex-start;
    gap: 12px;
  }
  .top-actions {
    margin-left: auto;
  }
}

@media (max-width: 767px) {
  .page-heading {
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
  }
  .page-heading h1 {
    font-size: clamp(1.55rem, 8vw, 1.9rem);
  }
  .page-description {
    font-size: 0.88rem;
    line-height: 1.35;
  }
  .connection-chip,
  .user-menu-button {
    max-width: 100%;
  }
  .user-menu-button span,
  .connection-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #movements {
    max-width: 100%;
    overflow-x: clip;
  }
  #movements .tabs {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
  #movements .tab {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 44px;
    padding: 8px 10px;
    text-align: center;
    white-space: normal;
    width: 100%;
  }
  #movements .movement-entry-shell,
  #movements .movement-entry-layout,
  #movements .movement-form-layout,
  #movements .movement-field-grid,
  #movements .movement-two-fields {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
    min-width: 0;
    width: 100%;
  }
  #movements .movement-form-section,
  #movements .movement-summary-card,
  #movements .movement-support-card {
    border-radius: 14px;
    padding: 16px;
  }
  #movements .movement-form-section {
    gap: 16px;
  }
  #movements .movement-field-grid {
    gap: 14px;
  }
  #movements .field,
  #movements .concept-search-group,
  #movements .movement-advanced,
  #movements .movement-summary-card,
  #movements .movement-support-card,
  #movements .support-meta li,
  #movements .movement-summary-card dl div {
    min-width: 0;
  }
  #movements .field input,
  #movements .field select,
  #movements .field textarea {
    font-size: 16px;
    min-height: 46px;
    width: 100%;
  }
  #movements .field textarea {
    min-height: 96px;
    overflow-x: hidden;
  }
  #movements .movement-value-field input {
    font-size: 1.35rem;
    min-height: 54px;
  }
  #movements .movement-accordion summary {
    align-items: flex-start;
    line-height: 1.25;
    min-height: 48px;
    padding: 13px 14px;
    white-space: normal;
  }
  #movements .movement-accordion > :not(summary) {
    margin-left: 14px;
    margin-right: 14px;
  }
  #movements .movement-summary-card {
    position: static;
  }
  #movements .movement-summary-card dl div {
    align-items: flex-start;
  }
  #movements .movement-summary-actions .primary,
  #movements .movement-summary-actions .secondary {
    min-height: 46px;
    width: 100%;
  }
}

@media (max-width: 430px) {
  #movements .tabs {
    gap: 6px;
  }
  #movements .tab {
    font-size: 0.88rem;
    padding-inline: 8px;
  }
  #movements .movement-entry-shell,
  #movements .movement-form-layout,
  #movements .movement-entry-layout {
    gap: 14px;
  }
  #movements .movement-form-section,
  #movements .movement-summary-card,
  #movements .movement-support-card {
    padding: 15px;
  }
  #movements .movement-summary-card dl {
    gap: 8px;
  }
  #movements .movement-summary-card dl div {
    display: grid;
    gap: 3px;
    justify-content: stretch;
  }
  #movements .movement-summary-card dd {
    text-align: left;
  }
  #movements .movement-summary-card dl div:nth-child(6) dd {
    font-size: 1.32rem;
  }
}

@media (max-width: 390px) {
  .main {
    padding-left: 12px;
    padding-right: 12px;
  }
  #movements .movement-form-section,
  #movements .movement-summary-card,
  #movements .movement-support-card {
    padding: 14px;
  }
  #movements .movement-value-field input {
    font-size: 1.24rem;
  }
}

@media (max-width: 340px) {
  .main {
    padding-left: 10px;
    padding-right: 10px;
  }
  #movements .tab {
    font-size: 0.82rem;
  }
}

@media (max-width: 560px) {
  .main { padding: 14px; }
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
  .page-heading {
    align-items: flex-start;
  }
  .top-actions {
    width: 100%;
    justify-content: space-between;
  }
  .dashboard-toolbar,
  .period-card {
    display: grid;
    justify-content: stretch;
  }
  .filter-chip {
    width: 100%;
  }
  .filter-chip input {
    width: 100%;
  }
  .dashboard-stat-grid,
  .dashboard-grid,
  .dashboard-grid.three {
    grid-template-columns: 1fr;
  }
  .dashboard-grid > .dashboard-card:first-child {
    grid-column: auto;
  }
  .metric-card {
    min-height: 112px;
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 15px;
  }
  .metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }
  .metric-icon svg {
    width: 21px;
    height: 21px;
  }
  .metric-card strong {
    font-size: 1.28rem;
  }
  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .section-head {
    display: grid;
  }
  .section-head button {
    justify-self: start;
  }
  .account-row,
  .receivable-row,
  .bucket-row,
  .dashboard-total {
    grid-template-columns: 1fr;
    display: grid;
  }
  .account-row .money-value,
  .receivable-row .money-value,
  .bucket-row .money-value,
  .dashboard-total strong {
    justify-self: start;
  }
  .chart-summary {
    display: grid;
  }
  .automation-comparison-row,
  .automation-checkbox-grid {
    grid-template-columns: 1fr;
  }
  .connection-chip,
  .user-menu-button {
    max-width: calc(50vw - 22px);
  }
  .auth-email,
  #connection-status-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  table { min-width: 680px; }
  .payment-priority table { min-width: 0; }
  .payment-priority thead { display: none; }
  .payment-priority tbody,
  .payment-priority tr,
  .payment-priority td {
    display: block;
    width: 100%;
  }
  .payment-priority tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 8px;
  }
  .payment-priority td {
    border-bottom: 0;
    padding: 7px 4px;
  }
  .payment-priority td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
  }
  .payment-priority td.num { text-align: left; }
  .audit-table { display: none; }
  .audit-card-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
  }
  .audit-field-list li {
    display: grid;
  }
  .audit-detail {
    width: calc(100vw - 24px);
    max-height: 88vh;
  }
  .audit-detail-header {
    display: grid;
  }
  .audit-summary {
    grid-template-columns: 1fr;
  }
  .automation-detail-grid {
    grid-template-columns: 1fr;
  }
  .automation-detail {
    width: calc(100vw - 24px);
    max-height: 92vh;
  }
  .automation-preview {
    min-height: 220px;
  }
  .automation-proposal-meta {
    grid-template-columns: 1fr;
  }
  .audit-change-head {
    display: none;
  }
  .audit-change-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .audit-change-row span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
  }
}

@media (max-width: 390px) {
  .main {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 340px) {
  .main {
    padding-left: 10px;
    padding-right: 10px;
  }
}
