/*
 * Copied from the Quantify QA Console (Avontus.QA/public/ui.css), trimmed, with
 * Switzer for display type and a dark token set.
 * Quantify QA design system. Tokens and primitives only; page layouts live in app.css.
 * The look is a native Mac app: system type at 13px, flat white cards with 1px borders,
 * a light grey sidebar, blue only for the primary action and the running state, and
 * monospace for anything that is a value. Naming follows shadcn/ui (background,
 * foreground, card, primary, muted, accent, border, input, ring, radius) so the
 * vocabulary is familiar. docs/DESIGN.md explains how to use it.
 */

:root {
  /* Surfaces and text */
  --background: #f9fafc;
  --foreground: #111214;
  --card: #ffffff;
  --card-foreground: #111214;
  --popover: #ffffff;
  --sidebar: #f4f5f9;
  --sidebar-border: #e6e7ec;
  --sidebar-active: #e5e6eb;
  --muted: #f3f4f7;
  --muted-soft: #f8f8f9;
  --muted-foreground: #6e7079;
  --secondary: #eceef2;
  --secondary-foreground: #2c2e33;
  --accent: #eaf0fd;
  --accent-foreground: #1f3f9c;
  --border: #e6e7ea;
  --border-strong: #d3d4da;
  --input: #d3d4da;
  --ring: rgba(46, 92, 225, 0.28);

  /* Brand: one blue, for the primary action and anything running */
  --primary: #2e5ce1;
  --primary-hover: #244fc9;
  --primary-foreground: #ffffff;

  /* Status: a strong color, a soft fill and the text that sits on the soft fill */
  --success: #43ad61;
  --success-soft: #e8f6ec;
  --success-border: #c8e7d2;
  --success-foreground: #1e6b36;
  --destructive: #c63b30;
  --destructive-soft: #fbebe9;
  --destructive-border: #f0c4bf;
  --destructive-foreground: #83281f;
  --warning: #c9811b;
  --warning-soft: #fff7ea;
  --warning-border: #efdcc0;
  --warning-foreground: #7a4f2a;
  --info: #2e5ce1;
  --info-soft: #eaf0fd;
  --info-border: #cad8f8;
  --info-foreground: #1f3f9c;
  --accent-soft: #fbfcff;
  --neutral: #95999e;
  --meter: #424347;
  --meter-track: #eeeff1;

  --overlay: rgba(17, 18, 20, 0.94);

  /* Shape, depth, type */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --shadow-sm: 0 1px 1px rgba(17, 18, 20, 0.04);
  --shadow: 0 1px 2px rgba(17, 18, 20, 0.05), 0 6px 20px rgba(17, 18, 20, 0.06);
  --shadow-lg: 0 10px 40px rgba(17, 18, 20, 0.16);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Inter", Helvetica, Arial, sans-serif;
  --font-display: "Switzer", var(--font-sans);
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Spacing scale: 4px steps */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Control heights: Mac-sized */
  --control-sm: 24px;
  --control: 28px;
  --control-lg: 34px;

  color-scheme: light;
}

@font-face { font-family: "Switzer"; src: url("/fonts/Switzer-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/Switzer-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/Switzer-Semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/Switzer-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

/* Dark: the same roles, re-pointed */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #111214;
    --foreground: #ececef;
    --card: #18191c;
    --card-foreground: #ececef;
    --popover: #1d1e22;
    --sidebar: #141518;
    --sidebar-border: #26272c;
    --sidebar-active: #25272c;
    --muted: #1f2024;
    --muted-soft: #1b1c20;
    --muted-foreground: #9a9ca5;
    --secondary: #26282d;
    --secondary-foreground: #dcdde2;
    --accent: #1b2648;
    --accent-foreground: #b3c7ff;
    --border: #2a2b30;
    --border-strong: #3b3c43;
    --input: #3b3c43;
    --ring: rgba(110, 145, 245, 0.35);
    --primary: #5580f2;
    --primary-hover: #4670e6;
    --success: #4cbb6c;
    --success-soft: #15291c;
    --success-border: #24452f;
    --success-foreground: #94dcaa;
    --destructive: #e0584c;
    --destructive-soft: #341a18;
    --destructive-border: #5a2b27;
    --destructive-foreground: #f5aaa1;
    --warning: #e09a3a;
    --warning-soft: #2f2415;
    --warning-border: #54401f;
    --warning-foreground: #f0c88f;
    --info: #5580f2;
    --info-soft: #1b2648;
    --info-border: #2c3d70;
    --info-foreground: #b3c7ff;
    --accent-soft: #161c2e;
    --neutral: #6c7077;
    --meter: #c9cbd1;
    --meter-track: #2a2b30;
    --overlay: rgba(0, 0, 0, 0.94);
    --shadow-sm: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--background); color: var(--foreground); font: 13px/1.45 var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.3; }
