/* ==========================================================================
   Pentco Automart — shared design system
   Used by the public website (site.css) and the admin (admin.css).
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-vf.woff2") format("woff2-variations"), url("../fonts/archivo-vf.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-vf.woff2") format("woff2-variations"), url("../fonts/inter-vf.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --yellow: #FFE600;
  --yellow-600: #F2D900;
  --yellow-100: #FFF7B0;
  --yellow-50: #FFFCE0;
  --black: #010101;
  --grey: #9A9C9F;
  --white: #FFFFFF;

  /* Neutrals */
  --ink: #010101;
  --ink-2: #2D2E30;
  --ink-3: #5B5D61;      /* muted text — 6.6:1 on white */
  --line: #E6E6E2;
  --line-2: #D3D3CE;
  --surface: #F7F7F4;
  --surface-2: #EEEEEA;
  --surface-dark: #111112;

  /* Status */
  --success: #11734A;
  --success-bg: #E7F4EC;
  --warning: #8A5300;
  --warning-bg: #FFF3D1;
  --danger: #B42318;
  --danger-bg: #FDECEA;
  --info: #1D4FB8;
  --info-bg: #EAF0FC;

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-2xs: 0.6875rem;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: clamp(1.625rem, 1.3rem + 1.1vw, 2.125rem);
  --fs-3xl: clamp(2rem, 1.45rem + 2.2vw, 3.125rem);
  --fs-display: clamp(2.5rem, 1.5rem + 4.2vw, 5rem);

  /* Space (4px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* Shape & depth */
  --r-sm: 2px;
  --r: 4px;
  --r-lg: 8px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(1, 1, 1, 0.05);
  --shadow-pop: 0 24px 56px -16px rgba(1, 1, 1, 0.25), 0 2px 8px rgba(1, 1, 1, 0.06);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 120ms;
  --dur-2: 220ms;
  --dur-3: 420ms;

  /* Layout */
  --container: 1320px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;

  color-scheme: light;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.015em; font-stretch: 108%; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
