:root {
  --canvas: #f1f2ef;
  --surface: #ffffff;
  --surface-soft: #f7f8f6;
  --surface-tint: #edf3f1;
  --ink: #1c292e;
  --ink-soft: #405057;
  --muted: #748086;
  --line: #e1e5e3;
  --line-strong: #cfd6d3;
  --nav: #102d3a;
  --nav-deep: #0a222d;
  --nav-text: #d9e8eb;
  --teal: #1c7474;
  --teal-dark: #155e5f;
  --teal-soft: #eaf3f1;
  --blue: #496f85;
  --blue-soft: #edf2f4;
  --green: #33725a;
  --green-soft: #edf4f0;
  --red: #a64a52;
  --red-soft: #f8eef0;
  --orange: #a86a35;
  --orange-soft: #faf1e8;
  --yellow: #877039;
  --yellow-soft: #f7f3e7;
  --shadow-soft: 0 5px 18px rgba(23, 42, 48, 0.04);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(8, 127, 131, 0.22);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(26px, 2.2vw, 35px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

h1 span {
  color: var(--muted);
  font-weight: 500;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.cockpit-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  color: var(--nav-text);
  background:
    radial-gradient(circle at 0 0, rgba(38, 156, 159, 0.26), transparent 18rem),
    linear-gradient(180deg, var(--nav), var(--nav-deep));
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 25px;
  color: #fff;
  text-decoration: none;
}

.sidebar-toggle {
  position: absolute;
  top: 72px;
  right: -13px;
  z-index: 2;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #d7edef;
  background: var(--nav);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

@media (min-width: 1051px) {
  .cockpit-shell.sidebar-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar-collapsed .sidebar {
    padding-right: 10px;
    padding-left: 10px;
  }

  .sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .sidebar-collapsed .sidebar-brand-copy,
  .sidebar-collapsed .sidebar-label,
  .sidebar-collapsed .nav-link > span:not(.nav-icon),
  .sidebar-collapsed .nav-link > small,
  .sidebar-collapsed .sidebar-footer-copy {
    display: none;
  }

  .sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0;
  }

  .sidebar-collapsed .sidebar-footer {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }
}

.brand-mark {
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #12a4a5, #08757c);
  box-shadow: 0 8px 18px rgba(1, 19, 26, 0.25);
  font-size: 19px;
  font-weight: 800;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  font-size: 15px;
  letter-spacing: -0.015em;
}

.sidebar-brand small {
  margin-top: 2px;
  color: #91b0b9;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sidebar-label {
  padding: 5px 12px 10px;
  color: #71959f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #aec5cb;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

a.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(8, 151, 154, 0.34), rgba(8, 151, 154, 0.12));
  border-color: rgba(91, 207, 208, 0.16);
}

.nav-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #88bac2;
  background: rgba(255, 255, 255, 0.055);
  font-size: 13px;
  font-weight: 800;
}

.nav-link.active .nav-icon {
  color: #c9ffff;
  background: rgba(25, 177, 178, 0.22);
}

.nav-link > small {
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 4px;
  color: #78959d;
  background: rgba(255, 255, 255, 0.05);
  font-size: 8px;
  text-transform: uppercase;
}