h3 { font-size: 13px; font-weight: 600; line-height: 1.4; }
h4 { font-size: 12.5px; font-weight: 600; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-foreground); }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code { font-family: var(--font-mono); font-size: 0.92em; background: var(--muted); padding: 1px 5px; border-radius: 4px; }
kbd { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-foreground); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--card); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Icons: 24 by 24 stroke paths, sized by the element they sit in */
.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control); padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--input); background: var(--card); color: var(--foreground); font: inherit; font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color 100ms, border-color 100ms, color 100ms, box-shadow 100ms; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--muted); text-decoration: none; color: var(--foreground); }
.btn:active { background: var(--secondary); }
.btn .ic { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-foreground); }
.btn-primary:active { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); border-color: transparent; color: var(--secondary-foreground); box-shadow: none; }
.btn-secondary:hover { background: var(--sidebar-active); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--muted); }
.btn-destructive { background: var(--destructive); border-color: var(--destructive); color: #fff; }
.btn-destructive:hover { background: #ad2f25; color: #fff; }
.btn-link { background: none; border-color: transparent; box-shadow: none; color: var(--primary); padding: 0; height: auto; }
.btn-link:hover { background: none; text-decoration: underline; color: var(--primary-hover); }
.btn-sm { height: var(--control-sm); padding: 0 9px; font-size: 12px; gap: 5px; }
.btn-sm .ic { width: 13px; height: 13px; }
.btn-lg { height: var(--control-lg); padding: 0 16px; font-size: 13.5px; }
.btn-lg .ic { width: 16px; height: 16px; }
.btn-icon { width: var(--control); padding: 0; }
.btn-icon.btn-sm { width: var(--control-sm); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-group { display: inline-flex; }
.btn-group .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.btn-group .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Badges: soft fills and outlines, small and quiet */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px; border: 1px solid transparent; font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap; background: var(--secondary); color: var(--secondary-foreground); }
.badge .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.badge-outline { background: transparent; border-color: var(--border-strong); color: var(--muted-foreground); }
.badge-dashed { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted-foreground); }
.badge-primary { background: var(--primary); color: var(--primary-foreground); }
.badge-success { background: var(--success-soft); color: var(--success-foreground); }
.badge-destructive { background: var(--destructive-soft); color: var(--destructive-foreground); }
.badge-warning { background: var(--warning-soft); color: var(--warning-foreground); }
.badge-info { background: var(--info-soft); color: var(--info-foreground); }
.badge-mono { font-family: var(--font-mono); font-size: 11px; }
.badge-pill { border-radius: 999px; }
.badge-lg { height: 24px; padding: 0 9px; font-size: 12.5px; }
.badge-lg .ic { width: 14px; height: 14px; }

/* Status dot: a small colored circle before a label */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); flex: none; }
.dot-success { background: var(--success); }
.dot-destructive { background: var(--destructive); }
.dot-warning { background: var(--warning); }
.dot-info { background: var(--info); }
.dot-muted { background: var(--border-strong); }
.dot-ring { background: transparent; border: 1.5px solid currentColor; width: 7px; height: 7px; }
.dot-pulse { box-shadow: 0 0 0 0 currentColor; animation: pulse 1.6s ease-out infinite; color: var(--success); }
@keyframes pulse { to { box-shadow: 0 0 0 6px rgba(67, 173, 97, 0); } }

/* Meter: a thin bar for a share or a count out of a total */
.meter { display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--meter-track); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 2px; background: var(--meter); }
.meter-success > i { background: var(--success); }
.meter-destructive > i { background: var(--destructive); }
.meter-warning > i { background: var(--warning); }
.meter-info > i { background: var(--primary); }

