/* LUTAI Solutions — core styles */
:root {
  --bg: #ffffff;
  --bg-elev: #f7f8fb;
  --fg: #1a1d24;
  --fg-muted: #5b6370;
  --fg-subtle: #8a92a0;
  --line: #e5e8ee;
  --line-strong: #cdd2dc;
  --primary: #1F2A6B;          /* LUTAI navy */
  --primary-ink: #ffffff;
  --accent: #33B8E8;            /* LUTAI cyan */
  --accent-ink: #0e1a44;
  --charcoal: #3A3E42;          /* LUTAI wordmark */
  --success: oklch(0.68 0.13 155);
  --warn: oklch(0.75 0.14 70);
  --danger: oklch(0.6 0.18 25);
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 0 oklch(0.22 0.04 250 / 0.04), 0 1px 2px oklch(0.22 0.04 250 / 0.04);
  --shadow-md: 0 1px 0 oklch(0.22 0.04 250 / 0.04), 0 8px 24px oklch(0.22 0.04 250 / 0.06);
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --maxw: 1200px;
}

[data-theme="dark"] {
  --bg: #0d1124;
  --bg-elev: #141a33;
  --fg: #eef1f7;
  --fg-muted: #a3abbd;
  --fg-subtle: #6d7590;
  --line: #242b45;
  --line-strong: #37405e;
  --primary: #33B8E8;           /* cyan becomes the action color in dark */
  --primary-ink: #0a0e1f;
  --accent: #33B8E8;
  --accent-ink: #0a0e1f;
  --charcoal: #eef1f7;
  --shadow-sm: 0 1px 0 oklch(0 0 0 / 0.3), 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 1px 0 oklch(0 0 0 / 0.3), 0 8px 24px oklch(0 0 0 / 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
}
h1, h2, h3, h4 { color: var(--fg); letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; font-weight: 500; }
h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.08; font-weight: 500; }
h3 { font-size: 20px; line-height: 1.25; font-weight: 500; }
p { text-wrap: pretty; color: var(--fg-muted); }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.15); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-elev); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(0.95); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.01em; font-size: 17px;
}
.nav-logo-mark {
  height: 28px; width: auto; display: block;
}
.nav-logo-img {
  height: 28px; width: auto; display: block;
}
.nav-logo-img.lg { height: 34px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-size: 14px; color: var(--fg-muted);
  transition: color .15s;
}
.nav-links a:hover { color: var(--fg); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 6px;
  border: 1px solid var(--line); background: transparent;
  display: grid; place-items: center; cursor: pointer;
  color: var(--fg-muted);
}
.icon-btn:hover { color: var(--fg); background: var(--bg-elev); }
.nav-burger { display: none; }

@media (max-width: 880px) {
  .nav-links, .nav-cta .btn-desktop { display: none; }
  .nav-burger { display: grid; }
}

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 50;
  pointer-events: none;
}
.drawer-scrim {
  position: absolute; inset: 0;
  background: oklch(0.1 0.02 250 / 0.5);
  opacity: 0; transition: opacity .2s ease;
}
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(340px, 86vw);
  background: var(--bg); border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2,.9,.3,1);
  padding: 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer a { font-size: 18px; color: var(--fg); padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Sections */
section { padding: 96px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: none; }
.section-head {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px;
  margin-bottom: 56px;
  align-items: end;
}
@media (max-width: 780px) {
  section { padding: 72px 0; }
  .section-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 40px; }
}

/* Hero */
.hero { padding-top: 72px; padding-bottom: 120px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px;
  align-items: center;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } }
.hero h1 .serif { color: var(--accent); }
[data-theme="dark"] .nav-logo-img, [data-theme="dark"] .portal-sidebar .nav-logo-img { filter: brightness(0) invert(1); }
.hero-sub { font-size: 19px; color: var(--fg-muted); max-width: 52ch; margin-top: 24px; }
.hero-actions { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 56px; display: flex; gap: 36px; flex-wrap: wrap;
  padding-top: 24px; border-top: 1px solid var(--line);
}
.hero-meta > div .eyebrow { margin-bottom: 6px; display: block; }
.hero-meta > div strong { font-weight: 500; font-size: 15px; color: var(--fg); }

