:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667386;
  --line: #d9e1ea;
  --panel: #ffffff;
  --canvas: #f5f7fa;
  --header: #111923;
  --brand: #008bd2;
  --brand-strong: #006ca8;
  --green: #1f7a55;
  --amber: #a76618;
  --rose: #aa3d58;
  --violet: #5c59b2;
  --shadow: 0 16px 42px rgba(24, 36, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
}

button,
select {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(320px, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 74px;
  padding: 10px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--header);
  color: #eef5fb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand img {
  width: 168px;
  max-width: 38vw;
  height: auto;
}

.brand span {
  padding-left: 13px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 1.05rem;
  font-weight: 800;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link,
.module-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 7px;
  color: #c9d5df;
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active,
.module-menu[open] summary,
.module-menu summary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.module-menu {
  position: relative;
}

.module-menu summary {
  cursor: pointer;
  list-style: none;
}

.module-menu summary::-webkit-details-marker {
  display: none;
}

.module-menu summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.module-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  display: grid;
  gap: 4px;
  width: 292px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.module-dropdown a {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 7px;
  text-decoration: none;
}

.module-dropdown a:hover,
.module-dropdown a.active {
  background: #eef7fc;
}

.module-dropdown span {
  font-weight: 800;
}

.module-dropdown small {
  color: var(--muted);
}

.customer-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
}

.customer-switcher label {
  color: #aebdca;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-switcher select {
  min-height: 38px;
  width: 220px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: #192433;
  color: #ffffff;
  padding: 0 10px;
}

.customer-switcher button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 800;
}

.customer-switcher button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.page-shell {
  display: grid;
  gap: 22px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero-panel,
.workspace-panel,
.billing-panel,
.customer-admin,
.support-panel,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  align-items: center;
  gap: 24px;
  min-height: 220px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(0, 139, 210, 0.12), rgba(31, 122, 85, 0.08)),
    #ffffff;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.hero-copy,
.panel-copy,
.support-panel p {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.subscription-summary {
  display: grid;
  gap: 5px;
  padding: 20px;
  border-radius: 8px;
  background: #111923;
  color: #ffffff;
}

.subscription-summary span,
.subscription-summary small {
  color: #b8c6d2;
}

.subscription-summary strong {
  font-size: 2.35rem;
}

.metrics-grid,
.content-grid {
  display: grid;
  gap: 18px;
}

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

.content-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.7fr);
  align-items: start;
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.metric strong {
  font-size: 1.65rem;
}

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

.workspace-panel,
.billing-panel,
.customer-admin,
.support-panel {
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf2f7;
  color: #3d4b5e;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.pill.green {
  background: rgba(31, 122, 85, 0.12);
  color: var(--green);
}

.pill.amber {
  background: rgba(167, 102, 24, 0.13);
  color: var(--amber);
}

.pill.rose {
  background: rgba(170, 61, 88, 0.13);
  color: var(--rose);
}

.pill.violet {
  background: rgba(92, 89, 178, 0.13);
  color: var(--violet);
}

.panel-copy {
  margin-top: 14px;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 800;
  text-decoration: none;
}

.primary-action {
  background: var(--brand);
  color: #ffffff;
}

.primary-action:hover {
  background: var(--brand-strong);
}

.secondary-action {
  border-color: var(--line);
  background: #ffffff;
}

.billing-panel {
  position: sticky;
  top: 96px;
}

.billing-list {
  display: grid;
  gap: 2px;
  margin-top: 15px;
}

.billing-row,
.billing-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.billing-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.billing-row span,
.billing-total span {
  color: var(--muted);
  font-weight: 750;
}

.billing-total {
  margin-top: 16px;
  padding: 15px;
  border-radius: 8px;
  background: #f0f6fb;
}

.billing-total strong {
  font-size: 1.35rem;
}

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

table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.selected-row {
  background: #f0f8fd;
}

.support-panel {
  background:
    linear-gradient(135deg, rgba(0, 139, 210, 0.08), rgba(170, 61, 88, 0.06)),
    #ffffff;
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .customer-switcher {
    align-items: start;
    flex-direction: column;
  }

  .customer-switcher select {
    width: min(360px, 100%);
  }

  .hero-panel,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .billing-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .app-header {
    padding: 14px 18px;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .brand span {
    padding-left: 0;
    border-left: 0;
  }

  .page-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 16px;
  }

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

  .hero-panel,
  .workspace-panel,
  .billing-panel,
  .customer-admin,
  .support-panel {
    padding: 18px;
  }

  .module-dropdown {
    left: auto;
    right: 0;
    width: min(292px, calc(100vw - 36px));
  }
}
