/* دفتر کل — base (T1). Components: components.css (T2). */

:root {
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 48px;
  --s-12: 64px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 36px;
  --sh-1: 0 1px 2px rgba(26, 42, 46, .06);
  --sh-2: 0 8px 24px -8px rgba(26, 42, 46, .18);
  --sh-3: 0 24px 48px -12px rgba(26, 42, 46, .3);
  --rail-w: 264px;
  --rail-w-collapsed: 72px;
  --topbar-h: 64px;
  --content-max: 1440px;
  --gutter: 32px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: 150ms;
  --focus: 0 0 0 3px var(--accent-soft);
  --paper: #F6F4EE;
  --surface: #FFFFFF;
  --surface-2: #F1EEE6;
  --ink: #14201D;
  --ink-2: #3A4A45;
  --muted: #6B7A74;
  --line: #E4DFD3;
  --line-strong: #CFC8B8;
  --accent: #0B6B5D;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3F1EC;
  --ok: #1F7A4D;
  --ok-soft: #E5F4EA;
  --warn: #A15C07;
  --warn-soft: #FBF0DC;
  --danger: #B4322A;
  --danger-soft: #FBE7E4;
  --info: #2557A7;
  --info-soft: #E6EEFA;
  --seal: #8E2B2B;
  color-scheme: light;
}
/* 2. Themes */
html[data-theme="dark"] {
  --paper: #0D1412;
  --surface: #131D1A;
  --surface-2: #18231F;
  --ink: #E6EEE9;
  --ink-2: #B4C2BB;
  --muted: #7F918A;
  --line: #23302B;
  --line-strong: #2F403A;
  --accent: #3FD3A5;
  --accent-ink: #06231B;
  --accent-soft: #12372E;
  --ok: #4ADE9A;
  --ok-soft: #15382b;
  --warn: #F2B13C;
  --warn-soft: #382e1b;
  --danger: #FF7A70;
  --danger-soft: #402522;
  --info: #7DB1FF;
  --info-soft: #1c3044;
  --seal: #FF7A70;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) { --paper: #0D1412;
  --surface: #131D1A;
  --surface-2: #18231F;
  --ink: #E6EEE9;
  --ink-2: #B4C2BB;
  --muted: #7F918A;
  --line: #23302B;
  --line-strong: #2F403A;
  --accent: #3FD3A5;
  --accent-ink: #06231B;
  --accent-soft: #12372E;
  --ok: #4ADE9A;
  --ok-soft: #15382b;
  --warn: #F2B13C;
  --warn-soft: #382e1b;
  --danger: #FF7A70;
  --danger-soft: #402522;
  --info: #7DB1FF;
  --info-soft: #1c3044;
  --seal: #FF7A70;
  color-scheme: dark;
}
}
@media (max-width: 1279px) { :root { --gutter: 24px; }
}
@media (max-width: 767px) { :root { --gutter: 16px; }
}
@media (max-width: 639px) { :root { --topbar-h: 56px; }
}
/* 3. Reset / type */
@font-face {
  font-family: Vazirmatn;
  src: url("/fonts/vazirmatn/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: JetBrains;
  src: url("/fonts/jetbrains-mono/JetBrainsMono-Variable-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
*, *::before, *::after { box-sizing: border-box; }
html {
  font-family: Vazirmatn, sans-serif;
  font-size: var(--fs-base);
  font-feature-settings: "ss01";
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  overflow-x: clip;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--fs-2xl); line-height: 36px; font-weight: 700; }
h2 { font-size: var(--fs-md); line-height: 24px; font-weight: 600; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea { min-height: 88px; resize: vertical; }
select {
  appearance: none;
  padding-inline-end: 36px;
  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='%236B7A74' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input:active, select:active, textarea:active { border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled, button:disabled, [aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
small { font-size: var(--fs-xs); line-height: 18px; color: var(--muted); }
code, kbd { font-family: JetBrains, monospace; direction: ltr; unicode-bidi: isolate; }
code { overflow-wrap: anywhere; }
img, svg { max-width: 100%; height: auto; }
:focus:not(:focus-visible) { outline: none; }
@media (pointer: coarse) {
  input, select, textarea, .a-btn, .a-button, .a-icon-button, .a-nav__link, .a-chip { min-height: 44px;
}
}
@media (max-width: 639px) { h1 { font-size: var(--fs-xl); line-height: 30px; }
}
/* 4. Shell */
.a-skip {
  position: fixed;
  inset-block-start: -100px;
  inset-inline-start: var(--s-4);
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-md);
}
.a-skip:focus { inset-block-start: var(--s-2); }
.a-shell { display: flex; min-height: 100vh; min-width: 0; }
.a-rail {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  flex: none;
  gap: var(--s-6);
  width: var(--rail-w);
  height: 100vh;
  padding: var(--s-6) var(--s-3);
  overflow-x: hidden;
  overflow-y: auto;
  color: #C9D6D1;
  background: #10201C;
  transition: width var(--dur) var(--ease);
}
html[data-theme="dark"] .a-rail { background: #0A100E; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .a-rail { background: #0A100E; }
}
.a-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-1) var(--s-3) var(--s-3);
  min-width: 0;
}
.a-brand__seal { width: 42px; height: 42px; flex: none; color: #efb3ab; transform: rotate(-4deg); }
.a-brand__words { display: grid; min-width: 0; }
.a-brand__words > span { display: block; }
.a-brand strong { color: #fff; font-size: var(--fs-xl); line-height: 1.2; }
.a-brand span { font-size: var(--fs-xs); color: #C9D6D1; }
.a-nav { display: grid; gap: var(--s-1); min-width: 0; }
.a-nav__group + .a-nav__group { margin-top: var(--s-4); }
.a-nav__heading {
  padding: var(--s-3);
  color: #9aada4;
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 20px;
}
.a-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 40px;
  padding: 10px 12px;
  color: #C9D6D1;
  border-radius: var(--r-md);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.a-nav__link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.a-nav__link.a-active, .a-nav__link[aria-current="page"] {
  color: #3FD3A5;
  font-weight: 700;
  background: rgba(63, 211, 165, .14);
}
.a-nav__link.a-active::before, .a-nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset-inline-start: -12px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 2px;
  background: #3FD3A5;
}
.a-rail__toggle {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 40px;
  padding: var(--s-3);
  color: #C9D6D1;
  border-radius: var(--r-md);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.a-rail__toggle:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.a-rail__close, .a-drawer-open, .a-drawer-scrim { display: none; }
.a-icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.a-icon svg { width: 100%; height: 100%; }
html[data-rail="collapsed"] .a-rail { width: var(--rail-w-collapsed); }
html[data-rail="collapsed"] .a-brand__words, html[data-rail="collapsed"] .a-nav__heading, html[data-rail="collapsed"] .a-nav__link span:not(.a-icon), html[data-rail="collapsed"] .a-rail__toggle span:not(.a-icon) {
  display: none;
}
html[data-rail="collapsed"] .a-brand, html[data-rail="collapsed"] .a-nav__link, html[data-rail="collapsed"] .a-rail__toggle {
  justify-content: center;
  padding-inline: 0;
}
.a-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.a-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  height: var(--topbar-h);
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.a-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  width: min(420px, 50%);
  min-height: 40px;
  padding-inline: var(--s-3);
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.a-search-trigger:hover { background: var(--surface-2); border-color: var(--line-strong); }
.a-search-trigger:active { background: var(--surface-2); }
.a-search-trigger kbd {
  margin-inline-start: auto;
  padding: 0 4px;
  font-size: var(--fs-xs);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.a-topbar__actions { display: flex; align-items: center; gap: var(--s-4); min-width: 0; }
.a-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-width: 40px;
  min-height: 40px;
  padding: var(--s-2);
  color: var(--ink-2);
  border-radius: var(--r-md);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.a-icon-button:hover { background: var(--surface-2); color: var(--ink); }
.a-icon-button:active { background: var(--line); }
.a-admin-menu { position: relative; }
.a-admin-menu summary {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  list-style: none;
  cursor: pointer;
  min-height: 40px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.a-admin-menu summary::-webkit-details-marker { display: none; }
.a-admin-menu > div {
  position: absolute;
  inset-inline-end: 0;
  z-index: 5;
  display: grid;
  gap: var(--s-2);
  min-width: 180px;
  max-width: min(280px, 90vw);
  margin-top: var(--s-2);
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
}
.a-admin-menu button { padding: var(--s-2) 0; text-align: start; color: var(--ink); }
.a-admin-menu button:hover { color: var(--accent); }
.a-content {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--s-6) var(--gutter);
  min-width: 0;
}
@media (max-width: 1023px) {
  .a-rail, html[data-rail="collapsed"] .a-rail { position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  inset-inline-end: auto;
  width: var(--rail-w);
  max-width: 85vw;
  visibility: hidden;
  transform: translateX(110%);
  box-shadow: var(--sh-3);
  transition: transform 200ms var(--ease), visibility 200ms var(--ease);
}
html[dir="rtl"] .a-rail, html[dir="rtl"][data-rail="collapsed"] .a-rail { transform: translateX(-110%); }
html[data-drawer="open"] .a-rail { visibility: visible; transform: none; }
html[data-drawer="open"] .a-rail .a-brand__words, html[data-drawer="open"] .a-rail .a-nav__heading, html[data-drawer="open"] .a-rail .a-nav__link span:not(.a-icon) {
  display: revert;
}
html[data-drawer="open"] .a-rail .a-brand, html[data-drawer="open"] .a-rail .a-nav__link, html[data-drawer="open"] .a-rail .a-rail__toggle {
  justify-content: flex-start;
  padding-inline: 12px;
}
.a-rail__toggle { display: none; }
.a-drawer-open, .a-rail__close { display: inline-flex; }
.a-rail__close { position: absolute; top: 20px; inset-inline-end: 12px; color: #fff; }
.a-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  border: 0;
  background: rgba(13, 20, 18, .6);
}
html[data-drawer="open"] .a-drawer-scrim { display: block; }
.a-search-trigger { width: auto; flex: 1; min-width: 0; }
.a-search-trigger kbd { display: none; }
}
@media (min-width: 1024px) { .a-drawer-open, .a-rail__close, .a-drawer-scrim { display: none !important; }
.a-rail .a-brand__words { display: grid; }
html[data-rail="collapsed"] .a-brand__words { display: none; }
}
/* 5. Page header */
.a-page-header, .a-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.a-page-header__title, .a-header h1 { font-size: var(--fs-2xl); line-height: 36px; font-weight: 700; }
.a-page-header__subtitle, .a-header .a-muted { margin-top: var(--s-1); }
.a-page-header__crumbs, .a-crumbs {
  font-size: var(--fs-xs);
  line-height: 18px;
  color: var(--muted);
  margin-bottom: var(--s-2);
}
.a-crumbs a:hover { color: var(--accent); }
.a-page-header__actions, .a-header > :last-child:not(:first-child) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  max-width: 100%;
}
.a-page-header__actions .a-segmented,
.a-header > :last-child:not(:first-child) .a-segmented {
  max-width: 100%;
  overflow-x: auto;
}
.a-section { display: grid; gap: var(--s-6); min-width: 0; }
.a-section-title { font-size: var(--fs-md); line-height: 24px; font-weight: 600; }
.a-link { color: var(--accent); transition: color var(--dur) var(--ease); }
.a-link:hover { color: var(--ink); }
.a-p-error-code {
  font-size: clamp(64px, 18vw, 120px);
  line-height: 1;
  font-weight: 700;
  color: var(--line-strong);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 639px) {
  .a-page-header, .a-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .a-page-header__title, .a-header h1 {
    font-size: var(--fs-xl);
    line-height: 30px;
  }
  .a-page-header__actions,
  .a-header > :last-child:not(:first-child) {
    flex: 1 1 100%;
    width: 100%;
  }
}
/* 6. Layout */
.a-stack { display: flex; flex-direction: column; gap: var(--gap, var(--s-4)); min-width: 0; }
.a-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--s-3)); min-width: 0; }
.a-grid { display: grid; gap: var(--gap, var(--s-4)); min-width: 0; }
.a-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.a-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.a-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.a-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: var(--s-6);
  min-width: 0;
}
.a-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  min-width: 0;
}
@media (max-width: 1023px) { .a-split { grid-template-columns: 1fr; }
.a-grid--3, .a-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) { .a-grid--2, .a-grid--3, .a-grid--4 { grid-template-columns: 1fr; }
}
/* 7. Forms */
.a-form-section {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  min-width: 0;
}
.a-form-section > .a-section-title { padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); }
.a-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4) var(--s-5);
  min-width: 0;
}
.a-form-grid__full { grid-column: 1 / -1; }
.a-field { display: grid; gap: 6px; min-width: 0; }
.a-field__label, .a-field > label {
  font-size: var(--fs-sm);
  line-height: 20px;
  font-weight: 500;
  color: var(--ink);
}
.a-field__hint, .a-field > small:not(.a-field__error) {
  font-size: var(--fs-xs);
  line-height: 18px;
  color: var(--muted);
}
.a-field__error { color: var(--danger); }
.a-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.a-fieldset > legend { padding: 0; margin-bottom: var(--s-3); font-size: var(--fs-sm); font-weight: 500; }
.a-radio-card {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.a-radio-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.a-radio-card:has(:checked), .a-radio-card[aria-checked="true"], .a-radio-card[data-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--focus);
}
.a-radio-card:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.a-radio-card input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
.a-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.a-sticky-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
@media (max-width: 767px) { .a-form-grid { grid-template-columns: 1fr; }
.a-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin-inline: calc(var(--gutter) * -1);
  margin-bottom: calc(var(--s-6) * -1);
  border-radius: 0;
  border-inline: 0;
  border-bottom: 0;
  box-shadow: var(--sh-2);
  padding-inline: var(--gutter);
  justify-content: flex-end;
}
}
@media (max-width: 639px) { .a-form-section { padding: var(--s-4); }
}
/* 8. Buttons */
.a-btn, .a-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  line-height: 1.2;
  transition: filter var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.a-btn:hover, .a-button:hover { filter: brightness(.94); }
