/* ─────────────────────────────────────────────────────
   CEIR Checker — Design System v2
   Apple-standard visual refinement.
   No external dependencies.
───────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* ── Surfaces (3 layers) ── */
  --shell:        #c9d1dc;
  --panel:        rgba(255, 255, 255, 0.98);
  --card:         rgba(253, 253, 255, 0.96);
  --inset:        rgba(237, 240, 245, 0.78);
  --input-bg:     rgba(118, 118, 128, 0.07);
  --table-head:   rgba(246, 248, 251, 0.99);

  /* ── Text ── */
  --t1: #1d1d1f;
  --t2: #3a3a3c;
  --t3: #6c6c70;
  --t4: #96969b;

  /* ── Borders ── */
  --b1: rgba(0, 0, 0, 0.06);
  --b2: rgba(0, 0, 0, 0.10);
  --b3: rgba(0, 0, 0, 0.16);

  /* ── Accent — Apple Blue ── */
  --blue:        #0071e3;
  --blue-deep:   #005bb5;
  --blue-tint:   rgba(0, 113, 227, 0.08);
  --blue-ring:   rgba(0, 113, 227, 0.26);
  --blue-border: rgba(0, 113, 227, 0.16);

  /* ── Status ── */
  --green:        #0d7a48;
  --green-bg:     rgba(228, 252, 239, 0.97);
  --green-border: rgba(13, 122, 72, 0.18);

  --amber:        #a16207;
  --amber-bg:     rgba(255, 246, 218, 0.97);
  --amber-border: rgba(161, 98, 7, 0.18);

  --red:        #be3030;
  --red-bg:     rgba(255, 234, 232, 0.97);
  --red-border: rgba(190, 48, 48, 0.18);

  /* ── Radii ── */
  --r4:   4px;
  --r8:   8px;
  --r10:  10px;
  --r12:  12px;
  --r14:  14px;
  --r16:  16px;
  --r20:  20px;
  --pill: 980px;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.09), 0 4px 14px rgba(0, 0, 0, 0.05);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.76);

  /* ── Typography ── */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

/* ──────────────────────────────────────────────────
   Reset
────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 1100px 580px at 104% -5%,  rgba(67, 97, 238, 0.11) 0%, transparent 54%),
    radial-gradient(ellipse 780px  720px at  -4% 105%, rgba(0, 113, 227, 0.07) 0%, transparent 54%),
    radial-gradient(ellipse 600px  400px at  50%  60%, rgba(0, 113, 227, 0.03) 0%, transparent 70%),
    var(--shell);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }

::selection { background: rgba(0, 113, 227, 0.16); }

::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: rgba(0,0,0,0.14); border-radius: var(--pill); }
::-webkit-scrollbar-thumb:hover  { background: rgba(0,0,0,0.22); }

/* ──────────────────────────────────────────────────
   Animations
────────────────────────────────────────────────── */
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.38; }
}

/* ──────────────────────────────────────────────────
   Icon sprite
────────────────────────────────────────────────── */
.icon-sprite {
  position: absolute;
  width: 0; height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ──────────────────────────────────────────────────
   Shell / layout
────────────────────────────────────────────────── */
.shell,
.auth-shell {
  position: relative;
  max-width: 1920px;
  margin: 0 auto;
  padding: 14px;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(258px, 290px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.sidebar-stack,
.main-stage {
  display: grid;
  gap: 10px;
}

/* ──────────────────────────────────────────────────
   Ambient orbs
────────────────────────────────────────────────── */
.ambient-orb {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.55;
}
.orb-one {
  top: -110px; right: -130px;
  width: 380px; height: 380px;
  background: rgba(0, 113, 227, 0.10);
}
.orb-two {
  bottom: -130px; left: -110px;
  width: 320px; height: 320px;
  background: rgba(0, 113, 227, 0.07);
}

/* ──────────────────────────────────────────────────
   Panel surface system
────────────────────────────────────────────────── */
.panel,
.signal-card,
.summary-card,
.selected-copy,
.identity-card {
  background: var(--panel);
  border: 1px solid var(--b1);
  border-radius: var(--r16);
  box-shadow: var(--shadow-md), var(--hi);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.panel { overflow: hidden; }

/* Panel padding */
.brand-panel,
.upload-panel,
.jobs-panel,
.command-panel,
.run-panel,
.results-panel {
  padding: 16px;
}

/* ──────────────────────────────────────────────────
   Typography
────────────────────────────────────────────────── */
h1, h2, h3, p { margin: 0; }

h1 {
  font-size: clamp(1.65rem, 2.4vw, 2.5rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
  font-weight: 700;
}

h2 {
  font-size: 1.06rem;
  line-height: 1.1;
  letter-spacing: -0.026em;
  font-weight: 700;
}

h3 {
  font-size: 0.95rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.eyebrow,
.signal-label,
.info-label,
.progress-label,
.step {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.2;
  letter-spacing: 0.07em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--t3);
}

.hero-copy,
.section-copy,
.helper,
.signal-copy,
.status-copy,
.subtle,
.section-meta {
  color: var(--t3);
}

.hero-copy:empty,
.section-copy:empty,
.signal-copy:empty {
  display: none;
}

.hero-copy {
  font-size: 0.76rem;
  line-height: 1.5;
}

.section-meta {
  font-size: 0.74rem;
  font-weight: 600;
  text-align: right;
}

.title-with-icon,
.label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-inline {
  width: 14px; height: 14px;
  flex: 0 0 auto;
  color: currentColor;
}

.icon-title { width: 16px; height: 16px; }

/* ──────────────────────────────────────────────────
   Buttons
────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  padding: 7px 15px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 100ms ease,
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    color 120ms ease,
    opacity 120ms ease;
}

.btn .icon-inline { width: 13px; height: 13px; }

.btn:hover:not(:disabled)  { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: scale(0.97); }

.btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Primary — Apple Blue */
.btn.primary {
  background: var(--blue);
  border-color: transparent;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 4px 12px rgba(0, 113, 227, 0.30);
}
.btn.primary:hover:not(:disabled) {
  background: var(--blue-deep);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 6px 18px rgba(0, 113, 227, 0.38);
}

/* Secondary */
.btn.secondary {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--b2);
  color: var(--t2);
}
.btn.secondary:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
  border-color: var(--b3);
  color: var(--t1);
}

/* Ghost */
.btn.ghost {
  background: transparent;
  border-color: var(--b2);
  color: var(--t3);
}
.btn.ghost:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--b2);
  color: var(--t1);
}

/* Danger */
.btn.danger {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}
.btn.danger:hover:not(:disabled) {
  background: rgba(255, 232, 230, 0.96);
  border-color: rgba(192, 57, 43, 0.24);
}

/* Quiet modifier — smaller */
.btn.btn-quiet {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 0.74rem;
}

.full-width { width: 100%; }

.dashboard-page :is(a, button, input, select, summary):focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.24);
  outline-offset: 2px;
}