/* Icon tile: an icon on a tinted square, for suites, verdicts and empty states */
.tile { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; background: var(--secondary); color: var(--secondary-foreground); flex: none; }
.tile .ic { width: 16px; height: 16px; }
.tile-sm { width: 24px; height: 24px; border-radius: 6px; }
.tile-sm .ic { width: 13px; height: 13px; }
.tile-lg { width: 44px; height: 44px; border-radius: 10px; }
.tile-lg .ic { width: 22px; height: 22px; }
.tile-success { background: var(--success-soft); color: var(--success); }
.tile-destructive { background: var(--destructive-soft); color: var(--destructive); }
.tile-warning { background: var(--warning-soft); color: var(--warning); }
.tile-info { background: var(--info-soft); color: var(--info); }
.tile-muted { background: var(--muted); color: var(--muted-foreground); }
.tile-solid-success { background: var(--success); color: #fff; }
.tile-solid-destructive { background: var(--destructive); color: #fff; }
.tile-solid-warning { background: var(--warning); color: #fff; }
.tile-solid-info { background: var(--primary); color: #fff; }
.tile-solid-muted { background: var(--border-strong); color: #fff; }
.tile-solid-dark { background: var(--foreground); color: #fff; }

/* Cards: white, one hairline border, no shadow */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-5) 0; }
.card-header > div { min-width: 0; }
.card-title { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; display: flex; align-items: center; gap: 7px; }
.card-title .ic { color: var(--muted-foreground); width: 16px; height: 16px; }
.card-description { color: var(--muted-foreground); font-size: 12.5px; margin-top: 3px; }
.card-content { padding: var(--space-5); }
.card-header + .card-content { padding-top: var(--space-4); }
.card-footer { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border); background: var(--muted-soft); border-radius: 0 0 var(--radius) var(--radius); }
.card-flush .card-content { padding: 0; }
.card-interactive { transition: border-color 100ms, box-shadow 100ms; }
.card-interactive:hover { border-color: var(--border-strong); }
.card-selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

/* Section heading: a title with its count, and something on the right (a legend, a link) */
.section-head { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; }
.section-head h2 { font-size: 14.5px; }
.section-head .count { font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground); }
.section-head .section-aside { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); color: var(--muted-foreground); font-size: 12.5px; }
.section-head .section-aside a { color: var(--foreground); font-weight: 500; }
.legend { display: inline-flex; align-items: center; gap: 5px; }
.legend .ic { width: 13px; height: 13px; }

/* Form controls */
.input, .select, .textarea { width: 100%; font: inherit; font-size: 13px; color: var(--foreground); background: var(--card); border: 1px solid var(--input); border-radius: var(--radius-sm); padding: 0 9px; height: var(--control); box-shadow: var(--shadow-sm); transition: border-color 100ms, box-shadow 100ms; }
.textarea { height: auto; min-height: 76px; padding: 7px 9px; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); opacity: 0.8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--muted); color: var(--muted-foreground); cursor: not-allowed; }
.select { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e7079' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; cursor: pointer; }
.input-sm, .select-sm { height: var(--control-sm); font-size: 12px; }
.mono-input { font-family: var(--font-mono); font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--foreground); display: flex; align-items: center; gap: 6px; }
.field-label .req { color: var(--destructive); }
.field-hint { font-size: 12px; color: var(--muted-foreground); }
.field-error { font-size: 12px; color: var(--destructive); }
.field-row { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.input-group { display: flex; align-items: center; gap: 7px; height: var(--control); padding: 0 9px; background: var(--card); border: 1px solid var(--input); border-radius: var(--radius-sm); color: var(--muted-foreground); box-shadow: var(--shadow-sm); }
.input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input-group input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; color: var(--foreground); height: 100%; }
.input-group .ic { width: 14px; height: 14px; }
.secret-input { padding-right: 2px; }
.secret-input input { font-family: var(--font-mono); font-size: 12px; }
.secret-input input::placeholder { font-family: var(--font-sans); font-size: 13px; }
.secret-input input:not(:placeholder-shown) { filter: blur(4px); transition: filter 120ms; }
.secret-input.revealed input { filter: none; }

/* Checkbox and switch */
.checkbox { appearance: none; width: 15px; height: 15px; margin: 0; border: 1px solid var(--input); border-radius: 4px; background: var(--card); display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: background-color 100ms, border-color 100ms; box-shadow: var(--shadow-sm); }
.checkbox:checked { background: var(--primary); border-color: var(--primary); }
.checkbox:checked::after { content: ""; width: 8px; height: 4.5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.checkbox:disabled { opacity: 0.5; cursor: not-allowed; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13px; color: var(--foreground); }
.check .checkbox { margin-top: 2px; }
.check-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-text .field-hint { line-height: 1.4; }
.check-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); transition: border-color 100ms, background-color 100ms; }
.check-card:hover { border-color: var(--border-strong); }
.check-card:has(.checkbox:checked) { border-color: var(--primary); background: var(--accent-soft); }
.switch { appearance: none; width: 30px; height: 18px; margin: 0; border-radius: 999px; background: var(--input); position: relative; cursor: pointer; flex: none; transition: background-color 100ms; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 100ms; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(12px); }

