:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #607080;
  --line: #dce4e9;
  --paper: #f7fafb;
  --card: #ffffff;
  --navy: #102b3d;
  --teal: #0f8b8d;
  --teal-dark: #0b686a;
  --yellow: #f2c94c;
  --red: #c74747;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.5; }
a { color: var(--teal-dark); }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 4vw; background: var(--navy); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--yellow); color: var(--navy); font-size: 17px; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: #dbe8ec; text-decoration: none; font-size: .94rem; }
.topbar nav a:hover { color: #fff; }
.main { width: min(1180px, 92vw); margin: 0 auto; flex: 1; padding: 42px 0 64px; }
.footer { padding: 28px 4vw; color: var(--muted); font-size: .86rem; border-top: 1px solid var(--line); background: #fff; }

.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 52px; align-items: center; min-height: 520px; }
.eyebrow { color: var(--teal-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 14px; letter-spacing: -.025em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); max-width: 680px; }
h2 { font-size: clamp(1.55rem, 3vw, 2.25rem); }
h3 { font-size: 1.1rem; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 620px; }
.hero-card { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: 0 18px 45px rgba(16,43,61,.09); }
.hero-card .signal { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.hero-card .signal:last-child { border-bottom: 0; }
.signal-label { color: var(--muted); font-size: .9rem; }
.signal-value { font-weight: 800; }
.dot { width: 9px; height: 9px; display: inline-block; background: #42b883; border-radius: 50%; margin-right: 7px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-weight: 750; }
.button.primary { color: #fff; background: var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { color: var(--navy); background: #fff; border-color: var(--line); }
.button.danger { color: #fff; background: var(--red); }
.button.small { min-height: 34px; padding: 0 11px; font-size: .86rem; }
.actions { display: flex; gap: 11px; flex-wrap: wrap; margin-top: 24px; }

.auth-grid { width: min(960px, 100%); margin: 24px auto; display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: stretch; }
.auth-aside { border-radius: 22px; padding: 34px; color: #fff; background: var(--navy); }
.auth-aside p { color: #c9dbe0; }
.form-card, .card { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 8px 28px rgba(16,43,61,.04); }
form { display: grid; gap: 15px; }
label { display: grid; gap: 6px; font-weight: 700; font-size: .92rem; }
input, select, textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #c7d4db; border-radius: 9px; background: #fff; color: var(--ink); }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(15,139,141,.18); border-color: var(--teal); }
.hint { color: var(--muted); font-size: .87rem; }
.error { padding: 12px 14px; border-radius: 10px; color: #8b2525; background: #fff1f1; border: 1px solid #f1c4c4; }
.success { padding: 12px 14px; border-radius: 10px; color: #17613c; background: #edfbf2; border: 1px solid #bde9cc; }

.dashboard-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 28px; }
.context-switcher { display: flex; align-items: center; gap: 9px; min-width: min(360px, 100%); }
.context-switcher form { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.context-switcher select { min-width: 190px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card p { color: var(--muted); }
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; color: #23614d; background: #e4f6ec; font-size: .75rem; font-weight: 800; }
.pill.off { color: #6a7180; background: #edf0f2; }
.pill.warn { color: #705516; background: #fff4cb; }
.product-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--navy); font-weight: 850; }
.product-card { display: flex; flex-direction: column; min-height: 192px; }
.product-card .actions { margin-top: auto; }
.metric { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.metric:last-child { border-bottom: 0; }
.metric strong { font-size: 1.1rem; }
.metric span { color: var(--muted); font-size: .88rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; }
th, td { padding: 11px 9px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.inline-form { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 110px; min-height: 34px; padding: 6px 8px; }
.section-title { margin: 35px 0 14px; }
.definition-list { display: grid; gap: 4px; }
.definition-list div { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.definition-list code { color: var(--teal-dark); font-size: .84rem; }
.empty { padding: 24px 0; color: var(--muted); }

@media (max-width: 820px) {
  .hero, .auth-grid, .grid.two, .grid.three { grid-template-columns: 1fr; }
  .hero { min-height: 0; padding: 24px 0 36px; }
  .dashboard-head { align-items: stretch; flex-direction: column; }
  .context-switcher form { width: 100%; }
  .context-switcher select { flex: 1; }
  .topbar { padding: 0 4vw; }
  .topbar nav a:not(.button) { display: none; }
}