/* Dashboard preview card */
.preview-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
}
.preview-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 60%, var(--bg-elev));
}
.preview-dots { display: flex; gap: 6px; }
.preview-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.preview-body { padding: 20px; display: grid; gap: 14px; }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  background: var(--bg);
}
.kpi .eyebrow { font-size: 10px; }
.kpi-val { font-size: 22px; font-weight: 500; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 11px; font-family: var(--font-mono); color: var(--success); }
.kpi-delta.neg { color: var(--danger); }

/* Benefits */
.benefits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.benefit { background: var(--bg); padding: 36px; min-height: 240px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.benefit-ix { font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); letter-spacing: 0.1em; }
.benefit h3 { font-size: 22px; font-weight: 500; }
.benefit p { margin: 10px 0 0; font-size: 15px; }
@media (max-width: 780px) { .benefits { grid-template-columns: 1fr; } }

/* How it works / steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: var(--bg-elev);
}
.step-num {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  margin-bottom: 16px; letter-spacing: 0.1em;
}
@media (max-width: 880px) { .steps { grid-template-columns: 1fr; } }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px; background: var(--bg-elev);
  display: flex; flex-direction: column; gap: 16px;
  position: relative;
}
.plan.featured { border-color: var(--primary); background: var(--primary); color: var(--primary-ink); }
.plan.featured h3, .plan.featured .plan-price { color: var(--primary-ink); }
.plan.featured p, .plan.featured li { color: color-mix(in oklab, var(--primary-ink) 82%, transparent); }
.plan.featured .plan-hr { border-color: color-mix(in oklab, var(--primary-ink) 18%, transparent); }
.plan-tag {
  position: absolute; top: 16px; right: 16px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  background: var(--accent); color: var(--accent-ink);
  padding: 4px 8px; border-radius: 4px;
}
.plan-price { font-size: 40px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 14px; color: var(--fg-muted); font-weight: 400; }
.plan.featured .plan-price small { color: color-mix(in oklab, var(--primary-ink) 65%, transparent); }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.plan li { font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.plan li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; opacity: 0.4; margin-top: 3px; flex-shrink: 0; }
.plan-hr { border: none; border-top: 1px solid var(--line); margin: 0; }
@media (max-width: 880px) { .pricing-grid { grid-template-columns: 1fr; } }

/* Calculator */
.calc {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--bg-elev); overflow: hidden;
}
.calc-controls { padding: 32px; border-right: 1px solid var(--line); }
.calc-output { padding: 32px; background: var(--primary); color: var(--primary-ink); }
.calc-field { margin-bottom: 24px; }
.calc-field label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.calc-field label strong { font-variant-numeric: tabular-nums; font-weight: 500; }
.calc-field input[type="range"] {
  width: 100%; height: 4px; appearance: none; background: var(--line-strong); border-radius: 2px; outline: none;
}
.calc-field input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; background: var(--primary); border-radius: 50%; cursor: pointer;
  border: 3px solid var(--bg-elev); box-shadow: 0 0 0 1px var(--line-strong);
}
.seg {
  display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px;
}
.seg button {
  flex: 1; border: none; background: transparent; padding: 8px 10px;
  font-size: 13px; color: var(--fg-muted); cursor: pointer; border-radius: 4px;
}
.seg button.active { background: var(--bg-elev); color: var(--fg); box-shadow: var(--shadow-sm); }
.calc-total { font-size: 56px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; margin-top: 12px; }
.calc-total small { font-size: 16px; color: color-mix(in oklab, var(--primary-ink) 60%, transparent); font-weight: 400; }
.calc-break { margin-top: 24px; display: grid; gap: 10px; font-size: 13px; }
.calc-break-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid color-mix(in oklab, var(--primary-ink) 14%, transparent); font-variant-numeric: tabular-nums; }
.calc-break-row:last-child { border-bottom: none; }
@media (max-width: 880px) { .calc { grid-template-columns: 1fr; } .calc-controls { border-right: none; border-bottom: 1px solid var(--line); } }

/* CTA band */
.cta-band {
  background: var(--primary); color: var(--primary-ink);
  border-radius: var(--radius-lg);
  padding: 64px; text-align: center;
  position: relative; overflow: hidden;
}
.cta-band h2 { color: var(--primary-ink); max-width: 18ch; margin: 0 auto; }
.cta-band p { color: color-mix(in oklab, var(--primary-ink) 75%, transparent); max-width: 52ch; margin: 16px auto 32px; }
.cta-band .btn-accent { color: var(--accent-ink); }

