:root {
  color-scheme: dark;
  --bg: #090b10;
  --bg-elevated: rgba(21, 24, 31, 0.96);
  --bg-panel: rgba(24, 26, 33, 0.98);
  --bg-soft: rgba(255, 255, 255, 0.055);
  --text: #f5f7fb;
  --muted: #8e94a6;
  --line: rgba(255, 255, 255, 0.075);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  --primary: #2d6df6;
  --teal: #11c4d4;
  --green: #21c580;
  --gold: #f4b400;
  --danger: #ef476f;
  --violet: #8f57f6;
  --card-radius: 20px;
  --font-display: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf1f7;
  --bg-elevated: rgba(255, 255, 255, 0.96);
  --bg-panel: rgba(255, 255, 255, 0.95);
  --bg-soft: rgba(17, 24, 39, 0.045);
  --text: #1a2232;
  --muted: #667085;
  --line: rgba(17, 24, 39, 0.07);
  --shadow: 0 20px 50px rgba(73, 94, 128, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-display);
  background:
    radial-gradient(circle at top left, rgba(45, 109, 246, 0.12), transparent 22%),
    radial-gradient(circle at bottom left, rgba(17, 196, 212, 0.08), transparent 26%),
    var(--bg);
  color: var(--text);
}

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

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  min-height: 100vh;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  position: sticky;
  top: 0;
  backdrop-filter: blur(18px);
  background: rgba(10, 12, 19, 0.72);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

:root[data-theme="light"] .top-nav {
  background: rgba(238, 243, 251, 0.86);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.9rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  box-shadow: 0 14px 40px rgba(45, 109, 246, 0.3);
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link,
.pill-button,
.theme-toggle {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 0.8rem 1rem;
}

.hero,
.dashboard-shell {
  padding: 2rem;
}

.dashboard-shell {
  padding: 0;
  min-height: 100vh;
}

.hero-grid {
  max-width: 1400px;
  margin: 0 auto;
}

.hero-card,
.panel,
.stat-card,
.timeline-card,
.checklist-card,
.admin-card {
  background: linear-gradient(180deg, rgba(24, 26, 33, 0.98), rgba(19, 21, 28, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--card-radius);
}

:root[data-theme="light"] .hero-card,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .timeline-card,
:root[data-theme="light"] .checklist-card,
:root[data-theme="light"] .admin-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 253, 0.98));
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
}

.hero-card {
  padding: 2rem;
}

.eyebrow {
  color: var(--teal);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  margin-bottom: 1rem;
}

.hero-card h1,
.section-title {
  font-size: clamp(2.5rem, 5vw, 4.7rem);
  line-height: 0.96;
  margin: 0 0 1rem;
}

.hero-copy {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 44rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.8rem;
}

.cta-primary,
.cta-secondary {
  border-radius: 999px;
  padding: 1rem 1.35rem;
  font-weight: 700;
}

.cta-primary {
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: white;
}

.cta-secondary {
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.hero-preview {
  padding: 1.4rem;
  display: grid;
}

.mini-dashboard {
  padding: 1.2rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(8, 10, 16, 0.92), rgba(26, 31, 45, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 1rem;
}

.mini-row,
.stats-grid {
  display: grid;
  gap: 1rem;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr) 64px;
  gap: 0;
  min-height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
}

.sidebar {
  padding: 1.25rem 1rem 1.1rem;
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  background: #221f1f;
  box-shadow: none;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 1.6rem;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sidebar-ghost {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.sidebar-title {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.8rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  color: rgba(244, 246, 252, 0.9);
  margin-bottom: 0.25rem;
  transition: background 140ms ease, color 140ms ease;
}

.sidebar-badge,
.rail-button {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 0.7rem;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.075);
  color: rgba(255, 255, 255, 0.72);
  flex-shrink: 0;
}

.sidebar-badge i,
.rail-button i,
.search-icon i,
.stat-icon i,
.timeline-dot i,
.icon-pill i {
  font-size: 0.88rem;
}

.sidebar-link.active,
.sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.11);
}

.content-stack {
  display: grid;
  gap: 1.4rem;
  padding: 0.95rem 1.1rem 1.3rem;
  background: #07090d;
  align-content: start;
  min-width: 0;
  min-height: 100vh;
}

.app-page-frame {
  display: grid;
  gap: 1.15rem;
  align-content: start;
  min-width: 0;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.1rem 0 0.35rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 0;
  position: sticky;
  top: 0;
  z-index: 15;
  padding-top: 0.2rem;
}

.dashboard-search {
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.82rem 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(40, 37, 37, 0.96), rgba(35, 33, 33, 0.96));
  border: 1px solid var(--line);
}

.search-icon,
.search-shortcut {
  color: var(--muted);
  font-size: 0.84rem;
}

.dashboard-search input {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--text);
}

.topbar-icons {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  flex-shrink: 0;
}

.icon-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.025);
  position: relative;
}

.icon-pill.has-alert em {
  position: absolute;
  top: -5px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f14b4b;
  color: #fff;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 700;
}

