:root {
  --bg: #f3f7fb;
  --panel: #ffffff;
  --line: #d9e2ec;
  --text: #1d2430;
  --muted: #657084;
  --brand: #0e8f83;
  --brand-2: #2764d8;
  --brand-3: #f59e0b;
  --danger: #a33b3b;
  --warning: #a86913;
  --ok: #276749;
  --shadow: 0 18px 45px rgba(31, 45, 61, 0.10);
  --soft-shadow: 0 10px 26px rgba(31, 45, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eef7f8 0%, #f8fbff 36%, #f3f7fb 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--brand-2);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, #102338 0%, #183b4c 56%, #175e59 100%);
  color: #fff;
  padding: 20px 16px;
  box-shadow: 10px 0 30px rgba(18, 35, 55, 0.12);
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 22px;
}

.nav-group {
  margin: 18px 0 7px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.nav-list a {
  display: block;
  color: #dce5ee;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 6px;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.page-title {
  font-size: 28px;
  margin: 0;
  letter-spacing: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--soft-shadow);
}

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

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

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

.metric {
  display: grid;
  gap: 4px;
}

.metric strong {
  font-size: 24px;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  color: #344055;
  font-size: 13px;
  background: #f1f4f7;
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.btn.primary,
button.primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px rgba(39, 100, 216, 0.22);
}

.btn.ghost {
  background: #f4f8fb;
}

.btn.danger,
button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c9d1dc;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

textarea {
  min-height: 90px;
}

label {
  display: grid;
  gap: 5px;
  color: #2e3949;
  font-weight: 600;
}

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

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

.table-search,
.select-search {
  margin-bottom: 10px;
  min-height: 34px;
  background: rgba(255, 255, 255, 0.92);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  background: #e8edf2;
  color: #293544;
}

.badge.ok {
  background: #dceee5;
  color: var(--ok);
}

.badge.warn {
  background: #fff0cf;
  color: var(--warning);
}

.badge.danger {
  background: #f7dddd;
  color: var(--danger);
}

.flash {
  padding: 11px 14px;
  border-radius: 7px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.flash.success {
  border-color: #acd5bf;
  background: #eef8f2;
}

.flash.error {
  border-color: #e0b0b0;
  background: #fff0f0;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  align-items: center;
  justify-content: center;
  gap: 44px;
  padding: 24px;
  background:
    linear-gradient(135deg, #0e8f83 0%, #2764d8 58%, #f59e0b 100%);
}

.login-box {
  width: min(420px, 100%);
}

.glass-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(18px);
}

.login-button {
  width: 100%;
}

.login-visual {
  min-height: 440px;
  display: grid;
  place-items: center;
}

.building-shape {
  width: min(420px, 76vw);
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.32);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 42px;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.25);
}

.building-shape span {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  min-height: 80px;
}

.dashboard-hero,
.assistant-card,
.cost-overview {
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.dashboard-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  color: #fff;
  background: linear-gradient(135deg, #0f766e 0%, #2563eb 70%, #f59e0b 100%);
}

.dashboard-hero h1,
.dashboard-hero p {
  margin: 4px 0;
}

.dashboard-hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.hero-controls {
  min-width: min(420px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: center;
}

.hero-controls label {
  color: #fff;
}

.status-pill {
  grid-column: 1 / -1;
  display: inline-flex;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-weight: 800;
}

.assistant-card {
  background: #fff;
}

.cost-overview {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.card-heading,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-heading h2,
.section-title h2 {
  margin: 0;
}

.card-heading strong {
  font-size: 34px;
  color: var(--brand-2);
}

.progress-track,
.mini-bar {
  height: 12px;
  border-radius: 999px;
  background: #e8eef5;
  overflow: hidden;
}

.progress-track span,
.mini-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
}

.check-grid,
.category-grid,
.quick-action-grid {
  display: grid;
  gap: 12px;
}

.check-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f4f8fb;
}

.check-item span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-weight: 900;
}

.check-item.done span {
  color: #fff;
  background: var(--brand);
}

.check-item.open span {
  color: #fff;
  background: var(--brand-3);
}

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

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.mini-bar.teal span { background: linear-gradient(90deg, #0e8f83, #21c6a8); }
.mini-bar.blue span { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.mini-bar.amber span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.mini-bar.rose span { background: linear-gradient(90deg, #e11d48, #fb7185); }

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

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

.category-card,
.quick-action,
.issue-card,
.data-card {
  text-decoration: none;
  color: var(--text);
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 7px;
}

.category-card:hover,
.quick-action:hover,
.issue-card:hover,
.data-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow);
}

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

.issue-card.warn {
  border-color: #f4d08a;
  background: #fff8e8;
}

.issue-card.danger {
  border-color: #f1b8b8;
  background: #fff1f1;
}

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

.quick-action span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 900;
}

.assistant-timeline {
  display: grid;
  gap: 14px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: stretch;
}

.step-number {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--soft-shadow);
}

.step-body {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.workflow-step.done .step-number {
  background: linear-gradient(135deg, #16a34a, #0e8f83);
}

.focus-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 26px;
  color: #fff;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e 0%, #2563eb 78%, #f59e0b 100%);
  box-shadow: var(--shadow);
}

.focus-hero h1,
.focus-hero p {
  margin: 4px 0;
}

.focus-hero .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}

.focus-status {
  display: grid;
  gap: 10px;
  min-width: 190px;
}

.focus-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.focus-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.focus-card strong {
  display: block;
  margin: 8px 0;
  font-size: 26px;
}

.primary-focus strong {
  font-size: 42px;
  color: var(--brand-2);
}

.calm-panel {
  box-shadow: 0 10px 28px rgba(31, 45, 61, 0.06);
}

.check-grid.compact,
.quick-action-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

details.panel[open] summary {
  margin-bottom: 16px;
}

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

.form-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.form-intro {
  padding: 12px 0;
}

.form-intro h2 {
  margin: 4px 0;
}

.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.inline-check {
  width: auto;
  min-height: auto;
  margin-right: 8px;
}

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

.option-tile {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.option-tile input {
  width: auto;
  min-height: auto;
}

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

.timeline-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-left: 4px solid var(--brand);
  background: #f8fbff;
  border-radius: 8px;
}

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

.split-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.split-title {
  grid-column: 1 / -1;
  color: var(--brand-2);
  font-weight: 900;
}

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

.rule-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--brand-2);
  font-weight: 900;
}

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

.rule-flow div {
  padding: 12px;
  border-radius: 8px;
  background: #f8fbff;
}

.rule-flow span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.empty-state {
  padding: 18px;
  border-radius: 8px;
  background: #f4f8fb;
  color: var(--muted);
}

.status-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .grid.cols-2,
  .grid.cols-3,
  .form-grid,
  .hero-controls,
  .category-grid,
  .quick-action-grid,
  .check-grid,
  .focus-grid,
  .form-shell,
  .option-grid,
  .split-row,
  .parking-grid,
  .rule-card-grid,
  .rule-flow {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    flex-direction: column;
  }

  .focus-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .main {
    padding: 18px;
  }
}