/* ──────────────────────────────────────────────────
   Form controls
────────────────────────────────────────────────── */
.field {
  display: grid;
  gap: 6px;
}

.field > span {
  color: var(--t3);
  font-size: 0.82rem;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="file"],
select {
  width: 100%;
  border: 1px solid var(--b2);
  border-radius: var(--r10);
  background: var(--input-bg);
  color: var(--t1);
  padding: 9px 12px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input::placeholder { color: var(--t4); }

select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg,  transparent 50%, var(--t4) 50%),
    linear-gradient(135deg, var(--t4) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 1px),
    calc(100% - 10px) calc(50% - 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

input[type="file"] { padding: 6px 8px; }

input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid var(--b2);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.92);
  color: var(--t2);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-ring);
  background: rgba(255, 255, 255, 0.96);
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 4px 0 2px;
  color: var(--t2);
  font-size: 0.84rem;
  white-space: nowrap;
}

.checkbox-field input {
  width: 16px; height: 16px;
  accent-color: var(--blue);
}

.compact-toggle { align-self: center; }

/* ──────────────────────────────────────────────────
   Brand panel (sidebar header)
────────────────────────────────────────────────── */
.brand-panel {
  display: grid;
  gap: 10px;
}

.brand-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-panel h1 {
  font-size: clamp(0.98rem, 1.55vw, 1.75rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
  max-width: 10.8ch;
}

.logout-form { display: flex; }

/* ──────────────────────────────────────────────────
   Identity cards
────────────────────────────────────────────────── */
.identity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.identity-card {
  min-width: 0;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  background: rgba(249, 250, 252, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--r12);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.identity-card strong {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--t1);
}

.identity-account-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.identity-mode-card {
  min-width: 118px;
  align-content: center;
}

.identity-card .subtle {
  display: block;
  font-size: 0.71rem;
  margin-top: 2px;
  color: var(--t4);
}

/* Mode chip */
.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: var(--pill);
  border: 1px solid rgba(0, 113, 227, 0.12);
  background: rgba(246, 249, 253, 0.94);
  color: var(--blue-deep);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ──────────────────────────────────────────────────
   Section headings
────────────────────────────────────────────────── */
.section-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.split-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* ──────────────────────────────────────────────────
   Upload panel
────────────────────────────────────────────────── */
.upload-form { display: grid; gap: 10px; }

/* upload-panel and jobs-panel shadows are handled by sidebar-stack */

.upload-form.is-readonly { opacity: 0.55; }

.helper {
  font-size: 0.74rem;
  line-height: 1.4;
  margin-top: 2px;
}

/* ──────────────────────────────────────────────────
   Tables (shared)
────────────────────────────────────────────────── */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--b1);
  border-radius: var(--r12);
  background: rgba(255, 255, 255, 0.97);
}

.dashboard-page .results-panel {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dashboard-page .jobs-panel .table-wrap,
.dashboard-page .results-panel .table-wrap {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.99);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.jobs-wrap    { max-height: 240px; }
.results-wrap { min-height: 360px; max-height: 840px; }

.dashboard-page .jobs-wrap { max-height: 260px; }

table { width: 100%; border-collapse: collapse; }

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--table-head);
  border-bottom: 1px solid var(--b2);
}

th {
  color: var(--t3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 10px;
  text-align: left;
}

.col-serial {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  color: var(--t3);
  font-size: 0.78rem;
  text-align: right;
  padding-right: 12px;
  font-variant-numeric: tabular-nums;
}

.col-select {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  text-align: center;
  padding-left: 12px;
  padding-right: 6px;
}

.table-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.table-check input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.table-check span {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.table-check span::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 4px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 120ms ease;
}

.table-check input:checked + span,
.table-check input:indeterminate + span {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.table-check input:checked + span::after {
  transform: rotate(45deg) scale(1);
}

.table-check input:indeterminate + span::after {
  left: 4px;
  top: 7px;
  width: 8px;
  height: 0;
  border-right: 0;
  border-bottom: 2px solid #fff;
  transform: none;
}

td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--b1);
  text-align: left;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
  cursor: pointer;
  transition: background 100ms ease;
}
tbody tr:hover  { background: rgba(0, 113, 227, 0.03); }
tbody tr.active { background: rgba(0, 113, 227, 0.07); }

.dashboard-page .jobs-wrap tbody tr td {
  transition: background 120ms ease, box-shadow 120ms ease;
}

.dashboard-page .jobs-wrap tbody tr:hover td {
  background: rgba(0, 113, 227, 0.05);
}

.dashboard-page .jobs-wrap tbody tr.active td {
  background: rgba(0, 113, 227, 0.1);
}

.dashboard-page .jobs-wrap tbody tr.active td:first-child {
  box-shadow: inset 3px 0 0 var(--blue);
}

.jobs-action-col,
.jobs-action-cell {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  padding-right: 10px;
}

/* ──────────────────────────────────────────────────
   Job name cell & mini-progress
────────────────────────────────────────────────── */
.job-name { display: grid; gap: 2px; }