.a-btn:active, .a-button:active { filter: brightness(.88); }
.a-btn--primary, .a-button--primary { background: var(--accent); color: var(--accent-ink); }
.a-btn--secondary, .a-button--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  filter: none;
}
.a-btn--secondary:hover, .a-button--secondary:hover { background: var(--surface-2); filter: none; }
.a-btn--ghost, .a-button--ghost { background: transparent; color: var(--ink-2); filter: none; }
.a-btn--ghost:hover, .a-button--ghost:hover { background: var(--surface-2); color: var(--ink); filter: none; }
.a-btn--danger, .a-button--danger { background: var(--danger); color: #fff; }
.a-btn--sm, .a-button--sm { min-height: 32px; padding: 5px 10px; font-size: var(--fs-xs); }
.a-btn--block, .a-button--block { width: 100%; }
.a-btn:disabled, .a-button:disabled, .a-btn[aria-disabled="true"], .a-button[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  filter: none;
}
.a-btn[aria-busy="true"]::before, .a-button[aria-busy="true"]::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: a-spin .7s linear infinite;
}
@keyframes a-spin { to { transform: rotate(360deg); }
}
/* 9. Tables */
.a-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.a-table { width: 100%; border-collapse: collapse; text-align: start; }
.a-table th, .a-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: middle;
}
.a-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 40px;
  padding-block: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 40px;
  color: var(--muted);
  background: var(--surface-2);
}
.a-table td { height: 52px; }
.a-table tbody tr:hover { background: var(--surface-2); }
.a-table .a-row { border-inline-start: 4px solid var(--line-strong); }
.a-table .a-row[data-tone="ok"] { border-color: var(--ok); }
.a-table .a-row[data-tone="warn"] { border-color: var(--warn); }
.a-table .a-row[data-tone="danger"] { border-color: var(--danger); }
.a-table .a-row[data-tone="info"] { border-color: var(--info); }
.a-row-link { color: var(--accent); }
.a-row-link:hover { text-decoration: underline; }
.a-num { font-variant-numeric: tabular-nums; text-align: end; }
.a-mono { font-family: JetBrains, monospace; direction: ltr; unicode-bidi: isolate; }
.a-muted { color: var(--muted); }
.a-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.a-ltr { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 767px) {
  .a-table--stack, .a-table--stack tbody, .a-table--stack tr, .a-table--stack td { display: block;
  width: 100%;
  min-width: 0;
}
.a-table-wrap:has(.a-table--stack) { overflow-x: visible; background: transparent; border: 0; box-shadow: none; }
.a-table--stack { min-width: 0; }
.a-table--stack thead { display: none; }
.a-table--stack tbody { display: grid; gap: var(--s-3); }
.a-table--stack tr {
  margin: 0;
  padding: var(--s-2) 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  height: auto;
}
.a-table--stack td {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-3);
  height: auto;
  padding: var(--s-2) var(--s-4);
  border-bottom: 0;
}
.a-table--stack td::before {
  content: attr(data-label);
  flex: none;
  max-width: 45%;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.a-table--stack .a-num { text-align: end; }
}
/* 10. KV / callout / chip / tabs */
.a-kv {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr);
  gap: var(--s-3) var(--s-4);
  min-width: 0;
}
.a-kv dt { color: var(--muted); font-size: var(--fs-sm); line-height: 20px; }
.a-kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 639px) { .a-kv { grid-template-columns: 1fr; gap: var(--s-1) 0; }
.a-kv dt { margin-top: var(--s-3); }
.a-kv dt:first-child { margin-top: 0; }
}
.a-callout {
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--info);
  border-radius: var(--r-md);
  background: var(--info-soft);
  min-width: 0;
}
.a-callout--info { border-inline-start-color: var(--info); background: var(--info-soft); }
.a-callout--ok { border-inline-start-color: var(--ok); background: var(--ok-soft); }
.a-callout--warn { border-inline-start-color: var(--warn); background: var(--warn-soft); }
.a-callout--danger { border-inline-start-color: var(--danger); background: var(--danger-soft); }
.a-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.a-chip:hover { background: var(--surface-2); border-color: var(--line-strong); }
.a-chip:active { background: var(--line); }
.a-chip[aria-pressed="true"], .a-chip[data-active="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.a-chip:disabled { opacity: .5; cursor: not-allowed; }
.a-segmented {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.a-segmented__input,
.a-segmented input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.a-segmented__item,
.a-segmented > label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
  min-width: 0;
  position: relative;
}
.a-segmented__item span,
.a-segmented > label,
.a-segmented > button,
.a-segmented > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.a-segmented__item:hover span,
.a-segmented > label:hover,
.a-segmented > button:hover,
.a-segmented > a:hover {
  color: var(--ink-2);
}
.a-segmented__input:checked + span,
.a-segmented > label:has(input:checked),
.a-segmented > [aria-pressed="true"],
.a-segmented > [aria-current],
.a-segmented > .a-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--sh-1);
}
.a-segmented__input:focus-visible + span,
.a-segmented > label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.a-checks {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.a-checks > label,
.a-checks__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 40px;
  margin: 0;
  cursor: pointer;
}
.a-checks input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: none;
  margin: 0;
  accent-color: var(--accent);
}
.a-meta {
  display: inline;
  font-size: var(--fs-xs);
  line-height: 18px;
  color: var(--muted);
}
.a-tabs {
  display: flex;
  gap: var(--s-4);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.a-tabs a {
  position: relative;
  padding: var(--s-3) var(--s-1);
  white-space: nowrap;
  color: var(--ink-2);
  transition: color var(--dur) var(--ease);
}
.a-tabs a:hover { color: var(--ink); }
.a-tabs a.a-active, .a-tabs a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.a-tabs a.a-active::after, .a-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.a-tabs a span { margin-inline-start: var(--s-1); color: var(--muted); font-variant-numeric: tabular-nums; }
.a-seal {
  display: inline-block;
  color: var(--seal);
  border: 2px solid currentColor;
  border-radius: 4px;
  padding: 1px 8px;
  transform: rotate(-4deg);
  font-weight: 700;
  font-size: var(--fs-xs);
}
.a-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: middle;
}
.a-dot--ok { background: var(--ok); }
.a-dot--warn { background: var(--warn); }
.a-dot--danger { background: var(--danger); }
.a-dot--muted { background: var(--muted); }
.a-danger-zone {
  border: 1px solid var(--danger);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  background: var(--danger-soft);
}
.a-guest {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--s-6);
  min-height: 100dvh;
  padding: var(--s-6);
  position: relative;
}
.a-guest-shell {
  width: min(100%, 400px);
  display: grid;
  gap: var(--s-6);
  justify-items: stretch;
  min-width: 0;
}
.a-guest-form {
  position: static;
  display: grid;
  gap: var(--s-6);
  justify-items: center;
  padding: 0;
  width: 100%;
  min-width: 0;
}
.a-guest-theme {
  position: absolute;
  top: var(--s-4);
  inset-inline-end: var(--s-4);
  z-index: 2;
}
.a-guest > .a-guest-brand,
.a-guest .a-guest-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--ink);
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  height: auto;
  width: auto;
}
.a-guest .a-brand {
  height: auto;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  color: var(--ink);
}
.a-guest-brand__seal,
.a-guest .a-guest-brand .a-brand__seal {
  width: 48px;
  height: 48px;
  flex: none;
  color: var(--seal);
}
.a-guest > .a-guest-brand strong,
.a-guest .a-guest-brand strong {
  color: var(--ink);
  font-size: var(--fs-xl);
  line-height: 1.2;
}
.a-guest > .a-guest-brand .a-brand__words > span,
.a-guest .a-guest-brand .a-brand__words > span {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.a-guest > .a-card,
.a-guest > main {
  width: min(100%, 400px);
}
.a-guest-form > .a-brand,
.a-guest-form > .a-guest-brand-seal,
.a-guest-brand-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: 0;
  color: var(--ink);
}
.a-guest-form > .a-brand .a-brand__seal,
.a-guest-brand-seal .a-brand__seal {
  width: 48px;
  height: 48px;
  color: var(--seal);
}
.a-guest-form > .a-brand strong,
.a-guest-brand-seal strong {
  color: var(--ink);
  font-size: var(--fs-xl);
}
.a-guest-form > .a-brand span,
.a-guest-brand-seal .a-brand__words > span {
  color: var(--muted);
}
.a-guest-form main {
  width: min(100%, 400px);
}
@media (max-width: 639px) {
  .a-guest { padding: var(--s-4); }
  .a-guest > .a-card,
  .a-guest > main,
  .a-guest-shell,
  .a-guest-form main {
    width: 100%;
    max-width: 100%;
  }
}
/* 11. Utilities */
.a-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 767px) { .a-hide-md { display: none !important; }
}
@media (max-width: 639px) { .a-hide-sm { display: none !important; }
.a-admin-menu summary { max-width: 88px; }
.a-topbar__actions { gap: var(--s-1); }
}
/* 12. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
}
/* 13. Print */
@media print {
  .a-rail, .a-topbar, .a-drawer-scrim, .a-btn, .a-button, .a-sticky-actions { display: none !important;
}
.a-content { max-width: none; padding: 0; }
body { background: #fff; color: #000; }
.a-form-section, .a-table-wrap, .a-toolbar { box-shadow: none; border-color: #ccc; }
}
