:root {
  color-scheme: dark;
  --bg: #090d18;
  --surface: #111827;
  --surface-2: #18243a;
  --surface-3: #24324d;
  --text: #f4f8ff;
  --muted: #9badc7;
  --line: rgba(158, 178, 214, 0.20);
  --accent: #22d3bd;
  --accent-2: #ffb545;
  --accent-3: #ff5f8f;
  --accent-4: #74a8ff;
  --accent-5: #9b7cff;
  --good: #35d992;
  --warn: #ffc857;
  --bad: #ff6670;
  --info: #5bb7ff;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 16px 36px rgba(17, 24, 39, 0.22);
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 50px rgba(34, 211, 189, 0.10);
  --radius: 8px;
  --sidebar: 270px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #f0f5fb;
  --surface-3: #e6eef9;
  --text: #152033;
  --muted: #62728b;
  --line: rgba(66, 84, 115, 0.16);
  --accent: #089e8b;
  --accent-2: #dc7d06;
  --accent-3: #d9406c;
  --accent-4: #2e74df;
  --accent-5: #7256d8;
  --good: #0b985e;
  --warn: #bd7a04;
  --bad: #d83a43;
  --info: #1875cf;
  --shadow: 0 14px 38px rgba(28, 42, 68, 0.12);
  --shadow-soft: 0 18px 42px rgba(39, 62, 101, 0.12);
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.72), 0 18px 48px rgba(8, 158, 139, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%),
    linear-gradient(225deg, color-mix(in srgb, var(--accent-3) 14%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent-4) 10%, transparent), transparent 360px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background-attachment: fixed;
}

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

button {
  color: inherit;
}

button,
.panel,
.metric-card,
.table-wrap,
.mobile-record,
.compact-item,
.due-item,
.insight,
.nav-button {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

a {
  color: inherit;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
}

.login-page.login-simple {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 16%, color-mix(in srgb, var(--accent-5) 30%, transparent), transparent 34%),
    radial-gradient(circle at 84% 78%, color-mix(in srgb, var(--accent-2) 24%, transparent), transparent 36%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent),
    var(--bg);
}

.login-showcase {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 32%, transparent), transparent 42%),
    linear-gradient(45deg, color-mix(in srgb, var(--accent-2) 24%, transparent), transparent 56%),
    linear-gradient(160deg, color-mix(in srgb, var(--accent-3) 18%, transparent), transparent 70%),
    var(--surface);
  border-right: 1px solid var(--line);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 54%, #f97316 100%);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.18), 0 2px 10px rgba(29, 78, 216, 0.18);
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
}

.login-showcase h1 {
  font-size: 42px;
  line-height: 1.05;
  margin: 72px 0 18px;
  max-width: 720px;
}

.login-showcase p {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

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

.showcase-tile {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent),
    rgba(255, 255, 255, 0.06);
  padding: 18px;
  border-radius: var(--radius);
}

.showcase-tile strong {
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
}

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

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

.login-simple .login-panel {
  width: min(100%, 460px);
  padding: 0;
}

.login-card {
  width: 100%;
  max-width: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-4) 10%, transparent), transparent 56%),
    var(--surface);
  box-shadow: var(--shadow), var(--glow);
  padding: 28px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
}

.unison-logo-mark {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 54%, #f97316 100%);
  box-shadow: 0 16px 36px rgba(124, 58, 237, 0.28);
  position: relative;
  overflow: hidden;
}

.unison-logo-mark svg {
  position: relative;
  z-index: 1;
}

.brand-mark .unison-logo-mark {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  box-shadow: none;
}

.unison-word {
  font-size: 31px;
  font-weight: 900;
  letter-spacing: 0;
}

.unison-word strong {
  margin-left: 2px;
  background: linear-gradient(90deg, #f97316, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-card h2,
.login-card p {
  text-align: center;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

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

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  min-height: 42px;
  padding: 10px 12px;
  outline: none;
}

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent 42%),
    linear-gradient(35deg, color-mix(in srgb, var(--accent-5) 12%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.sidebar-head h1 {
  margin: 0;
  font-size: 18px;
}

.sidebar-head span {
  color: var(--muted);
  font-size: 12px;
}

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

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  font-weight: 750;
}

.nav-button.active,
.nav-button:hover {
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), transparent 72%),
    var(--surface-2);
  border-color: var(--line);
  transform: translateX(3px);
}

.nav-button.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.nav-button svg,
.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.user-pill {
  display: grid;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.user-pill strong {
  font-size: 14px;
}

.user-pill span {
  color: var(--muted);
  font-size: 12px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 36%),
    color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
}

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