/* Footer */
footer { padding: 56px 0 40px; border-top: 1px solid var(--line); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.foot-grid h4 { font-size: 13px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-muted); font-weight: 500; margin-bottom: 16px; }
.foot-grid a { display: block; padding: 6px 0; font-size: 14px; color: var(--fg-muted); }
.foot-grid a:hover { color: var(--fg); }
.foot-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-subtle); }
@media (max-width: 780px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* Login modal */
.modal-scrim { position: fixed; inset: 0; background: oklch(0.1 0.02 250 / 0.55); z-index: 80; display: grid; place-items: center; padding: 24px; backdrop-filter: blur(4px); }
.modal {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-lg); max-width: 440px; width: 100%;
  padding: 40px; box-shadow: var(--shadow-md);
}
.modal h3 { font-size: 26px; margin-bottom: 8px; }
.modal p.sub { font-size: 14px; margin-bottom: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--fg-muted); }
.field input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--bg); color: var(--fg); font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 15%, transparent); }
.role-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }

/* Auth: tabs */
.auth-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 22px;
}
.auth-tabs button {
  flex: 1; height: 36px; border: none; background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--fg-muted); cursor: pointer; border-radius: 6px;
  transition: background-color .15s, color .15s;
}
.auth-tabs button.active { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); }

/* Auth: two-up field rows */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

.field-err { font-size: 12px; color: var(--danger); margin-top: 5px; }
.field input.invalid { border-color: var(--danger); }

/* Auth: password strength meter */
.pwd-meter { display: flex; align-items: center; gap: 10px; margin: -8px 0 14px; }
.pwd-bars { display: flex; gap: 4px; flex: 1; }
.pwd-bars span {
  height: 4px; flex: 1; border-radius: 2px; background: var(--line);
  transition: background-color .2s;
}
.pwd-bars span.lvl-1 { background: var(--danger); }
.pwd-bars span.lvl-2 { background: var(--warn); }
.pwd-bars span.lvl-3 { background: oklch(0.72 0.13 110); }
.pwd-bars span.lvl-4 { background: var(--success); }
.pwd-label { font-size: 11px; font-family: var(--font-mono); color: var(--fg-muted); min-width: 64px; text-align: right; }

/* Auth: terms checkbox */
.terms { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--fg-muted); margin-bottom: 16px; cursor: pointer; }
.terms input { margin-top: 3px; accent-color: var(--primary); width: 15px; height: 15px; }

/* Auth: switch + demo note */
.auth-switch { font-size: 13px; color: var(--fg-muted); text-align: center; margin-top: 16px; }
.auth-switch a { color: var(--accent); font-weight: 500; }

/* Auth: demo "preview as" role picker */
.preview-as { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.preview-as-label {
  display: block; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-subtle);
  margin-bottom: 10px;
}
.auth-demo-note {
  font-size: 12px; color: var(--fg-subtle); line-height: 1.5;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.auth-demo-note strong { color: var(--fg-muted); }
.role-pick button {
  padding: 10px 8px; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 12px; color: var(--fg-muted); cursor: pointer;
  font-family: inherit;
}
.role-pick button.active { border-color: var(--primary); color: var(--fg); background: var(--bg); }

/* Portal (the fake Glide replacement) */
.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; background: var(--bg); }
.portal-sidebar { border-right: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 4px; background: var(--bg-elev); }
.portal-sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 18px; }
.portal-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 6px; font-size: 14px; color: var(--fg-muted); cursor: pointer;
}
.portal-nav-item:hover { background: var(--bg); color: var(--fg); }
.portal-nav-item.active { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); }
.portal-nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: auto; }
.portal-main { padding: 32px 40px; overflow-x: auto; }
.portal-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.portal-user { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.portal-user .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; font-weight: 500; }
.portal-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.portal-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-elev); padding: 24px; }
.portal-panel h3 { font-size: 15px; margin-bottom: 16px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-weight: 500; color: var(--fg-muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.data-table tr:last-child td { border-bottom: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.04em; }
.tag-ok { background: color-mix(in oklab, var(--success) 20%, transparent); color: var(--success); }
.tag-warn { background: color-mix(in oklab, var(--warn) 25%, transparent); color: oklch(0.55 0.15 70); }
.tag-err { background: color-mix(in oklab, var(--danger) 22%, transparent); color: var(--danger); }
[data-theme="dark"] .tag-warn { color: var(--warn); }

.portal-close { position: absolute; top: 20px; right: 20px; }

@media (max-width: 880px) { .portal-shell { grid-template-columns: 1fr; } .portal-sidebar { display: none; } }

/* Placeholder imagery */
.placeholder-img {
  background-image: repeating-linear-gradient(
    -45deg,
    var(--line) 0, var(--line) 1px,
    transparent 1px, transparent 10px
  );
  background-color: var(--bg-elev);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle);
  border: 1px solid var(--line); border-radius: 6px;
}

/* Chart bars for dashboard preview */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 88px; }
.bars span { flex: 1; background: var(--line-strong); border-radius: 2px 2px 0 0; }
.bars span.hi { background: var(--accent); }
.bars span.mid { background: var(--primary); opacity: 0.5; }

