:root {
  --bg: #08111f;
  --bg-soft: rgba(16, 26, 43, 0.88);
  --panel: rgba(8, 17, 31, 0.78);
  --panel-strong: rgba(10, 18, 29, 0.94);
  --line: rgba(160, 180, 205, 0.18);
  --text: #edf3ff;
  --muted: #9aadc9;
  --accent: #57d7b6;
  --accent-strong: #1fb391;
  --warm: #ffb057;
  --danger: #ff7f7f;
  --success: #7de6a0;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-small: 16px;
  --font: "Bahnschrift", "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(31, 179, 145, 0.18), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(255, 176, 87, 0.15), transparent 26%),
    linear-gradient(135deg, #060c16, #0b1423 45%, #10192d 100%);
}

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

button {
  cursor: pointer;
  border: none;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

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

input,
select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7, 13, 23, 0.72);
  color: var(--text);
  padding: 0.9rem 1rem;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 0.45rem;
}

label span {
  font-size: 0.86rem;
  color: var(--muted);
}

.ambient {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.36;
  pointer-events: none;
}

.ambient-left {
  background: rgba(31, 179, 145, 0.22);
  top: -12rem;
  left: -8rem;
}

.ambient-right {
  background: rgba(255, 176, 87, 0.2);
  top: 12rem;
  right: -10rem;
}

.hidden {
  display: none !important;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--warm);
}

.lead {
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.6;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card,
.panel-card,
.sidebar,
.topbar,
.status-card {
  backdrop-filter: blur(18px);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(1100px, 100%);
  padding: 2rem;
  border-radius: 32px;
}

.login-grid,
.two-column-grid,
.three-column-grid,
.card-grid {
  display: grid;
  gap: 1.2rem;
}

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

.three-column-grid {
  grid-template-columns: 1.15fr 1fr 1.2fr;
}

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

.demo-card,
.panel-card {
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  padding: 1rem;
}

.sidebar {
  border-radius: 28px;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.brand-block p {
  color: var(--muted);
  line-height: 1.5;
}

.nav-stack {
  display: grid;
  gap: 0.55rem;
}

.nav-button {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid transparent;
}

.nav-button.active {
  background: linear-gradient(135deg, rgba(87, 215, 182, 0.26), rgba(255, 176, 87, 0.12));
  border-color: rgba(87, 215, 182, 0.36);
}

.main-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.topbar {
  border-radius: 28px;
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.status-card,
.user-pill {
  border-radius: 18px;
  padding: 0.8rem 0.95rem;
}

.status-card {
  display: grid;
  gap: 0.2rem;
}

.status-card small,
.helper-text,
.empty-state {
  color: var(--muted);
}

.user-pill {
  display: grid;
  gap: 0.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.view-section {
  display: none;
  gap: 1rem;
}

.view-section.active {
  display: grid;
}

.executive-hero {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr;
  gap: 1rem;
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(87, 215, 182, 0.14), rgba(255, 176, 87, 0.08)),
    var(--panel-strong);
}

.executive-badge {
  border-radius: 20px;
  border: 1px solid rgba(87, 215, 182, 0.22);
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 0.35rem;
}

.executive-badge span {
  color: var(--warm);
  letter-spacing: 0.16em;
  font-size: 0.75rem;
}

.executive-badge strong {
  font-size: 1.15rem;
}

.executive-grid {
  grid-template-columns: 1.1fr 1fr 1fr;
}

.executive-subsection {
  margin-top: 1rem;
}

.map-shell {
  display: grid;
  gap: 0.9rem;
}

#executiveMapCanvas {
  width: 100%;
  max-width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(87, 215, 182, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 64px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 64px
    ),
    rgba(7, 13, 23, 0.7);
}

.timeline-rail {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.2rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  padding-left: 0.2rem;
}

.section-header,
.card-title-row,
.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.subtle-badge {
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack-form,
.list-stack,
.detail-stack,
.checklist-stack {
  display: grid;
  gap: 0.9rem;
}

.compact-form {
  gap: 0.8rem;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 16px;
  padding: 0.9rem 1rem;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #04110f;
}

.secondary-button {
  background: rgba(255, 176, 87, 0.14);
  color: var(--text);
  border: 1px solid rgba(255, 176, 87, 0.26);
}

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

.panel-card h3,
.panel-card h4,
.login-card h1,
.topbar h1 {
  margin: 0;
}

.list-item {
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 0.45rem;
}

.order-card {
  text-align: left;
}

.order-card.selected {
  border-color: rgba(87, 215, 182, 0.4);
  background: linear-gradient(135deg, rgba(87, 215, 182, 0.12), rgba(255, 255, 255, 0.04));
}

.list-item strong {
  font-size: 1rem;
}

.list-meta {
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  background: rgba(87, 215, 182, 0.14);
  color: var(--accent);
  font-size: 0.76rem;
}

.pill.warn {
  color: var(--warm);
  background: rgba(255, 176, 87, 0.14);
}

.pill.danger {
  color: var(--danger);
  background: rgba(255, 127, 127, 0.14);
}

.pill.success {
  color: var(--success);
  background: rgba(125, 230, 160, 0.14);
}

.pill.neutral {
  color: #d3ddf0;
  background: rgba(211, 221, 240, 0.12);
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.full-width {
  margin-top: 0.9rem;
}

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

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.72rem 0.82rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.checklist-item input {
  width: auto;
}

.signature-block {
  border: 1px dashed rgba(87, 215, 182, 0.4);
  border-radius: 18px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
}

#signatureCanvas {
  width: 100%;
  max-width: 100%;
  border-radius: 18px;
  background: #ffffff;
  touch-action: none;
}

.feature-list,
.login-card ul,
.login-card ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.65;
}

.command-block {
  margin: 0;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  overflow: auto;
}

.toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: grid;
  gap: 0.8rem;
}

.toast {
  min-width: 280px;
  max-width: 420px;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(7, 13, 23, 0.95);
  box-shadow: var(--shadow);
}

.toast strong {
  display: block;
  margin-bottom: 0.24rem;
}

.toast.info strong {
  color: var(--accent);
}

.toast.success strong {
  color: var(--success);
}

.toast.error strong {
  color: var(--danger);
}

@media (max-width: 1200px) {
  .three-column-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .nav-stack {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: auto;
  }

  .topbar,
  .section-header,
  .card-title-row,
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .login-grid,
  .two-column-grid,
  .three-column-grid,
  .card-grid,
  .checklist-grid,
  .executive-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-shell,
  .app-shell {
    padding: 0.75rem;
  }

  .login-card,
  .sidebar,
  .topbar,
  .panel-card {
    border-radius: 22px;
  }

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