:root {
  --bg: #081017;
  --bg-2: #0d1823;
  --paper: linear-gradient(180deg, rgba(14, 24, 35, 0.94), rgba(9, 17, 26, 0.96));
  --paper-strong: #101d29;
  --paper-soft: rgba(16, 29, 41, 0.72);
  --ink: #edf2f7;
  --muted: #9bacbd;
  --line: rgba(146, 174, 199, 0.18);
  --line-strong: rgba(255, 184, 90, 0.22);
  --accent: #f1a94e;
  --accent-2: #7bd1c8;
  --accent-soft: rgba(241, 169, 78, 0.14);
  --danger: #ff7e72;
  --success: #75d6a4;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.42);
  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --gap: 1rem;
  --display: "Aptos Display", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
  --body: "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  --mono: "Consolas", "Cascadia Mono", monospace;
  font-family: var(--body);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(123, 209, 200, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 209, 200, 0.05) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(241, 169, 78, 0.22), transparent 32%),
    radial-gradient(circle at top right, rgba(123, 209, 200, 0.18), transparent 24%),
    linear-gradient(180deg, #0c1620 0%, #081017 100%);
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 0%, rgba(241, 169, 78, 0.1), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(123, 209, 200, 0.08), transparent 24%);
  mix-blend-mode: screen;
}

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

.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 24px 36px;
}

.hero {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.4fr 0.9fr;
  margin-bottom: 20px;
}

.hero-panel,
.sidebar,
.surface,
.tab-button,
.stat,
.card,
.table-wrap,
.list-card {
  backdrop-filter: blur(14px);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-panel {
  border-radius: var(--radius-lg);
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.hero-panel::before,
.surface::before,
.sidebar::before,
.card::before,
.list-card::before,
.table-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(241, 169, 78, 0.08), transparent 28%, rgba(123, 209, 200, 0.05) 80%);
}

.surface,
.sidebar,
.card,
.list-card,
.table-wrap {
  position: relative;
  overflow: hidden;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--mono);
}

.headline {
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.92;
  margin: 0.45rem 0 0.7rem;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.subline {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 60ch;
  margin: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.4rem;
}

.stat {
  border-radius: var(--radius-md);
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line-strong);
}

.stat-label {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
}

.stat-value {
  display: block;
  font-size: 1.75rem;
  margin-top: 0.35rem;
  font-family: var(--display);
  font-weight: 700;
}

.hero-callout {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}

.sidebar {
  border-radius: var(--radius-lg);
  padding: 22px;
  position: sticky;
  top: 20px;
  height: fit-content;
}

.sidebar h2,
.section-header h2,
.card h3 {
  margin: 0;
}

.sidebar p,
.hint,
.muted {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 0.85rem;
}

.actions {
  display: grid;
  gap: 0.65rem;
}

.content {
  min-width: 0;
}

.tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 16, 23, 0.56);
  width: fit-content;
  max-width: 100%;
}

.tab-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  background: transparent;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
  color: var(--muted);
  font-weight: 700;
}

.tab-button.is-active {
  background: linear-gradient(135deg, rgba(241, 169, 78, 0.92) 0%, rgba(197, 116, 45, 0.92) 100%);
  color: #081017;
  border-color: rgba(255, 209, 140, 0.4);
}

.tab-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--ink);
}

.surface {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 18px;
}

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

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

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

.card,
.list-card,
.table-wrap {
  border-radius: var(--radius-md);
  padding: 18px;
  background: linear-gradient(180deg, rgba(17, 30, 43, 0.92), rgba(9, 18, 27, 0.92));
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 16px;
}

.pill-row,
.need-row,
.meta-row,
.field-row,
.inline-form,
.route-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.pill.is-on {
  background: var(--accent-soft);
  border-color: rgba(241, 169, 78, 0.35);
  color: #ffe2b8;
}

.pill button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: rgba(5, 11, 17, 0.65);
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(241, 169, 78, 0.18);
  border-color: rgba(241, 169, 78, 0.4);
}

.button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}

.button {
  background: linear-gradient(135deg, #f1a94e 0%, #c66a34 100%);
  color: #081017;
  font-weight: 800;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger-button {
  background: rgba(255, 126, 114, 0.09);
  color: var(--danger);
  border: 1px solid rgba(255, 126, 114, 0.24);
}

.button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

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

.table th,
.table td {
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.table th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-family: var(--mono);
}

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

.balance-positive {
  color: var(--success);
}

.balance-negative {
  color: var(--danger);
}

.warning {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 126, 114, 0.08);
  color: var(--danger);
  border: 1px solid rgba(255, 126, 114, 0.16);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
}

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(123, 209, 200, 0.1);
  color: var(--accent-2);
  font-size: 0.88rem;
  border: 1px solid rgba(123, 209, 200, 0.18);
}

.island-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.building-list,
.need-list {
  display: grid;
  gap: 0.7rem;
}

.building-row,
.need-group {
  display: grid;
  grid-template-columns: 1.7fr 88px 88px auto;
  gap: 0.75rem;
  align-items: center;
}

.need-group {
  grid-template-columns: 1fr;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.mini {
  font-size: 0.86rem;
}

.route-row {
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.route-row:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.overview-list {
  display: grid;
  gap: 0.8rem;
}

.overview-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.overview-item strong {
  font-family: var(--display);
}

.sidebar h2,
.section-header h2,
.card h3,
.list-card h3,
.table-wrap h3 {
  font-family: var(--display);
  letter-spacing: -0.03em;
}

.sidebar,
.surface,
.card,
.table-wrap,
.list-card,
.hero-panel {
  isolation: isolate;
}

@media (max-width: 1100px) {
  .hero,
  .layout,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 16px;
  }

  .hero-panel,
  .sidebar,
  .surface,
  .card,
  .list-card,
  .table-wrap {
    padding: 18px;
  }

  .hero-grid,
  .building-row {
    grid-template-columns: 1fr;
  }
}
