/* ============================================================
   AL MOKHTABAR — Web Design System · Foundations
   Clinical-clean: white, precise, quiet premium.
   Brand from logo: red #D8141C · gold #F5B80B
   All layout properties are logical (RTL-safe).
   ============================================================ */

:root {
  /* ---- Brand ---- */
  --red-800: #7E0B10;
  --red-700: #9E0D13;
  --red-600: #BE1017;
  --red-500: #D8141C;          /* logo red — primary action */
  --red-400: #E4444A;
  --red-100: #F9DCDD;
  --red-50:  #FCEEEE;
  --red-25:  #FDF6F5;

  --gold-600: #C4900A;
  --gold-500: #F0B40D;         /* logo gold — loyalty, highlights */
  --gold-300: #FFD84D;
  --gold-100: #FBEFC8;
  --gold-50:  #FDF8E8;

  /* ---- Neutrals (warm-neutral, clinical) ---- */
  --ink-900: #17181C;
  --ink-800: #24262C;
  --ink-700: #383B43;
  --ink-600: #52555F;
  --ink-500: #6E7280;
  --ink-400: #979BA6;
  --ink-300: #C3C6CD;
  --line:    #E6E6E2;          /* hairline */
  --line-soft: #EEEEEA;
  --wash:    #F4F4F1;          /* soft fill */
  --bg:      #F8F8F6;          /* app/page background */
  --paper:   #FFFFFF;

  /* ---- Functional ---- */
  --green-600: #14733F;
  --green-500: #1A8A4D;
  --green-50:  #E9F5EE;
  --amber-600: #97640A;
  --amber-500: #B87B10;
  --amber-50:  #FBF3E2;
  --blue-600:  #2D5A93;
  --blue-500:  #3A6DAE;
  --blue-50:   #EBF1F8;
  --danger:    var(--red-600);
  --danger-50: var(--red-50);

  /* ---- Type ---- */
  --font-latin: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- Radius (tweakable: data-radius="soft") ---- */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* ---- Shadows: quiet ---- */
  --sh-xs: 0 1px 2px rgba(23,24,28,.05);
  --sh-sm: 0 1px 2px rgba(23,24,28,.04), 0 3px 10px -2px rgba(23,24,28,.05);
  --sh-md: 0 2px 4px rgba(23,24,28,.04), 0 10px 28px -8px rgba(23,24,28,.10);
  --sh-lg: 0 4px 8px rgba(23,24,28,.05), 0 24px 56px -16px rgba(23,24,28,.16);
  --sh-red: 0 6px 18px -6px rgba(216,20,28,.35);

  /* ---- Focus ---- */
  --focus-ring: 0 0 0 3px rgba(216,20,28,.16);

  /* ---- Layout ---- */
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --header-h: 72px;
  --topbar-h: 40px;
}

html[data-radius="soft"] {
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px;
}
html[data-font="plex"] {
  --font-latin: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

/* ============================================================
   Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-latin);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" on;
}

html[lang="ar"] body,
[lang="ar"] { font-family: var(--font-ar); letter-spacing: 0 !important; }

img { max-width: 100%; display: block; }
svg { display: block; }
.icon { flex: none; width: 20px; height: 20px; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }

/* Any class setting `display` outranks the UA's [hidden] rule — keep `hidden` authoritative. */
[hidden] { display: none !important; }

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--red-600); text-decoration: none; }
a:hover { color: var(--red-500); }
h1,h2,h3,h4,h5,p,ul,ol,figure { margin: 0; }
ul,ol { padding: 0; list-style: none; }
hr { border: 0; height: 1px; background: var(--line); margin: 0; }

::selection { background: var(--red-100); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-xs); }

/* ============================================================
   Type scale
   ============================================================ */