.topbar-title h2 {
  margin: 0;
  font-size: 22px;
}

.topbar-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.content {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: 18px 22px;
}

.button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.button:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-4) 72%, var(--accent)));
  border-color: var(--accent);
  color: #04110f;
}

.button.warn {
  background: linear-gradient(135deg, color-mix(in srgb, var(--warn) 28%, var(--surface-2)), var(--surface-2));
  border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
}

.button.danger {
  background: linear-gradient(135deg, color-mix(in srgb, var(--bad) 24%, var(--surface-2)), var(--surface-2));
  border-color: color-mix(in srgb, var(--bad) 55%, var(--line));
}

.button.icon-only {
  width: 40px;
  padding: 0;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

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

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

.two-col {
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr);
  align-items: start;
}

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

.panel,
.metric-card,
.table-wrap,
.modal-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-4) 7%, transparent), transparent 60%),
    var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.panel:hover,
.table-wrap:hover,
.metric-card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: var(--shadow), var(--glow);
  transform: translateY(-2px);
}

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

.panel-head h3 {
  margin: 0;
  font-size: 17px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.metric-card {
  min-height: 142px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--metric-color, var(--accent)), color-mix(in srgb, var(--metric-color, var(--accent)) 45%, var(--accent-2)));
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: 5px 0 0;
  z-index: -1;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--metric-color, var(--accent)) 20%, transparent), transparent 58%),
    linear-gradient(225deg, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 64%);
}

.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-value {
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  align-self: center;
  overflow-wrap: anywhere;
}

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

.trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--good);
  font-weight: 800;
}

.trend.bad {
  color: var(--bad);
}

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

.period-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--period-color, var(--accent)) 20%, transparent), transparent 68%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 8px;
}

.period-card.positive {
  --period-color: var(--good);
}

.period-card.warning {
  --period-color: var(--warn);
}

.period-card.danger {
  --period-color: var(--bad);
}

.period-card span,
.period-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.period-card strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.dashboard-section {
  margin-top: 10px;
}

.welcome-band {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 62%),
    linear-gradient(225deg, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.welcome-band span,
.welcome-band p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.welcome-band h2 {
  margin: 4px 0;
  font-size: 26px;
  line-height: 1.05;
}

.welcome-band p {
  margin: 0;
}

.welcome-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.welcome-badges span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: var(--surface-2);
  color: var(--text);
}

.dashboard-hero-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  align-items: start;
}

.visual-panel {
  overflow: hidden;
}

.clarity-board {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(300px, .95fr);
  gap: 14px;
  align-items: stretch;
}

.clarity-bars,
.allocation-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-4) 9%, transparent), transparent 70%),
    var(--surface-2);
  padding: 14px;
}

.clarity-bars {
  display: grid;
  gap: 12px;
}

.clarity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
}

.clarity-row strong,
.clarity-row span {
  display: block;
}

.clarity-row > div:first-child span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.clarity-track {
  grid-column: 1 / -1;
}

.clarity-track,
.pressure-bar {
  height: 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-3) 72%, transparent);
  border: 1px solid var(--line);
  overflow: hidden;
}

.clarity-track i,
.pressure-bar i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, white));
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 30%, transparent);
}

.allocation-card {
  display: grid;
  gap: 14px;
}

.allocation-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.allocation-title span,
.legend-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stacked-flow {
  display: flex;
  height: 34px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}

.stacked-flow i {
  display: block;
  width: var(--w);
  min-width: 5px;
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 60%, white));
}

.legend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: color-mix(in srgb, var(--surface) 48%, transparent);
}

.legend-item i,
.pressure-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
}

.flow-board {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(250px, 360px);
  gap: 18px;
  align-items: center;
}

.flow-orbit {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 58%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent-5) 10%, transparent), transparent),
    var(--surface-2);
}

.flow-orbit svg {
  width: min(100%, 540px);
  height: auto;
}

.flow-orbit text {
  fill: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.flow-stats {
  display: grid;
  gap: 12px;
}

.flow-stat {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 12px;
}

.flow-stat div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.flow-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.flow-stat strong {
  text-align: right;
}

.flow-stat i {
  display: block;
  height: 9px;
  width: var(--w);
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, white));
  border-radius: 999px;
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 40%, transparent);
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.heat-cell {
  min-height: 118px;
  border: 1px solid color-mix(in srgb, var(--heat-color) 38%, var(--line));
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--heat-color) var(--heat), transparent), transparent 78%),
    var(--surface-2);
}

.heat-cell span,
.heat-cell small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.heat-cell strong {
  font-size: 22px;
}