.nav-future {
  cursor: default;
  opacity: 0.62;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 15px 12px 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer strong,
.sidebar-footer small {
  display: block;
}

.sidebar-footer strong {
  color: #c4d7dc;
  font-size: 10px;
}

.sidebar-footer small {
  margin-top: 2px;
  color: #75969f;
  font-size: 9px;
}

.local-indicator {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4ac195;
  box-shadow: 0 0 0 4px rgba(74, 193, 149, 0.11);
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px clamp(20px, 2.5vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-title span,
.topbar-title strong {
  display: block;
}

.topbar-kicker {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.topbar-title strong {
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -0.015em;
}

.topbar-actions,
.table-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.month-navigation {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 5px 7px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.month-navigation-title {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.month-navigation-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.month-current {
  position: relative;
  min-width: 112px;
  min-height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.month-current:hover,
.month-current[aria-expanded="true"] {
  color: var(--teal);
  background: var(--teal-soft);
}

.month-nav-button,
.month-today-button {
  min-height: 24px;
  border: 0;
  background: transparent;
}

.month-nav-button {
  width: 24px;
  border-radius: 6px;
  color: var(--teal);
  font-size: 18px;
  line-height: 1;
}

.month-nav-button:hover {
  background: var(--teal-soft);
}

.month-today-button {
  padding: 0 6px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 750;
}

.month-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 250px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(10, 34, 45, 0.16);
}

.month-picker-year {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  margin-bottom: 9px;
}

.month-picker-year strong {
  text-align: center;
  font-size: 12px;
}

.month-picker-year button,
.month-picker-grid button {
  border: 0;
  border-radius: 7px;
  color: var(--ink-soft);
  background: transparent;
}

.month-picker-year button {
  height: 30px;
  color: var(--teal);
  font-size: 18px;
}

.month-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.month-picker-grid button {
  min-height: 34px;
  font-size: 9.5px;
  font-weight: 700;
}

.month-picker-year button:hover,
.month-picker-grid button:hover {
  background: var(--surface-soft);
}

.month-picker-grid button.is-current {
  box-shadow: inset 0 0 0 1px #b9d7d7;
}

.month-picker-grid button.is-selected {
  color: #fff;
  background: var(--teal);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  transition: transform 100ms ease, background 120ms ease, border-color 120ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 5px 13px rgba(8, 127, 131, 0.17);
}

.button-primary:hover {
  background: var(--teal-dark);
}

.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-secondary:hover,
.button-demo:hover {
  background: var(--surface-soft);
  border-color: #afc1c6;
}

.button-quiet {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-soft);
}

.button-demo {
  min-height: 40px;
  color: #53666e;
  background: #fff;
  border-color: var(--line);
  font-size: 11px;
}

.button-danger {
  color: #fff;
  background: var(--red);
}

main {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 30px clamp(20px, 2.5vw, 38px) 0;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 4px 1px 22px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #8b999e;
  font-size: 10px;
  font-weight: 650;
}

.breadcrumb span {
  color: var(--teal);
}

.breadcrumb b {
  color: #b7c1c5;
  font-weight: 400;
}

.page-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.health-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b989d;
}

.health-good {
  color: var(--green);
  background: var(--green-soft);
  border-color: #cbe0d7;
}

.health-good .health-dot {
  background: var(--green);
}

.health-warning {
  color: var(--yellow);
  background: var(--yellow-soft);
  border-color: #e9dda4;
}

.health-warning .health-dot {
  background: #d2a923;
}

.health-danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #edc5ca;
}

.health-danger .health-dot {
  background: var(--red);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 12px;
}

.metric-card {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  overflow: visible;
  flex-direction: column;
  padding: 16px 17px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.metric-card::before {
  display: none;
}

.metric-income,
.metric-paid,
.metric-rest {
  border-color: #d9e4df;
}

.metric-overdue {
  border-color: #ead6d8;
}

.metric-open {
  border-color: #eadfd5;
}

.metric-card-emphasis {
  grid-column: span 2;
  background: var(--surface);
  border-color: #c8dcd8;
}

.metric-income .metric-value,
.metric-paid .metric-value,
.metric-rest .metric-value {
  color: var(--green);
}

.metric-overdue .metric-value {
  color: var(--red);
}

.metric-open .metric-value {
  color: var(--orange);
}

.metric-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 25px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.metric-heading > span:last-child {
  white-space: nowrap;
}

.metric-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 850;
}

.income-icon,
.paid-icon,
.rest-icon {
  color: var(--green);
  background: var(--green-soft);
}

.expense-icon,
.overdue-icon {
  color: var(--red);
  background: var(--red-soft);
}

.open-icon {
  color: var(--orange);
  background: var(--orange-soft);
}

.balance-icon {
  color: var(--teal);
  background: var(--teal-soft);
}

.metric-value {
  display: block;
  overflow: visible;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: clamp(19px, 1.6vw, 25px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-overflow: clip;
  white-space: normal;
}

.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.35;
  white-space: normal;
}

.metric-card.is-danger {
  border-color: #e7b8be;
  background: linear-gradient(135deg, #fff, var(--red-soft));
}

.metric-card.is-warning {
  border-color: #e7d89c;
  background: linear-gradient(135deg, #fff, var(--yellow-soft));
}

.negative {
  color: var(--red) !important;
}

.positive {
  color: var(--green) !important;
}

.dashboard-modules {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.8fr);
  align-items: stretch;
  gap: 14px;
  margin-top: 14px;
}

.module {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.dashboard-modules > .module {
  height: 100%;
}

.module-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 21px 17px;
  border-bottom: 1px solid #e6edef;
}

.analysis-heading,
.section-heading-actions {
  display: flex;
  align-items: center;
}

.analysis-heading {
  justify-content: space-between;
  gap: 20px;
  padding: 20px 21px 17px;
  border-bottom: 1px solid #e6edef;
}

.section-heading-actions {
  justify-content: flex-end;
  gap: 9px;
}

.section-status {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.collapsible-content[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 8.5px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.module-tag {
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.need-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 15px 20px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
}

.need-summary > div {
  min-width: 0;
  padding: 9px 12px;
  background: var(--surface-soft);
}

.need-summary span,
.need-summary strong {
  display: block;
}

.need-summary span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.need-summary strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.liquidity-grid {
  min-height: 157px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  padding: 16px 20px 20px;
}

.liquidity-item,
.gap-box {
  min-width: 0;
  padding: 13px 14px;
  border-radius: 10px;
}

.liquidity-item {
  border: 1px solid #e0e8ea;
  background: var(--surface-soft);
}

.liquidity-grid > .liquidity-item:first-child {
  border-color: #c2d8d4;
  background: var(--teal-soft);
  box-shadow: inset 3px 0 var(--teal);
}

.liquidity-grid > .liquidity-item:first-child strong {
  color: var(--teal-dark);
  font-size: 22px;
}

.liquidity-item-result {
  border-color: #c9dcd8;
  background: #f1f6f4;
}

.liquidity-item-result strong {
  color: var(--teal-dark);
}

.liquidity-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.liquidity-label > span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
}

.liquidity-item strong,
.gap-box strong {
  display: block;
  overflow: hidden;
  margin-bottom: 4px;
  font-size: 18px;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.liquidity-item small,
.gap-box small {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.35;
}

.liquidity-separator {
  display: grid;
  place-items: center;
  color: #b0c0c4;
  font-size: 13px;
}

.gap-box {
  color: var(--teal);
  background: var(--teal-soft);
}

.gap-box .liquidity-label > span,
.gap-box small {
  color: currentColor;
  opacity: 0.78;
}

.gap-box.has-gap {
  color: var(--red);
  background: var(--red-soft);
}

.warning-panel {
  min-width: 0;
}

.warning-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #75a99b;
  box-shadow: 0 0 0 5px rgba(36, 118, 93, 0.09);
}

.warning-panel.has-critical .warning-pulse {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(180, 63, 74, 0.09);
}

.warning-empty {
  min-height: 157px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px;
}

.warning-empty-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
  font-weight: 850;
}

.warning-empty strong,
.warning-empty small {
  display: block;
}

.warning-empty strong {
  margin-bottom: 4px;
  font-size: 12px;
}

.warning-empty small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.warning-items {
  display: grid;
  grid-auto-rows: 50px;
  gap: 8px;
  max-height: 199px;
  overflow-y: auto;
  padding: 15px 17px 18px;
  overscroll-behavior: contain;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.warning-item {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  overflow: hidden;
}

.warning-item > div {
  min-width: 0;
}

.warning-symbol {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-weight: 850;
}

.warning-item strong,
.warning-item small {
  display: block;
}

.warning-item strong {
  overflow: hidden;
  margin-bottom: 2px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warning-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.warning-title-line strong {
  min-width: 0;
}

.info-hint-button {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #bfd0d0;
  border-radius: 50%;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.72);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.info-hint-button:hover,
.info-hint-button:focus-visible,
.info-hint-button[aria-expanded="true"] {
  border-color: var(--teal);
  color: var(--teal);
  background: #fff;
}

.info-hint-popover {
  position: fixed;
  inset: auto;
  width: min(300px, calc(100vw - 24px));
  max-width: min(300px, calc(100vw - 24px));
  margin: 0;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(15, 42, 53, 0.18);
  font-size: 13px;
  line-height: 1.5;
}

.info-hint-popover::backdrop {
  background: transparent;
}

.info-hint-popover.is-open {
  display: block;
}

.warning-item small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.warning-item-danger {
  border-color: #edcbd0;
  background: var(--red-soft);
}

.warning-item-arrears {
  border-color: #dfc4cf;
  background: #f7edf1;
}

.warning-item-arrears .warning-symbol {
  color: #93465f;
  background: #ecd9e0;
}

.warning-panel {
  height: 100%;
  display: flex;
  overflow: hidden;
  flex-direction: column;
}

#warningsContent {
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.warning-item-danger .warning-symbol {
  color: var(--red);
  background: #f7dce0;
}

.warning-item-upcoming {
  border-color: #f0d5b9;
  background: var(--orange-soft);
}

.warning-item-upcoming .warning-symbol {
  color: var(--orange);
  background: #f8dfc7;
}

.warning-item-rest {
  border-color: #e8dca7;
  background: var(--yellow-soft);
}

.warning-item-rest .warning-symbol {
  color: var(--yellow);
  background: #f4e9b8;
}

.fixed-costs-section {
  margin-top: 14px;
  overflow: hidden;
}

.income-templates-section {
  border-top: 3px solid var(--green);
}

.recurring-payments-section {
  margin-top: 14px;
  overflow: hidden;
}

.recurring-payments-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
  align-items: stretch;
  background: var(--surface-soft);
}

.recurring-payments-grid > .module {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  box-shadow: none;
}

.recurring-payments-grid .fixed-costs-heading {
  min-height: 176px;
  align-items: flex-start;
  flex-direction: column;
  padding: 17px;
}

.recurring-payments-grid .module-actions {
  width: 100%;
  margin-top: auto;
  flex-wrap: wrap;
}

.recurring-payments-grid .module-actions .button {
  flex: 1 1 150px;
  min-height: 34px;
  padding: 6px 9px;
  font-size: 9px;
}

.recurring-payments-grid .button-primary {
  box-shadow: none;
}

.recurring-payments-panels {
  display: grid;
  gap: 12px;
  padding: 0 14px;
  background: var(--surface-soft);
}

.recurring-payments-panels .fixed-cost-details {
  min-width: 0;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.recurring-detail-heading {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}

.recurring-detail-heading h3,
.recurring-detail-heading .eyebrow {
  margin-bottom: 0;
}

.recurring-detail-heading h3 {
  margin-top: 3px;
  font-size: 14px;
}

.recurring-detail-heading > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.arrears-section {
  margin-top: 14px;
  overflow: hidden;
  border-top: 3px solid #9b5268;
}

.arrears-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.arrears-table {
  min-width: 980px;
}

.arrears-table tbody tr {
  background: #fffafb;
}

.arrears-table tbody tr:hover {
  background: #f8eef2;
}

.origin-cell strong {
  color: #87475b;
  white-space: nowrap;
}

.arrears-table-hint {
  margin: 11px 20px 0;
  padding: 9px 11px;
  border: 1px solid #dfcbd2;
  border-radius: 8px;
  color: #744657;
  background: #faf1f4;
  font-size: 9px;
}

.finance-trend-section {
  margin-top: 14px;
  overflow: hidden;
}

.finance-trend-content {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr) minmax(170px, 0.55fr);
  align-items: stretch;
  gap: 12px;
  padding: 16px 20px 20px;
}

.chart-card {
  min-width: 0;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.chart-card-heading,
.chart-card-heading > div,
.chart-legend {
  display: flex;
  align-items: center;
}

.chart-card-heading {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.chart-card-heading > div {
  gap: 7px;
}

.chart-card-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.chart-card-heading strong {
  font-size: 11px;
}

.chart-legend {
  gap: 10px;
}

.chart-legend span::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 4px;
  border-radius: 2px;
}

.legend-income::before {
  background: var(--green);
}

.legend-expense::before {
  background: var(--red);
}

.annual-finance-chart {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 180px;
  display: grid;
  grid-template-columns: repeat(12, minmax(44px, 1fr));
  gap: 5px;
  align-items: end;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 7px 6px 0;
  contain: layout paint;
}

.annual-chart-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 126px auto auto;
  gap: 4px;
  text-align: center;
}

.annual-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  border-bottom: 1px solid var(--line-strong);
}

.annual-bars i {
  width: 9px;
  min-height: 0;
  border-radius: 4px 4px 0 0;
}

.annual-income-bar {
  background: var(--green);
}

.annual-expense-bar {
  background: var(--red);
}

.annual-chart-column > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.annual-chart-column > small {
  max-width: 100%;
  overflow: hidden;
  padding: 2px 1px;
  border-radius: 4px;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annual-chart-column > small.negative {
  background: var(--red-soft);
}

.annual-chart-column > small.positive {
  background: var(--green-soft);
}

.category-expense-chart {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
  max-height: none;
  overflow: hidden;
  padding-right: 2px;
}

.expense-structure-layout {
  min-height: 180px;
  display: grid;
  grid-template-columns: minmax(96px, 112px) minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  max-width: 100%;
  overflow: hidden;
}

.expense-donut {
  position: relative;
  width: 112px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#e1e6e3 0 100%);
}

.expense-donut::after {
  content: "";
  position: absolute;
  width: 68%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
}

.expense-donut > div {
  position: relative;
  z-index: 1;
  max-width: 70px;
  text-align: center;
}

.expense-donut strong,
.expense-donut span {
  display: block;
}

.expense-donut strong {
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.15;
}

.expense-donut span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.category-bar-row > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
  font-size: 8.5px;
}

.category-bar-row span {
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-name {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.category-name > i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.category-bar-row strong {
  flex: 0 0 auto;
  max-width: 48%;
  overflow: hidden;
  margin-left: 8px;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-bar-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edef;
}

.category-bar-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--red);
}

.chart-empty {
  margin: 25px 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.bottleneck-card {
  min-height: 180px;
  display: grid;
  align-content: center;
  grid-template-rows: auto auto auto auto;
  padding: 16px;
}

.bottleneck-card > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.bottleneck-card > strong {
  margin: 9px 0 3px;
  font-size: 22px;
}

.bottleneck-card > small {
  color: var(--muted);
  font-size: 8.5px;
}

.bottleneck-scale {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 12px 0 2px;
}

.bottleneck-scale i {
  height: 8px;
  border-radius: 999px;
}

.bottleneck-scale i:nth-child(1) { background: #d25f69; }
.bottleneck-scale i:nth-child(2) { background: #d5ad43; }
.bottleneck-scale i:nth-child(3) { background: #55a080; }

.bottleneck-scale b {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--ink);
}

.status-danger .bottleneck-scale b { left: 15%; }
.status-warning .bottleneck-scale b { left: 50%; }
.status-good .bottleneck-scale b { left: 84%; }
.status-danger > strong { color: var(--red); }
.status-warning > strong { color: var(--yellow); }
.status-good > strong { color: var(--green); }

.matrix-section {
  margin-top: 14px;
  overflow: hidden;
}

.matrix-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 21px 17px;
}

.matrix-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  background: #fbfdfd;
}

.matrix-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.matrix-switch button {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  font-weight: 750;
}

.matrix-switch button.is-active {
  color: #fff;
  background: var(--teal);
}

.matrix-table-wrap {
  width: 100%;
  max-width: 100%;
  padding-bottom: 0;
  border-top: 1px solid var(--line);
}

.matrix-table {
  width: 100%;
  min-width: 0;
  font-size: 10px;
}

.monthly-matrix-wrapper {
  overflow-x: hidden;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.monthly-matrix-wrapper::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.monthly-matrix-wrapper .matrix-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.monthly-matrix-wrapper .matrix-table th,
.monthly-matrix-wrapper .matrix-table td {
  min-width: 0;
}

.monthly-matrix-wrapper .matrix-table th:first-child {
  width: 24%;
  min-width: 0;
}

.yearly-matrix-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: auto;
}

.yearly-matrix-wrapper .matrix-table {
  min-width: 1320px;
}

.matrix-table th,
.matrix-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.matrix-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 160px;
  background: #f4f6f4;
  box-shadow: 1px 0 0 var(--line);
}

.matrix-table td {
  min-width: 96px;
  border-right: 1px solid #edf0ee;
  white-space: nowrap;
}

.matrix-table .matrix-total,
.matrix-table tfoot {
  font-weight: 800;
}

.matrix-table .positive {
  color: var(--green);
  background: rgba(51, 114, 90, 0.035);
}

.matrix-table .negative {
  color: var(--red);
  background: rgba(166, 74, 82, 0.035);
}

.matrix-table .zero {
  color: #a0adb1;
}

.matrix-table tfoot th,
.matrix-table tfoot td {
  border-top: 1px solid var(--line-strong);
  background: #f5f7f5;
}

.matrix-table tfoot .matrix-difference-row th,
.matrix-table tfoot .matrix-difference-row td {
  border-top: 2px solid #91aaa7;
  background: #edf3f1;
  font-weight: 850;
}

.matrix-empty {
  padding: 34px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.fixed-costs-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 21px 17px;
  border-bottom: 1px solid #e6edef;
}

.fixed-cost-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
}

.fixed-cost-preview strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.module-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.fixed-cost-details {
  border-top: 0;
}

.fixed-cost-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 20px;
  padding: 10px 12px;
  border: 1px solid #cfe4e3;
  border-radius: 9px;
  color: #49666c;
  background: var(--teal-soft);
}

.fixed-cost-note > span {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--teal);
  background: #fff;
  font-size: 10px;
  font-weight: 850;
}

.fixed-cost-note p {
  margin: 0;
  font-size: 9px;
  line-height: 1.45;
}

.fixed-cost-table-wrap {
  max-height: min(420px, 52vh);
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.fixed-cost-table {
  min-width: 940px;
}

.fixed-cost-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.fixed-cost-table .actions-column {
  text-align: right;
}

.template-name strong,
.template-name small,
.interval-cell strong,
.interval-cell small {
  display: block;
}

.template-name strong,
.interval-cell strong {
  color: var(--ink);
}

.template-name small,
.interval-cell small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

.interval-pill {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 8.5px;
  font-weight: 750;
}

.template-active-toggle {
  min-width: 67px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 8.5px;
  font-weight: 750;
}

.template-active-toggle.is-active {
  color: var(--green);
  border-color: #c5ddd3;
  background: var(--green-soft);
}

.template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.fixed-cost-empty {
  min-height: 135px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 20px;
  text-align: left;
}

.fixed-cost-empty-icon {
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 17px;
}

.fixed-cost-empty strong,
.fixed-cost-empty small {
  display: block;
}

.fixed-cost-empty strong {
  margin-bottom: 4px;
  font-size: 11px;
}

.fixed-cost-empty small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.entries-section {
  margin-top: 14px;
  overflow: hidden;
}

.entries-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 21px 17px;
}

.entries-table-tools {
  justify-content: flex-end;
  padding: 11px 20px;
  border-top: 1px solid var(--line);
  background: #fbfdfd;
}

.payment-plan-tabs {
  display: flex;
  gap: 3px;
  padding: 10px 20px 0;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.payment-plan-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  background: transparent;
  font-size: 9.5px;
  font-weight: 750;
}

.payment-plan-tabs button.is-active {
  color: var(--teal-dark);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 -2px 0 var(--teal) inset;
}

.payment-plan-tabs button.has-arrears {
  color: #8d4259;
  background: #faf0f3;
}

.payment-plan-tabs button.has-arrears.is-active {
  border-color: #ddc4cd;
}

.payment-plan-panel[hidden] {
  display: none !important;
}

.section-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9.5px;
}