/* Tabs (segmented control) */
.tabs { display: inline-flex; gap: 2px; padding: 2px; background: var(--secondary); border-radius: 7px; }
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 24px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted-foreground); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--foreground); }
.tab[aria-selected="true"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgba(17, 18, 20, 0.12); }
.tab .ic { width: 13px; height: 13px; }
.tabs-full { display: flex; }
.tabs-full .tab { flex: 1; }

/* Filter chips: inline, a count then a word. In a .summary-strip they become stat cells. */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--foreground); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: border-color 100ms, background-color 100ms; }
.chip:hover { border-color: var(--border-strong); background: var(--muted-soft); }
.chip-value { display: inline-flex; align-items: center; gap: 5px; order: -1; }
.chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.chip .ic { width: 14px; height: 14px; }
.chip.active { border-color: var(--primary); background: var(--accent); color: var(--accent-foreground); }
.chip-success .ic { color: var(--success); }
.chip-destructive .ic { color: var(--destructive); }
.chip-warning .ic { color: var(--warning); }
.chip-muted .ic { color: var(--muted-foreground); }
.chip-info .ic { color: var(--primary); }
.chip-static { cursor: default; }
.chip-static:hover { border-color: var(--border); background: var(--card); }

/* Summary strip: one bordered row of stat cells, each a chip that filters when clicked */
.summary-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.summary-strip .chip { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 6px; height: auto; min-width: 0; padding: 14px 18px 16px; border: 0; border-left: 1px solid var(--border); border-radius: 0; background: var(--card); text-align: left; white-space: normal; }
.summary-strip .chip:first-child { border-left: 0; }
.summary-strip .chip:hover { background: var(--muted-soft); }
.summary-strip .chip.active { background: var(--accent); color: var(--foreground); box-shadow: inset 0 -2px 0 var(--primary); }
.summary-strip .chip-label { color: var(--muted-foreground); font-size: 12.5px; order: -1; }
.summary-strip .chip.active .chip-label { color: var(--accent-foreground); }
.summary-strip .chip-value { order: 0; gap: 8px; }
.summary-strip .chip b { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.summary-strip .chip .ic { width: 15px; height: 15px; }
.summary-strip .chip-static:hover { background: var(--card); }
@media (max-width: 760px) { .summary-strip { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); } .summary-strip .chip:nth-child(odd) { border-left: 0; } .summary-strip .chip:nth-child(n + 3) { border-top: 1px solid var(--border); } }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.card .table-wrap { border: 0; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted-foreground); padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--muted-soft); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--muted-soft); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12px; }
.table th.num { font-family: var(--font-sans); }
.table-row-link { cursor: pointer; }
.table .row-end { width: 1%; color: var(--muted-foreground); }
.table .row-end .ic { width: 14px; height: 14px; }

/* Alerts */
.alert { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); font-size: 13px; }
.alert > .ic { width: 17px; height: 17px; color: var(--muted-foreground); align-self: flex-start; margin-top: 2px; }
.alert-title { font-weight: 600; }
.alert-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.alert-body > span:not(.alert-title) { color: var(--muted-foreground); }
.alert-action { margin-left: auto; flex: none; }
.alert-warning { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning-foreground); }
.alert-warning > .ic { color: var(--warning); }
.alert-warning .alert-body > span:not(.alert-title) { color: var(--warning-foreground); opacity: 0.85; }
.alert-destructive { background: var(--destructive-soft); border-color: var(--destructive-border); color: var(--destructive-foreground); }
.alert-destructive > .ic { color: var(--destructive); }
.alert-destructive .alert-body > span:not(.alert-title) { color: var(--destructive-foreground); opacity: 0.85; }
.alert-info { background: var(--info-soft); border-color: var(--info-border); color: var(--info-foreground); }
.alert-info > .ic { color: var(--info); }
.alert-info .alert-body > span:not(.alert-title) { color: var(--info-foreground); opacity: 0.85; }
.alert-success { background: var(--success-soft); border-color: var(--success-border); color: var(--success-foreground); }
.alert-success > .ic { color: var(--success); }
.alert-success .alert-body > span:not(.alert-title) { color: var(--success-foreground); opacity: 0.85; }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: var(--space-8) var(--space-5); text-align: center; color: var(--muted-foreground); }
.empty .tile { margin-bottom: 4px; }
.empty b { color: var(--foreground); font-weight: 600; font-size: 13.5px; }
.empty p { max-width: 44ch; font-size: 12.5px; }
.empty .btn { margin-top: 6px; }
.placeholder { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--muted-foreground); font-size: 13px; }
.placeholder .ic { width: 16px; height: 16px; }

