/* ─────────────────────────────────────────────────────────────
   BYD Showroom Intelligence — portal design system
   Palette: BYD red on charcoal + silver surfaces
   ───────────────────────────────────────────────────────────── */

:root {
  --brand: #c8102e;
  --brand-strong: #e01834;
  --brand-dark: #96031d;
  --brand-tint: #fdeef0;
  --brand-glow: rgba(200, 16, 46, 0.32);

  --ink: #14181f;
  --ink-soft: #39424e;
  --muted: #68737f;
  --line: #e4e8ee;
  --line-strong: #cfd6df;

  --bg: #f3f5f8;
  --bg-deep: #e9edf2;
  --panel: #ffffff;
  --panel-alt: #f8fafc;

  --header-ink: #eef1f5;
  --header-muted: #9aa4b2;

  --accent: #1f2937;
  --steel: #33404f;

  --ok: #0d7a5f;
  --ok-tint: #e4f5ee;
  --ok-line: #b7e2d4;
  --warn: #b45309;

  --shadow-sm: 0 1px 2px rgba(15, 20, 30, 0.05), 0 1px 3px rgba(15, 20, 30, 0.07);
  --shadow-md: 0 8px 28px rgba(15, 20, 30, 0.09);
  --shadow-lg: 0 24px 60px rgba(10, 14, 22, 0.42);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: var(--font);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { color-scheme: light; }
body {
  font-family: var(--font);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 520px at 8% -12%, rgba(200, 16, 46, 0.06), transparent 60%),
    radial-gradient(900px 480px at 105% 0%, rgba(31, 41, 55, 0.05), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

::selection { background: rgba(200, 16, 46, 0.16); }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:is(button, input, select, textarea) { font-family: inherit; }
:is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Shell header ──────────────────────────────────────────── */

.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.8rem 1.75rem;
  background: linear-gradient(180deg, #171c24 0%, #0d1117 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 -2px 0 var(--brand);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.brand-badge, .brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.34rem 0.72rem;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand-dark));
  color: #fff;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.14em;
  box-shadow: 0 4px 14px var(--brand-glow);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-title {
  color: var(--header-ink);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.brand-sub, .brand .sub {
  color: var(--header-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.nav a {
  color: var(--header-muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav a:hover {
  color: var(--header-ink);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand-dark));
  box-shadow: 0 4px 14px var(--brand-glow);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.85rem;
  color: var(--header-muted);
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a3442, #171d26);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  line-height: 1.1;
}
.user-name {
  color: var(--header-ink);
  font-weight: 600;
  font-size: 0.85rem;
}
.badge {
  display: inline-block;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: rgba(200, 16, 46, 0.18);
  border: 1px solid rgba(224, 24, 52, 0.45);
  color: #ff8fa0;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge.monitor {
  background: rgba(122, 143, 165, 0.16);
  border-color: rgba(154, 164, 178, 0.4);
  color: #aeb9c6;
}
.logout-form { margin: 0; }
.shell-header .btn-ghost {
  color: var(--header-muted);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  background: transparent;
}
.shell-header .btn-ghost:hover {
  color: #fff;
  border-color: var(--brand-strong);
  background: rgba(200, 16, 46, 0.14);
}

.shell-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 1.25rem 1rem 2rem;
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-soft);
  border-radius: var(--radius-xs);
  padding: 0.48rem 1rem;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease,
    background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-strong), var(--brand-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px var(--brand-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #eb2540, var(--brand-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 22px var(--brand-glow);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn-ghost:hover {
  color: var(--brand);
  border-color: transparent;
  box-shadow: none;
}
.btn-block { width: 100%; }
.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.76rem;
  border-radius: 7px;
}
.btn:disabled { opacity: 0.55; cursor: wait; }

/* ── Page layout ───────────────────────────────────────────── */

main.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  animation: rise 0.4s ease-out;
}
main.page.page-wide { max-width: 1420px; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  main.page { animation: none; }
}

.eyebrow {
  display: inline-block;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.4rem;
}
h1 {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.lead {
  color: var(--muted);
  margin: 0 0 1.6rem;
  font-size: 0.98rem;
  max-width: 46rem;
}
.page-head { margin-bottom: 0.5rem; }

/* ── Cards ─────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.15rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand-strong), transparent 85%);
  opacity: 0.75;
}
.card:hover { box-shadow: var(--shadow-md); }
.card .label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.card .value {
  font-size: 2.1rem;
  font-weight: 800;
  margin-top: 0.3rem;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.card .hint { color: var(--muted); font-size: 0.82rem; margin-top: 0.4rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.panel h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.8rem;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.panel h2::before {
  content: "";
  width: 4px;
  height: 1.05em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-strong), var(--brand-dark));
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Home quick-link cards */
.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem;
  margin-top: 0.4rem;
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease, transform 0.15s ease;
}
.link-card:hover {
  text-decoration: none;
  border-color: rgba(200, 16, 46, 0.4);
  background: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.lc-title {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.lc-title::after {
  content: "→";
  color: var(--brand);
  font-weight: 700;
  transition: transform 0.15s ease;
}
.link-card:hover .lc-title::after { transform: translateX(3px); }
.lc-desc { color: var(--muted); font-size: 0.82rem; }

/* ── Toolbar / filters ─────────────────────────────────────── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  box-shadow: var(--shadow-sm);
}
.toolbar button {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: border-color 0.15s ease, color 0.15s ease,
    background 0.15s ease, box-shadow 0.15s ease;
}
.toolbar button:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.toolbar button.active {
  background: linear-gradient(135deg, var(--brand-strong), var(--brand-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px var(--brand-glow);
}
.toolbar label.muted {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.toolbar input[type="date"],
.toolbar input[type="search"],
.toolbar select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.toolbar input:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}
.toolbar .btn {
  border-radius: var(--radius-xs);
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  padding: 0.42rem 1.05rem;
}
.toolbar .btn:hover {
  background: var(--steel);
  border-color: var(--steel);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.toolbar-secondary { margin-top: -0.4rem; }

.seg-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  padding-right: 0.6rem;
  margin-right: 0.2rem;
  border-right: 1px solid var(--line);
}
.seg-group:last-of-type { border-right: none; }
.seg-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-right: 0.3rem;
}
.search-wrap input[type="search"] { min-width: 12rem; }

/* ── Charts ────────────────────────────────────────────────── */

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 900px) {
  .charts-row { grid-template-columns: 1fr; }
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 170px;
  height: 190px;
  padding-top: 0.4rem;
}
.bar-wrap {
  flex: 1 1 0;
  min-width: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.bar {
  width: 100%;
  max-width: 34px;
  background: linear-gradient(180deg, var(--brand-strong), var(--brand-dark));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: filter 0.15s ease;
}
.bar:hover { filter: brightness(1.15); }
.bar.ret { background: linear-gradient(180deg, #46586c, var(--accent)); }
.bar-val {
  font-size: 0.62rem;
  color: var(--muted);
  margin-bottom: 0.18rem;
  font-variant-numeric: tabular-nums;
}
.bar-label { font-size: 0.6rem; color: var(--muted); margin-top: 0.32rem; }

.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
  margin-top: 0.75rem;
}
.spark i {
  display: block;
  flex: 1;
  background: linear-gradient(180deg, var(--brand-strong), rgba(200, 16, 46, 0.55));
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}

/* ── Tables ────────────────────────────────────────────────── */

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
table.data tbody tr { transition: background 0.12s ease; }
table.data tbody tr:hover { background: var(--panel-alt); }
table.data tbody tr:last-child td { border-bottom: none; }

/* ── Heatmap page ──────────────────────────────────────────── */

.seg-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
#hm-toolbar button.empty {
  opacity: 0.55;
}
#hm-toolbar input[type="datetime-local"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  font-size: 0.83rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#hm-toolbar input[type="datetime-local"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}
.status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.2rem;
  color: var(--muted);
  font-size: 0.82rem;
  margin: -0.2rem 0 0.85rem;
}
.status-meta strong {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.heatmap-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(200, 16, 46, 0.06), transparent 70%),
    #10141a;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.stage-img {
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  display: block;
}
.stage-hint {
  position: absolute;
  color: #8b96a3;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.heatmap-stage.loading .stage-img { opacity: 0.35; }

/* ── Forms / alerts ────────────────────────────────────────── */

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}
.field input, .field select {
  width: 100%;
  padding: 0.68rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.14);
}

.error {
  background: var(--brand-tint);
  color: var(--brand-dark);
  border: 1px solid #f3c3cc;
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.8rem;
  font-size: 0.87rem;
  margin-bottom: 0.9rem;
}
.ok {
  background: var(--ok-tint);
  color: var(--ok);
  border: 1px solid var(--ok-line);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.8rem;
  font-size: 0.87rem;
  margin-bottom: 0.9rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.inline-form input, .inline-form select {
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  font-size: 0.83rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.inline-form input:focus, .inline-form select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.muted { color: var(--muted); font-size: 0.85rem; }
.offline { color: var(--warn); }

/* Admin table extras */
.role-badge {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-tint);
  border: 1px solid #f0c6ce;
  color: var(--brand-dark);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.role-badge.monitor {
  background: #edf1f5;
  border-color: var(--line-strong);
  color: var(--steel);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}
.status-pill.on { color: var(--ok); }
.status-pill.on::before {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(13, 122, 95, 0.15);
}
.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ── Login ─────────────────────────────────────────────────── */

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(900px 500px at 18% 8%, rgba(200, 16, 46, 0.22), transparent 55%),
    radial-gradient(700px 420px at 88% 92%, rgba(58, 76, 98, 0.35), transparent 60%),
    linear-gradient(150deg, #10141b 0%, #0a0d12 55%, #131a23 100%);
}
.login-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: min(880px, 100%);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.login-hero {
  padding: 2.6rem 2.4rem;
  background:
    radial-gradient(500px 320px at 0% 110%, rgba(200, 16, 46, 0.35), transparent 60%),
    linear-gradient(160deg, #181e27 0%, #0c1016 100%);
  color: var(--header-ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}
.login-hero .brand-badge { align-self: flex-start; font-size: 1.15rem; }
.login-hero h2 {
  margin: 0.4rem 0 0;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.login-hero p {
  margin: 0;
  color: var(--header-muted);
  font-size: 0.92rem;
  max-width: 30ch;
}
.hero-points {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.hero-points li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #c6cdd6;
  font-size: 0.88rem;
  font-weight: 500;
}
.hero-points li::before {
  content: "";
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-strong), var(--brand-dark));
  flex: 0 0 auto;
}
.login-card {
  background: var(--panel);
  padding: 2.6rem 2.3rem 2.1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-card .mark {
  display: none;
}
.login-card h1 { font-size: 1.4rem; margin: 0 0 0.25rem; }
.login-card .lead { margin-bottom: 1.4rem; font-size: 0.9rem; }
.login-foot {
  margin: 1.2rem 0 0;
  font-size: 0.78rem;
  text-align: center;
}
@media (max-width: 760px) {
  .login-layout { grid-template-columns: 1fr; width: min(440px, 100%); }
  .login-hero { padding: 1.9rem 1.8rem; gap: 0.6rem; }
  .login-hero h2 { font-size: 1.4rem; }
  .hero-points { display: none; }
}

/* ── Persons page ──────────────────────────────────────────── */

.persons-panel .table-wrap { overflow-x: auto; }
.persons-table .col-thumb { width: 76px; }
.person-thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}
.thumb-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  background: var(--bg);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
}
.person-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.92rem;
}
.person-meta, .person-phone { font-size: 0.76rem; margin-top: 0.14rem; }
.person-phone { font-weight: 600; color: var(--ink-soft); }
.seen-count {
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.seen-range, .seen-cams { font-size: 0.76rem; margin-top: 0.18rem; }

.seg-control {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--panel-alt);
}
.seg-control button {
  border: none;
  background: transparent;
  padding: 0.38rem 0.72rem;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-control button:hover { color: var(--ink); }
.seg-control button.active {
  background: linear-gradient(135deg, #2c3646, var(--accent));
  color: #fff;
}
.seg-control button.active[data-type="employee"] {
  background: linear-gradient(135deg, var(--brand-strong), var(--brand-dark));
}
.seg-control button:disabled { opacity: 0.6; cursor: wait; }

.check-pill {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.check-pill:hover { border-color: var(--ok); color: var(--ok); }
.check-pill.on {
  background: var(--ok-tint);
  border-color: var(--ok-line);
  color: var(--ok);
}
.check-pill.on::before { content: "✓ "; font-weight: 800; }
.check-pill:disabled { opacity: 0.6; cursor: wait; }

.expand-row td { background: var(--panel-alt); padding: 0 !important; }
.expand-inner {
  padding: 1.1rem 1.3rem 1.3rem;
  border-top: 2px solid var(--brand);
}
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.details-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.details-grid label.full { grid-column: 1 / -1; }
.details-grid input,
.details-grid textarea {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.details-grid input:focus,
.details-grid textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}
.details-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.timings-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.timings-table { font-size: 0.82rem; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.page-info {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .shell-header { padding: 0.7rem 1rem; }
  main.page { padding: 1.4rem 1rem 2.5rem; }
  .details-grid { grid-template-columns: 1fr; }
  .persons-table th:nth-child(4),
  .persons-table td:nth-child(4) { min-width: 120px; }
  .user-meta { display: none; }
}