/* Tweaks panel */
.tweaks {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  width: 300px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 16px; font-size: 13px;
  display: none;
}
.tweaks.visible { display: block; }
.tweaks h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); margin: 0 0 14px; font-weight: 500; }
.tweaks .row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.tweaks .row:first-of-type { border-top: none; }
.tweaks input[type="color"] { width: 40px; height: 28px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; padding: 2px; background: transparent; }

/* Power BI embed slot */
.pbi-embed { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg); }
.pbi-embed-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.pbi-mark {
  font-size: 12px; font-weight: 700; color: var(--fg);
  background: var(--accent); color: var(--accent-ink);
  padding: 2px 8px; border-radius: 4px; letter-spacing: -0.01em;
}
.pbi-embed-body { position: relative; padding: 20px; display: grid; gap: 16px; min-height: 320px; }
.pbi-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pbi-kpi { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--bg-elev); }
.pbi-chart { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: var(--bg-elev); }
.pbi-watermark {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; text-align: center;
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
  margin: 12px;
}
.pbi-watermark strong { font-size: 15px; color: var(--fg); }
.pbi-watermark span { font-size: 12px; color: var(--fg-muted); max-width: 42ch; }
.pbi-flow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--fg-muted); font-family: var(--font-mono);
}
.pbi-arrow { color: var(--accent); }

/* Import: dropzone + mapping chips */
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
  padding: 44px 24px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--fg-muted); background: var(--bg);
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 6%, var(--bg)); }
.dropzone strong { color: var(--fg); font-size: 15px; font-weight: 500; }
.dropzone span { font-size: 12px; color: var(--fg-subtle); }

/* Update data: two-file slots + status strip */
.imp-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
@media (max-width: 640px) { .imp-slots { grid-template-columns: 1fr; } }
.imp-slot {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 16px; background: var(--bg);
  transition: border-color .15s, background-color .15s;
}
.imp-slot.filled { border-color: var(--success); background: color-mix(in oklab, var(--success) 6%, var(--bg)); }
.imp-slot-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.imp-slot-title { font-size: 13px; font-weight: 600; color: var(--fg); }
.imp-slot-name { font-size: 12px; font-family: var(--font-mono); color: var(--fg-muted); margin: 8px 0 0; overflow-wrap: anywhere; }
.imp-slot-hint { font-size: 12px; color: var(--fg-subtle); margin: 8px 0 0; }
.imp-status {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.imp-status > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.imp-status span { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-subtle); }
.imp-status strong { font-size: 13px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-note {
  font-size: 12px; color: var(--fg-muted); background: color-mix(in oklab, var(--accent) 8%, var(--bg));
  border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--line)); border-radius: 8px; padding: 8px 12px;
}
.map-chip {
  font-size: 12px; font-family: var(--font-mono);
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 10px; color: var(--fg-muted);
}
.map-chip b { color: var(--accent); font-weight: 600; }

/* Fade/slide reveal — kept visible by default for reliability in captures/PDF/background tabs */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 1; }

/* ===== Reports dashboard ===== */
.rep-slicers { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 18px; }
.rep-sel { display: flex; flex-direction: column; gap: 4px; }
.rep-sel > span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-subtle); }
.rep-sel select, .rep-input {
  height: 36px; padding: 0 10px; font-size: 13px; font-family: var(--font-sans);
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: var(--radius); outline: none;
  max-width: 220px;
}
.rep-sel select:focus, .rep-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 15%, transparent); }

