:root {
  color-scheme: light;
  --violet-950: #1f0c31;
  --violet-900: #2a1040;
  --violet-800: #3d1b5c;
  --violet-700: #522673;
  --violet-100: #f1eaf6;
  --violet-50: #f8f5fa;
  --teal-700: #007d7a;
  --teal-600: #008b87;
  --teal-500: #00a29d;
  --teal-100: #dff4f2;
  --teal-50: #eef9f8;
  --ink-950: #151923;
  --ink-900: #202631;
  --ink-700: #485365;
  --ink-600: #667085;
  --line: #dfe4ea;
  --line-soft: #edf0f3;
  --surface: #ffffff;
  --canvas: #f4f5f7;
  --success: #146c4c;
  --success-bg: #e8f6f0;
  --danger: #9f1d1d;
  --danger-bg: #fff1f0;
  --warning: #8a5a16;
  --warning-bg: #fdf3e3;
  --warning-line: #ecd8ac;
  --shadow-soft: 0 14px 38px rgba(35, 20, 52, 0.08), 0 2px 8px rgba(23, 28, 39, 0.04);
  --shadow-deep: 0 28px 56px -28px rgba(50, 32, 73, 0.34), 0 16px 30px -22px rgba(0, 0, 0, 0.18);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink-900);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

a { color: var(--violet-700); }
a:hover { color: var(--teal-700); }

/* ---- application shell (matches reseller workspace) ---- */

.shell-header {
  position: sticky;
  z-index: 50;
  top: 0;
  background: rgba(31, 12, 49, 0.97);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(31, 12, 49, 0.14);
}

.shell-header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 16px;
  color: #fff;
  text-decoration: none;
}
.brand-lockup img { width: 112px; height: auto; }
.brand-divider { width: 1px; height: 32px; background: rgba(255, 255, 255, 0.26); }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 15px; letter-spacing: -0.01em; }
.brand-copy span { display: block; color: rgba(255, 255, 255, 0.66); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; }