/* Stat: a label, a big number and a line under it. Several in a .stat-group share one border. */
.stat { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--muted-foreground); display: flex; align-items: center; gap: 6px; }
.stat-value { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat-value .dot { width: 8px; height: 8px; }
.stat-sub { font-size: 12.5px; color: var(--muted-foreground); }
.stat .meter { margin-top: 4px; }
.stat-group { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.stat-group .stat { border: 0; border-left: 1px solid var(--border); border-radius: 0; }
.stat-group .stat:first-child { border-left: 0; }
@media (max-width: 760px) { .stat-group { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); } .stat-group .stat:nth-child(odd) { border-left: 0; } .stat-group .stat:nth-child(n + 3) { border-top: 1px solid var(--border); } }

/* Avatar, separator, skeleton */
.avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--secondary); color: var(--secondary-foreground); font-size: 10px; font-weight: 600; flex: none; }
.separator { height: 1px; background: var(--border); border: 0; margin: 0; }
.separator-v { width: 1px; align-self: stretch; background: var(--border); }
.skeleton { background: linear-gradient(90deg, var(--muted), var(--secondary), var(--muted)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-foreground); min-width: 0; }
.crumbs a { color: var(--muted-foreground); }
.crumbs a:hover { color: var(--foreground); text-decoration: none; }
.crumbs .ic { width: 13px; height: 13px; opacity: 0.6; }
.crumbs .current { color: var(--foreground); font-weight: 500; }
.crumbs .current.mono { font-size: 12.5px; }

/* Key-value rows */
.kv { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px; align-items: center; }
.kv:first-of-type { border-top: 0; padding-top: 0; }
.kv-k { display: flex; align-items: center; gap: 6px; color: var(--muted-foreground); }
.kv-k .ic { width: 14px; height: 14px; }
.kv-v { min-width: 0; overflow-wrap: anywhere; }

/* Two lines in a cell: a name over a monospace detail */
.cell-2 { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cell-2 b { font-weight: 500; }
.cell-2 .mono { color: var(--muted-foreground); }

/* Layout helpers */
.row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { gap: var(--space-2); }
.stack-lg { gap: var(--space-6); }
.grid { display: grid; gap: var(--space-4); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.ml-auto { margin-left: auto; }

/* Gallery: full-screen screenshot viewer opened by openGallery() */
.gallery { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: var(--space-4); border: 0; background: var(--overlay); color: #fff; display: none; flex-direction: column; gap: var(--space-3); }
.gallery[open] { display: flex; }
.gallery::backdrop { background: transparent; }
.gallery .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.25); box-shadow: none; }
.gallery .btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.gallery .btn-ghost { border-color: transparent; }
.gallery-bar { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-sm); }
.gallery-count { color: rgba(255, 255, 255, 0.6); font-size: 12.5px; font-family: var(--font-mono); }
.gallery-caption { flex: 1; min-width: 0; font-weight: 500; }
.gallery-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: var(--space-4); }
.gallery-image { max-width: 100%; max-height: 100%; min-width: 0; object-fit: contain; border-radius: var(--radius); }
.gallery-body > .btn { flex: none; width: var(--control-lg); height: var(--control-lg); border-radius: 999px; }
.gallery-strip { display: flex; gap: var(--space-2); justify-content: safe center; overflow-x: auto; padding-bottom: var(--space-1); }
.gallery-strip button { flex: none; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer; opacity: 0.55; transition: opacity 100ms, border-color 100ms; }
.gallery-strip button:hover { opacity: 0.85; }
.gallery-strip button[aria-current] { border-color: #fff; opacity: 1; }
.gallery-strip img { display: block; width: 96px; height: 54px; object-fit: cover; border-radius: 4px; }