/* multi-select slicer */
.rep-ms-btn {
  height: 36px; min-width: 150px; max-width: 220px; padding: 0 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; font-family: var(--font-sans); text-align: left; cursor: pointer;
  background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.rep-ms-btn:hover { border-color: var(--fg-subtle); }
.rep-ms-btn.has-sel { border-color: var(--primary); color: var(--primary); }
.rep-ms-btn svg { flex: none; opacity: 0.65; }
.rep-ms-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-ms-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; width: max-content; min-width: 100%; max-width: 300px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 10px 30px color-mix(in oklab, var(--fg) 18%, transparent); padding: 8px;
}
.rep-ms-toolbar { display: flex; gap: 6px; margin-bottom: 6px; }
.rep-ms-toolbar button {
  flex: 1; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 6px; cursor: pointer; color: var(--fg-muted);
  background: color-mix(in oklab, var(--fg) 5%, var(--bg)); border: 1px solid var(--line);
}
.rep-ms-toolbar button:hover { color: var(--primary); border-color: var(--primary); }
.rep-ms-search {
  width: 100%; height: 32px; padding: 0 9px; margin-bottom: 6px; font-size: 13px; font-family: var(--font-sans);
  background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); border-radius: 6px; box-sizing: border-box;
}
.rep-ms-search:focus { border-color: var(--primary); outline: none; }
.rep-ms-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.rep-ms-opt {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--fg);
}
.rep-ms-opt:hover { background: color-mix(in oklab, var(--primary) 8%, var(--bg)); }
.rep-ms-opt input { accent-color: var(--primary); width: 15px; height: 15px; flex: none; cursor: pointer; }
.rep-ms-empty { padding: 10px 8px; font-size: 12px; color: var(--fg-subtle); }

/* ===== Dashboard print / PDF export ===== */
.rep-print-head { display: none; }
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  /* when printing a dashboard, strip the app chrome down to the report canvas */
  body.rep-printing .portal-sidebar,
  body.rep-printing .portal-topbar,
  body.rep-printing .tweaks,
  body.rep-printing .rep-dash-seg,
  body.rep-printing .rep-slicers,
  body.rep-printing .rep-connect,
  body.rep-printing .rep-chips,
  body.rep-printing .tile-x,
  body.rep-printing .rep-ms-pop,
  body.rep-printing .rep-root > .portal-panel:first-of-type { display: none !important; }
  body.rep-printing .portal-shell { display: block !important; }
  body.rep-printing .portal-main { padding: 0 !important; overflow: visible !important; }
  body.rep-printing .rep-print-head { display: block; margin-bottom: 14px; }
  body.rep-printing .rep-print-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  body.rep-printing .rep-print-brand img { height: 24px; }
  body.rep-printing .rep-print-brand span { font-size: 12px; font-family: var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-muted); }
  body.rep-printing .rep-print-head h1 { font-size: 24px; margin: 0 0 6px; }
  body.rep-printing .rep-print-meta { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--fg-muted); padding-bottom: 10px; border-bottom: 1.5px solid var(--primary); }
  /* keep each tile intact across page breaks */
  body.rep-printing .portal-panel { break-inside: avoid; page-break-inside: avoid; box-shadow: none !important; border: 1px solid var(--line) !important; }
  body.rep-printing .rep-grid-2 { break-inside: avoid; }
  body.rep-printing .kpi-strip, body.rep-printing .rep-kpis { break-inside: avoid; }
}
.rep-input { flex: 1; min-width: 260px; max-width: none; }
.rep-clear { align-self: flex-end; }
.rep-clear:disabled { opacity: 0.4; cursor: not-allowed; }
.rep-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rep-chip { font-family: var(--font-mono); font-size: 11px; padding: 3px 9px; border-radius: 999px; background: color-mix(in oklab, var(--accent) 14%, var(--bg)); color: var(--accent-ink); border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent); }
[data-theme="dark"] .rep-chip { color: var(--accent); }
.rep-connect { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.rep-dash-seg { background: var(--bg); border-color: var(--line-strong); }
.rep-dash-seg button { font-weight: 500; font-size: 13.5px; }
.rep-dash-seg button.active { background: var(--primary); color: var(--primary-ink); box-shadow: none; }
[data-theme="dark"] .rep-dash-seg button.active { background: var(--accent); color: var(--accent-ink); }

/* KPI strip */
.rep-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.rep-kpi { background: var(--bg-elev); padding: 16px 18px; }
.rep-kpi .eyebrow { font-size: 9.5px; }
.rep-kpi-val { font-size: 28px; font-weight: 500; margin-top: 8px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--primary); }
[data-theme="dark"] .rep-kpi-val { color: var(--accent); }
.rep-kpi-sub { font-size: 11px; color: var(--fg-subtle); font-family: var(--font-mono); }
@media (max-width: 1000px) { .rep-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .rep-kpis { grid-template-columns: repeat(2, 1fr); } }