.job-name strong {
  font-size: 0.87rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.job-name .subtle {
  font-size: 0.72rem;
  color: var(--t4);
}

.mini-progress-label {
  color: var(--t3);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}

.mini-progress {
  height: 5px;
  width: 100%;
  min-width: 60px;
  border-radius: var(--pill);
  background: rgba(0, 113, 227, 0.09);
  overflow: hidden;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #4b88df);
  transition: width 300ms ease;
}

/* Job delete button (inline table) */
.job-delete-btn {
  min-height: 26px;
  padding: 4px 10px;
  border-radius: var(--pill);
  border: 1px solid var(--red-border);
  background: transparent;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease;
}
.job-delete-btn:hover:not(:disabled) {
  background: var(--red-bg);
  border-color: rgba(192, 57, 43, 0.22);
}
.job-delete-btn:disabled { opacity: 0.34; cursor: not-allowed; }

/* ──────────────────────────────────────────────────
   Command panel (main stage header)
────────────────────────────────────────────────── */
.command-panel { display: grid; gap: 10px; }

.dashboard-page .app-shell {
  gap: 16px;
  grid-template-columns: minmax(228px, 264px) minmax(0, 1fr);
}

/* Sidebar becomes one unified panel */
.dashboard-page .sidebar-stack {
  gap: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-top: 2px solid rgba(0, 113, 227, 0.52);
  border-radius: var(--r16);
  box-shadow: var(--shadow-sm), var(--hi);
  overflow: hidden;
}

.dashboard-page .main-stage {
  gap: 12px;
}

.dashboard-page .section-copy,
.dashboard-page .helper,
.dashboard-page .subtle,
.dashboard-page .section-meta,
.dashboard-page .signal-copy,
.dashboard-page .status-copy {
  color: #5f6369;
}

/* Sidebar children: strip floating panel styles, add internal dividers */
.dashboard-page .brand-panel,
.dashboard-page .upload-panel,
.dashboard-page .jobs-panel {
  padding: 11px 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dashboard-page .brand-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 8px;
  background: rgba(246, 249, 253, 0.55);
}

.dashboard-page .upload-panel,
.dashboard-page .jobs-panel {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Title sits left, nav buttons sit right — same row */
.dashboard-page .brand-copy {
  grid-column: 1;
  grid-row: 1;
  gap: 0;
  align-self: center;
}

.dashboard-page .brand-topbar {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

/* "CEIR PRIVATE" eyebrow is redundant in the sidebar */
.dashboard-page .brand-topbar .eyebrow {
  display: none;
}

.dashboard-page .brand-panel h1 {
  font-size: 1.05rem;
  letter-spacing: -0.04em;
  line-height: 1;
  max-width: none;
}

/* Subtitle is redundant — app name says it all */
.dashboard-page .brand-panel .hero-copy {
  display: none;
}

/* Identity row spans full width below the title row */
.dashboard-page .identity-row {
  grid-column: 1 / -1;
  grid-row: 2;
}

.dashboard-page .brand-actions {
  gap: 4px;
  flex-wrap: nowrap;
}

.dashboard-page .brand-actions .btn.btn-quiet {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 0.7rem;
}

.dashboard-page .identity-row {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
}

/* Strip card chrome — just show the values inline */
.dashboard-page .identity-card {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  gap: 0;
}

/* Labels ("Signed In", "Bridge Mode") add no value here */
.dashboard-page .identity-card .info-label {
  display: none;
}

.dashboard-page .identity-card strong {
  font-size: 0.82rem;
}

.dashboard-page .identity-account-card {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-page .identity-account-main {
  gap: 6px;
}

/* Mode card separated by a hairline */
.dashboard-page .identity-mode-card {
  flex: 0 0 auto;
  min-width: auto;
  padding-left: 10px;
  margin-left: 10px;
  border-left: 1px solid var(--b2);
  align-content: center;
}

.dashboard-page .upload-panel .section-head,
.dashboard-page .jobs-panel .section-head {
  margin-bottom: 8px;
}

.dashboard-page .upload-panel h2,
.dashboard-page .jobs-panel h2 {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dashboard-page .upload-form {
  gap: 8px;
}

.dashboard-page .upload-panel .field {
  gap: 5px;
}

.dashboard-page .upload-panel .field > span {
  font-size: 0.74rem;
  letter-spacing: -0.01em;
  color: var(--t2);
}

.dashboard-page .upload-panel :is(input[type="text"], input[type="file"]) {
  padding: 7px 10px;
  border-color: rgba(0, 0, 0, 0.07);
  background: rgba(247, 248, 250, 0.92);
}

.dashboard-page .upload-panel input[type="file"] {
  padding: 6px 8px;
  border-style: dashed;
}

.dashboard-page .upload-panel input[type="file"]::file-selector-button {
  padding: 4px 10px;
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.95);
}

.dashboard-page .upload-panel .btn.secondary {
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.08), rgba(0, 113, 227, 0.04));
  border-color: rgba(0, 113, 227, 0.16);
  color: var(--blue-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 100ms ease;
}

/* File chosen → button becomes solid primary blue */
.dashboard-page .upload-panel .upload-form.has-file .btn.secondary {
  background: var(--blue);
  border-color: transparent;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 4px 12px rgba(0, 113, 227, 0.32);
}

.dashboard-page .upload-panel .upload-form.has-file .btn.secondary:hover:not(:disabled) {
  background: var(--blue-deep);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 6px 18px rgba(0, 113, 227, 0.40);
}

.dashboard-page .upload-panel .helper {
  font-size: 0.72rem;
  margin-top: 0;
}

.dashboard-page .upload-panel .section-copy {
  font-size: 0.72rem;
  line-height: 1.35;
}

.dashboard-page .jobs-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.dashboard-page .jobs-panel-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.dashboard-page .jobs-panel .section-meta {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: var(--pill);
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: rgba(248, 249, 251, 0.9);
  color: var(--t2);
  font-size: 0.72rem;
  font-weight: 700;
}

.dashboard-page .jobs-panel-tools .btn.btn-quiet {
  min-height: 26px;
  padding: 4px 9px;
  font-size: 0.72rem;
}

/* ── Compact batch list: demote detail, let upload section breathe ── */
.dashboard-page .jobs-list-wrap {
  max-height: 260px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.dashboard-page .jobs-list {
  gap: 1px;
}

/* Flat row — no card chrome */
.dashboard-page .job-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  padding: 5px 8px;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: var(--r8);
}

.dashboard-page .job-card:hover {
  background: rgba(0, 113, 227, 0.05);
  border: none;
  box-shadow: none;
}

.dashboard-page .job-card.active {
  background: rgba(0, 113, 227, 0.09);
  border: none;
  box-shadow: none;
}

.dashboard-page .job-card.is-running {
  border: none;
}

/* Reorder: status dot leads, main content follows */
.dashboard-page .job-card-footer {
  order: -1;
  display: flex;
  align-items: center;
  margin-right: 7px;
  flex-wrap: nowrap;
  gap: 0;
}

/* Hide progress bar entirely */
.dashboard-page .job-card-progress {
  display: none;
}

/* Status badge in sidebar job cards → collapse to a solid 7px dot */
.dashboard-page .job-card .badge {
  background: currentColor !important; /* uses text color (green/amber/blue) as fill */
  border-radius: 50% !important;
  width: 7px !important;
  height: 7px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  font-size: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
  display: inline-block !important;
  flex-shrink: 0;
}

.dashboard-page .job-card .badge::before {
  display: none !important;
}

/* Main area: flex row */
.dashboard-page .job-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Single-line truncated name */
.dashboard-page .job-name {
  flex: 1;
  min-width: 0;
  display: block;
  gap: 0;
}

.dashboard-page .job-name strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* Hide "N IMEIs" sub-label — redundant with count */
.dashboard-page .job-name .subtle {
  display: none;
}

/* Count: plain text, no pill chrome */
.dashboard-page .job-card-count {
  font-size: 0.68rem;
  font-weight: 600;
  min-width: unset;
  min-height: unset;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--t4);
  letter-spacing: 0;
}

/* Delete button: slightly smaller */
.dashboard-page .job-card-delete {
  width: 20px;
  height: 20px;
  box-shadow: none;
}

.jobs-list-wrap {
  max-height: 340px;
  overflow: auto;
  padding: 4px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--r12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 4px 12px rgba(15, 23, 42, 0.02);
}

.jobs-list {
  display: grid;
  gap: 6px;
}

.job-card {
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--r12);
  background: rgba(255, 255, 255, 0.97);
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.job-card:hover {
  border-color: rgba(0, 113, 227, 0.14);
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.035);
}

.job-card.active {
  border-color: rgba(0, 113, 227, 0.18);
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.98), rgba(243, 248, 255, 0.94));
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.045);
}