.panel {
  padding: 1.22rem;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.72);
  backdrop-filter: blur(6px);
  z-index: 45;
}

.app-modal-card {
  width: min(640px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  overflow: auto;
}

.settings-form {
  display: grid;
  gap: 1rem;
}

.compact-grid {
  align-items: start;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.toggle-row input {
  width: auto;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-actions-group {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.dashboard-title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.welcome-panel {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-height: 188px;
  border-radius: 22px;
}

.welcome-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 14% 50%, rgba(69, 82, 197, 0.14), transparent 28%),
    linear-gradient(90deg, rgba(27, 31, 70, 0.56), rgba(18, 21, 30, 0.26));
  pointer-events: none;
}

.welcome-panel {
  position: relative;
  overflow: hidden;
}

.welcome-headline {
  display: flex;
  gap: 0.95rem;
  align-items: center;
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(210, 220, 245, 0.92));
  display: grid;
  place-items: center;
  color: #6b573f;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(18, 171, 213, 0.08);
}

.welcome-copy h1 {
  font-size: clamp(1.45rem, 2vw, 2.15rem);
  margin: 0 0 0.18rem;
}

.welcome-chip-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

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

.stats-grid .stat-card {
  padding: 1.08rem;
}

.page-header,
.metric-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-header {
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

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

.list-grid {
  display: grid;
  gap: 1rem;
}

.list-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.86rem 0.96rem;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  font-size: 0.69rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.table-shell {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.84rem 0.95rem;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.delta {
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
}

.teal { color: #4fe7e0; }
.blue { color: #78a5ff; }
.gold { color: #ffd15c; }
.green { color: #5cdf96; }

.accent-blue { color: #69a6ff; }
.accent-violet { color: #a279ff; }
.accent-gold { color: #f7c64c; }
.accent-green { color: #43d79c; }

.stat-card {
  min-height: 102px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.042);
}

.stat-value {
  font-size: 1.56rem;
  font-weight: 800;
  margin-top: 0.24rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.checklist-list,
.timeline-list {
  display: grid;
  gap: 0.95rem;
  margin-top: 1.25rem;
}

.checklist-item,
.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.92rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.038);
}

.checklist-item.is-complete {
  background: rgba(255, 255, 255, 0.055);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-head h2,
.panel h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

.timeline-copy strong {
  display: block;
  margin-bottom: 0.2rem;
}

.timeline-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
}

.right-rail {
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  background: #0a0b10;
  border-left: 1px solid var(--line);
  position: sticky;
  top: 0;
  min-height: 100vh;
}

.rail-button {
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: transparent;
  border: 0;
}

.rail-divider {
  width: 24px;
  height: 1px;
  background: var(--line);
}

.theme-cluster {
  margin-top: auto;
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.theme-choice {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
}

.theme-choice.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

body[data-compact="1"] .panel,
body[data-compact="1"] .stat-card,
body[data-compact="1"] .timeline-card,
body[data-compact="1"] .checklist-card,
body[data-compact="1"] .admin-card {
  padding: 1rem;
}

body[data-compact="1"] .content-stack {
  gap: 1rem;
  padding: 0.8rem 0.9rem 1.1rem;
}

body[data-compact="1"] .dashboard-topbar {
  padding-top: 0;
}

body[data-compact="1"] .welcome-panel {
  min-height: 164px;
}

body[data-compact="1"] .stats-grid .stat-card {
  padding: 0.95rem;
}

body[data-compact="1"] .checklist-list,
body[data-compact="1"] .timeline-list {
  gap: 0.75rem;
  margin-top: 1rem;
}

.auth-stage {
  min-height: calc(100vh - 82px);
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    radial-gradient(circle at 50% 40%, rgba(110, 76, 255, 0.16), transparent 16%),
    radial-gradient(circle at 50% 100%, rgba(53, 97, 239, 0.18), transparent 32%);
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
  margin-top: 1rem;
}

.progress > span {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--teal));
}

.form-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem;
}

.form-shell form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

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

input,
select,
textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  padding: 0.95rem 1rem;
}

input::placeholder {
  color: var(--muted);
}

button {
  cursor: pointer;
}

.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-shell .page-wrap {
  max-width: none;
  margin: 0;
  padding: 0;
}

.pricing-grid,
.feature-grid,
.industry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.pricing-card,
.feature-card,
.industry-card {
  padding: 1.4rem;
}

.tiny {
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .hero-grid,
  .dashboard-grid,
  .two-col,
  .module-grid,
  .stats-grid,
  .pricing-grid,
  .feature-grid,
  .industry-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .right-rail {
    display: none;
  }

  .top-nav {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
  }

  .content-stack {
    padding: 1rem;
  }

  .dashboard-topbar {
    position: static;
    flex-wrap: wrap;
  }

  .dashboard-search {
    width: 100%;
  }

  .topbar-icons {
    width: 100%;
    justify-content: flex-end;
  }
}
