:root {
  --bg: #f7f8fc;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(255, 255, 255, 0.58);
  --glass-line: rgba(88, 101, 128, 0.18);
  --line: rgba(99, 113, 139, 0.18);
  --text: #101820;
  --muted: #6d7682;
  --muted-2: #8c96a3;
  --accent: #23856d;
  --accent-soft: rgba(35, 133, 109, 0.12);
  --ink: #0d1720;
  --danger: #c94848;
  --success: #23856d;
  --sidebar-width: 216px;
  --sidebar-collapsed: 68px;
  --content-width: min(calc(100vw - var(--sidebar-width) - 40px), 1680px);
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 24px 70px rgba(48, 62, 86, 0.17);
  --shadow-soft: 0 14px 34px rgba(44, 56, 78, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 4% 4%, rgba(164, 210, 242, 0.88), transparent 42%),
    radial-gradient(circle at 84% 3%, rgba(179, 225, 218, 0.72), transparent 39%),
    radial-gradient(circle at 86% 90%, rgba(157, 218, 207, 0.58), transparent 44%),
    radial-gradient(circle at 18% 96%, rgba(183, 220, 241, 0.54), transparent 36%),
    linear-gradient(135deg, #f7fbff 0%, #f1f8f8 52%, #f4fbfa 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.auth-pending {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

body.auth-pending > :not(.auth-gate):not(script) {
  display: none !important;
}

.auth-gate {
  width: min(430px, 100%);
}

.auth-gate[hidden] { display: none; }

.auth-card {
  padding: 28px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.auth-brand > span:last-child { display: grid; gap: 2px; }
.auth-brand strong { font-size: 15px; }
.auth-brand small { color: var(--muted); font-size: 11px; }
.auth-card h1 { margin: 4px 0 8px; font-size: 30px; }
.auth-copy { margin: 0 0 22px; color: var(--muted); line-height: 1.55; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; }
.auth-form label > span { color: var(--muted); font-size: 11px; font-weight: 820; text-transform: uppercase; }
.auth-form input { width: 100%; min-height: 46px; }
.auth-form button { width: 100%; margin-top: 4px; }
.auth-message { min-height: 20px; margin: 14px 0 0; color: var(--danger); font-size: 12px; font-weight: 700; }
.auth-message[data-kind="info"] { color: var(--muted); }
.auth-privacy { display: block; margin-top: 20px; color: var(--muted-2); line-height: 1.45; }

.preview-banner {
  position: fixed;
  right: 16px;
  bottom: 12px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(35, 133, 109, 0.24);
  border-radius: 999px;
  background: rgba(240, 255, 250, 0.92);
  box-shadow: 0 10px 30px rgba(35, 87, 74, 0.14);
  color: #176653;
  font-size: 11px;
  pointer-events: none;
  backdrop-filter: blur(18px);
}

.preview-banner[hidden] { display: none; }
.preview-banner strong { font-size: inherit; }
.preview-banner > span:last-child { color: var(--muted); }

.sidebar-user {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.sidebar-collapsed .sidebar-user { display: none; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.08);
}

body.sidebar-collapsed {
  --sidebar-width: var(--sidebar-collapsed);
}

button,
input,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(35, 133, 109, 0.22);
  outline-offset: 2px;
}

.sidebar {
  position: fixed;
  inset: 12px auto 12px 12px;
  z-index: 10;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  width: var(--sidebar-width);
  padding: 12px;
  border: 1px solid var(--glass-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(1.2);
  transition: width 220ms ease, padding 220ms ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 4px 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #0f1a24, #1f3545);
  color: #bff7dd;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(16, 24, 32, 0.18);
}

.sidebar-brand-copy,
.nav-text,
.nav-section-label {
  transition: opacity 160ms ease, transform 160ms ease;
}

.sidebar-brand-copy {
  display: grid;
  min-width: 0;
}

.sidebar-brand-copy strong {
  overflow: hidden;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-brand-copy span {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-toggle {
  justify-self: end;
  width: 28px;
  height: 28px;
  margin: -2px 2px 12px 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: #526170;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.sidebar-toggle:hover {
  background: color-mix(in srgb, var(--accent) 10%, white 90%);
  border-color: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: var(--shadow-soft);
}

body.sidebar-collapsed .sidebar-toggle {
  justify-self: center;
  margin-right: 0;
  transform: rotate(180deg);
}

.app-tabs {
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: hidden;
}

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

.nav-section-label {
  padding: 0 10px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tab-button,
.sidebar-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #4b5865;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 720;
  text-align: left;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.tab-button:hover,
.sidebar-action:hover {
  background: color-mix(in srgb, var(--accent) 10%, white 90%);
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--ink);
}

.tab-button.is-sortable,
.sidebar-action.is-sortable {
  cursor: grab;
}

.tab-button.is-sortable:active,
.sidebar-action.is-sortable:active {
  cursor: grabbing;
}

.tab-button.is-dragging,
.sidebar-action.is-dragging {
  opacity: 0.58;
  transform: scale(0.98);
  box-shadow: 0 14px 30px rgba(35, 45, 65, 0.14);
}

.tab-button.is-sortable:focus-visible,
.sidebar-action.is-sortable:focus-visible {
  outline: 2px solid rgba(35, 133, 109, 0.34);
  outline-offset: 2px;
}

.tab-button.active {
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, white 88%);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(62, 88, 128, 0.09);
}

.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 9px;
  background: rgba(16, 24, 32, 0.06);
  color: #4d6b8d;
  font-size: 12px;
  font-weight: 850;
}

.tab-button.active .nav-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-footer {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sidebar-theme-control {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px;
  padding: 0 6px 7px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
}

.sidebar-theme-control .tool-label {
  padding: 0;
  font-size: 9px;
}

.theme-switcher.sidebar-theme-switcher {
  justify-self: end;
  gap: 1px;
  width: auto;
  padding: 2px;
  border-radius: 9px;
}

.theme-switcher.sidebar-theme-switcher button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 7px;
  font-size: 0;
}

.theme-switcher.sidebar-theme-switcher button > span:first-child { font-size: 12px; }

.theme-switcher.sidebar-theme-switcher .theme-label { display: none; }

body.sidebar-collapsed .sidebar-theme-control .tool-label,
body.sidebar-collapsed .sidebar-theme-switcher .theme-label {
  display: none;
}

body.sidebar-collapsed .sidebar-theme-switcher {
  display: grid;
  justify-self: center;
}

body.sidebar-collapsed .sidebar-theme-switcher button {
  width: 30px;
  min-height: 26px;
  padding: 0;
}

.tool-label {
  padding: 0 10px 2px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

body.sidebar-collapsed .sidebar {
  padding-inline: 10px;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-brand-copy,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .tool-label {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
}

body.sidebar-collapsed .tab-button,
body.sidebar-collapsed .sidebar-action {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .tab-button::after,
body.sidebar-collapsed .sidebar-action::after {
  content: attr(data-tooltip);
  position: fixed;
  left: calc(var(--sidebar-collapsed) + 24px);
  z-index: 40;
  min-width: max-content;
  padding: 7px 9px;
  border: 1px solid rgba(88, 101, 128, 0.16);
  border-radius: 10px;
  background: rgba(13, 23, 32, 0.9);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(13, 23, 32, 0.2);
  font-size: 12px;
  font-weight: 760;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 100ms ease, transform 100ms ease;
}

body.sidebar-collapsed .tab-button:hover::after,
body.sidebar-collapsed .sidebar-action:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.appbar {
  display: none;
  position: relative;
  margin-left: calc(var(--sidebar-width) + 24px);
  padding: 18px 0 8px;
  transition: margin-left 220ms ease;
  border-bottom: 1px solid rgba(99, 113, 139, 0.1);
  background: rgba(247, 249, 253, 0.94);
  box-shadow: 0 8px 24px rgba(44, 56, 78, 0.06);
  backdrop-filter: blur(22px) saturate(1.12);
}

.appbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--content-width);
  margin-inline: auto;
}

.appbar-main {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.eyebrow {
  margin: 0;
  color: #168064;
  font-size: 10px;
  font-weight: 840;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1;
}

.brand-copy span {
  color: var(--muted);
  font-size: 13px;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

main {
  margin-left: calc(var(--sidebar-width) + 24px);
  transition: margin-left 220ms ease;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.shell {
  display: grid;
  grid-template-columns: minmax(198px, 224px) minmax(0, 1fr);
  gap: 12px;
  width: var(--content-width);
  margin-inline: auto;
  padding: 12px 0 34px;
  align-items: start;
}

.shell > .filters,
.shell > .content,
.shell > .content > :first-child {
  margin-top: 0;
}

body.filters-collapsed .shell {
  grid-template-columns: 58px minmax(0, 1fr);
}

.page-shell {
  display: grid;
  gap: 18px;
  padding: 18px 0 44px;
}

.page-shell.narrow {
  width: var(--content-width);
  margin-inline: auto;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.page-header h2 {
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1;
}

.page-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.budget-target-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 4px 6px 4px 11px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 26px rgba(35, 45, 65, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  backdrop-filter: blur(16px);
}

.budget-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 7px;
  color: var(--ink);
  font-size: 13px;
}

.budget-input-wrap input {
  width: 82px;
  min-height: 27px;
  padding: 3px 6px;
  border-color: rgba(89, 102, 126, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.inline-actions,
.top-actions,
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.action-button,
.ghost-button,
.delete-row-button,
.danger-button,
.icon-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(45, 55, 72, 0.07);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.action-button:hover,
.ghost-button:hover,
.delete-row-button:hover,
.danger-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--accent) 8%, white 92%);
  border-color: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: 0 12px 26px rgba(45, 55, 72, 0.1);
}

.action-button.primary {
  border-color: rgba(16, 24, 32, 0.12);
  background: rgba(13, 23, 32, 0.92);
  color: #ffffff;
}

.compact {
  min-height: 28px;
  padding-inline: 10px;
  font-size: 11px;
}

.ghost-button {
  width: 100%;
  background: var(--ink);
  color: #ffffff;
}

.delete-row-button,
.danger-button {
  min-height: 28px;
  color: var(--danger);
  background: rgba(255, 246, 246, 0.86);
  border-color: rgba(201, 72, 72, 0.18);
}

.icon-button {
  width: 31px;
  min-width: 31px;
  padding: 0;
  font-size: 15px;
}

.mini-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 11px;
  white-space: nowrap;
}

.filters,
.metric,
.panel {
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(1.16);
}

.filters {
  position: sticky;
  top: 12px;
  align-self: start;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  padding: 12px;
  transition: max-height 180ms ease, padding 180ms ease, box-shadow 180ms ease, width 180ms ease;
}

.filters.collapsed {
  gap: 0;
  overflow: hidden;
  width: 58px;
  padding: 10px;
}

.filters.collapsed > :not(.filter-heading) {
  display: none;
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.filters.collapsed .filter-heading > div {
  display: none;
}

.filters.collapsed .filter-heading {
  justify-content: center;
  padding-bottom: 0;
  border-bottom: 0;
}

.filters.collapsed #filterToggle {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 0;
}

.filters.collapsed #filterToggle::before {
  content: "⚙";
  font-size: 15px;
}

.filter-heading strong {
  font-size: 14px;
}

.filter-heading span {
  color: var(--muted);
  font-size: 11px;
}

.filter-grid,
.filter-group,
.range-control {
  display: grid;
  gap: 7px;
}

label,
.range-header,
.range-control span,
.template-form label > span,
.modal-form label > span,
.category-form label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 32px;
  border: 1px solid rgba(92, 108, 130, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 0 10px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

td select {
  min-width: 160px;
  min-height: 32px;
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 17px;
  accent-color: var(--success);
  padding: 0;
}

input:focus,
select:focus {
  border-color: rgba(35, 133, 109, 0.48);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(35, 133, 109, 0.11);
}

input[type="range"] {
  accent-color: var(--accent);
  padding: 0;
}

.range-panel {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(35, 133, 109, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.range-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.range-header strong {
  color: var(--text);
  text-align: right;
}

.quick-filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.quick-filter {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 760;
}

.quick-filter:hover,
.quick-filter.active {
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, white 86%);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
}

.content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.metric {
  display: grid;
  gap: 7px;
  min-height: 100px;
  padding: 14px;
}

.metric span,
.panel-title span,
.hero-title-block span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric strong {
  font-size: clamp(19px, 1.7vw, 28px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.metric small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.metric.primary {
  background: rgba(14, 22, 32, 0.88);
  color: #ffffff;
}

.metric.primary span,
.metric.primary small {
  color: rgba(255, 255, 255, 0.68);
}

.metric.primary .metric-icon {
  background: rgba(255, 255, 255, 0.12);
  color: #bff7dd;
}

.metric.warning strong {
  color: var(--danger);
}

.panel {
  min-width: 0;
  overflow: hidden;
  padding: 15px;
}

.hero-analysis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-height: 430px;
  background:
    radial-gradient(circle at 16% 8%, rgba(130, 217, 201, 0.28), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(139, 92, 246, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(12, 22, 31, 0.96), rgba(31, 55, 78, 0.96));
  color: #f7fbff;
}

.mobile-week-budget-banner {
  display: none;
}

.hero-analysis-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.hero-title-block {
  display: grid;
  gap: 4px;
}

.hero-title-block h2 {
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 0.98;
}

.hero-title-block p {
  margin: 0;
  color: rgba(247, 251, 255, 0.7);
  font-size: 13px;
  line-height: 1.4;
}

.hero-analysis .hero-title-block span,
.hero-analysis h2 {
  color: #ffffff;
}

.hero-stats {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-stats div {
  min-width: 132px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-stats span {
  display: block;
  margin-bottom: 4px;
  color: rgba(247, 251, 255, 0.62);
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.hero-stats strong {
  color: #ffffff;
  font-size: 17px;
}

.chart-shell {
  position: relative;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.monthly-panel canvas {
  height: clamp(350px, 48vh, 500px);
  min-width: min(100%, 1000px);
}

.chart-tooltip {
  position: absolute;
  z-index: 30;
  min-width: 150px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  background: rgba(13, 23, 32, 0.9);
  color: #ffffff;
  box-shadow: 0 20px 44px rgba(10, 18, 26, 0.24);
  pointer-events: none;
  opacity: 0;
  transition: opacity 100ms ease;
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.chart-tooltip span {
  display: block;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  line-height: 1.35;
}

.chart-tooltip .tooltip-top {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

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

.dashboard-grid > .panel {
  min-height: 250px;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.panel-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: -2px 0 12px;
}

.panel-tools input {
  min-height: 30px;
}

.empty-state {
  margin: 0;
  padding: 20px 0;
  color: var(--muted);
  font-size: 13px;
}

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

.drilldown-row {
  cursor: pointer;
  border-radius: 11px;
  padding: 4px;
  margin: -4px;
  transition: background 120ms ease, transform 120ms ease;
}

.drilldown-row:hover,
.drilldown-row:focus-visible {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateY(-1px);
}

.bar-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  font-weight: 720;
}

.bar-line span:first-child {
  flex: 0 0 auto;
  overflow: visible;
  white-space: nowrap;
}

.track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(26, 36, 47, 0.07);
}

.fill {
  height: 100%;
  border-radius: inherit;
}

.cost-split {
  display: grid;
  gap: 14px;
}

.split-stack {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(26, 36, 47, 0.08);
}

.split-part {
  min-width: 2px;
  height: 100%;
}

.cost-card {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(99, 113, 139, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.52);
}

.cost-card-line,
.expense-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.cost-card strong,
.expense-line strong {
  font-size: 13px;
}

.cost-card small,
.expense-meta {
  color: var(--muted);
  font-size: 12px;
}

.expense-list {
  display: grid;
  gap: 9px;
}

.expense-item {
  display: grid;
  gap: 6px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(99, 113, 139, 0.12);
}

.expense-item:last-child {
  border-bottom: 0;
}

.expense-rank {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(16, 24, 32, 0.06);
  color: #4b5865;
  font-size: 11px;
  font-weight: 850;
}

.expense-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.expense-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-panel {
  padding-bottom: 0;
  background: var(--surface-strong);
  backdrop-filter: blur(18px);
}

.table-wrap {
  overflow: auto;
  margin: 0 -14px;
  max-height: 300px;
  border-top: 1px solid var(--line);
}

.table-wrap.large {
  max-height: calc(100vh - 250px);
}

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

th,
td {
  padding: 10px 13px;
  border-bottom: 1px solid rgba(99, 113, 139, 0.14);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

#merchantsTable td,
#ordersTable td,
#categoriesTable td {
  padding-block: 9px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 250, 253, 0.96);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
  backdrop-filter: blur(14px);
}

.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.duplicate {
  color: var(--danger);
  font-weight: 800;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: none;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--chip-color, #8a96a6) 22%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip-color, #8a96a6) 12%, white 88%);
  color: color-mix(in srgb, var(--chip-color, #3f4b5b) 58%, #111827 42%);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.chip.subtle {
  background: color-mix(in srgb, var(--chip-color, #64748b) 8%, white 92%);
  border-color: color-mix(in srgb, var(--chip-color, #64748b) 18%, transparent);
  color: color-mix(in srgb, var(--chip-color, #475569) 50%, #1f2937 50%);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(35, 133, 109, 0.1);
  color: var(--success);
  font-size: 12px;
  font-weight: 820;
}

.category-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.order-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(8, minmax(116px, 1fr));
  gap: 10px;
  align-items: end;
}

.mobile-filter-toggle,
.booking-stepper,
.booking-step-action {
  display: none;
}

.booking-step {
  display: contents;
}

.budget-controls {
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr);
}

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

.budget-share {
  display: grid;
  gap: 6px;
  min-width: 120px;
}

.budget-share span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.template-form,
.modal-form {
  display: grid;
  gap: 10px;
  align-items: end;
}

.template-form label,
.modal-form label,
.category-form label {
  display: grid;
  gap: 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.checkbox-label span {
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  text-transform: none;
}

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

.intro-card {
  display: grid;
  gap: 10px;
  min-height: 176px;
}

.intro-card.hero-help {
  grid-column: span 2;
}

.intro-card h3 {
  margin: 0;
  font-size: 18px;
}

.intro-card p,
.faq-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.intro-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.faq-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.faq-panel details {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.faq-panel summary {
  cursor: pointer;
  font-weight: 820;
}

.template-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

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

.form-actions,
.modal-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-actions .ghost-button,
.modal-actions .ghost-button,
.row-actions .ghost-button {
  width: auto;
  flex: 1;
}

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

.row-actions .ghost-button,
.row-actions .action-button {
  flex: 0 0 auto;
}

.table-input {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 9px;
  font-size: 12px;
}

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

.editing-row {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 24, 36, 0.24);
  backdrop-filter: blur(14px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(780px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 255, 0.84));
  box-shadow: 0 32px 90px rgba(25, 36, 58, 0.28);
  padding: 18px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0;
  font-size: 26px;
}

.modal-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.csv-import-card {
  width: min(860px, 100%);
}

.csv-import-section {
  display: grid;
  gap: 16px;
}

.csv-import-section[hidden] {
  display: none;
}

.csv-import-summary,
.csv-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.csv-import-summary > div,
.csv-result-grid > div {
  display: grid;
  gap: 3px;
  min-height: 68px;
  align-content: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.csv-import-summary span,
.csv-result-grid span,
.field-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.csv-import-summary strong,
.csv-result-grid strong {
  font-size: 20px;
}

.csv-column-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.csv-column-chip {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(35, 133, 109, 0.12);
  color: #176653;
  font-size: 10px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.csv-import-messages:empty {
  display: none;
}

.csv-import-message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(201, 72, 72, 0.1);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.csv-import-message.warning {
  background: rgba(35, 133, 109, 0.1);
  color: #176653;
}

.csv-preview-table-wrap {
  max-height: 270px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.csv-preview-table {
  min-width: 640px;
}

.csv-preview-table th,
.csv-preview-table td {
  padding: 10px 12px;
  font-size: 11px;
}

.csv-preview-table td:last-child,
.csv-preview-table th:last-child {
  text-align: right;
}

.csv-import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.csv-result-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-inline: auto;
  border-radius: 50%;
  background: rgba(35, 133, 109, 0.14);
  color: var(--success);
  font-size: 22px;
  font-weight: 900;
}

.csv-import-section > h3 {
  margin: -5px 0 2px;
  text-align: center;
}

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

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

.wide-field,
.modal-actions {
  grid-column: 1 / -1;
}

.modal-check {
  align-self: end;
}

body.modal-open {
  overflow: hidden;
}

.mobile-bottom-nav,
.mobile-more-menu {
  display: none;
}

.app-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(13, 23, 32, 0.94);
  color: #ffffff;
  box-shadow: 0 18px 46px rgba(13, 23, 32, 0.24);
  font-size: 13px;
  font-weight: 760;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.table-title-inline {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.orders-table {
  table-layout: fixed;
}

.orders-table th {
  position: sticky;
}

.orders-table th .th-content {
  display: block;
  overflow: hidden;
  padding-right: 12px;
  text-overflow: ellipsis;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 3;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.column-resizer::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 4px;
  bottom: 9px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
}

.orders-table th:hover .column-resizer::after,
.column-resizer:hover::after,
.column-resizer.active::after {
  background: rgba(35, 133, 109, 0.64);
}

body.resizing-column {
  cursor: col-resize;
  user-select: none;
}

.hidden-row {
  color: var(--muted);
  background: rgba(248, 250, 253, 0.76);
}

.orders-table th,
.orders-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.orders-table td {
  white-space: nowrap;
}

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

@media (max-width: 1180px) {
  :root {
    --content-width: calc(100vw - var(--sidebar-width) - 40px);
  }

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

  .filters {
    position: static;
    max-height: none;
  }

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

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

@media (max-width: 1024px) {
  :root {
    --content-width: calc(100vw - 40px);
  }

  .sidebar {
    display: none;
  }

  .tab-button.is-sortable,
  .sidebar-action.is-sortable {
    cursor: pointer;
  }

  .appbar,
  main {
    margin-left: 0;
  }

  .appbar {
    display: block;
    position: static;
  }

  main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .appbar-inner,
  .shell,
  .page-shell.narrow {
    width: var(--content-width);
  }

  #openNewOrderModal {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 42;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    min-height: 72px;
    padding: 7px 8px 6px;
    border: 1px solid var(--glass-line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 20px 60px rgba(37, 50, 73, 0.2);
    backdrop-filter: blur(28px) saturate(1.18);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .mobile-nav-item {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 54px;
    padding: 3px 2px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 9px;
    font-weight: 760;
    line-height: 1.05;
    text-align: center;
  }

  .mobile-nav-item.active {
    color: var(--success);
  }

  .mobile-nav-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(16, 24, 32, 0.055);
    color: currentColor;
    font-size: 15px;
    font-weight: 850;
  }

  .mobile-nav-primary {
    position: relative;
    align-self: start;
    margin-top: -25px;
    overflow: visible;
    color: var(--ink);
    font-weight: 850;
  }

  .mobile-primary-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 2px;
    border: 5px solid rgba(255, 255, 255, 0.94);
    border-radius: 50%;
    background: var(--success);
    color: #ffffff;
    box-shadow: 0 14px 34px rgba(35, 133, 109, 0.3);
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
  }

  body.modal-open .mobile-bottom-nav,
  body.mobile-menu-open .mobile-bottom-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
  }

  .mobile-more-menu {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: grid;
    align-items: end;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    background: rgba(14, 24, 36, 0.22);
    backdrop-filter: blur(12px);
  }

  .mobile-more-menu[hidden] {
    display: none;
  }

  .mobile-more-sheet {
    width: min(520px, 100%);
    margin-inline: auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 22px;
    background: var(--surface-strong);
    box-shadow: 0 30px 80px rgba(25, 36, 58, 0.28);
  }

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

  .mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mobile-more-grid button,
  .mobile-more-grid a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 760;
    text-align: left;
    text-decoration: none;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mobile-more-grid button span,
  .mobile-more-grid a span {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(35, 133, 109, 0.12);
    color: var(--success);
    font-size: 11px;
    font-weight: 850;
  }

  .modal-backdrop {
    place-items: stretch;
    padding: 0;
    background: rgba(247, 248, 252, 0.96);
  }

  .modal-card {
    width: 100%;
    height: 100dvh;
    max-height: none;
    padding: max(18px, env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 14px;
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.98) 82%, rgba(251, 253, 255, 0));
  }

  .modal-head .icon-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 14px;
  }

  .modal-form input,
  .modal-form select {
    min-height: 48px;
    padding-inline: 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    font-size: 15px;
  }

  .modal-form input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: 22px;
  }

  .modal-form .checkbox-label {
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.68);
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-top: 14px;
    background: linear-gradient(0deg, rgba(251, 253, 255, 0.99) 80%, rgba(251, 253, 255, 0));
  }

  .modal-actions button {
    min-height: 48px;
    border-radius: 12px;
    font-size: 14px;
  }

  .csv-import-card {
    overflow-x: hidden;
  }

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

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

  .csv-import-summary > div,
  .csv-result-grid > div {
    min-height: 60px;
    padding: 10px;
  }

  .csv-import-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  }

  .booking-stepper {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.055);
  }

  .booking-stepper span {
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
  }

  .booking-stepper span.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    box-shadow: 0 5px 16px rgba(43, 55, 77, 0.1);
  }

  .booking-step {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .booking-step.active {
    display: grid;
  }

  .booking-step .wide-field {
    grid-column: 1 / -1;
  }

  .booking-step-action {
    display: inline-flex;
  }

  .modal-form[data-current-step="1"] #bookingPreviousStep,
  .modal-form[data-current-step="1"] #bookingSubmit,
  .modal-form[data-current-step="2"] #cancelBookingModal,
  .modal-form[data-current-step="2"] #bookingNextStep {
    display: none;
  }

  .table-wrap {
    scrollbar-width: none;
  }

  .table-wrap::-webkit-scrollbar {
    display: none;
  }

  .app-toast {
    right: 16px;
    bottom: calc(98px + env(safe-area-inset-bottom));
    left: 16px;
    max-width: none;
    text-align: center;
  }

  body.modal-open .app-toast {
    bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 1024px) {
  .appbar {
    padding: 12px 14px 2px;
  }

  .appbar-main h1 {
    font-size: 28px;
    line-height: 1;
  }

  .appbar-main .subtitle {
    font-size: 13px;
  }

  .appbar-inner,
  .shell,
  .page-shell.narrow {
    width: auto;
  }

  .shell,
  .page-shell {
    padding: 10px 14px 96px;
  }

  .hero-analysis-head {
    align-items: start;
    flex-direction: column;
  }

  .hero-analysis {
    min-height: 0;
    gap: 10px;
    padding: 14px;
  }

  .mobile-week-budget-banner {
    display: grid;
    gap: 9px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
  }

  .mobile-week-budget-head,
  .mobile-week-budget-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-week-budget-head span {
    color: rgba(247, 251, 255, 0.7);
    font-size: 11px;
    font-weight: 820;
    text-transform: uppercase;
  }

  .mobile-week-budget-head strong {
    font-size: 16px;
    line-height: 1;
  }

  .mobile-week-budget-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
  }

  .mobile-week-budget-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #6fd8b9;
    transition: width 180ms ease, background 180ms ease;
  }

  .mobile-week-budget-meta {
    color: rgba(247, 251, 255, 0.72);
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-week-budget-meta span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-week-budget-banner[data-status="warning"] .mobile-week-budget-fill {
    background: #f59e0b;
  }

  .mobile-week-budget-banner[data-status="over"] .mobile-week-budget-fill {
    background: #dc5656;
  }

  .hero-title-block h2 {
    font-size: 28px;
  }

  .hero-title-block p {
    font-size: 12px;
  }

  .hero-stats {
    width: 100%;
    justify-content: stretch;
  }

  .hero-stats div {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 12px;
  }

  .hero-stats strong {
    font-size: 15px;
  }

  .chart-shell {
    overflow-x: hidden;
  }

  .hero-analysis,
  .filter-grid,
  .dashboard-grid,
  .kpis,
  .category-layout,
  .order-controls,
  .template-layout,
  .intro-grid,
  .modal-form {
    grid-template-columns: 1fr;
  }

  .intro-card.hero-help,
  .wide-field,
  .modal-actions {
    grid-column: auto;
  }

  body.filters-collapsed .shell {
    grid-template-columns: 1fr;
  }

  .monthly-panel canvas {
    height: 210px;
    min-width: 0;
  }

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

  #ordersPage .page-header {
    gap: 10px;
  }

  #ordersPage .inline-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  #ordersPage .inline-actions .action-button {
    min-width: 0;
    min-height: 42px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .mobile-filter-toggle {
    display: inline-flex;
    grid-column: 1 / -1;
    justify-content: center;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.82);
  }

  .order-controls {
    padding: 10px;
  }

  .order-controls .filter-group:not(:first-child) {
    display: none;
  }

  .order-controls.mobile-expanded .filter-group {
    display: grid;
  }

  .order-controls.mobile-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(62dvh, 560px);
    overflow-y: auto;
  }

  .order-controls.mobile-expanded .filter-group:first-child {
    grid-column: 1 / -1;
  }

  #ordersPage .table-panel {
    padding: 10px;
    background: rgba(255, 255, 255, 0.52);
  }

  #ordersPage .table-title-inline {
    align-items: center;
  }

  #ordersPage .table-title-inline h2 {
    font-size: 18px;
  }

  #resetOrderColumns {
    display: none;
  }

  #ordersMeta {
    font-size: 10px;
  }

  #ordersPage .table-wrap.large {
    max-height: none;
    overflow: visible;
  }

  #ordersTableElement,
  #ordersTableElement tbody {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
  }

  #ordersTableElement colgroup,
  #ordersTableElement thead {
    display: none;
  }

  #ordersTableElement tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid rgba(99, 113, 139, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 24px rgba(44, 56, 78, 0.08);
  }

  #ordersTableElement td {
    display: flex;
    align-items: center;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  #ordersTableElement td:nth-child(4) {
    grid-column: 1;
    grid-row: 1;
    overflow: hidden;
    font-size: 15px;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #ordersTableElement td:nth-child(9) {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    color: var(--ink);
    font-size: 15px;
    font-weight: 850;
  }

  #ordersTableElement td:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    color: var(--muted);
    font-size: 11px;
  }

  #ordersTableElement td:nth-child(5) {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  #ordersTableElement td:nth-child(6),
  #ordersTableElement td:nth-child(7),
  #ordersTableElement td:nth-child(8) {
    display: none;
  }

  #ordersTableElement td:nth-child(1),
  #ordersTableElement td:nth-child(2) {
    grid-row: 4;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
  }

  #ordersTableElement td:nth-child(1) {
    grid-column: 1;
  }

  #ordersTableElement td:nth-child(1)::after {
    content: "Analyse";
  }

  #ordersTableElement td:nth-child(2) {
    grid-column: 2;
  }

  #ordersTableElement td:nth-child(2)::after {
    content: "Sichtbar";
  }

  #ordersTableElement td:nth-child(10) {
    grid-column: 1 / -1;
    grid-row: 5;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--line);
  }

  #ordersTableElement .row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  #ordersTableElement .row-actions button {
    min-height: 38px;
  }

  #ordersTableElement tr.editing-row td {
    display: grid;
    grid-column: 1 / -1;
    grid-row: auto;
  }

  #ordersTableElement tr.editing-row td:nth-child(1),
  #ordersTableElement tr.editing-row td:nth-child(2) {
    display: flex;
  }

  #ordersTableElement tr.editing-row td:nth-child(1)::after,
  #ordersTableElement tr.editing-row td:nth-child(2)::after {
    display: none;
  }

  #ordersTableElement tr.editing-row td:nth-child(10) {
    padding-top: 8px;
  }

  .page-header-tools {
    width: 100%;
    justify-content: space-between;
  }

  .booking-step {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .booking-step .wide-field {
    grid-column: auto;
  }

  .modal-card {
    padding-inline: 16px;
  }

  .modal-head {
    padding-bottom: 8px;
  }

  .modal-form {
    gap: 9px;
  }

  .modal-form input,
  .modal-form select {
    min-height: 44px;
  }

  .modal-form .checkbox-label {
    min-height: 44px;
  }

  .mobile-bottom-nav {
    right: 8px;
    left: 8px;
    border-radius: 18px;
  }

  .mobile-nav-item {
    font-size: 8px;
  }

  .mobile-more-menu {
    padding-inline: 12px;
  }
}