.job-card.is-running {
  border-color: rgba(0, 113, 227, 0.16);
}

.dashboard-page .job-card:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.18);
  outline-offset: 2px;
}

.job-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.job-card-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.job-card-state {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.job-card-progress {
  min-width: 78px;
  margin-left: auto;
}

.job-card-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--pill);
  background: rgba(247, 248, 250, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--t2);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.job-card-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(192, 57, 43, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--red);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.job-card-delete .icon-inline {
  width: 12px;
  height: 12px;
}

.job-card:hover .job-card-delete,
.job-card:focus-within .job-card-delete,
.job-card.active .job-card-delete {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.job-card-delete:hover:not(:disabled) {
  background: var(--red-bg);
  border-color: rgba(192, 57, 43, 0.24);
}

.job-card-delete:disabled {
  opacity: 0.42;
  color: var(--t4);
  border-color: rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.job-card-progress .mini-progress {
  min-width: 78px;
  height: 5px;
}

.jobs-hint {
  margin-top: 6px;
  color: var(--t4);
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0;
}

.jobs-context-menu {
  position: fixed;
  z-index: 200;
  min-width: 168px;
  padding: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--r14);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-lg), var(--hi);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.jobs-context-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r10);
  background: transparent;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.jobs-context-action:hover:not(:disabled) {
  background: var(--red-bg);
}

.jobs-context-action.action-primary:hover:not(:disabled) {
  background: var(--blue-bg, rgba(0, 102, 255, 0.08));
  color: var(--blue, #0066ff);
}

.jobs-context-action:disabled {
  color: var(--t4);
  cursor: not-allowed;
}

.checks-context-imei {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--t3);
  padding: 6px 12px 2px;
  margin: 0;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ── Row selection ──────────────────────────────────────────────────────── */
tbody tr.row-selected td {
  background: rgba(0, 113, 227, 0.07);
}
tbody tr.row-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--blue);
}

/* ── Floating selection bar ─────────────────────────────────────────────── */
.selection-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 6px 5px 14px;
  background: rgba(20, 20, 25, 0.93);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: 999px;
  color: #fff;
  font-size: 0.8rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28), 0 1px 0 rgba(255,255,255,0.06) inset;
  white-space: nowrap;
}

.selection-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-right: 6px;
}

.sel-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}

.sel-action:hover {
  background: rgba(255,255,255,0.12);
}

.sel-recheck {
  color: #6ab7ff;
}

.sel-recheck:hover {
  background: rgba(100, 170, 255, 0.15);
}

.sel-clear {
  color: rgba(255,255,255,0.45);
  font-size: 0.72rem;
  padding: 5px 9px;
}

.sel-clear:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
}

.dashboard-page .jobs-list-wrap .empty-row {
  padding: 14px 12px;
  border-radius: var(--r12);
  background: rgba(248, 249, 251, 0.84);
}

.dashboard-page .jobs-wrap thead th {
  padding: 8px 9px;
}

.dashboard-page .jobs-wrap td {
  padding: 8px 9px;
}

.dashboard-page .command-panel {
  padding: 10px 14px;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm), var(--hi);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.command-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.command-copy {
  display: grid;
  gap: 2px;
  max-width: 32rem;
}

.dashboard-page .command-head { align-items: center; }

.dashboard-page .command-copy {
  gap: 2px;
  max-width: 34rem;
}

.dashboard-page .command-copy h2 {
  font-size: 0.98rem;
}

.command-copy h2 {
  font-size: 1.24rem;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.topbar-actions .btn {
  min-height: 34px;
  padding: 7px 15px;
  font-size: 0.8rem;
}

.dashboard-page .topbar-actions .btn {
  min-height: 32px;
  padding: 6px 14px;
}

.dashboard-page .topbar-actions {
  gap: 10px;
}

.dashboard-page .system-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-page .system-status-item {
  display: grid;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--r10);
  background: rgba(250, 250, 252, 0.94);
  box-shadow: var(--shadow-xs);
  transition: background 300ms ease;
}

.dashboard-page .system-status-item:has(.status-pill.good) {
  background: rgba(235, 252, 243, 0.72);
}

.dashboard-page .system-status-item:has(.status-pill.info) {
  background: rgba(238, 247, 255, 0.72);
}

.dashboard-page .system-status-item:has(.status-pill.warn) {
  background: rgba(255, 249, 230, 0.72);
}

.dashboard-page .system-status-item:has(.status-pill.danger) {
  background: rgba(255, 238, 236, 0.72);
}

.dashboard-page .system-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-page .system-status-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-page .system-status-copy strong {
  font-size: 0.82rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.dashboard-page .system-status-copy p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.3;
}

/* ──────────────────────────────────────────────────
   Signal grid
────────────────────────────────────────────────── */
.signal-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(240px, 0.85fr);
  gap: 10px;
}

.signal-card {
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 86px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--r12);
  box-shadow: var(--shadow-xs), var(--hi);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.signal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.signal-card strong {
  font-size: 0.96rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.signal-copy {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--t3);
}

/* ──────────────────────────────────────────────────
   Status pill (inline label)
────────────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: var(--pill);
  border: 1px solid var(--b2);
  background: rgba(244, 244, 246, 0.9);
  color: var(--t2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill.good    { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.status-pill.warn    { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.status-pill.danger  { background: var(--red-bg);   color: var(--red);   border-color: var(--red-border);   }
.status-pill.info    { background: var(--blue-tint); color: var(--blue); border-color: var(--blue-border);  }
.status-pill.neutral { background: rgba(244, 244, 246, 0.8); color: var(--t3); border-color: var(--b2); }

/* Live pulse dot on good/info pills inside the activity strip */
.activity-strip-side .status-pill.good::before,
.activity-strip-side .status-pill.info::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
  flex: 0 0 auto;
  animation: pulse-live 2.4s ease-in-out infinite;
}

/* ──────────────────────────────────────────────────
   Selected batch summary
────────────────────────────────────────────────── */
.selected-summary {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 0.9fr);
  gap: 10px;
}