.rep-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .rep-grid-2 { grid-template-columns: 1fr; } }
.rep-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.rep-panel-head h3 { margin: 0; font-size: 15px; }
.rep-sub { font-size: 11px; color: var(--fg-subtle); font-family: var(--font-mono); }
.rep-empty { padding: 28px; text-align: center; color: var(--fg-subtle); font-size: 13px; }

/* Heatmap / user matrix */
.rep-matrix-scroll { overflow: auto; max-height: 360px; border: 1px solid var(--line); border-radius: var(--radius); }
.rep-matrix { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.rep-matrix th { position: sticky; top: 0; z-index: 1; background: var(--bg-elev); text-align: center; font-weight: 500; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-muted); padding: 9px 6px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.rep-matrix td { text-align: center; padding: 8px 6px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.rep-matrix tr td:last-child, .rep-matrix tr th:last-child { border-right: none; }
.rep-matrix tr:last-child td { border-bottom: none; }
.rep-cell { font-weight: 500; }
.rep-wk { text-align: left !important; white-space: nowrap; color: var(--fg); font-weight: 500; padding-left: 12px !important; background: var(--bg); position: sticky; left: 0; }
.rep-wk-yr { color: var(--fg-subtle); font-weight: 400; }
.rep-matrix thead th.rep-wk { z-index: 2; background: var(--bg-elev); }
.rep-uname { text-align: left !important; white-space: nowrap; color: var(--fg); font-weight: 500; padding-left: 12px !important; background: var(--bg); position: sticky; left: 0; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.rep-matrix thead th.rep-uname { z-index: 2; background: var(--bg-elev); }
.rep-tot { font-weight: 600; color: var(--fg); background: var(--bg-elev); }
.rep-foot td { font-weight: 600; color: var(--fg); background: var(--bg-elev); border-top: 1px solid var(--line-strong); }

/* Bar list */
.rep-bars { display: flex; flex-direction: column; gap: 10px; }
.rep-bar-row { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 12px; }
.rep-bar-label { font-size: 12px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-bar-track { height: 22px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.rep-bar-fill { height: 100%; border-radius: 4px; min-width: 2px; transition: width .4s cubic-bezier(.2,.9,.3,1); }
.rep-bar-val { font-size: 13px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); }
@media (max-width: 520px) { .rep-bar-row { grid-template-columns: 90px 1fr 44px; } }

/* Stacked columns */
.rep-cols { display: flex; align-items: flex-end; gap: 14px; padding: 8px 4px 0; }
.rep-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.rep-col-stack { width: 100%; max-width: 54px; height: 100%; display: flex; flex-direction: column-reverse; justify-content: flex-start; border-radius: 4px 4px 0 0; overflow: hidden; }
.rep-seg { width: 100%; transition: height .4s cubic-bezier(.2,.9,.3,1); }
.rep-col-x { font-size: 11px; color: var(--fg-muted); font-family: var(--font-mono); }
.rep-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.rep-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fg-muted); }
.rep-leg i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

/* Line chart + side legend */
.rep-chart-row { display: flex; gap: 18px; align-items: stretch; }
.rep-chart-row > svg, .rep-chart-row > div:first-child { flex: 1; min-width: 0; }
.rep-line { width: 100%; height: auto; display: block; overflow: visible; }
.rep-line-lbl { font-size: 11px; font-weight: 600; font-family: var(--font-sans); }
.rep-line-x { font-size: 11px; font-family: var(--font-mono); }
.rep-legend-side { flex: 0 0 auto; min-width: 130px; max-width: 190px; display: flex; flex-direction: column; gap: 8px; align-self: center; }
.rep-legend-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-subtle); margin-bottom: 2px; }
.rep-legend-side .rep-leg { font-size: 12px; }
.rep-seg-lbl { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; }
@media (max-width: 720px) { .rep-chart-row { flex-direction: column; } .rep-legend-side { flex-direction: row; flex-wrap: wrap; max-width: none; align-self: stretch; } .rep-legend-title { width: 100%; } }