.shell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  font-size: 13px;
}
.shell-identity { text-align: right; }
.shell-identity strong { display: block; font-size: 13px; }
.shell-identity span { display: block; color: rgba(255, 255, 255, 0.65); }
.shell-actions a { color: #fff; font-weight: 650; text-decoration: none; }
.shell-actions a:hover { color: var(--teal-100); }
.shell-actions a[aria-current="page"] { color: #7fe3db; border-bottom: 2px solid var(--teal-500); padding-bottom: 3px; }
.shell-actions form { margin: 0; }

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

/* ---- controls ---- */

button,
.button-link {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 11px 17px;
  background: var(--violet-800);
  color: #fff;
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
button:hover,
.button-link:hover {
  background: var(--violet-700);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(61, 27, 92, 0.2);
}
button.secondary,
.button-link.secondary { background: #edf0f3; color: var(--ink-900); }
button.secondary:hover,
.button-link.secondary:hover { background: #e3e7ec; }
.shell-actions button {
  min-height: 36px;
  padding: 8px 14px;
  background: #fff;
  color: var(--violet-950);
}
.shell-actions button:hover { background: var(--teal-100); color: var(--violet-950); transform: none; box-shadow: none; }

button:focus-visible,
.button-link:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(0, 162, 157, 0.28);
  outline-offset: 2px;
}

.link-button {
  background: none;
  min-height: 0;
  padding: 0;
  color: var(--ink-600);
  font-size: 13px;
  font-weight: 600;
}
.link-button:hover { background: none; color: var(--ink-900); transform: none; box-shadow: none; }

label { display: block; margin: 0 0 6px; color: var(--ink-900); font-size: 13px; font-weight: 750; }

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd2da;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink-900);
  font-size: 14px;
}
input:hover, select:hover { border-color: #aeb8c4; }
input:focus, select:focus { outline: 3px solid rgba(0, 162, 157, 0.16); border-color: var(--teal-600); }
input[type=checkbox] { width: 18px; min-height: 18px; height: 18px; margin: 0 8px 0 0; accent-color: var(--teal-600); }

.field-error { margin-top: 6px; color: var(--danger); font-size: 12px; }

/* ---- content cards & tables ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.card h1, .card h2 { margin-top: 0; color: var(--violet-800); letter-spacing: -0.025em; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h1, .section-head h2 { margin: 0; color: var(--violet-800); letter-spacing: -0.025em; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th,
.data-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data-table th { color: var(--ink-600); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.data-table tbody tr:last-child td { border-bottom: 0; }

.analysis-grid td, .analysis-grid th { padding: 7px 8px; }
.analysis-grid input { min-width: 110px; min-height: 40px; padding: 7px 9px; }
.cell-value { font-variant-numeric: tabular-nums; }
.cell-unit, .cell-method, .cell-qualifier { color: var(--ink-600); font-size: 12px; white-space: nowrap; }
.cell-classification { font-size: 12px; }

.flag-preliminary {
  display: inline-block;
  background: var(--warning-bg);
  border: 1px solid var(--warning-line);
  color: var(--warning);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 750;
}

.muted, .empty { color: var(--ink-600); font-size: 13px; }

.site-empty-state { padding: 15px 17px; background: var(--violet-50); border-left: 3px solid var(--violet-700); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.site-empty-state strong { display: block; color: var(--violet-800); font-size: 14px; }
.site-empty-state p { margin: 4px 0 0; color: var(--ink-700); font-size: 13px; }

.flashes { list-style: none; padding: 0; max-width: 1180px; margin: 16px auto 0; width: min(1180px, calc(100% - 40px)); }
.flash { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 14px; }
.flash.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f0c4c0; }
.flash.message { background: var(--teal-50); color: var(--teal-700); border: 1px solid #cbe9e6; }

.site-footer { text-align: center; color: var(--ink-600); font-size: 12px; padding: 20px; }

/* ---- sign-in (split screen, mirrors reseller workspace) ---- */

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr); background: #fff; }
.login-story {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 44px clamp(32px, 6vw, 84px);
  background: var(--violet-950);
  color: #fff;
}
.login-story::after { content: ""; position: absolute; width: 280px; height: 280px; right: -150px; bottom: 12%; transform: rotate(34deg); background: var(--teal-500); opacity: 0.2; }
.login-logo { width: 128px; position: relative; z-index: 2; }
.login-story-copy { position: relative; z-index: 2; margin: 48px 0; max-width: 640px; }
.eyebrow { margin: 0 0 12px; color: var(--teal-500); font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.login-story .eyebrow { color: #59d3cb; }
.login-story h1 { margin: 0; font-size: clamp(42px, 5.4vw, 68px); font-weight: 320; line-height: 1.02; letter-spacing: -0.05em; }
.login-story h1 em { color: #59d3cb; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.login-story-copy > p { max-width: 560px; margin: 22px 0 0; color: rgba(255, 255, 255, 0.8); font-size: 17px; }
.login-metrics { display: grid; gap: 10px; margin-top: 36px; max-width: 460px; }
.login-metric { padding: 12px 14px; border-left: 3px solid var(--teal-500); background: #35234a; }
.login-metric strong { display: block; color: #fff; font-size: 13px; }
.login-metric span { color: rgba(255, 255, 255, 0.72); font-size: 11px; }
.login-foot { position: relative; z-index: 2; color: rgba(255, 255, 255, 0.62); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

.login-panel { display: grid; place-items: center; min-height: 100vh; padding: 40px clamp(32px, 5vw, 84px); background: #fff; }
.login-card { width: min(420px, 100%); overflow-x: visible; }
.login-card h2 { margin: 0; color: var(--violet-800); font-size: 36px; font-weight: 420; line-height: 1.08; letter-spacing: -0.035em; }
.login-card .sub { margin: 10px 0 26px; color: var(--ink-600); }
.login-card form > label { margin-top: 20px; }
.login-card form > button, .login-card .ms-button { width: 100%; margin-top: 22px; }
.login-card .flashes-inline { list-style: none; padding: 0; margin: 0 0 20px; }

.ms-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 16px;
  background: #fff;
  color: var(--ink-900);
  border: 1px solid #cbd2da;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.ms-button:hover { background: #f7f8fa; border-color: #aeb8c4; color: var(--ink-950); transform: none; box-shadow: none; }
.ms-button svg { flex: 0 0 auto; }

.login-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 2px; color: var(--ink-600); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.help { margin: 22px 0 0; color: var(--ink-600); font-size: 13px; line-height: 1.6; }

/* ---- responsive ---- */

@media (max-width: 860px) {
  .shell-header-inner { width: min(100% - 28px, 1180px); }
  .shell-identity { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-story { min-height: auto; padding: 34px 32px 38px; }
  .login-story h1 { font-size: clamp(40px, 9vw, 60px); }
  .login-metrics { max-width: none; }
  .login-panel { min-height: auto; padding: 52px 28px; }
}

@media (max-width: 680px) {
  .page-shell { width: min(100% - 24px, 1180px); padding-top: 14px; }
  .shell-header-inner { min-height: 62px; }
  .brand-lockup img { width: 92px; }
  .brand-divider, .brand-copy span { display: none; }
  .brand-copy strong { font-size: 12px; }
  .shell-actions { gap: 10px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .card { padding: 18px; }
}