.search-field {
  height: 38px;
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

.search-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
}

.table-tools select {
  height: 38px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 600;
}

.bulk-action-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 20px;
  border-top: 1px solid var(--line);
  background: var(--teal-soft);
}

.bulk-action-bar > strong {
  color: var(--teal-dark);
  font-size: 10px;
}

.bulk-action-bar > div {
  display: flex;
  gap: 7px;
}

.button-compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 9px;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.entries-section .table-wrap,
.entries-section .arrears-table-wrap {
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.entries-section .table-wrap thead th,
.entries-section .arrears-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 11px;
}

.entries-section table {
  min-width: 940px;
  table-layout: fixed;
}

.entries-section th:nth-child(1) { width: 4%; }
.entries-section th:nth-child(2) { width: 11%; }
.entries-section th:nth-child(3) { width: 8%; }
.entries-section th:nth-child(4) { width: 13%; }
.entries-section th:nth-child(5) { width: 15%; }
.entries-section th:nth-child(6) { width: 10%; }
.entries-section th:nth-child(7) { width: 11%; }
.entries-section th:nth-child(8) { width: 5%; }
.entries-section th:nth-child(9) { width: 210px; }

th {
  padding: 11px 11px;
  border-bottom: 1px solid var(--line);
  color: #72858c;
  background: #f4f6f4;
  font-size: 8.5px;
  font-weight: 850;
  letter-spacing: 0.065em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  padding-left: 21px;
}