dl, dd { margin: 0; }
table { border-collapse: collapse; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-8) 0; }
[hidden] { display: none !important; }
::selection { background: var(--yellow); color: var(--black); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; border-radius: var(--r-sm); }
.on-dark :focus-visible, .is-dark :focus-visible { outline-color: var(--yellow); }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; stroke: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 1000; padding: 12px 16px;
  background: var(--black); color: var(--yellow); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; font-stretch: 118%; color: var(--ink-3);
}
.eyebrow::before { content: ""; width: 18px; height: 3px; background: var(--yellow); }
.on-dark .eyebrow { color: rgba(255, 255, 255, 0.72); }
.h-display { font-size: var(--fs-display); font-weight: 760; letter-spacing: -0.03em; line-height: 0.98; font-stretch: 112%; }
.h1 { font-size: var(--fs-3xl); letter-spacing: -0.025em; }
.h2 { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
.h3 { font-size: var(--fs-xl); }
.h4 { font-size: var(--fs-lg); }
.lead { font-size: var(--fs-md); line-height: 1.6; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; }
.prose { max-width: 68ch; color: var(--ink-2); }
.prose p + p { margin-top: 1em; }
.prose a { color: var(--black); }
.link { color: var(--black); font-weight: 600; text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; transition: text-decoration-color var(--dur-2) var(--ease); }
.link:hover { text-decoration-color: var(--black); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.link-arrow .icon { transition: transform var(--dur-2) var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 44px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 20px;
  font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600; line-height: 1; letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap;
  color: var(--black); background: var(--white);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { border-color: var(--black); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--yellow); border-color: var(--yellow); }
.btn--primary:hover { background: var(--black); border-color: var(--black); color: var(--yellow); }
.btn--dark { background: var(--black); border-color: var(--black); color: var(--white); }
.btn--dark:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn--outline { background: transparent; border-color: var(--black); }
.btn--outline:hover { background: var(--black); color: var(--white); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: var(--white); }
.btn--danger:hover { background: #8f1c13; border-color: #8f1c13; }
.btn--light { background: var(--white); border-color: var(--white); }
.btn--light:hover { background: var(--yellow); border-color: var(--yellow); }
.btn--on-dark { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.4); }
.btn--on-dark:hover { border-color: var(--yellow); color: var(--yellow); }
.btn--whatsapp .icon { color: #128C4B; }
.btn--whatsapp:hover { border-color: #128C4B; }
.btn--sm { --btn-h: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.btn--xs { --btn-h: 30px; padding: 0 10px; font-size: var(--fs-xs); gap: 6px; }
.btn--lg { --btn-h: 52px; padding: 0 28px; font-size: var(--fs-base); }
.btn--icon { width: var(--btn-h); padding: 0; }
.btn--block { width: 100%; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
  border: 2px solid currentColor; border-color: var(--black) var(--black) transparent transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.btn--dark.is-loading::after, .btn--danger.is-loading::after { border-color: #fff #fff transparent transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); display: flex; align-items: baseline; gap: 6px; }
.field__label .req { color: var(--danger); font-weight: 700; }
.field__label .opt { color: var(--ink-3); font-weight: 400; font-size: var(--fs-xs); }
.field__hint { font-size: 0.8125rem; color: var(--ink-3); }
.field__error { font-size: 0.8125rem; color: var(--danger); font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.field__error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; }

.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 12px;
  font-size: 1rem; line-height: 1.3;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease);
  appearance: none; -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: #8b8d91; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--grey); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.65); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface); color: var(--ink-3); cursor: not-allowed; }
.textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select {
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23010101' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.select[multiple] { height: auto; padding: 6px; background-image: none; }
.input--sm, .select--sm { height: 36px; font-size: var(--fs-sm); }
.is-invalid .input, .is-invalid .select, .is-invalid .textarea, .input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.is-invalid .input:focus, .input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18); }

.input-group { display: flex; align-items: stretch; }
.input-group__addon {
  display: inline-flex; align-items: center; padding: 0 12px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3);
  background: var(--surface); border: 1px solid var(--line-2); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.input-group__addon--end { border-right: 1px solid var(--line-2); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group .input:not(:last-child) { border-radius: var(--r-sm) 0 0 var(--r-sm); }

.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; width: 18px; height: 18px; }
.input-icon > .input { padding-left: 40px; }

.form-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.form-grid > * { grid-column: span 12; }
@media (min-width: 640px) {
  .form-grid .span-6 { grid-column: span 6; }
  .form-grid .span-4 { grid-column: span 4; }
  .form-grid .span-3 { grid-column: span 6; }
  .form-grid .span-8 { grid-column: span 8; }
}
@media (min-width: 1024px) { .form-grid .span-3 { grid-column: span 3; } }

/* Checkbox / radio */
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: var(--fs-sm); line-height: 1.35; min-height: 24px; }
.check input[type="checkbox"], .check input[type="radio"] {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 18px; height: 18px; margin: 1px 0 0;
  border: 1.5px solid var(--line-2); background: var(--white); border-radius: var(--r-sm);
  display: inline-grid; place-items: center; cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.check input[type="radio"] { border-radius: 50%; }
.check:hover input:not(:disabled) { border-color: var(--black); }
.check input::after { content: ""; opacity: 0; transform: scale(0.6); transition: opacity var(--dur-1) var(--ease), transform var(--dur-2) var(--ease-out); }
.check input[type="checkbox"]::after { width: 10px; height: 6px; border-left: 2px solid var(--black); border-bottom: 2px solid var(--black); transform: translateY(-1px) rotate(-45deg) scale(0.6); }
.check input[type="radio"]::after { width: 8px; height: 8px; border-radius: 50%; background: var(--black); }
.check input:checked { background: var(--yellow); border-color: var(--black); }
.check input:checked::after { opacity: 1; transform: scale(1); }
.check input[type="checkbox"]:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.check input:focus-visible { box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.8); outline: 2px solid var(--black); outline-offset: 1px; }
.check input:disabled { background: var(--surface); cursor: not-allowed; }
.check:has(input:disabled:not(:checked)) { color: var(--ink-3); cursor: not-allowed; opacity: 0.55; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); font-weight: 500; }
.switch input {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 38px; height: 22px; margin: 0;
  border-radius: var(--r-pill); background: var(--line-2); cursor: pointer; transition: background-color var(--dur-2) var(--ease);
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform var(--dur-2) var(--ease-out);
}
.switch input:checked { background: var(--black); }
.switch input:checked::after { transform: translateX(16px); background: var(--yellow); }
.switch input:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

/* Segmented control */
.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 2px; background: var(--white); }
.segmented button, .segmented a, .segmented label {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; background: transparent;
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3); border-radius: 1px; text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.segmented [aria-pressed="true"], .segmented [aria-current="true"], .segmented .is-active, .segmented input:checked + span { background: var(--black); color: var(--white); }
.segmented label { padding: 0; }
.segmented label span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 1px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px;
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1;
  color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm); white-space: nowrap;
}
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--available { color: var(--success); }
.badge--available::before { background: var(--success); }
.badge--arriving { color: var(--info); }
.badge--arriving::before { background: var(--info); }
.badge--reserved { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.badge--sold { background: var(--black); border-color: var(--black); color: var(--white); }
.badge--draft { background: var(--surface-2); border-color: var(--surface-2); color: var(--ink-2); }
.badge--published { background: var(--success-bg); border-color: var(--success-bg); color: var(--success); }
.badge--archived { background: var(--surface); border-color: var(--line); color: var(--ink-3); }
.badge--demo { border-style: dashed; border-color: var(--ink-3); color: var(--ink-2); background: rgba(255,255,255,0.92); }
.badge--featured { background: var(--black); border-color: var(--black); color: var(--yellow); }
.badge--new { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.badge--warning { background: var(--warning-bg); border-color: var(--warning-bg); color: var(--warning); }
.badge--danger { background: var(--danger-bg); border-color: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); border-color: var(--info-bg); color: var(--info); }
.badge--success { background: var(--success-bg); border-color: var(--success-bg); color: var(--success); }
.badge--muted { background: var(--surface); border-color: var(--line); color: var(--ink-3); }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink); text-decoration: none;
  background: var(--yellow-50); border: 1px solid #E8D400; border-radius: var(--r-sm);
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  animation: chip-in var(--dur-2) var(--ease-out);
}
.chip .icon { width: 16px; height: 16px; padding: 2px; border-radius: 1px; transition: background-color var(--dur-1) var(--ease); }
.chip:hover { background: var(--yellow); border-color: var(--black); }
.chip:hover .icon { background: rgba(0,0,0,.08); }
.chip--plain { background: var(--white); border-color: var(--line-2); padding-right: 12px; }
@keyframes chip-in { from { opacity: 0; transform: scale(0.94); } }