.t-display {
  font-size: clamp(38px, 4.6vw, 58px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.028em;
  color: var(--ink-900);
  text-wrap: balance;
}
.t-h1 { font-size: clamp(30px, 3vw, 40px); line-height: 1.08; font-weight: 600; letter-spacing: -0.022em; color: var(--ink-900); text-wrap: balance; }
.t-h2 { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.15; font-weight: 600; letter-spacing: -0.018em; color: var(--ink-900); text-wrap: balance; }
.t-h3 { font-size: 21px; line-height: 1.28; font-weight: 600; letter-spacing: -0.012em; color: var(--ink-900); }
.t-h4 { font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -0.008em; color: var(--ink-900); }
.t-body-lg { font-size: 17px; line-height: 1.6; }
.t-body { font-size: 15px; line-height: 1.55; }
.t-small { font-size: 13.5px; line-height: 1.5; }
.t-xs { font-size: 12px; line-height: 1.45; }

/* Specimen-label: the lab voice */
.t-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.t-label--red { color: var(--red-500); }
.t-mono { font-family: var(--font-mono); }
.t-num { font-variant-numeric: tabular-nums; }
/* Latin-ordered runs (phone numbers, "+20 10 ** *** 1234", national IDs) inside Arabic copy. The
   bidi algorithm otherwise pushes the leading "+20" to the far end and reorders the groups, so the
   number reads back to front. isolate keeps the run out of the surrounding paragraph's ordering. */
.t-ltr { direction: ltr; unicode-bidi: isolate; }

.muted { color: var(--ink-500); }
.dim { color: var(--ink-400); }
.strong { font-weight: 600; color: var(--ink-900); }

html[lang="ar"] .t-display, html[lang="ar"] .t-h1, html[lang="ar"] .t-h2 { line-height: 1.3; }

/* ============================================================
   Container & grid
   ============================================================ */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
}

.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.gap-2 { gap: 8px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 46px;
  padding-inline: 22px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.006em;
  white-space: nowrap;
  user-select: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .06s ease;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }

.btn--primary { background: var(--red-500); color: #fff; box-shadow: var(--sh-red); }
.btn--primary:hover { background: var(--red-600); color: #fff; }

.btn--outline { background: var(--paper); color: var(--ink-800); border: 1px solid var(--line); box-shadow: var(--sh-xs); }
.btn--outline:hover { border-color: var(--ink-300); color: var(--ink-900); }

.btn--soft { background: var(--red-50); color: var(--red-600); }
.btn--soft:hover { background: var(--red-100); color: var(--red-700); }

.btn--ghost { background: transparent; color: var(--ink-600); }
.btn--ghost:hover { background: var(--wash); color: var(--ink-900); }

.btn--ink { background: var(--ink-900); color: #fff; }
.btn--ink:hover { background: var(--ink-700); color: #fff; }

.btn--danger-soft { background: var(--red-50); color: var(--red-600); }
.btn--danger-soft:hover { background: var(--red-100); }

.btn--lg { height: 54px; padding-inline: 28px; font-size: 16px; border-radius: var(--r-md); }
.btn--sm { height: 36px; padding-inline: 14px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn[disabled], .btn--disabled { opacity: .45; pointer-events: none; }

.btn-icon {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  border-radius: var(--r-sm);
  color: var(--ink-600);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-icon:hover { background: var(--wash); color: var(--ink-900); }
.btn-icon--outline { border: 1px solid var(--line); background: var(--paper); }
.btn-icon--outline:hover { border-color: var(--ink-300); }

/* Text link with arrow */
.link-more {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 14px; color: var(--red-600);
}
.link-more:hover { color: var(--red-500); }
.link-more .icon { width: 16px; height: 16px; transition: translate .15s ease; }
.link-more:hover .icon { translate: 3px 0; }
html[dir="rtl"] .link-more .icon { rotate: 180deg; }
html[dir="rtl"] .link-more:hover .icon { translate: -3px 0; }

/* Paged listings (tests, packages, news, branches). In Arabic the page reads right-to-left, so the
   "previous" arrow has to point RIGHT and "next" LEFT — same mirroring .link-more already does.
   The arrow markup stays identical in both directions; only the rendering flips. */
.pagination .icon { width: 16px; height: 16px; }
html[dir="rtl"] .pagination .icon { rotate: 180deg; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}
.card--hover { transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease; }
.card--hover:hover { box-shadow: var(--sh-md); border-color: var(--ink-300); transform: translateY(-2px); }
.card--flat { box-shadow: none; }
.card--wash { background: var(--wash); border-color: transparent; box-shadow: none; }
.card-pad { padding: 24px; }
.card-pad-lg { padding: 32px; }
.card-pad-sm { padding: 16px; }

/* ============================================================
   Badges & status
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding-inline: 9px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  background: var(--wash); color: var(--ink-600);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--plain::before { display: none; }
.badge--ready, .badge--approved, .badge--completed { background: var(--green-50); color: var(--green-600); }
.badge--pending, .badge--processing { background: var(--amber-50); color: var(--amber-600); }
.badge--review, .badge--rejected, .badge--danger { background: var(--red-50); color: var(--red-600); }
.badge--submitted, .badge--info { background: var(--blue-50); color: var(--blue-600); }
.badge--gold { background: var(--gold-50); color: var(--gold-600); }
.badge--new { background: var(--red-500); color: #fff; }

/* Mono reference tag (order ids, codes) */
.tag-mono {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em;
  color: var(--ink-500);
  background: var(--wash); border: 1px solid var(--line-soft);
  padding: 3px 8px; border-radius: var(--r-xs);
  white-space: nowrap;
}

/* Counter dot */
.count-dot {
  min-width: 18px; height: 18px; padding-inline: 5px;
  border-radius: var(--r-pill);
  background: var(--red-500); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* ============================================================
   Forms
   ============================================================ */
.field { display: block; text-align: start; }
.field + .field { margin-block-start: 18px; }
.field__label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-800);
  margin-block-end: 7px;
}
.field__label .req { color: var(--red-500); }
.field__hint { font-size: 12.5px; color: var(--ink-500); margin-block-start: 6px; }
.field__error { display: flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 500; color: var(--red-600); margin-block-start: 6px; }

.input, .select, .textarea {
  width: 100%;
  height: 48px;
  padding-inline: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: 15px;
  color: var(--ink-900);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { height: auto; min-height: 110px; padding-block: 12px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--red-500); box-shadow: var(--focus-ring); }
.input--error { border-color: var(--red-500); }
.input--error:focus { box-shadow: 0 0 0 3px rgba(216,20,28,.12); }
.input[disabled] { background: var(--wash); color: var(--ink-500); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-inline-end: 40px;
}
html[dir="rtl"] .select { background-position: left 14px center; }

/* Input with leading icon or affix */
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-start: 44px; }
.input-wrap__icon {
  position: absolute; inset-inline-start: 14px; inset-block-start: 50%;
  translate: 0 -50%;
  color: var(--ink-400); width: 19px; height: 19px; pointer-events: none;
}
html[dir="rtl"] .input-wrap__icon { translate: 0 -50%; }
.input-wrap__trail {
  position: absolute; inset-inline-end: 8px; inset-block-start: 50%;
  translate: 0 -50%;
}

/* Phone input: dial code prefix */
.phone-wrap { display: flex; }
.phone-wrap .dial {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding-inline: 14px;
  border: 1px solid var(--line); border-inline-end: 0;
  border-start-start-radius: var(--r-sm); border-end-start-radius: var(--r-sm);
  background: var(--wash);
  font-weight: 600; font-size: 14px; color: var(--ink-700);
  white-space: nowrap;
  /* "+20" is a neutral followed by digits: in an RTL paragraph it flips to "20+" without this. */
  direction: ltr; unicode-bidi: isolate;
}
.phone-wrap .input {
  border-start-start-radius: 0; border-end-start-radius: 0;
  font-family: var(--font-mono); letter-spacing: .04em;
}

/* Checkbox / radio */
.check {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; color: var(--ink-700); cursor: pointer;
}
.check input {
  appearance: none; margin: 2px 0 0;
  width: 18px; height: 18px; flex: none;
  border: 1.5px solid var(--ink-300); border-radius: 5px;
  background: var(--paper);
  display: grid; place-items: center;
  transition: background .12s ease, border-color .12s ease;
  cursor: pointer;
}
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--red-500); border-color: var(--red-500); }
.check input[type="checkbox"]:checked::after {
  content: ""; width: 10px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}
.check input[type="radio"]:checked::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff;
}

/* Toggle switch */
.switch { position: relative; display: inline-flex; flex: none; width: 44px; height: 26px; cursor: pointer; }
.switch input { appearance: none; position: absolute; inset: 0; margin: 0; border-radius: var(--r-pill); background: var(--ink-300); transition: background .15s ease; cursor: pointer; }
.switch input:checked { background: var(--red-500); }
.switch::after {
  content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(23,24,28,.25);
  transition: translate .15s ease; pointer-events: none;
}
.switch:has(input:checked)::after { translate: 18px 0; }
html[dir="rtl"] .switch:has(input:checked)::after { translate: -18px 0; }

/* Segmented control */
.seg {
  display: inline-flex; gap: 2px;
  background: var(--wash);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 3px;
}
.seg button {
  height: 34px; padding-inline: 16px;
  border-radius: calc(var(--r-sm) - 3px);
  font-size: 13.5px; font-weight: 600; color: var(--ink-500);
  transition: background .12s ease, color .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink-800); }