.pressure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.pressure-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pressure-legend .safe {
  --c: var(--good);
}

.pressure-legend .watch {
  --c: var(--warn);
}

.pressure-legend .over {
  --c: var(--bad);
}

.pressure-table {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.pressure-row {
  display: grid;
  grid-template-columns: minmax(140px, .8fr) minmax(180px, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
}

.pressure-row.safe {
  --pressure: var(--good);
}

.pressure-row.watch {
  --pressure: var(--warn);
}

.pressure-row.over {
  --pressure: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 42%, var(--line));
}

.pressure-row .pressure-bar i {
  --c: var(--pressure);
}

.pressure-name strong,
.pressure-name span,
.pressure-values strong,
.pressure-values span {
  display: block;
}

.pressure-name span,
.pressure-values span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

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

.alert-stack {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.reminder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent),
    var(--surface-2);
  border-radius: 7px;
  padding: 12px;
}

.reminder-item.urgent {
  border-color: color-mix(in srgb, #f97316 62%, var(--line));
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.26), rgba(255, 95, 143, 0.16)),
    var(--surface-2);
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.16);
}

.reminder-item.overdue {
  border-color: color-mix(in srgb, var(--bad) 55%, var(--line));
  background:
    linear-gradient(135deg, rgba(220, 38, 38, 0.28), rgba(249, 115, 22, 0.18)),
    var(--surface-2);
}

.reminder-item.acknowledged {
  opacity: 0.72;
  border-color: color-mix(in srgb, var(--good) 38%, var(--line));
}

.reminder-item strong {
  display: block;
  margin-bottom: 4px;
}

.reminder-item span {
  color: var(--muted);
  font-size: 12px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.home-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%),
    var(--surface-2);
}

.home-card.selected {
  border-color: color-mix(in srgb, var(--accent-2) 68%, var(--line));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent-2) 20%, transparent);
}

.home-card span,
.home-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-card strong {
  display: block;
  margin: 4px 0;
}

.tenant-select {
  min-width: 270px;
  max-width: 360px;
}

.tenant-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 850;
  color: var(--text);
}

.tenant-gate {
  min-height: 360px;
}

.role-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.role-guide article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-4) 13%, transparent), transparent 70%),
    var(--surface-2);
}

.role-guide strong,
.role-guide span {
  display: block;
}

.role-guide span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 5px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.comparison-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--good) 12%, transparent), transparent 68%),
    var(--surface-2);
}

.comparison-card.loss {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bad) 14%, transparent), transparent 68%),
    var(--surface-2);
}

.comparison-card.muted-card {
  opacity: .68;
}

.comparison-card span,
.comparison-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.comparison-card strong {
  font-size: 20px;
}

.mini-bars {
  display: grid;
  gap: 5px;
}

.mini-bars i {
  display: block;
  width: var(--w);
  min-width: 4px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 50%, white));
}

.chart-bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 34px;
}

.bar-label {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: var(--width);
  min-width: 2px;
  background: linear-gradient(90deg, var(--color, var(--accent)), color-mix(in srgb, var(--color, var(--accent)) 62%, white));
  border-radius: inherit;
  box-shadow: 0 0 18px color-mix(in srgb, var(--color, var(--accent)) 32%, transparent);
}

.bar-value {
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.insight-list,
.due-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.insight {
  border: 1px solid var(--line);
  border-left: 5px solid var(--info);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--info) 9%, transparent), transparent),
    var(--surface-2);
  border-radius: 7px;
  padding: 12px;
}

.insight:hover,
.due-item:hover,
.compact-item:hover,
.mobile-record:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent-2) 38%, var(--line));
  box-shadow: var(--shadow-soft);
}

.insight.positive {
  border-left-color: var(--good);
}

.insight.warning {
  border-left-color: var(--warn);
}

.insight.danger {
  border-left-color: var(--bad);
}

.insight strong {
  display: block;
  margin-bottom: 4px;
}

.insight span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.due-item,
.compact-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent),
    var(--surface-2);
  border-radius: 7px;
  padding: 12px;
}

.due-item strong,
.compact-item strong {
  display: block;
  margin-bottom: 3px;
}

.due-item span,
.compact-item span {
  color: var(--muted);
  font-size: 12px;
}

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  white-space: nowrap;
}

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

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

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

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

.table-wrap {
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.search {
  max-width: 360px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
  background: var(--surface-2);
}

tr:hover td {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 68%),
    color-mix(in srgb, var(--surface-2) 64%, transparent);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent),
    var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.essential,
.tag.admin,
.tag.paid {
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 45%, var(--line));
}

