/* Rennick customer portal: sign in, code, dashboard.
   The UI is the AccurateW6 app's, ported from its globals.css and shadcn
   components: the same tokens (the dark .app-shell set across sign in, the code
   step and the dashboard), 4px control radius, 16px panels, copper focus ring,
   status badges, segmented code input. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv01", "cv03";
  line-height: 1.5;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #b07a3e; color: #fff; }
[hidden] { display: none !important; }

:root {
  --radius: 4px;
  --radius-glass: 16px;
  --rich-black: #070713;
  --oxford: #0b2546;
  --cream: #eee7e3;
  --kobicha: #724f28;
  --copper: #b07a3e;
  --copper-soft: rgba(176, 122, 62, 0.14);
  --copper-glow: rgba(176, 122, 62, 0.35);
  --ok: #22c55e;
  --warn: #f59e0b;
  --fault: #ef4444;
  --info: #38bdf8;
  --idle: #7a889c;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.app-shell {
  --background: #ffffff;
  --foreground: #1a1a1a;
  --card: #ffffff;
  --primary: #1a1a1a;
  --primary-fg: #fafafa;
  --secondary: #ececec;
  --muted: #eeeeee;
  --muted-fg: #6b7280;
  --border: rgba(0, 0, 0, 0.1);
  --input: rgba(0, 0, 0, 0.16);
  --ring: #b07a3e;
  color-scheme: light;
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  min-height: 100dvh;
}
.app-shell.dark {
  --background: #141414;
  --foreground: #ffffff;
  --card: #1a1a1a;
  --primary: #ededed;
  --primary-fg: #1a1a1a;
  --secondary: #262626;
  --muted: #242424;
  --muted-fg: #a3a3a3;
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.14);
  color-scheme: dark;
}

/* ---------- primitives ---------- */
.muted { color: var(--muted-fg); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.22em; color: var(--muted-fg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.alert { font-size: 14px; color: var(--fault); }
.note-ok { font-size: 14px; color: var(--ok); }

.label { display: block; font-size: 14px; font-weight: 500; line-height: 1; }
.field { display: grid; gap: 8px; }
.input {
  display: block; width: 100%; height: 40px; padding: 0 10px;
  border: 1px solid var(--input); border-radius: var(--radius);
  background: transparent; color: var(--foreground); font-size: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.dark .input { background-color: color-mix(in srgb, var(--input) 30%, transparent); }
.input::placeholder { color: var(--muted-fg); }
.input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
.input[aria-invalid="true"] { border-color: var(--fault); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
textarea.input { height: auto; min-height: 112px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
select.input {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.dark select.input option { background: #1e1e1e; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--primary); color: var(--primary-fg);
  font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer;
  outline: none; transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.btn:hover { background: color-mix(in srgb, var(--primary) 80%, transparent); }
.btn:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-lg { height: 40px; }
.btn-block { width: 100%; }
.btn-outline { background: var(--background); border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { background: var(--muted); }
.dark .btn-outline { background: color-mix(in srgb, var(--input) 30%, transparent); border-color: var(--input); }
.dark .btn-outline:hover { background: color-mix(in srgb, var(--input) 50%, transparent); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--muted); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }

.link {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: color-mix(in srgb, var(--foreground) 70%, transparent);
  text-decoration: none; transition: color 0.15s;
}
.link:hover { color: var(--foreground); }
.link:disabled { opacity: 0.5; pointer-events: none; }
.link:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px;
  border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 500; line-height: 16px; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); border-color: rgba(34, 197, 94, 0.25); background: rgba(34, 197, 94, 0.1); }
.badge.warn { color: var(--warn); border-color: rgba(245, 158, 11, 0.25); background: rgba(245, 158, 11, 0.1); }
.badge.fault { color: var(--fault); border-color: rgba(239, 68, 68, 0.25); background: rgba(239, 68, 68, 0.1); }
.badge.info { color: var(--info); border-color: rgba(56, 189, 248, 0.25); background: rgba(56, 189, 248, 0.1); }
.badge.idle { color: var(--muted-fg); border-color: color-mix(in srgb, var(--foreground) 15%, transparent); background: color-mix(in srgb, var(--foreground) 5%, transparent); }
.badge.idle::before { background: var(--idle); }

.panel { position: relative; border: 1px solid var(--border); border-radius: var(--radius-glass); background: var(--card); }
.backdrop {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(58rem 38rem at 8% -10%, rgba(176, 122, 62, 0.06), transparent 60%),
    radial-gradient(48rem 48rem at 100% -6%, rgba(255, 255, 255, 0.02), transparent 55%);
}
.logo-mark { display: block; height: 20px; width: auto; }

/* ---------- segmented code input (Accurate's OtpInput) ---------- */
.otp { position: relative; }
.otp-boxes { display: flex; gap: 8px; }
.otp-box {
  flex: 1; height: 48px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--input); border-radius: 10px;
  font-family: var(--mono); font-size: 20px; font-variant-numeric: tabular-nums; color: var(--muted-fg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.otp-box.filled { background: color-mix(in srgb, var(--input) 20%, transparent); color: var(--foreground); }
.otp-box.active { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
.otp input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: text; font-size: 16px; border: 0; }
.otp.disabled { opacity: 0.5; }

/* ---------- sign in: split shell (Accurate's AuthShell), dark, with the turbine model ---------- */
.auth { display: block; }
@media (min-width: 1024px) { .auth { display: grid; grid-template-columns: 1.1fr 1fr; } }
.auth-brand {
  display: none; position: relative; overflow: hidden; padding: 40px;
  background:
    radial-gradient(40rem 26rem at 58% 44%, rgba(176, 122, 62, 0.10), transparent 65%),
    radial-gradient(50rem 30rem at 0% 0%, rgba(255, 255, 255, 0.03), transparent 60%),
    #0d0d0f;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
@media (min-width: 1024px) { .auth-brand { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-logo { position: relative; z-index: 1; width: fit-content; color: #fff; }
.auth-logo .logo-mark { height: 22px; }
.auth-headline { position: relative; z-index: 1; max-width: 448px; font-size: 36px; font-weight: 500; line-height: 1.08; color: #f4f0ec; }
.model { position: relative; z-index: 1; flex: 1; min-height: 0; margin: 12px -40px; }
.model canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; }
.model .title-block { position: absolute; right: 40px; bottom: 4px; z-index: 2; }
.title-block { min-width: 210px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.03); font-family: var(--mono); font-size: 11px; color: #e5e7eb; }
.title-block div { display: grid; grid-template-columns: 64px 1fr; }
.title-block div + div { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.title-block span { padding: 5px 8px; border-right: 1px solid rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.45); text-transform: uppercase; letter-spacing: 0.08em; font-size: 9.5px; }
.title-block b { padding: 5px 8px; font-weight: 500; }
@media (min-width: 1280px) { .auth-headline { font-size: 48px; } }
.auth-col { display: flex; min-height: 100vh; min-height: 100dvh; flex-direction: column; }
.auth-mobile-logo { display: flex; justify-content: center; padding-top: 40px; color: var(--foreground); }
.auth-mobile-logo .logo-mark { height: 22px; }
@media (min-width: 1024px) { .auth-mobile-logo { display: none; } }
.auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form { width: 100%; max-width: 384px; }
.auth-form h1 { font-size: 30px; font-weight: 600; line-height: 1.2; }
.auth-form .lead { margin-top: 8px; font-size: 14px; }
.auth-form form { margin-top: 32px; display: grid; gap: 20px; }
.auth-form .fine { font-size: 12px; }
.auth-foot { margin-top: 40px; display: grid; gap: 6px; border-top: 1px solid var(--border); padding-top: 20px; font-size: 14px; color: var(--muted-fg); }

/* ---------- code step: dark "console door" card (Accurate's /verify) ---------- */
.verify { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: 40px 16px; }
.verify > * { position: relative; z-index: 1; }
.verify-logo { color: #fff; }
.verify-logo .logo-mark { height: 22px; }
.verify-card { width: 100%; max-width: 768px; overflow: hidden; }
@media (min-width: 768px) { .verify-card { display: grid; grid-template-columns: 0.95fr 1.25fr; } }
.scan { display: none; }
@media (min-width: 768px) {
  .scan { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 40px; border-right: 1px solid var(--border); background: rgba(0, 0, 0, 0.25); }
}
.frame { position: relative; display: flex; width: 176px; height: 176px; align-items: center; justify-content: center; }
.frame i { position: absolute; width: 24px; height: 24px; border-color: rgba(176, 122, 62, 0.7); border-style: solid; border-width: 0; }
.frame i:nth-child(1) { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.frame i:nth-child(2) { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.frame i:nth-child(3) { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.frame i:nth-child(4) { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }
.frame-box { position: relative; display: flex; width: 96px; height: 96px; align-items: center; justify-content: center; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px; background: rgba(255, 255, 255, 0.04); color: rgba(255, 255, 255, 0.7); }
.frame-box svg { width: 36px; height: 36px; }
.sweep { position: absolute; inset: 0 auto 0 0; width: 33%; background: linear-gradient(90deg, transparent, rgba(176, 122, 62, 0.25), transparent); animation: sweep 2.4s ease-in-out infinite; }
@keyframes sweep { from { transform: translateX(-110%); } to { transform: translateX(310%); } }
.scan-copy { text-align: center; }
.scan-copy b { display: block; font-size: 18px; font-weight: 500; }
.scan-copy span { display: block; margin: 4px auto 0; max-width: 220px; font-size: 14px; color: var(--muted-fg); overflow-wrap: anywhere; }
.verify-body { padding: 32px; }
@media (min-width: 768px) { .verify-body { padding: 40px; } }
.verify-body .eyebrow { color: rgba(255, 255, 255, 0.4); }
.verify-body h1 { margin-top: 12px; font-size: 24px; font-weight: 600; }
.verify-body .lead { margin-top: 8px; font-size: 14px; }
.verify-body form { margin-top: 32px; display: grid; gap: 20px; }
.verify-row { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.verify-alt { margin-top: 12px; font-size: 14px; }

/* ---------- dashboard ---------- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 40px; } }
.dash-top { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--background) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.dash-top-in { display: flex; height: 60px; align-items: center; gap: 12px; }
.dash-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.dash-sep { color: var(--muted-fg); }
.dash-crumb { font-size: 14px; font-weight: 500; }
.dash-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dash-who { display: none; align-items: center; gap: 8px; padding: 0 8px; font-size: 13px; color: var(--muted-fg); }
@media (min-width: 768px) { .dash-who { display: flex; } }
.avatar { display: inline-flex; width: 28px; height: 28px; flex: none; align-items: center; justify-content: center; border-radius: 50%; background: var(--copper-soft); box-shadow: inset 0 0 0 1px var(--copper-glow); color: #e2b98a; font-size: 11px; font-weight: 600; }
.avatar.lg { width: 40px; height: 40px; font-size: 13px; }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: inline; } }

.dash { position: relative; z-index: 1; padding-top: 32px; padding-bottom: 64px; }
.dash-head h1 { margin-top: 10px; font-size: 30px; font-weight: 600; line-height: 1.2; }
.dash-head .lead { margin-top: 6px; font-size: 14px; }
.stats { margin-top: 28px; display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 16px 18px; }
.stat p:first-child { font-size: 13px; color: var(--muted-fg); }
.stat .n { margin-top: 6px; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .stat { padding: 12px; } .stat .n { font-size: 22px; } .stat p:first-child { font-size: 12px; } }
.dash-grid { margin-top: 20px; display: grid; gap: 20px; }
@media (min-width: 1024px) { .dash-grid { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; } }
.dash-main, .dash-side { display: grid; gap: 20px; min-width: 0; }
@media (min-width: 1024px) { .dash-side { position: sticky; top: 80px; } }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.sec-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.sec-head .count { font-size: 12px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.sec-body { padding: 16px 18px; }
.empty { padding: 28px 18px; text-align: center; font-size: 14px; color: var(--muted-fg); }
.empty a { color: var(--foreground); }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { height: 40px; padding: 0 12px; text-align: left; font-weight: 500; font-size: 13px; color: var(--muted-fg); white-space: nowrap; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color 0.15s; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--muted) 50%, transparent); }
.tbl th:first-child, .tbl td:first-child { padding-left: 18px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 18px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .ref { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.tbl .date { white-space: nowrap; }
.tbl .parts { max-width: 260px; }
.tbl .parts span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .parts small { color: var(--muted-fg); font-size: 12px; }
@media (max-width: 640px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 12px 18px; border-bottom: 1px solid var(--border); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td { padding: 2px 0 !important; border: 0; text-align: left !important; }
  .tbl td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 110px; color: var(--muted-fg); font-size: 12px; }
  .tbl .parts { max-width: none; }
}

.project { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.project:last-child { border-bottom: 0; }
.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-title { font-size: 15px; font-weight: 600; }
.project-meta { margin-top: 2px; font-size: 13px; color: var(--muted-fg); }
.project-meta .mono { font-size: 12px; }
.steps { margin-top: 16px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.step { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; font-size: 12px; color: var(--muted-fg); }
.step::before { content: ""; position: absolute; top: 5px; left: calc(-50% + 8px); right: calc(50% + 8px); height: 2px; background: var(--border); }
.step:first-child::before { display: none; }
.step i { position: relative; width: 12px; height: 12px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--foreground) 25%, transparent); background: var(--card); }
.step.done { color: var(--foreground); }
.step.done i { border-color: var(--copper); background: var(--copper); }
.step.done::before, .step.now::before { background: rgba(176, 122, 62, 0.7); }
.step.now { color: var(--foreground); font-weight: 500; }
.step.now i { border-color: var(--copper); background: var(--card); box-shadow: 0 0 0 4px var(--copper-soft); }
@media (max-width: 480px) { .step span { font-size: 10px; } }
.project-foot { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--muted-fg); }
.project-foot b { color: var(--foreground); font-weight: 500; }
.project-note { margin-top: 10px; font-size: 13px; padding: 8px 10px; border-radius: var(--radius); background: color-mix(in srgb, var(--muted) 60%, transparent); }

.eng { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.eng-name { font-size: 14px; font-weight: 600; }
.eng-title { font-size: 12px; color: var(--muted-fg); }
.eng-links { margin-top: 8px; display: grid; gap: 4px; font-size: 13px; }
.eng-links a { display: inline-flex; align-items: center; gap: 8px; width: fit-content; overflow-wrap: anywhere; }
.eng-links svg { width: 14px; height: 14px; flex: none; color: var(--muted-fg); }
.msg { display: grid; gap: 14px; padding: 16px 18px; }
.msg h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.profile { padding: 16px 18px; margin-top: 20px; }
.profile form { margin-top: 12px; display: grid; gap: 12px; }
@media (min-width: 768px) { .profile form { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; } }

.skel { border-radius: var(--radius); background: color-mix(in srgb, var(--foreground) 6%, transparent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------- segmented control (Accurate's SegmentedNav: copper active pill) ---------- */
.seg { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--foreground) 3%, transparent); }
.seg a, .seg button { padding: 6px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted-fg); font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: color 0.15s, background-color 0.15s; }
.seg a:hover, .seg button:hover { color: var(--foreground); }
.seg .on { background: var(--copper-soft); color: var(--foreground); box-shadow: inset 0 0 0 1px var(--copper-glow); }
.seg a:focus-visible, .seg button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.seg.sm a, .seg.sm button { padding: 4px 10px; font-size: 12px; }

/* ---------- admin (rennickcnc.ca/admin) ---------- */
.admin-tabs { margin-top: 20px; overflow-x: auto; padding-bottom: 2px; }
.page-head { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 24px; font-weight: 600; line-height: 1.25; }
.page-head p { margin-top: 4px; max-width: 700px; font-size: 14px; color: var(--muted-fg); }
.stats5 { margin-top: 20px; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .stats5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.stats5 a { display: block; padding: 14px 16px; color: inherit; text-decoration: none; transition: background-color 0.15s; }
.stats5 a:hover { background: color-mix(in srgb, var(--foreground) 3%, var(--card)); }
.stats5 p:first-child { font-size: 12px; color: var(--muted-fg); }
.stats5 .n { margin-top: 4px; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tone-warn { color: var(--warn); }
.tone-fault { color: var(--fault); }
.toolbar { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.filter-note { font-size: 13px; color: var(--muted-fg); }
.filter-note a { margin-left: 6px; color: var(--foreground); }
.admin-panel { margin-top: 16px; }
.cell-sub { display: block; font-size: 12px; color: var(--muted-fg); }
.tbl .actions { text-align: right; white-space: nowrap; }
.tbl .actions > * + * { margin-left: 6px; }
.tbl .wrap { white-space: pre-wrap; min-width: 260px; max-width: 520px; }
.late { color: var(--fault); }
.notice { margin-top: 16px; padding: 18px; border: 1px dashed var(--border); border-radius: 12px; text-align: center; font-size: 14px; color: var(--muted-fg); }
.notice.warn { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.06); color: var(--warn); text-align: left; }
.search { display: flex; gap: 8px; max-width: 460px; }

.sheet-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(560px, 100%); display: flex; flex-direction: column; background: #1a1a1a; border-left: 1px solid var(--border); box-shadow: -20px 0 60px -30px rgba(0, 0, 0, 0.9); }
.sheet-head { position: relative; padding: 18px 52px 14px 20px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.sheet-head p { margin-top: 4px; font-size: 13px; color: var(--muted-fg); }
.sheet-close { position: absolute; top: 14px; right: 12px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: grid; gap: 26px; align-content: start; }
.sheet-sec h3 { margin-bottom: 10px; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-fg); }
.sheet-sec .muted, .sheet-sec .small { font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .span2 { grid-column: 1 / -1; }
.row-actions { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.note { font-size: 12px; }
.note.ok { color: var(--ok); }
.note.err { color: var(--fault); }
.part-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 10px; }
.part-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; font-size: 14px; }
.part-list li + li { border-top: 1px solid var(--border); }
.quoted-note { white-space: pre-wrap; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--foreground) 5%, transparent); font-size: 14px; }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--foreground); font-size: 14px; text-decoration: none; }
.link-row:hover { background: color-mix(in srgb, var(--foreground) 3%, transparent); }
.link-row span:last-child { color: var(--muted-fg); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.check input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--copper); }
.check small { display: block; font-size: 12px; color: var(--muted-fg); }
.input.sm { height: 32px; font-size: 13px; }
.input.numr { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.input.changed { border-color: rgba(176, 122, 62, 0.75); }
.settings-grid { display: grid; gap: 4px 24px; padding: 12px; }
@media (min-width: 760px) { .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 6px; border-radius: 8px; }
.setting > span { min-width: 0; font-size: 13px; }
.setting > span small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted-fg); }
.setting .unit { width: 56px; font-size: 12px; color: var(--muted-fg); }
.sec-gap { margin-top: 28px; }
.sec-title { font-size: 14px; font-weight: 600; }
.sec-desc { margin-top: 2px; font-size: 12px; color: var(--muted-fg); }
/* Pricing tables stay tables on phones (they scroll sideways). */
@media (max-width: 640px) {
  .tbl.keep { display: table; }
  .tbl.keep thead { display: table-header-group; }
  .tbl.keep tbody { display: table-row-group; }
  .tbl.keep tr { display: table-row; padding: 0; }
  .tbl.keep td { display: table-cell; width: auto; padding: 8px 10px !important; }
}

/* ---------- preview banner (admin viewing a customer's dashboard) ---------- */
.preview-bar { margin-bottom: 20px; padding: 10px 14px; border: 1px solid rgba(56, 189, 248, 0.3); border-radius: 10px; background: rgba(56, 189, 248, 0.08); color: #bae6fd; font-size: 14px; }
.preview-bar a { color: #fff; margin-left: 6px; }
.previewing [data-ask] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sweep { display: none; }
}