.seg button.is-active { background: var(--paper); color: var(--ink-900); box-shadow: var(--sh-xs); }

/* OTP boxes */
.otp { display: flex; gap: 10px; direction: ltr; }
.otp input {
  width: 52px; height: 60px; text-align: center;
  font-family: var(--font-mono); font-size: 24px; font-weight: 600;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink-900);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.otp input:focus { outline: none; border-color: var(--red-500); box-shadow: var(--focus-ring); }
.otp input.is-filled { border-color: var(--ink-300); background: var(--wash); }
.otp--error input { border-color: var(--red-500); background: var(--red-25); }

/* Upload dropzone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 28px 20px; text-align: center;
  border: 1.5px dashed var(--ink-300); border-radius: var(--r-md);
  background: var(--wash);
  color: var(--ink-500); font-size: 13.5px;
  transition: border-color .15s ease, background .15s ease;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--red-400); background: var(--red-25); }
.dropzone .icon { width: 26px; height: 26px; color: var(--ink-400); }

/* ============================================================
   Alerts
   ============================================================ */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.5;
  background: var(--blue-50); color: var(--ink-800);
  border: 1px solid rgba(58,109,174,.22);
}
.alert .icon { width: 18px; height: 18px; margin-block-start: 1px; color: var(--blue-600); }
.alert--success { background: var(--green-50); border-color: rgba(26,138,77,.25); }
.alert--success .icon { color: var(--green-600); }
.alert--warning { background: var(--amber-50); border-color: rgba(184,123,16,.28); }
.alert--warning .icon { color: var(--amber-600); }
.alert--danger { background: var(--red-50); border-color: rgba(216,20,28,.22); }
.alert--danger .icon { color: var(--red-600); }
.alert--gold { background: var(--gold-50); border-color: rgba(196,144,10,.3); }
.alert--gold .icon { color: var(--gold-600); }
.alert b { color: var(--ink-900); font-weight: 600; }

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex; gap: 26px;
  border-block-end: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative;
  padding: 12px 2px 14px;
  font-size: 14.5px; font-weight: 600; color: var(--ink-500);
  white-space: nowrap;
  transition: color .12s ease;
}
.tabs button:hover { color: var(--ink-800); }
.tabs button.is-active { color: var(--ink-900); }
.tabs button.is-active::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: -1px;
  height: 2px; background: var(--red-500); border-radius: 2px;
}
.tabs .count { margin-inline-start: 6px; color: var(--ink-400); font-weight: 500; }

/* Pill filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px; padding-inline: 15px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13.5px; font-weight: 500; color: var(--ink-600);
  transition: all .12s ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-300); color: var(--ink-900); }
.chip.is-active { background: var(--ink-900); border-color: var(--ink-900); color: #fff; font-weight: 600; }

/* ============================================================
   Modal
   ============================================================ */
.modal-veil {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(23,24,28,.44);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
}
.modal {
  width: 100%; max-width: 440px;
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  padding: 28px;
  text-align: center;
  position: relative;
}
.modal--start { text-align: start; }
.modal--scrollable {
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal__close { position: absolute; inset-inline-end: 14px; inset-block-start: 14px; }
.modal__icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  margin: 4px auto 18px;
  background: var(--green-50); color: var(--green-600);
}
.modal__icon .icon { width: 30px; height: 30px; }
.modal__icon--danger { background: var(--red-50); color: var(--red-600); }
.modal__icon--warning { background: var(--amber-50); color: var(--amber-600); }
.modal__icon--gold { background: var(--gold-50); color: var(--gold-600); }