@media (max-width: 480px) {
  .mobile-more-grid {
    grid-template-columns: 1fr;
  }

  .mobile-more-sheet {
    max-height: min(82dvh, 620px);
    overflow-y: auto;
  }
}

/* Final dashboard utilities and appearance modes */
.theme-switcher {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: var(--surface-soft);
  backdrop-filter: blur(18px);
}

.theme-switcher button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
}

.theme-switcher button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.theme-switcher button.active {
  background: color-mix(in srgb, var(--accent) 12%, white 88%);
  color: var(--accent);
  box-shadow: 0 4px 14px rgba(44, 56, 78, 0.1);
}

.dashboard-utility-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-utility-grid .utility-panel {
  grid-column: span 2;
  min-height: 224px;
}

.dashboard-utility-grid .utility-panel:nth-child(1),
.dashboard-utility-grid .utility-panel:nth-child(2) {
  grid-column: span 3;
}

.text-button {
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
}

.compact-transaction-list,
.account-overview,
.budget-overview,
.notice-list {
  display: grid;
  gap: 4px;
}

.compact-transaction,
.account-row,
.budget-row {
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 5px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.compact-transaction,
.account-row {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
}

.compact-transaction:hover,
.account-row:hover,
.budget-row:hover {
  padding-inline: 7px;
  border-radius: 9px;
  background: var(--accent-soft);
}

.compact-transaction span:nth-child(2),
.account-row span:nth-child(2),
.budget-row > span:first-child,
.notice-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.compact-transaction strong,
.account-row strong,
.budget-row strong,
.notice-row strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-transaction small,
.account-row small,
.budget-row small,
.notice-row small {
  color: var(--muted);
  font-size: 10px;
}

.compact-transaction b,
.account-row b {
  font-size: 12px;
  white-space: nowrap;
}

.positive { color: var(--success) !important; }
.negative { color: var(--danger) !important; }

.transaction-dot,
.account-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--dot, var(--accent)) 14%, transparent);
  color: var(--dot, var(--accent));
  font-size: 12px;
  font-weight: 900;
}