.tag.flexible,
.tag.viewer,
.tag.planned {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, var(--line));
}

.tag.investment,
.tag.manager {
  color: var(--accent-4);
  border-color: color-mix(in srgb, var(--accent-4) 45%, var(--line));
}

.tag.user {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.mobile-cards {
  display: none;
  gap: 12px;
}

.mobile-record {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-4) 9%, transparent), transparent),
    var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.record-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.52);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  padding: 0;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 52%),
    var(--surface);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal-head h3 {
  margin: 0;
}

.modal-body {
  padding: 18px;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.month-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.month-pills label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 9px;
  color: var(--muted);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 13px;
}

.month-pills input {
  accent-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
  max-width: min(420px, calc(100vw - 36px));
}

.toast {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent),
    var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 12px 14px;
  border-left: 5px solid var(--accent);
}

.toast.error {
  border-left-color: var(--bad);
}

.toast.success {
  border-left-color: var(--good);
}

.report-month-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(64px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 260px;
}

.waterfall-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(86px, 1fr));
  gap: 10px;
}

.waterfall-card {
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--wf-color, var(--good)) 24%, transparent), transparent 72%),
    var(--surface-2);
}

.waterfall-card.save {
  --wf-color: var(--good);
}

.waterfall-card.loss {
  --wf-color: var(--bad);
}

.waterfall-card span,
.waterfall-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.waterfall-card strong {
  font-size: 18px;
}

.report-heatmap {
  display: grid;
  grid-template-columns: minmax(130px, 1.2fr) repeat(12, minmax(62px, 1fr));
  gap: 7px;
  align-items: stretch;
  overflow-x: auto;
}

.heat-month,
.heat-category,
.heat-dot {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

.heat-month,
.heat-category {
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.heat-category {
  justify-content: start;
  padding: 0 10px;
}

.heat-dot {
  border: 1px solid color-mix(in srgb, var(--heat-color) 35%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--heat-color) var(--heat), transparent), transparent),
    var(--surface-2);
  color: var(--text);
}

.month-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  height: 230px;
}

.month-bar-stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-5) 10%, transparent), transparent),
    var(--surface-2);
  border-radius: 7px;
  padding: 4px;
}

.month-bar-plan,
.month-bar-actual {
  min-height: 2px;
  border-radius: 5px;
}

.month-bar-plan {
  height: var(--plan);
  background: color-mix(in srgb, var(--accent-4) 78%, white);
}

.month-bar-actual {
  height: var(--actual);
  background: color-mix(in srgb, var(--accent-2) 84%, white);
}

.month-label {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.mobile-topbar {
  display: none;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.error-banner {
  border: 1px solid color-mix(in srgb, var(--bad) 50%, var(--line));
  background: color-mix(in srgb, var(--bad) 14%, var(--surface));
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
}

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

  .two-col,
  .settings-grid,
  .dashboard-hero-grid,
  .flow-board {
    grid-template-columns: 1fr;
  }

  .clarity-board {
    grid-template-columns: 1fr;
  }

  .clarity-row,
  .pressure-row {
    grid-template-columns: 1fr;
  }

  .pressure-values {
    text-align: left;
  }

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

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

  .waterfall-grid {
    grid-template-columns: repeat(6, minmax(86px, 1fr));
  }
}

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

  .login-showcase {
    display: none;
  }

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 320px);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 30;
  }

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

  .topbar-actions {
    width: 100%;
  }

  .tenant-select,
  .tenant-chip {
    width: 100%;
    max-width: none;
  }

  .content {
    padding: 14px;
  }

  .kpi-grid,
  .three-col {
    grid-template-columns: 1fr;
  }

  .table-scroll {
    display: none;
  }

  .mobile-cards {
    display: grid;
    padding: 12px;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .search,
  .button.primary {
    width: 100%;
  }

  .toolbar .button {
    flex: 1 1 auto;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-value {
    justify-self: start;
  }

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

  .report-month-grid {
    grid-template-columns: repeat(6, minmax(44px, 1fr));
  }

  .period-strip,
  .waterfall-grid,
  .role-guide {
    grid-template-columns: 1fr;
  }

  .welcome-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-badges {
    justify-content: flex-start;
  }

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

  .flow-orbit {
    min-height: 220px;
  }
}

@media (max-width: 520px) {
  .metric-value {
    font-size: 25px;
  }

  .panel,
  .metric-card {
    padding: 14px;
  }

  .due-item,
  .compact-item,
  .record-head {
    flex-direction: column;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal-card {
    max-height: 96vh;
  }

  .report-month-grid {
    grid-template-columns: repeat(3, minmax(52px, 1fr));
  }
}