/* ============================================================
   Tables (desktop) → cards (mobile)
   ============================================================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: start;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .12em; color: var(--ink-500);
  padding: 12px 16px;
  border-block-end: 1px solid var(--line);
  background: var(--wash);
  white-space: nowrap;
}
.table td { padding: 14px 16px; border-block-end: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-block-end: 0; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: var(--red-25); }

/* ============================================================
   Skeleton / loading
   ============================================================ */
@keyframes mk-shimmer { 0% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.skel {
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--wash) 40%, #ECECE8 50%, var(--wash) 60%);
  background-size: 300% 100%;
  animation: mk-shimmer 1.4s linear infinite;
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.spinner {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  border: 2.5px solid var(--red-100);
  border-block-start-color: var(--red-500);
  animation: mk-spin .7s linear infinite;
}
@keyframes mk-spin { to { rotate: 360deg; } }

/* ============================================================
   Empty state
   ============================================================ */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  padding: 56px 24px;
}
.empty__art {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--wash);
  display: grid; place-items: center;
  color: var(--ink-400);
  margin-block-end: 10px;
  position: relative;
}
.empty__art .icon { width: 30px; height: 30px; }
.empty__art::after {
  content: ""; position: absolute; inset: -9px;
  border: 1px dashed var(--line); border-radius: 50%;
}
.empty h4 { font-size: 16.5px; font-weight: 600; color: var(--ink-900); }
.empty p { font-size: 13.5px; color: var(--ink-500); max-width: 340px; }
.empty .btn { margin-block-start: 14px; }

/* ============================================================
   Steppers / progress
   ============================================================ */
.progress { height: 6px; border-radius: var(--r-pill); background: var(--wash); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--red-500); transition: width .3s ease; }
.progress--gold i { background: var(--gold-500); }
.progress--green i { background: var(--green-500); }

/* ============================================================
   Avatar
   ============================================================ */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--red-50); color: var(--red-600);
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
  border: 1px solid var(--red-100);
}
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.avatar--lg { width: 52px; height: 52px; font-size: 17px; }
.avatar--xl { width: 72px; height: 72px; font-size: 23px; }
.avatar--ink { background: var(--wash); color: var(--ink-600); border-color: var(--line); }
.avatar--gold { background: var(--gold-50); color: var(--gold-600); border-color: var(--gold-100); }
.avatar--blue { background: var(--blue-50); color: var(--blue-600); border-color: transparent; }
.avatar--green { background: var(--green-50); color: var(--green-600); border-color: transparent; }

/* Icon tile */
.tile {
  width: 44px; height: 44px; flex: none;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--red-50); color: var(--red-500);
}
.tile .icon { width: 21px; height: 21px; }
.tile--gold { background: var(--gold-50); color: var(--gold-600); }
.tile--green { background: var(--green-50); color: var(--green-600); }
.tile--blue { background: var(--blue-50); color: var(--blue-600); }
.tile--ink { background: var(--wash); color: var(--ink-600); }
.tile--lg { width: 52px; height: 52px; border-radius: var(--r-lg); }
.tile--lg .icon { width: 24px; height: 24px; }

/* ============================================================
   Utilities
   ============================================================ */
.divider-v { width: 1px; align-self: stretch; background: var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hide { display: none !important; }

.scroll-x {
  display: flex; gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-block-end: 6px;
  scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { scroll-snap-align: start; flex: none; }

/* Crosshair registration mark (brand motif) */
.reg-mark { position: relative; width: 14px; height: 14px; flex: none; opacity: .5; }
.reg-mark::before, .reg-mark::after { content: ""; position: absolute; background: currentColor; }
.reg-mark::before { inset-inline: 0; inset-block-start: 50%; height: 1px; }
.reg-mark::after { inset-block: 0; inset-inline-start: 50%; width: 1px; }

/* Placeholder imagery — striped, labelled */
.ph {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background:
    repeating-linear-gradient(45deg, #F1F1ED 0 10px, #EBEBE6 10px 20px);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  min-height: 120px;
}
.ph::after {
  content: attr(data-ph);
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-500);
  background: rgba(255,255,255,.85);
  padding: 5px 10px; border-radius: var(--r-xs);
  border: 1px solid var(--line);
}