.account-icon {
  --dot: var(--accent);
}

.budget-row {
  grid-template-columns: 1fr;
  gap: 5px;
}

.budget-row > span:first-child {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
}

.budget-row .track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(99, 113, 139, 0.12);
}

.budget-row .track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-action-grid button {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 780;
  cursor: pointer;
}

.quick-action-grid button:hover {
  border-color: rgba(35, 133, 109, 0.32);
  background: var(--accent-soft);
}

.quick-action-grid button span {
  color: var(--accent);
  font-size: 18px;
}

.notice-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding-block: 6px;
  border-bottom: 1px solid var(--line);
}

.notice-row > span:first-child {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: rgba(35, 133, 109, 0.12);
  color: var(--success);
}

.notice-row em {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(35, 133, 109, 0.12);
  color: var(--success);
  font-size: 9px;
  font-style: normal;
  font-weight: 820;
}

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

.account-card {
  display: grid;
  gap: 18px;
}

.account-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-card-head .edit-account-name {
  margin-left: auto;
}

.account-card-head > span:last-child {
  display: grid;
}

.account-card-head small,
.account-note p {
  color: var(--muted);
}

.account-balance {
  font-size: clamp(24px, 3vw, 36px);
}

.account-meta {
  display: grid;
  gap: 5px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.account-meta span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.account-note {
  margin-top: 14px;
}

.account-form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.account-form[hidden] { display: none; }

.account-form label,
.account-inline-edit label {
  display: grid;
  flex: 1 1 280px;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.account-form input,
.account-inline-edit input {
  min-height: 38px;
}

.account-inline-edit {
  display: grid;
  gap: 10px;
}

.form-error {
  min-height: 16px;
  margin: 0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 720;
}

.account-note p {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.55;
}

.status-icon-cell {
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.mobile-status-icon { display: none; }
.mobile-booking-status { display: none; }

.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#ordersTableElement td,
#ordersTableElement th {
  padding-block: 7px;
}

html.dark-mode {
  color-scheme: dark;
  --bg: #0d1420;
  --surface: rgba(22, 31, 44, 0.78);
  --surface-strong: rgba(27, 37, 52, 0.96);
  --surface-soft: rgba(31, 42, 58, 0.62);
  --glass-line: rgba(181, 199, 226, 0.13);
  --line: rgba(181, 199, 226, 0.12);
  --text: #eef4fb;
  --muted: #aab6c5;
  --muted-2: #8391a4;
  --accent: #23856d;
  --accent-soft: rgba(35, 133, 109, 0.16);
  --ink: #eef4fb;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html.dark-mode body {
  background:
    radial-gradient(circle at 5% 4%, rgba(28, 94, 126, 0.48), transparent 40%),
    radial-gradient(circle at 84% 5%, rgba(31, 107, 96, 0.38), transparent 39%),
    radial-gradient(circle at 87% 88%, rgba(24, 91, 83, 0.3), transparent 44%),
    linear-gradient(135deg, #0a121b 0%, #0e1821 52%, #0d1c1d 100%);
}

html.dark-mode body::before { background: rgba(0, 0, 0, 0.08); }
html.dark-mode .sidebar { background: rgba(16, 24, 35, 0.72); }
html.dark-mode .panel,
html.dark-mode .metric,
html.dark-mode .filters,
html.dark-mode .modal-card,
html.dark-mode .mobile-more-sheet,
html.dark-mode .mobile-bottom-nav { background: var(--surface); }
html.dark-mode .auth-card { border-color: var(--line); background: var(--surface-strong); }
html.dark-mode .preview-banner { border-color: rgba(111, 216, 185, 0.24); background: rgba(16, 37, 34, 0.94); color: #8de1c7; }
html.dark-mode .hero-analysis { background: radial-gradient(circle at 16% 8%, rgba(44, 151, 126, 0.2), transparent 34%), linear-gradient(135deg, #101b28, #17283c); }
html.dark-mode input,
html.dark-mode select,
html.dark-mode textarea,
html.dark-mode .table-input { border-color: var(--line); background: rgba(8, 14, 23, 0.52); color: var(--text); }
html.dark-mode input:focus,
html.dark-mode select:focus { background: rgba(8, 14, 23, 0.72); }
html.dark-mode .range-panel,
html.dark-mode .quick-filter { border-color: var(--line); background: rgba(8, 14, 23, 0.34); }
html.dark-mode .quick-filter:hover,
html.dark-mode .quick-filter.active { border-color: rgba(111, 216, 185, 0.38); background: rgba(35, 133, 109, 0.2); color: #8de1c7; }
html.dark-mode .tab-button,
html.dark-mode .sidebar-action,
html.dark-mode .nav-section-label,
html.dark-mode .tool-label { color: #aab6c5; }
html.dark-mode .tab-button:hover,
html.dark-mode .sidebar-action:hover,
html.dark-mode .sidebar-toggle:hover,
html.dark-mode .theme-switcher button:hover,
html.dark-mode .quick-action-grid button:hover,
html.dark-mode .ghost-button:hover,
html.dark-mode .action-button:hover,
html.dark-mode .icon-button:hover {
  border-color: rgba(111, 216, 185, 0.2);
  background: rgba(35, 133, 109, 0.16);
  color: #e8f5f1;
}
html.dark-mode .tab-button.active { border-color: rgba(111, 216, 185, 0.28); background: rgba(35, 133, 109, 0.22); color: #ffffff; }
html.dark-mode th { background: rgba(19, 28, 41, 0.96); color: var(--muted); }
html.dark-mode td { border-color: var(--line); }
html.dark-mode .ghost-button,
html.dark-mode .action-button.primary { border-color: #23856d; background: #23856d; color: #ffffff; }
html.dark-mode .action-button { border-color: var(--line); background: rgba(22, 31, 44, 0.92); color: var(--text); }
html.dark-mode .danger-button { background: rgba(201, 72, 72, 0.16); }
html.dark-mode .theme-switcher button.active { background: rgba(35, 133, 109, 0.22); color: #8de1c7; }
html.dark-mode .brand-mark { background: #23856d; color: #ffffff; }
html.dark-mode .eyebrow { color: #6fd8b9; }
html.dark-mode .chart-tooltip { border-color: rgba(255, 255, 255, 0.12); background: rgba(5, 10, 17, 0.96); }
html.dark-mode #ordersTableElement tr { background: rgba(20, 29, 42, 0.9); }
html.dark-mode .quick-action-grid button { background: rgba(10, 17, 27, 0.4); }
html.dark-mode tbody tr:hover,
html.dark-mode .drilldown-row:hover,
html.dark-mode .drilldown-row:focus-visible,
html.dark-mode .editing-row,
html.dark-mode .compact-transaction:hover,
html.dark-mode .account-row:hover,
html.dark-mode .budget-row:hover {
  background: rgba(35, 133, 109, 0.12);
}
html.dark-mode .appbar { border-color: var(--line); background: rgba(13, 20, 32, 0.97); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); }
html.dark-mode .modal-card { border-color: var(--line); background: var(--surface-strong); box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5); }
html.dark-mode .modal-backdrop { background: rgba(7, 12, 20, 0.9); }
html.dark-mode .modal-head {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(27, 37, 52, 0.99) 84%, rgba(27, 37, 52, 0));
}
html.dark-mode .modal-head .icon-button {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}
html.dark-mode .mobile-more-sheet { border-color: var(--line); background: var(--surface-strong); }
html.dark-mode .mobile-more-grid button,
html.dark-mode .mobile-more-grid a { border-color: var(--line); background: var(--surface-soft); color: var(--text); }
html.dark-mode .mobile-more-grid button:hover,
html.dark-mode .mobile-more-grid a:hover { background: rgba(35, 133, 109, 0.16); }
html.dark-mode .budget-target-control { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-soft); }
html.dark-mode .budget-input-wrap { color: var(--text); }
html.dark-mode .modal-actions { border-color: var(--line); background: transparent; }
html.dark-mode .split-part:nth-child(2) { background: #23856d !important; }
html.dark-mode .chip {
  border-color: color-mix(in srgb, var(--chip-color, #9aa7b7) 42%, transparent);
  background: color-mix(in srgb, var(--chip-color, #9aa7b7) 26%, rgba(255, 255, 255, 0.02) 74%);
  color: color-mix(in srgb, var(--chip-color, #cbd5e1) 42%, #ffffff 58%);
}
html.dark-mode .chip.subtle {
  border-color: color-mix(in srgb, var(--chip-color, #9aa7b7) 34%, transparent);
  background: color-mix(in srgb, var(--chip-color, #9aa7b7) 18%, rgba(255, 255, 255, 0.03) 82%);
  color: color-mix(in srgb, var(--chip-color, #dbeafe) 36%, #ffffff 64%);
}
html.dark-mode .csv-import-summary > div,
html.dark-mode .csv-result-grid > div { border-color: var(--line); background: var(--surface-soft); }
html.dark-mode .csv-column-chip { background: rgba(35, 133, 109, 0.2); color: #8de1c7; }
html.dark-mode .csv-import-message { background: rgba(201, 72, 72, 0.16); color: #ffaaaa; }
html.dark-mode .csv-import-message.warning { background: rgba(35, 133, 109, 0.18); color: #8de1c7; }
html.dark-mode .csv-preview-table-wrap { border-color: var(--line); background: var(--surface); }
html.dark-mode .csv-result-icon { background: rgba(35, 133, 109, 0.22); color: #8de1c7; }

@media (max-width: 1024px) {
  body.auth-pending { padding: 18px; }
  .auth-card { padding: 24px 20px; border-radius: 16px; }
  .preview-banner {
    top: 8px;
    right: auto;
    bottom: auto;
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 24px);
    min-height: 30px;
    padding: 5px 10px;
    font-size: 10px;
    transform: translateX(-50%);
  }

  .theme-switcher {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 2px;
  }

  .theme-switcher button {
    width: 30px;
    min-height: 28px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .theme-switcher button::before { font-size: 13px; }
  .theme-switcher button[data-theme-value="light"]::before { content: "☀"; }
  .theme-switcher button[data-theme-value="dark"]::before { content: "☾"; }
  .theme-switcher button[data-theme-value="system"]::before { content: "◐"; }

  .dashboard-utility-grid,
  .accounts-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-utility-grid .utility-panel,
  .dashboard-utility-grid .utility-panel:nth-child(1),
  .dashboard-utility-grid .utility-panel:nth-child(2) {
    grid-column: auto;
    min-height: 0;
  }

  #ordersTableElement tr.booking-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 3px 8px;
    padding: 6px 9px;
    border-radius: 10px;
  }

  #ordersTableElement tr.booking-row td:nth-child(1),
  #ordersTableElement tr.booking-row td:nth-child(2),
  #ordersTableElement tr.booking-row td:nth-child(6),
  #ordersTableElement tr.booking-row td:nth-child(7),
  #ordersTableElement tr.booking-row td:nth-child(8),
  #ordersTableElement tr.booking-row td:nth-child(9) {
    display: none;
  }

  #ordersTableElement tr.booking-row td:nth-child(3) {
    grid-column: 1;
    grid-row: 1;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
    padding: 0;
  }
  #ordersTableElement tr.booking-row td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0;
  }
  #ordersTableElement tr.booking-row td:nth-child(10) {
    grid-column: 3;
    grid-row: 1;
    padding: 0;
  }
  #ordersTableElement tr.booking-row td:nth-child(5) {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 0;
  }
  #ordersTableElement tr.booking-row td:nth-child(5) .chip {
    min-width: 0;
    max-width: calc(100% - 92px);
    overflow: visible;
    white-space: normal;
  }
  #ordersTableElement tr.booking-row .mobile-booking-status {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(35, 133, 109, 0.12);
    color: #176b58;
    font-size: 9px;
    font-weight: 800;
  }
  #ordersTableElement tr.booking-row .mobile-booking-status.excluded {
    background: rgba(201, 72, 72, 0.11);
    color: #b33d3d;
  }
  #ordersTableElement tr.booking-row td:nth-child(11),
  #ordersTableElement tr.booking-row td:nth-child(12) { display: none; }
  #ordersTableElement tr.booking-row td:nth-child(13) {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-end;
    padding: 0;
    border: 0;
  }

  #ordersTableElement tr.booking-row .row-actions { gap: 4px; }
  #ordersTableElement tr.booking-row .mobile-status-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: var(--muted);
    font-size: 12px;
  }
  #ordersTableElement tr.booking-row .row-actions button { min-width: 28px; min-height: 28px; padding: 0 7px; font-size: 0; }
  #ordersTableElement tr.booking-row .edit-row-button::before { content: "✎"; font-size: 14px; }
  #ordersTableElement tr.booking-row .delete-row-button::before { content: "×"; font-size: 17px; }
  #ordersTableElement tr.editing-row td:nth-child(13) { padding-top: 8px; }
  #ordersTableElement tr.editing-row td:nth-child(10) {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-content: stretch;
    padding-top: 0;
    border-top: 0;
  }

  html.dark-mode #ordersTableElement tr.booking-row .mobile-booking-status {
    background: rgba(35, 133, 109, 0.22);
    color: #8de1c7;
  }

  html.dark-mode #ordersTableElement tr.booking-row .mobile-booking-status.excluded {
    background: rgba(201, 72, 72, 0.2);
    color: #ff9b9b;
  }
}