.dashboard-page .run-panel {
  padding: 11px 14px;
  border-color: rgba(0, 113, 227, 0.10);
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.99), rgba(242, 249, 255, 0.97));
  box-shadow:
    0 10px 24px rgba(0, 113, 227, 0.055),
    0 3px 10px rgba(15, 23, 42, 0.025),
    var(--hi);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dashboard-page .run-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dashboard-page .run-topbar-copy {
  display: grid;
  gap: 0;
}

.dashboard-page .run-topbar-copy h2 {
  font-size: 0.94rem;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.dashboard-page .activity-strip {
  margin-bottom: 8px;
  padding: 5px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: none;
  border-radius: 0;
  background: transparent;
}

.dashboard-page .activity-strip-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-page .activity-strip-copy strong {
  font-size: 0.82rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.dashboard-page .activity-strip-copy .signal-copy {
  font-size: 0.72rem;
  line-height: 1.35;
}

.dashboard-page .activity-strip-side {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-page .activity-detail {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.dashboard-page .activity-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--t3);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dashboard-page .activity-chip span {
  color: var(--t4);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dashboard-page .activity-chip strong {
  color: var(--t1);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.dashboard-page .activity-chip-user {
  color: var(--blue-deep);
}

.dashboard-page .activity-detail {
  gap: 14px;
}

.dashboard-page .selected-summary {
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.selected-copy {
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  background: rgba(255, 255, 255, 0.90);
  border-radius: var(--r12);
  box-shadow: var(--shadow-xs);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dashboard-page .selected-copy {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.selected-copy h3 {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.selected-copy .subtle {
  font-size: 0.75rem;
  color: var(--t3);
}

.summary-strip {
  display: grid;
  grid-template-columns: minmax(170px, 1.45fr) repeat(3, minmax(0, 0.72fr));
  gap: 8px;
}

.dashboard-page .summary-strip {
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: none;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.summary-card {
  padding: 10px 12px;
  min-height: 60px;
  display: grid;
  align-content: center;
  gap: 5px;
  background: rgba(249, 249, 251, 0.88);
  border: 1px solid var(--b1);
  border-radius: var(--r12);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dashboard-page .summary-card {
  background: rgba(247, 248, 250, 0.86);
  border-color: rgba(0, 0, 0, 0.06);
  min-height: 31px;
  padding: 0 10px;
  border-radius: var(--pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.summary-card span {
  color: var(--t4);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
  color: var(--t1);
}

.dashboard-page .summary-card strong {
  font-size: 0.82rem;
  line-height: 1;
}

button.summary-card {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}
button.summary-card:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.14);
}
button.summary-card:disabled { opacity: 0.5; cursor: default; }
.dashboard-page button.summary-card.is-active {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
.dashboard-page .summary-card-fail.is-active strong { color: var(--red, #e53e3e); }
.dashboard-page .summary-card-fail.is-active span   { color: var(--red, #e53e3e); }

.summary-card-wide { background: rgba(255, 255, 255, 0.88); }

.dashboard-page .summary-card-wide {
  background: rgba(255, 255, 255, 0.94);
  min-width: 136px;
  max-width: 180px;
}

.dashboard-page .summary-card-wide strong {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ──────────────────────────────────────────────────
   Progress card
────────────────────────────────────────────────── */
.progress-card {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: var(--r16);
  border: 1px solid var(--blue-border);
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.05), rgba(255, 255, 255, 0.92));
}

.dashboard-page .progress-card {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: var(--r12);
  border-color: rgba(0, 113, 227, 0.12);
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.035), rgba(255, 255, 255, 0.98));
}

.dashboard-page .progress-head {
  margin-bottom: 5px;
  align-items: center;
}

.dashboard-page .progress-head strong {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.progress-card[data-state="complete"] {
  border-color: var(--green-border);
  background: linear-gradient(160deg, rgba(13, 122, 72, 0.065) 0%, rgba(255, 255, 255, 0.97) 100%);
}

.progress-card[data-state="warning"] {
  border-color: var(--amber-border);
  background: linear-gradient(160deg, rgba(161, 98, 7, 0.055) 0%, rgba(255, 255, 255, 0.97) 100%);
}

.progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.progress-label { display: block; margin-bottom: 3px; }

.progress-head strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.progress-head span:last-child {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--t1);
  white-space: nowrap;
}

.progress-bar {
  height: 6px;
  border-radius: var(--pill);
  background: rgba(0, 113, 227, 0.09);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue) 0%, #4f9cf0 100%);
  transition: width 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.status-copy {
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--t3);
}

/* ──────────────────────────────────────────────────
   Error callout
────────────────────────────────────────────────── */
.callout {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--r10);
  border: 1px solid var(--red-border);
  background: var(--red-bg);
  color: var(--red);
  font-size: 0.78rem;
  line-height: 1.5;
}

.dashboard-page .recovery-callout {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-radius: var(--r12);
  border: 1px solid rgba(180, 83, 9, 0.18);
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.92), rgba(255, 255, 255, 0.96));
}

.dashboard-page .run-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.dashboard-page .system-strip-compact {
  margin-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.dashboard-page .system-strip-compact .system-status-item {
  background: rgba(248, 249, 251, 0.78);
  border-color: rgba(0, 0, 0, 0.06);
  padding: 5px 9px;
  border-radius: var(--r10);
}

.dashboard-page .system-strip-compact .status-pill {
  min-height: 18px;
  padding: 1px 7px;
  font-size: 9px;
}

.dashboard-page .system-strip-compact .system-status-copy strong {
  font-size: 0.74rem;
}

.dashboard-page .system-strip-compact .system-status-copy p {
  font-size: 0.68rem;
}

.dashboard-page .run-secondary {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.dashboard-page .recovery-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-page .recovery-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}

.dashboard-page .recovery-text {
  margin: 0;
  color: var(--t2);
  font-size: 0.79rem;
  line-height: 1.45;
}

.dashboard-page .recovery-callout .btn {
  min-width: 150px;
  flex: 0 0 auto;
}

/* ──────────────────────────────────────────────────
   Run actions
────────────────────────────────────────────────── */
.run-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.dashboard-page .run-actions {
  gap: 8px;
  margin-top: 0;
  justify-content: flex-start;
}

.run-actions .btn {
  min-height: 34px;
  padding: 7px 16px;
  font-size: 0.78rem;
  min-width: 136px;
}

.dashboard-page .run-actions .btn {
  min-height: 28px;
  min-width: 112px;
  padding: 4px 11px;
  font-size: 0.75rem;
}

.dashboard-page .debug-panel {
  margin-top: 0;
  min-width: 124px;
  border-color: rgba(0, 0, 0, 0.06);
  background: rgba(248, 249, 251, 0.8);
}

/* ──────────────────────────────────────────────────
   Diagnostics / debug panel
────────────────────────────────────────────────── */
.debug-panel {
  margin-top: 12px;
  border-radius: var(--r12);
  border: 1px solid var(--b1);
  background: rgba(248, 248, 250, 0.5);
}

.debug-panel summary {
  cursor: pointer;
  padding: 10px 14px;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--t3);
  user-select: none;
}

.dashboard-page .debug-panel summary {
  min-height: 30px;
  padding: 8px 12px;
  font-size: 0.74rem;
}

.debug-panel summary::-webkit-details-marker { display: none; }
.debug-panel[open] summary { border-bottom: 1px solid var(--b1); }

.worker-kv {
  display: grid;
  gap: 5px;
  padding: 10px 12px 12px;
}

.worker-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r8);
  border: 1px solid var(--b1);
  background: rgba(255, 255, 255, 0.68);
}

.worker-item span {
  color: var(--t3);
  font-size: 0.76rem;
}

.worker-item strong {
  font-size: 0.76rem;
  text-align: right;
  word-break: break-all;
  color: var(--t1);
}

/* ──────────────────────────────────────────────────
   Results panel
────────────────────────────────────────────────── */
.results-panel {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg), var(--hi);
}

.results-panel .section-head { margin-bottom: 10px; }

.dashboard-page .results-panel {
  position: relative;
  overflow: hidden;
  padding: 12px 14px 14px;
  border-color: rgba(0, 0, 0, 0.07);
  border-top: 2px solid rgba(0, 113, 227, 0.42);
  background: #ffffff;
  box-shadow:
    0 20px 42px rgba(15, 23, 42, 0.08),
    0 8px 18px rgba(15, 23, 42, 0.05),
    var(--hi);
}

/* Redundant eyebrow — h2 "Latest Checks" already identifies this panel */
.dashboard-page .results-head .eyebrow {
  display: none;
}

.dashboard-page .results-panel::before { display: none; }

.dashboard-page .results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dashboard-page .results-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-page .results-head .eyebrow {
  color: var(--blue);
}

.dashboard-page .results-head h2 {
  font-size: 1.1rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.dashboard-page .results-cap {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: var(--pill);
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: rgba(0, 0, 0, 0.04);
  color: var(--t3);
  font-size: 0.71rem;
  font-weight: 600;
}

.dashboard-page .results-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-page .results-filter-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-page .results-filter-label {
  color: var(--t2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-page .results-filter-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  background: rgba(0, 0, 0, 0.055);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--pill);
  padding: 3px;
}

/* Sliding pill — sits behind the buttons, animated via JS */
.dashboard-page .filter-pill-track {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 40px; /* overridden by JS */
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.12),
    0 0 0 0.5px rgba(0, 0, 0, 0.05);
  pointer-events: none;
  z-index: 0;
  transition:
    left  220ms cubic-bezier(0.34, 1.56, 0.64, 1),
    width 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dashboard-page .filter-pill-track.no-transition {
  transition: none !important;
}

.dashboard-page .results-filter-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--pill);
  border: none;
  background: transparent;
  color: var(--t3);
  font-size: 0.72rem;
  font-weight: 700;
  transition: color 160ms ease;
}

.dashboard-page .results-filter-btn:hover:not(:disabled) {
  color: var(--t2);
}

/* Active: pill track provides the bg; button just gets the right text color */
.dashboard-page .results-filter-btn.is-active {
  background: transparent;
  box-shadow: none;
  color: var(--t1);
}

.dashboard-page .results-filter-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.dashboard-page .results-filter-btn span {
  font-weight: 800;
}

/* Semantic text colors for active states — pill is always white */
.dashboard-page .results-filter-btn[data-tax-filter="paid"].is-active      { color: var(--green); }
.dashboard-page .results-filter-btn[data-tax-filter="unpaid"].is-active     { color: var(--amber); }
.dashboard-page .results-filter-btn[data-status-filter="incorrect"].is-active { color: var(--red); }
.dashboard-page .results-filter-btn[data-block-filter="blocked"].is-active  { color: var(--red); }

.dashboard-page .results-context {
  margin-bottom: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(0, 113, 227, 0.08);
  border-radius: var(--r14);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(255, 255, 255, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.dashboard-page .results-context.selected-summary {
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.dashboard-page .results-context .selected-copy {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.dashboard-page .results-context .selected-copy h3 {
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.dashboard-page .results-context .selected-copy .subtle {
  font-size: 0.76rem;
  color: var(--t3);
}

/* Batch name: "Batch 2026-03-18 [14:05:09]" — time part is muted */
.dashboard-page .results-context .selected-copy h3 .batch-time {
  font-weight: 500;
  color: var(--t4);
  font-size: 0.84em;
  letter-spacing: 0;
}

.dashboard-page .results-context .summary-strip {
  justify-content: flex-end;
}

.dashboard-page .results-context .summary-card {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 113, 227, 0.08);
}

.dashboard-page .results-context .summary-card-wide {
  min-width: 160px;
  max-width: 212px;
}

.dashboard-page .results-context .summary-card-wide strong {
  max-width: 154px;
}

/* Semantic tints for OK / Fail stat chips */
.dashboard-page .summary-card-ok {
  background: var(--green-bg);
  border-color: var(--green-border);
}
.dashboard-page .summary-card-ok strong {
  color: var(--green);
}
.dashboard-page .summary-card-fail {
  background: var(--red-bg);
  border-color: var(--red-border);
}
.dashboard-page .summary-card-fail strong {
  color: var(--red);
}

.dashboard-page .results-retry-btn {
  height: 28px;
  padding: 0 11px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: var(--pill);
}
.dashboard-page .results-retry-btn:not(:disabled) {
  color: var(--red, #e53e3e);
  border-color: var(--red, #e53e3e);
}

.dashboard-page .results-summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--pill);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.05);
  color: var(--t1);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.dashboard-page .results-panel .section-meta {
  font-size: 0.8rem;
  color: var(--t2);
  font-weight: 700;
}

.dashboard-page .results-panel .table-wrap {
  border-color: rgba(0, 113, 227, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 6px 18px rgba(15, 23, 42, 0.03);
}

.dashboard-page .results-wrap {
  min-height: 220px;
  max-height: 760px;
}

.dashboard-page .results-panel thead th {
  background: rgba(248, 249, 251, 0.98);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dashboard-page .results-wrap thead th {
  padding: 10px 12px;
}

.dashboard-page .results-wrap td {
  padding: 13px 12px;
}

.dashboard-page .results-wrap tbody tr:nth-child(even) td {
  background: rgba(248, 250, 253, 0.82);
}

.dashboard-page .results-wrap tbody tr:hover td {
  background: rgba(0, 113, 227, 0.05);
}

.dashboard-page .results-wrap td:first-child {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  color: inherit;
}

.dashboard-page .results-wrap td.col-serial {
  font-family: var(--mono);
  font-size: 0.81rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--t1);
}

.dashboard-page .results-wrap thead th.col-select,
.dashboard-page .results-wrap td.col-select {
  text-align: center;
}

/* ──────────────────────────────────────────────────
   Badges (status dot labels — in table cells)
────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--pill);
  border: 1px solid var(--b2);
  background: rgba(244, 244, 246, 0.9);
  color: var(--t2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
  flex: 0 0 auto;
}

/* Positive */
.badge.completed,
.badge.done,
.badge.tax_paid,
.badge.cleared,
.badge.allowed,
.badge.correct,
.badge.connected,
.badge.standalone,
.badge.paid {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green-border);
}

/* Warning / pending */
.badge.pending,
.badge.unknown,
.badge.configured,
.badge.tax_not_paid_yet,
.badge.not_paid_yet {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: var(--amber-border);
}

/* Error / blocked */
.badge.failed,
.badge.blocked,
.badge.invalid_or_not_found,
.badge.incorrect,
.badge.unavailable {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}

/* Info / active */
.badge.running {
  background: var(--blue-tint);
  color: var(--blue);
  border-color: var(--blue-border);
}

/* ──────────────────────────────────────────────────
   Results table — compact badges
────────────────────────────────────────────────── */
.dashboard-page .results-wrap td .badge {
  padding: 2px 7px;
  font-size: 9.5px;
  gap: 4px;
  letter-spacing: 0.03em;
}

.dashboard-page .results-wrap td .badge::before {
  width: 5px;
  height: 5px;
}

/* ──────────────────────────────────────────────────
   Table cell helpers
────────────────────────────────────────────────── */
.device-copy {
  max-width: 340px;
  color: var(--t3);
  font-size: 0.77rem;
  line-height: 1.4;
  margin-top: 3px;
}

.issue-copy {
  margin-top: 3px;
  color: var(--t3);
  font-size: 0.74rem;
  line-height: 1.4;
}

.empty-row {
  color: var(--t3);
  text-align: left;
  padding: 14px 10px;
  font-size: 0.8rem;
}

/* ──────────────────────────────────────────────────
   Toast notification
────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: 340px;
  padding: 10px 15px;
  border-radius: var(--r12);
  background: rgba(20, 20, 22, 0.92);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ──────────────────────────────────────────────────
   Utilities
────────────────────────────────────────────────── */
.hidden        { display: none !important; }
.hidden-action { display: none !important; }

.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
}

code {
  padding: 2px 6px;
  border-radius: var(--r4);
  background: var(--blue-tint);
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.88em;
}

/* ──────────────────────────────────────────────────
   Login / Auth page
────────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-shell { width: 100%; }

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 32px));
  margin: 5vh auto;
  padding: 28px 24px 24px;
  display: grid;
  gap: 22px;
  background: var(--panel);
  border: 1px solid var(--b1);
  border-radius: var(--r20);
  box-shadow: var(--shadow-lg), var(--hi);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
}

.auth-copy {
  display: grid;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--b1);
}

.auth-copy .eyebrow { color: var(--blue); }

.auth-copy h1 {
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  letter-spacing: -0.046em;
}

.auth-form { display: grid; gap: 12px; }

.auth-error {
  padding: 9px 12px;
  border-radius: var(--r10);
  border: 1px solid var(--red-border);
  background: var(--red-bg);
  color: var(--red);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0;
}

.auth-warning {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r10);
  border: 1px solid var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
}
.auth-warning > div > strong { display: block; font-size: 0.81rem; margin-bottom: 2px; }
.auth-warning p { margin: 0; opacity: 0.85; }
.auth-warning-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--amber);
}

.auth-success {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--r10);
  border: 1px solid var(--green-border);
  background: var(--green-bg);
  color: var(--green);
  font-size: 0.82rem;
  line-height: 1.4;
}

/* ──────────────────────────────────────────────────
   Users page
────────────────────────────────────────────────── */
.users-page .shell { padding-top: 16px; }

.users-shell {
  display: grid;
  gap: 12px;
  width: min(1040px, calc(100vw - 40px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.users-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  padding: 18px 20px;
  align-items: start;
}

.users-hero-copy { display: grid; gap: 4px; }

.users-hero h1 {
  font-size: clamp(1.7rem, 2.4vw, 2.4rem);
  letter-spacing: -0.05em;
}

.users-hero .section-copy { font-size: 0.84rem; }

.users-hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--t4);
  font-size: 0.78rem;
  font-weight: 600;
}

.users-hero-meta strong { color: var(--t2); }

.users-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.users-topbar-actions .btn {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.78rem;
}

.users-panel { padding: 18px 20px; }

.users-create-panel .section-head,
.users-directory-panel .section-head {
  margin-bottom: 12px;
}

.users-create-strip {
  display: grid;
  grid-template-columns: minmax(155px, 0.9fr) minmax(185px, 1fr) minmax(128px, 0.58fr) auto;
  gap: 12px;
  align-items: end;
}

.create-user-actions { display: flex; align-items: flex-end; }
.create-user-btn { min-width: 132px; }

/* ──────────────────────────────────────────────────
   User cards
────────────────────────────────────────────────── */
.users-list { display: grid; gap: 10px; }

.user-card {
  display: grid;
  grid-template-columns: minmax(200px, 0.78fr) minmax(0, 1.22fr);
  gap: 12px 16px;
  padding: 14px 16px;
  border: 1px solid var(--b1);
  border-radius: var(--r16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-xs);
  align-items: center;
}

.user-card-identity {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
}

.user-card-identity strong {
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.1;
}

.user-badges { display: flex; flex-wrap: wrap; gap: 5px; }

.user-card-actions {
  display: grid;
  grid-template-columns: minmax(118px, 138px) minmax(190px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

/* Account badges */
.account-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: var(--pill);
  border: 1px solid var(--b2);
  background: rgba(244, 244, 246, 0.9);
  color: var(--t2);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-badge.role-admin,
.account-badge.state-active {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}

.account-badge.role-operator {
  border-color: var(--blue-border);
  background: var(--blue-tint);
  color: var(--blue);
}

.account-badge.role-viewer {
  border-color: var(--b2);
  background: rgba(248, 248, 250, 0.9);
  color: var(--t3);
}

.account-badge.state-inactive {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.account-badge.account-current {
  border-color: var(--blue-border);
  background: var(--blue-tint);
  color: var(--blue);
}

/* ──────────────────────────────────────────────────
   Audit page
────────────────────────────────────────────────── */
.audit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.audit-stat {
  padding: 18px 20px;
  display: grid;
  gap: 6px;
}

.audit-stat strong {
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.audit-stat .subtle { font-size: 0.74rem; }

.audit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(248px, 0.95fr);
  gap: 12px;
}

.audit-events-panel,
.audit-usage-panel { min-width: 0; }

.audit-alert-panel { padding-top: 14px; padding-bottom: 14px; }

.audit-alerts { display: grid; gap: 8px; }
.audit-alerts .auth-error { margin: 0; }

.audit-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.audit-table-wrap { max-height: 700px; }

.audit-time {
  white-space: nowrap;
  font-size: 0.76rem;
  color: var(--t3);
}

.audit-ip {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.audit-details { min-width: 150px; }

.audit-usage-list { display: grid; gap: 10px; }

.audit-usage-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--b1);
  border-radius: var(--r16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-xs);
}

.audit-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.audit-usage-head strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.audit-usage-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--t2);
  font-size: 0.76rem;
  font-weight: 600;
}

/* ──────────────────────────────────────────────────
   Responsive breakpoints
────────────────────────────────────────────────── */
@media (max-width: 1320px) {
  .signal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .selected-summary { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-page .selected-summary,
  .dashboard-page .run-lower { grid-template-columns: 1fr; }
  .dashboard-page .summary-strip,
  .dashboard-page .run-secondary { justify-content: flex-start; }
}

@media (max-width: 1180px) {
  .app-shell,
  .dashboard-page .app-shell { grid-template-columns: 1fr; }
  .sidebar-stack,
  .dashboard-page .sidebar-stack { order: 2; }
  .main-stage,
  .dashboard-page .main-stage { order: 1; }
}

@media (max-width: 980px) {
  .user-card,
  .user-card-actions,
  .audit-grid { grid-template-columns: 1fr; }

  .users-create-strip { grid-template-columns: 1fr; gap: 12px; }
  .create-user-actions { padding-top: 4px; }
  .create-user-btn { justify-self: start; min-width: 148px; }
  .users-topbar-actions { justify-content: flex-start; flex-wrap: wrap; }
  .users-hero { grid-template-columns: 1fr; }
  .audit-summary-grid,
  .audit-filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 880px) {
  .command-head { flex-direction: column; }
  .dashboard-page .run-topbar { flex-direction: column; align-items: stretch; }
  .dashboard-page .activity-strip { flex-direction: column; align-items: stretch; }
  .dashboard-page .activity-strip-side,
  .dashboard-page .activity-detail { justify-content: flex-start; }
  .dashboard-page .results-head { flex-direction: column; align-items: flex-start; }
  .dashboard-page .results-head-main { align-items: flex-start; }
  .dashboard-page .results-head-actions { justify-content: flex-start; }
  .dashboard-page .results-filter-cluster { width: 100%; }
  .split-head   { flex-direction: column; gap: 6px; }
  .section-meta { text-align: left; }
  .identity-row { grid-template-columns: 1fr; }
  .selected-summary { grid-template-columns: 1fr; }
  .dashboard-page .jobs-panel-tools { justify-content: flex-start; }
  .job-card-main { grid-template-columns: 1fr; }
  .job-card-progress { width: 100%; margin-left: 0; }
  .job-card-progress .mini-progress-label { text-align: left; }
  .job-card-progress .mini-progress { width: 100%; }
  .job-card-delete {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

@media (max-width: 720px) {
  .shell,
  .auth-shell { padding: 12px; }

  .app-shell,
  .dashboard-page .app-shell {
    gap: 10px;
  }

  .brand-panel,
  .upload-panel,
  .jobs-panel,
  .command-panel,
  .run-panel,
  .results-panel,
  .auth-panel,
  .users-panel { padding: 14px; }

  .signal-grid,
  .dashboard-page .system-strip,
  .dashboard-page .system-strip-compact,
  .summary-strip,
  .audit-summary-grid,
  .audit-filters { grid-template-columns: 1fr; }

  .dashboard-page .brand-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-page .brand-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .dashboard-page .brand-actions .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 108px;
  }

  .dashboard-page .identity-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions,
  .run-actions { flex-direction: column; width: 100%; }

  .topbar-actions .btn,
  .run-actions .btn { width: 100%; }

  .dashboard-page .run-secondary,
  .dashboard-page .debug-panel { width: 100%; }

  .dashboard-page .activity-strip,
  .dashboard-page .results-head,
  .dashboard-page .results-context.selected-summary {
    gap: 10px;
  }

  .dashboard-page .activity-strip-side,
  .dashboard-page .activity-detail,
  .dashboard-page .results-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard-page .activity-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, max-content));
    gap: 6px;
  }

  .dashboard-page .results-head-main,
  .dashboard-page .results-head-actions {
    width: 100%;
  }

  .dashboard-page .results-filter-cluster {
    display: grid;
    gap: 6px;
  }

  .dashboard-page .results-filter-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .dashboard-page .results-summary-pill {
    align-self: flex-start;
  }

  .dashboard-page .selected-summary,
  .dashboard-page .results-context.selected-summary {
    grid-template-columns: 1fr;
  }

  .dashboard-page .summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .dashboard-page .summary-card,
  .dashboard-page .summary-card-wide {
    width: 100%;
    min-width: 0;
    max-width: none;
    justify-content: space-between;
  }

  .dashboard-page .summary-card-wide strong {
    max-width: none;
  }

  .dashboard-page .jobs-panel-head {
    grid-template-columns: 1fr;
  }

  .dashboard-page .jobs-panel-tools {
    width: 100%;
  }

  .dashboard-page .jobs-panel-tools .btn {
    width: 100%;
    justify-content: center;
  }

  .job-card-delete {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .jobs-context-menu {
    min-width: 156px;
  }

  .dashboard-page .recovery-callout {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-page .recovery-callout .btn {
    width: 100%;
  }

  .jobs-wrap,
  .results-wrap { max-height: none; }

  h1 { font-size: 1.7rem; }
  h2 { font-size: 1rem; }
}

@media (max-width: 480px) {
  .shell,
  .auth-shell { padding: 10px; }

  .brand-panel,
  .upload-panel,
  .jobs-panel,
  .command-panel,
  .run-panel,
  .results-panel,
  .auth-panel,
  .users-panel { padding: 12px; }

  .dashboard-page .identity-row {
    grid-template-columns: 1fr;
  }

  .dashboard-page .brand-actions .btn {
    flex: 1 1 100%;
  }

  .dashboard-page .activity-detail,
  .dashboard-page .summary-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-page .results-cap,
  .dashboard-page .results-summary-pill {
    min-height: 24px;
    padding: 0 9px;
    font-size: 0.7rem;
  }

  .dashboard-page .results-wrap td,
  .dashboard-page .results-wrap thead th {
    padding-left: 8px;
    padding-right: 8px;
  }
}