/* ---------- Cards & panels ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm); }
.card__body { padding: var(--sp-6); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--line); }
.card__title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 700; }
.card__foot { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--line); background: var(--surface); }

/* Definition list (specifications) */
.spec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); border-top: 1px solid var(--line); }
.spec-list > div { display: flex; justify-content: space-between; gap: var(--sp-4); padding: 14px 0; border-bottom: 1px solid var(--line); margin-right: var(--sp-6); }
.spec-list dt { color: var(--ink-3); font-size: var(--fs-sm); }
.spec-list dd { font-weight: 600; font-size: var(--fs-sm); text-align: right; }
.spec-list .is-unknown dd { color: var(--ink-3); font-weight: 400; font-style: italic; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; padding: 10px 14px; white-space: nowrap;
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background-color var(--dur-1) var(--ease); }
.table tbody tr:hover { background: #FBFBF9; }
.table tbody tr.is-selected { background: var(--yellow-50); }
.table .col-check { width: 44px; }
.table .num, .table .right { text-align: right; }
.table--compact td { padding: 8px 12px; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; font-size: var(--fs-sm); border-left: 3px solid var(--black); background: var(--surface); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.alert .icon { margin-top: 1px; }
.alert--success { border-color: var(--success); background: var(--success-bg); }
.alert--error { border-color: var(--danger); background: var(--danger-bg); }
.alert--warning { border-color: #D19A00; background: var(--warning-bg); }
.alert--info { border-color: var(--info); background: var(--info-bg); }
.alert--yellow { border-color: var(--black); background: var(--yellow-50); }
.alert strong { font-weight: 600; }

/* ---------- Empty / loading states ---------- */
.empty { display: grid; justify-items: center; gap: var(--sp-3); text-align: center; padding: var(--sp-16) var(--sp-6); border: 1px dashed var(--line-2); border-radius: var(--r-sm); background: var(--white); }
.empty__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); }
.empty__icon .icon { width: 26px; height: 26px; }
.empty__title { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 700; }
.empty p { max-width: 52ch; color: var(--ink-3); }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line-2); border-top-color: var(--black); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }

.progress { height: 4px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--black); transition: width var(--dur-2) var(--ease); }

/* ---------- Modals & drawers (native <dialog>) ---------- */
.modal, .drawer {
  padding: 0; border: 0; color: var(--ink); background: var(--white); max-width: none; max-height: none;
}
.modal::backdrop, .drawer::backdrop { background: rgba(1, 1, 1, 0.5); backdrop-filter: blur(2px); }
.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto;
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; display: none; flex-direction: column;
}
.modal[open] { display: flex; animation: modal-in var(--dur-3) var(--ease-out); }
.modal[open]::backdrop { animation: fade-in var(--dur-2) var(--ease); }
.modal.is-closing { animation: modal-out var(--dur-2) var(--ease) forwards; }
.modal.is-closing::backdrop { animation: fade-out var(--dur-2) var(--ease) forwards; }
.modal--wide { width: min(880px, calc(100vw - 32px)); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--line); }
.modal__title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; }
.modal__body { padding: var(--sp-6); overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--line); background: var(--surface); }