th:last-child,
td:last-child {
  padding-right: 21px;
}

td {
  max-width: 190px;
  padding: 12px 11px;
  border-bottom: 1px solid #ecefed;
  color: #3b4d55;
  vertical-align: middle;
}

.entries-section td {
  overflow: hidden;
  padding-right: 8px;
  padding-left: 8px;
  text-overflow: ellipsis;
}

.entries-section td:first-child {
  padding-left: 12px;
}

.entries-section td:last-child {
  padding-right: 15px;
}

.selection-column {
  min-width: 38px;
  padding-right: 5px !important;
  padding-left: 12px !important;
  text-align: center;
}

.entry-checkbox {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

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

tbody tr {
  transition: background 100ms ease;
}

tbody tr:hover {
  background: #f9fbfb;
}

tbody tr.row-overdue {
  background: var(--red-soft);
  box-shadow: inset 3px 0 var(--red);
}

tbody tr.row-upcoming {
  background: var(--orange-soft);
  box-shadow: inset 3px 0 var(--orange);
}

tbody tr.row-deferred-target {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 var(--blue);
}

.filter-empty {
  padding: 34px !important;
  color: var(--muted);
  text-align: center;
}

.date-cell strong,
.date-cell small,
.description-cell strong,
.description-cell small {
  display: block;
}

.date-cell strong,
.description-cell strong {
  color: var(--ink);
}

.date-cell small,
.description-cell small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arrear-target-hint {
  color: var(--red) !important;
  font-weight: 750;
}

.arrear-status-stack {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.arrear-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid #e5c3c8;
  border-radius: 999px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.deferred-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 999px;
  color: var(--blue);
  background: #dfe9ee;
  font-size: 10px;
  font-weight: 800;
}

.type-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.type-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.type-income {
  color: var(--green);
}

.type-income::before {
  background: var(--green);
}

.type-expense {
  color: var(--red);
}

.type-expense::before {
  background: var(--red);
}

.amount-cell {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.amount-expense {
  color: var(--red);
}

.align-right {
  text-align: right;
}

.status-select {
  max-width: 108px;
  height: 28px;
  padding: 0 23px 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #4e5f66;
  background: #edf1f2;
  font-size: 9px;
  font-weight: 750;
  text-transform: capitalize;
}

.status-erhalten,
.status-bezahlt {
  color: var(--green);
  background: var(--green-soft);
}

.status-offen,
.status-prüfen {
  color: var(--orange);
  background: var(--orange-soft);
}

.status-erwartet,
.status-geplant {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-verschoben {
  color: #6d5f73;
  background: #f0edf2;
}

.priority {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  text-transform: capitalize;
}

.priority-signal {
  width: 40px;
  height: 28px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  vertical-align: middle;
}

.priority-signal:hover {
  border-color: #b7c7c9;
  background: var(--surface-soft);
}

.priority-signal span {
  width: 5px;
  border-radius: 2px 2px 1px 1px;
  background: #d8dede;
}

.priority-signal span:nth-child(1) { height: 6px; }
.priority-signal span:nth-child(2) { height: 10px; }
.priority-signal span:nth-child(3) { height: 14px; }
.priority-signal-niedrig span.is-active { background: var(--green); }
.priority-signal-mittel span.is-active { background: var(--orange); }
.priority-signal-hoch span.is-active { background: var(--red); }

.priority::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aeb9bd;
}

.priority-hoch::before {
  background: var(--red);
}

.priority-mittel::before {
  background: var(--orange);
}

.priority-niedrig::before {
  background: var(--green);
}

.actions-column {
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  text-align: right;
}

.row-actions {
  display: grid;
  grid-template-columns: 74px repeat(3, 30px);
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.row-action {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

.row-action:hover {
  color: var(--teal);
  border-color: #afd0d0;
  background: var(--teal-soft);
}

.row-action.delete:hover {
  color: var(--red);
  border-color: #eac2c7;
  background: var(--red-soft);
}

.row-action.complete {
  width: 74px;
  padding: 0 10px;
  font-size: 8.5px;
  font-weight: 750;
}

.row-action.row-primary-action {
  min-width: 74px;
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 3px 8px rgba(21, 94, 95, 0.14);
}

.row-primary-placeholder {
  width: 74px;
  height: 30px;
  display: block;
  visibility: hidden;
}

.row-action.row-primary-action:hover {
  color: #fff;
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.entries-section .actions-column {
  text-align: center;
}

.info-action {
  border-radius: 50%;
  color: var(--teal);
  background: var(--teal-soft);
  font-family: Georgia, serif;
  font-weight: 800;
}

.info-action-muted {
  color: #819298;
  background: var(--surface-soft);
}

.empty-state {
  min-height: 250px;
  padding: 44px 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(8, 127, 131, 0.055), transparent 13rem),
    #fff;
}

.empty-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border: 1px solid #cce2e1;
  border-radius: 12px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 22px;
}

.empty-state h3 {
  margin-bottom: 7px;
  font-size: 15px;
}

.empty-state p {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 10px;
}

.table-footer {
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 21px;
  color: var(--muted);
  font-size: 9.5px;
}

.table-footer-note {
  color: #94a1a6;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px clamp(20px, 2.5vw, 38px) 23px;
  color: var(--muted);
  font-size: 9px;
}

.text-button {
  padding: 5px;
  border: 0;
  background: transparent;
  font-size: 9px;
}

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

.entry-dialog,
.fixed-cost-dialog,
.entry-detail-dialog,
.fixed-cost-delete-dialog,
.confirm-dialog,
.backup-dialog {
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 85px rgba(10, 34, 45, 0.27);
}

.entry-dialog,
.fixed-cost-dialog {
  width: min(730px, calc(100% - 26px));
}

.entry-dialog::backdrop,
.fixed-cost-dialog::backdrop,
.entry-detail-dialog::backdrop,
.fixed-cost-delete-dialog::backdrop,
.confirm-dialog::backdrop,
.backup-dialog::backdrop {
  background: rgba(8, 28, 37, 0.58);
  backdrop-filter: blur(4px);
}

.entry-detail-dialog {
  width: min(560px, calc(100% - 26px));
  padding: 0;
}

.fixed-cost-delete-dialog {
  width: min(520px, calc(100% - 28px));
  padding: 25px;
  text-align: center;
}

.fixed-cost-delete-dialog h2 {
  margin-bottom: 7px;
}

.delete-template-name {
  display: block;
  margin-bottom: 17px;
  color: var(--ink-soft);
  font-size: 12px;
}

.delete-template-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 0 0 13px;
}

.delete-template-stats > div {
  padding: 10px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.delete-template-stats dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.delete-template-stats dd {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.history-note {
  margin: 0 0 14px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 9px;
}

.fixed-cost-delete-actions {
  display: grid;
  gap: 8px;
}

.fixed-cost-delete-actions .button {
  width: 100%;
}

.fixed-cost-delete-actions .button-danger:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.entry-detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  padding: 10px 25px 20px;
}

.detail-row {
  min-width: 0;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}

.detail-row dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.detail-row dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.entry-detail-dialog .dialog-actions {
  position: static;
}

.entry-dialog form,
.fixed-cost-dialog form {
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 25px 17px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfdfd);
}

.dialog-header h2 {
  font-size: 20px;
}

.icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 20px;
  line-height: 1;
}

.type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 19px 25px 0;
}