/* Single-series monthly totals */
.rep-col-single { width: 100%; max-width: 54px; border-radius: 4px 4px 0 0; transition: height .4s cubic-bezier(.2,.9,.3,1); }
.rep-col-val { font-size: 12px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.rep-cols-24 { gap: 3px; }
.rep-cols-24 .rep-col-single { max-width: none; border-radius: 2px 2px 0 0; }
.rep-col-x-sm { font-size: 9px; letter-spacing: -0.02em; }

/* Importer × month volume matrix */
.rep-matrix-vol th, .rep-matrix-vol td { white-space: nowrap; }
.rep-matrix-vol .rep-mgrp { border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); color: var(--primary); font-size: 11px; }
[data-theme="dark"] .rep-matrix-vol .rep-mgrp { color: var(--accent); }
.rep-cell-v { font-weight: 500; border-left: 1px solid var(--line-strong) !important; font-variant-numeric: tabular-nums; }
.rep-pct { color: var(--fg-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.rep-diff { font-size: 11px; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.rep-diff.pos { color: var(--accent); }
[data-theme="dark"] .rep-diff.pos { color: var(--accent); }
.rep-matrix-vol .rep-foot td { border-left: none; }
.rep-matrix-vol .rep-foot .rep-cell-v, .rep-matrix-vol tbody .rep-cell-v { border-left: 1px solid var(--line-strong) !important; }

/* Day → hour × user detail */
.rep-dayhdr td { background: var(--bg-elev); font-weight: 600; color: var(--fg); border-top: 2px solid var(--line-strong); font-variant-numeric: tabular-nums; }
.rep-dayhdr .rep-uname { background: var(--bg-elev); }
.rep-hour { text-align: left !important; padding-left: 26px !important; color: var(--fg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; position: sticky; left: 0; background: var(--bg); font-size: 11px; }

/* User comparison — clustered columns per user */
.cmp-plot { display: flex; align-items: flex-end; gap: 20px; padding: 8px 4px 0; overflow-x: auto; }
.cmp-group { flex: 1; min-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.cmp-group-bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; height: 100%; }
.cmp-bar-col { flex: 1; max-width: 34px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.cmp-bar { width: 100%; border-radius: 4px 4px 0 0; transition: height .4s cubic-bezier(.2,.9,.3,1); min-height: 2px; }
.cmp-bar-val { font-size: 10px; font-weight: 600; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.cmp-group-label { font-size: 11px; color: var(--fg-muted); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Raw data panel */
.rawdata-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.rawdata-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-muted); cursor: pointer; }
.rawdata-check input, .rawdata-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.rawdata-table th { position: sticky; top: 0; background: var(--bg-elev); z-index: 1; white-space: nowrap; }
.rawdata-table tbody tr:hover, .rawdata-table tbody tr:hover { background: var(--bg); }
.rawdata-table tr.rawdata-on { background: color-mix(in oklab, var(--accent) 12%, var(--bg)); }
[data-theme="dark"] .rawdata-table tr.rawdata-on { background: color-mix(in oklab, var(--accent) 18%, var(--bg-elev)); }

/* Tile export button — sits at the right of a tile head */
.rep-panel-head .tile-x { flex: 0 0 auto; align-self: flex-start; }

/* ===== Ocean status board ===== */
.ocean-table th { position: sticky; top: 0; background: var(--bg-elev); z-index: 1; white-space: nowrap; }
.ocean-table td { white-space: nowrap; }
.ocean-row-missing { background: color-mix(in oklab, var(--danger) 9%, transparent); }
.ocean-row-missing:hover { background: color-mix(in oklab, var(--danger) 15%, transparent); }
.ocean-noisf { color: var(--danger); font-family: var(--font-mono); font-size: 11px; }
.ocean-pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; font-family: var(--font-mono); letter-spacing: 0.03em; }
.ocean-pill-hot { background: color-mix(in oklab, var(--danger) 16%, transparent); color: var(--danger); }
.ocean-pill-ontime { background: color-mix(in oklab, var(--primary) 14%, transparent); color: var(--primary); }
[data-theme="dark"] .ocean-pill-ontime { color: var(--accent); background: color-mix(in oklab, var(--accent) 18%, transparent); }