.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(440px, 100vw); height: 100dvh; margin: 0 0 0 auto;
  display: none; flex-direction: column; box-shadow: var(--shadow-pop);
}
.drawer--left { inset: 0 auto 0 0; margin: 0 auto 0 0; }
.drawer--full { width: 100vw; }
.drawer[open] { display: flex; animation: drawer-in var(--dur-3) var(--ease-out); }
.drawer--left[open] { animation-name: drawer-in-left; }
.drawer[open]::backdrop { animation: fade-in var(--dur-2) var(--ease); }
.drawer.is-closing { animation: drawer-out var(--dur-2) var(--ease) forwards; }
.drawer--left.is-closing { animation-name: drawer-out-left; }
.drawer.is-closing::backdrop { animation: fade-out var(--dur-2) var(--ease) forwards; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); min-height: 64px; }
.drawer__title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-5); overscroll-behavior: contain; }
.drawer__foot { display: flex; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); background: var(--white); padding-bottom: max(var(--sp-4), env(safe-area-inset-bottom)); }

@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes drawer-out { to { transform: translateX(100%); } }
@keyframes drawer-in-left { from { transform: translateX(-100%); } }
@keyframes drawer-out-left { to { transform: translateX(-100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

body.has-dialog { overflow: hidden; }

/* ---------- Dropdown menu ---------- */
.menu { position: relative; display: inline-block; }
.menu__list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 200px; padding: 6px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(-4px) scale(0.98); transform-origin: top right; pointer-events: none; visibility: hidden;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
}
.menu.is-open .menu__list { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; font-size: var(--fs-sm); text-align: left;
  color: var(--ink); background: none; border: 0; border-radius: var(--r-sm); text-decoration: none; cursor: pointer;
}
.menu__item:hover, .menu__item:focus-visible { background: var(--surface); outline: none; }
.menu__item--danger { color: var(--danger); }
.menu__sep { height: 1px; margin: 6px 0; background: var(--line); }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; z-index: 1000; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; pointer-events: auto;
  background: var(--black); color: var(--white); border-radius: var(--r); box-shadow: var(--shadow-pop); font-size: var(--fs-sm);
  animation: toast-in var(--dur-3) var(--ease-out);
}
.toast.is-leaving { animation: toast-out var(--dur-2) var(--ease) forwards; }
.toast__icon { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); color: var(--black); }
.toast__icon .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.toast--error .toast__icon { background: #F97066; }
.toast__msg { flex: 1; }
.toast__action { flex: none; padding: 6px 10px; font-weight: 700; color: var(--yellow); background: transparent; border: 1px solid rgba(255,230,0,.4); border-radius: var(--r-sm); }
.toast__action:hover { background: rgba(255,230,0,.12); }
.toast__close { flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: rgba(255,255,255,.7); background: none; border: 0; border-radius: var(--r-sm); }
.toast__close:hover { color: #fff; background: rgba(255,255,255,.08); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Disclosure (animated accordion) ---------- */
.disclosure__panel { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--dur-3) var(--ease-out); }
.disclosure__panel > div { overflow: hidden; min-height: 0; }
.disclosure.is-collapsed .disclosure__panel { grid-template-rows: 0fr; }
.disclosure__toggle .icon { transition: transform var(--dur-2) var(--ease); }
.disclosure.is-collapsed .disclosure__toggle .icon { transform: rotate(-90deg); }

/* ---------- Tabs / stepper ---------- */
.stepper { display: flex; gap: 0; counter-reset: step; border-bottom: 1px solid var(--line); overflow-x: auto; }
.stepper__item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 20px 14px 0; margin-right: 24px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); text-decoration: none; white-space: nowrap;
}
.stepper__num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); font-size: var(--fs-xs); font-weight: 700; }
.stepper__item.is-current { color: var(--ink); }
.stepper__item.is-current::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--yellow); }
.stepper__item.is-current .stepper__num { background: var(--black); border-color: var(--black); color: var(--yellow); }
.stepper__item.is-done .stepper__num { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.stepper__item[aria-disabled="true"] { pointer-events: none; opacity: 0.5; }

/* ---------- Reveal motion (only when JS is available) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); transition-delay: calc(min(var(--i, 0), 6) * 60ms); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Utilities ---------- */
.stack > * + * { margin-top: var(--stack, var(--sp-4)); }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.wrap { flex-wrap: wrap; }
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.w-full { width: 100%; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--line); }
.kbd { display: inline-block; padding: 1px 6px; font-size: var(--fs-xs); font-family: ui-monospace, monospace; background: var(--surface-2); border-radius: var(--r-sm); border: 1px solid var(--line); }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.92em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .skeleton::after { display: none; }
}