.type-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-switch span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 750;
  cursor: pointer;
}

.type-switch input:checked + span {
  color: var(--green);
  border-color: #8ebdab;
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px #8ebdab;
}

.type-switch label:last-child input:checked + span {
  color: var(--red);
  border-color: #dfa4ab;
  background: var(--red-soft);
  box-shadow: inset 0 0 0 1px #dfa4ab;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 16px;
  padding: 17px 25px 22px;
}

.form-section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 2px;
  padding: 0 0 8px;
  border-bottom: 1px solid #e8edef;
}

.form-section-label:not(:first-child) {
  margin-top: 7px;
}

.form-section-label span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.form-section-label small {
  color: #99a5a9;
  font-size: 8.5px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  color: #4b5d64;
  font-size: 10px;
  font-weight: 750;
}

.field em {
  color: var(--red);
  font-style: normal;
}

.field input,
.field select,
.field textarea,
.amount-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

.field input,
.field select {
  height: 41px;
  padding: 0 11px;
}

.field select {
  cursor: pointer;
}

.form-month-control {
  min-height: 41px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.form-month-button {
  padding: 0;
  border: 0;
  color: var(--teal);
  background: var(--surface-soft);
  font-size: 19px;
  line-height: 1;
}

.form-month-button:first-child {
  border-right: 1px solid var(--line);
}

.form-month-button:last-child {
  border-left: 1px solid var(--line);
}

.form-month-button:hover {
  background: var(--teal-soft);
}

.form-month-display {
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 0 8px;
  color: var(--ink);
  font-size: 11px;
  text-align: center;
}

.end-month-empty {
  min-height: 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px 0 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

.end-month-empty strong {
  font-size: 10px;
}

.end-month-control {
  display: grid;
  gap: 5px;
}

.inline-text-button {
  padding: 4px 2px;
  border: 0;
  color: var(--teal);
  background: transparent;
  font-size: 8.5px;
  font-weight: 750;
  text-align: right;
}

.end-month-control > .inline-text-button {
  justify-self: end;
}

.field textarea {
  min-height: 76px;
  padding: 10px 11px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a3adb1;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.amount-input:focus-within {
  border-color: #6bafb0;
  outline: 3px solid rgba(8, 127, 131, 0.1);
}

.field-full {
  grid-column: 1 / -1;
}

.amount-input {
  display: flex;
  align-items: center;
  padding-right: 11px;
}

.amount-input input {
  border: 0;
  outline: 0 !important;
}

.amount-input span {
  color: var(--muted);
  font-weight: 750;
}

.field-error {
  min-height: 0;
  color: var(--red);
  font-size: 8.5px;
}

.field-hint {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.field.has-error .amount-input,
.field.has-error .form-month-control {
  border-color: var(--red);
}

.dialog-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 25px;
  border-top: 1px solid var(--line);
  background: rgba(247, 250, 250, 0.96);
  backdrop-filter: blur(8px);
}

.confirm-dialog {
  width: min(390px, calc(100% - 28px));
  padding: 25px 25px 0;
  text-align: center;
}

.confirm-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  color: var(--red);
  background: var(--red-soft);
  font-size: 18px;
  font-weight: 850;
}

.confirm-dialog h2 {
  margin-bottom: 8px;
}

.confirm-dialog p {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.confirm-dialog .dialog-actions {
  position: static;
  margin: 0 -25px;
}

.backup-section {
  margin-top: 14px;
  overflow: hidden;
}

.backup-content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  padding: 0 21px 21px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.backup-action-card,
.backup-security-note {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.backup-action-copy {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.backup-action-copy h3 {
  margin-bottom: 5px;
  font-size: 16px;
}

.backup-action-copy p,
.backup-security-note li,
.backup-dialog-intro,
.backup-password-warning,
.backup-import-warning p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.backup-lock {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 13px;
}

.backup-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.backup-security-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 14px;
}

.backup-security-note ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.backup-dialog {
  width: min(540px, calc(100% - 28px));
}

.backup-dialog form {
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}

.backup-dialog-content {
  display: grid;
  gap: 16px;
  padding: 20px 25px 22px;
}

.backup-dialog-intro {
  margin: 0;
}

.backup-password-warning,
.backup-file-name {
  margin: 0;
  padding: 11px 12px;
  border-radius: 8px;
  color: #4d6269;
  background: #f0f6f6;
  font-size: 13px;
  line-height: 1.45;
}

.backup-file-name {
  overflow-wrap: anywhere;
  font-weight: 750;
}

.backup-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

.backup-preview-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.backup-preview-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.backup-preview-grid dd {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.backup-import-warning {
  padding: 13px 14px;
  border: 1px solid #e6c6a0;
  border-radius: 9px;
  background: #fff8ed;
}

.backup-import-warning strong {
  display: block;
  margin-bottom: 4px;
  color: #8b5216;
  font-size: 14px;
}

.backup-import-warning p {
  margin: 0;
  color: #755a3f;
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 9px;
  color: #fff;
  background: #18333d;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.19);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Lesbarkeits-Feinschliff außerhalb des unveränderten Headers */
main,
dialog {
  font-size: 15px;
}

main :is(
  .breadcrumb,
  .health-badge,
  .metric-heading,
  .metric-card small,
  .section-status,
  .eyebrow,
  .module-tag,
  .need-summary span,
  .liquidity-item span,
  .gap-box span,
  .liquidity-item small,
  .gap-box small,
  .warning-empty small,
  .warning-item strong,
  .warning-item small,
  .fixed-cost-preview,
  .recurring-detail-heading > span,
  .arrears-table-hint,
  .chart-card-heading span,
  .chart-empty,
  .bottleneck-card > span,
  .bottleneck-card > small,
  .matrix-switch button,
  .matrix-empty,
  .fixed-cost-note p,
  .template-name small,
  .interval-cell small,
  .interval-pill,
  .template-active-toggle,
  .fixed-cost-empty small,
  .payment-plan-tabs button,
  .section-copy,
  .search-field input,
  .table-tools select,
  .bulk-action-bar > strong,
  .button-compact,
  .date-cell small,
  .description-cell small,
  .status-select,
  .priority,
  .row-action.complete,
  .empty-state p,
  .table-footer
) {
  font-size: 12px;
}

main .fixed-cost-preview strong,
main .chart-card-heading strong,
main .fixed-cost-empty strong {
  font-size: 13px;
}

main .metric-card small,
main .liquidity-item small,
main .gap-box small,
main .warning-empty small,
main .warning-item small,
main .section-copy,
main .fixed-cost-note p,
main .fixed-cost-empty small {
  line-height: 1.45;
}

main .warning-items {
  grid-auto-rows: 58px;
  max-height: 223px;
}

main .warning-item {
  height: 58px;
}

main .warning-item small {
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-line-clamp: 1;
}

main .recurring-payments-grid .module-actions .button {
  font-size: 12px;
}

main table,
main .matrix-table {
  font-size: 13px;
}

main th {
  font-size: 12px;
  letter-spacing: 0.045em;
}

main .annual-chart-column > span,
main .annual-chart-column > small {
  font-size: 12px;
}

main .category-bar-row > div:first-child,
main .expense-donut strong,
main .expense-donut span {
  font-size: 12px;
}

main .category-bar-track {
  height: 4px;
}

dialog :is(
  .delete-template-stats dt,
  .history-note,
  .detail-row dt,
  .form-section-label small,
  .field-error,
  .field-hint,
  .inline-text-button
) {
  font-size: 12px;
}

dialog :is(
  .detail-row dd,
  .form-section-label span,
  .field > span,
  .form-month-display,
  .end-month-empty strong,
  .confirm-dialog p
) {
  font-size: 13px;
}

footer,
footer .text-button {
  font-size: 12px;
}

.toast {
  font-size: 13px;
}

@media (min-width: 1550px) {
  .metrics-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .metric-card-emphasis {
    grid-column: span 1;
  }
}

@media (max-width: 1180px) {
  .finance-trend-content {
    grid-template-columns: minmax(0, 1.5fr) minmax(230px, 1fr);
  }

  .bottleneck-card {
    grid-column: 1 / -1;
  }

  .dashboard-modules {
    grid-template-columns: 1fr;
  }

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

  .warning-empty {
    min-height: 110px;
  }

  .warning-items {
    grid-template-columns: 1fr;
  }

  .entries-section table {
    min-width: 900px;
  }
}

@media (max-width: 1050px) {
  .sidebar-toggle {
    display: none;
  }

  .cockpit-shell {
    display: block;
  }

  .recurring-payments-grid {
    grid-template-columns: 1fr;
  }

  .backup-content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 13px 16px 10px;
  }

  .sidebar-brand {
    padding: 0 3px 11px;
  }

  .sidebar-label,
  .sidebar-footer {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-link {
    min-width: max-content;
    min-height: 38px;
    padding: 0 10px;
  }

  .nav-link > small {
    display: none;
  }

  .topbar {
    top: 0;
  }

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

  .metric-card-emphasis {
    grid-column: span 2;
  }

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

  .liquidity-separator {
    display: none;
  }

  .entries-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .fixed-costs-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .matrix-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .module-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .module-actions .button {
    flex: 1;
  }

  .table-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-field {
    flex: 1 1 100%;
  }
}

@media (max-width: 700px) {
  .finance-trend-content {
    grid-template-columns: 1fr;
    padding-right: 15px;
    padding-left: 15px;
  }

  .bottleneck-card {
    grid-column: auto;
  }

  .analysis-heading,
  .section-heading-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading-actions {
    width: 100%;
  }

  .section-heading-actions .button {
    width: 100%;
  }

  .entries-table-tools {
    align-items: stretch;
  }

  .topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 15px 16px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .month-navigation {
    order: -1;
    flex: 1 1 100%;
    align-items: stretch;
  }

  .month-navigation-row {
    justify-content: space-between;
  }

  .button-demo,
  .topbar-actions .button-primary {
    flex: 1;
  }

  .module-actions {
    align-items: stretch;
    flex-direction: column;
  }

  main {
    padding: 23px 16px 0;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .warning-items {
    grid-template-columns: 1fr;
  }

  .form-section-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  footer {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 520px) {
  .sidebar-brand strong {
    font-size: 14px;
  }

  .nav-icon {
    display: none;
  }

  .metrics-grid,
  .liquidity-grid,
  .need-summary,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .metric-card-emphasis,
  .field-full {
    grid-column: auto;
  }

  .module-heading,
  .fixed-costs-heading,
  .entries-heading {
    padding-right: 16px;
    padding-left: 16px;
  }

  .fixed-cost-note {
    margin-right: 15px;
    margin-left: 15px;
  }

  .liquidity-grid {
    padding-right: 15px;
    padding-left: 15px;
  }

  .table-tools select {
    flex: 1;
  }

  .bulk-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .bulk-action-bar > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .delete-template-stats {
    grid-template-columns: 1fr;
  }

  .table-footer-note {
    display: none;
  }

  .dialog-header,
  .form-grid,
  .type-switch,
  .dialog-actions,
  .backup-dialog-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .backup-content {
    padding-right: 15px;
    padding-left: 15px;
  }

  .backup-buttons {
    flex-direction: column;
  }

  .backup-buttons .button {
    width: 100%;
  }

  .backup-preview-grid {
    grid-template-columns: 1fr;
  }

  .dialog-actions .button {
    flex: 1;
  }

  .entry-detail-content {
    grid-template-columns: 1fr;
    padding-right: 18px;
    padding-left: 18px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
