/* ============================================================================
 * ZIVOX — design system (tokens + primitives)
 * Shared by the public website, the intern portal and the admin dashboard.
 * Ported from the approved UI/UX handoff design tokens.
 * ==========================================================================*/

/* The [hidden] attribute must always win over a class-based display
   (e.g. .app { display: grid }), otherwise hidden views still render. */
[hidden] { display: none !important; }

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --bg: #f4f6fb;
  --bg-2: #eef2fa;
  --ink: #0c1427;
  --ink-2: #2e3b57;
  --muted: #5a6884;
  --faint: #8a96ac;
  --line: rgba(20, 40, 90, 0.10);
  --line-2: rgba(20, 40, 90, 0.06);

  /* Brand */
  --brand: #1d6ff2;
  --brand-ink: #1657c9;
  --sky: #0ea5e9;
  --violet: #7c3aed;
  --violet-2: #8b5cf6;
  --grad: linear-gradient(120deg, #1d6ff2 0%, #4f63f3 50%, #8b5cf6 100%);
  --grad-soft: linear-gradient(120deg, rgba(29, 111, 242, 0.10), rgba(139, 92, 246, 0.10));
  --grad-text: linear-gradient(100deg, #1d6ff2, #7c3aed);
  --cta-grad: linear-gradient(125deg, #1d5fe8 0%, #3f5cf0 45%, #7c45ec 100%);
  --accent-stat: linear-gradient(140deg, #1d62ea, #5a4ff0 60%, #8b5cf6);
  --ok-grad: linear-gradient(140deg, #16a34a, #0e8a5f);

  /* Glass */
  --glass: rgba(255, 255, 255, 0.62);
  --glass-2: rgba(255, 255, 255, 0.80);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --blur: 18px;

  /* Status */
  --ok: #137a3e;        --ok-bg: #e7f6ed;
  --warn: #a85a06;      --warn-bg: #fff3df;
  --vio: #6531c9;       --vio-bg: #f0eaff;
  --bad: #c0262d;       --bad-bg: #fdeced;
  --info: #1d62d6;      --info-bg: #e8f0ff;
  --neu: #4b5873;       --neu-bg: #eef1f6;

  /* Radii */
  --r-xs: 8px; --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px; --pill: 999px;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(16, 30, 70, .05), 0 1px 1px rgba(16, 30, 70, .03);
  --sh-2: 0 1px 2px rgba(16, 30, 70, .04), 0 6px 18px -6px rgba(16, 30, 70, .10);
  --sh-3: 0 2px 4px rgba(16, 30, 70, .04), 0 18px 40px -14px rgba(16, 30, 70, .18);
  --sh-4: 0 4px 10px rgba(16, 30, 70, .05), 0 40px 80px -30px rgba(30, 50, 120, .28);
  --sh-brand: 0 10px 24px -8px rgba(37, 90, 240, .45);

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --depth: 1;

  /* Layout */
  --maxw: 1200px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink-2);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6 {
  font-family: 'Sora', 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 700;
}
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.15em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
::selection { background: rgba(29, 111, 242, .18); }

:focus-visible {
  outline: 2.5px solid #4f63f3;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Ambient background ---------- */
.zx-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.zx-bg::before,
.zx-bg::after,
.zx-bg i {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
}
.zx-bg::before { width: 520px; height: 520px; background: #cfe0ff; top: -180px; left: -140px; }
.zx-bg::after { width: 460px; height: 460px; background: #e4d9ff; top: -120px; right: -160px; }
.zx-bg i { width: 380px; height: 380px; background: #d4f1fb; bottom: -180px; left: 30%; }
.zx-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(29, 60, 140, .05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(29, 60, 140, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 78%);
}

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
@media (min-width: 640px) { .wrap { padding: 0 28px; } }
.section { padding: 64px 0; }
@media (min-width: 640px) { .section { padding: 84px 0; } }
@media (min-width: 980px) { .section { padding: 104px 0; } }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr; }
.g3 { grid-template-columns: 1fr; }
.g4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .g2, .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .g4 { grid-template-columns: repeat(4, 1fr); } }
.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;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: #fff; color: var(--ink); padding: 10px 16px;
  border-radius: var(--r-sm); box-shadow: var(--sh-3); font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 500; }
.txt-muted { color: var(--muted); }
.txt-faint { color: var(--faint); }
.txt-center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- Typography ---------- */
.h-hero { font-size: clamp(34px, 7.4vw, 72px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; }
.h1 { font-size: clamp(30px, 5.2vw, 52px); font-weight: 700; }
.h2 { font-size: clamp(26px, 3.8vw, 40px); font-weight: 700; }
.h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.h4 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.lede { font-size: clamp(16px, 1.7vw, 19px); line-height: 1.65; max-width: 62ch; color: var(--muted); }
.small { font-size: 13.5px; }
.xs { font-size: 12px; }
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-ink);
  margin: 0 0 14px;
}
.eyebrow::before {
  content: '';
  width: 18px; height: 2px;
  background: var(--grad);
  border-radius: 2px;
}
.body-lg { font-size: 15.5px; line-height: 1.75; }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { transform: translateY(calc(-1px * var(--depth))); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover { color: #fff; box-shadow: 0 14px 30px -8px rgba(37, 90, 240, .55); }
.btn-glass {
  background: rgba(255, 255, 255, .7);
  color: var(--ink);
  border-color: var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--sh-1);
}
.btn-glass:hover { background: #fff; border-color: rgba(20, 40, 90, .18); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { background: rgba(20, 40, 90, .05); color: var(--ink); }
.btn-outline { background: transparent; color: var(--brand-ink); border-color: rgba(29, 111, 242, .35); }
.btn-outline:hover { background: rgba(29, 111, 242, .07); border-color: var(--brand); }
.btn-danger { background: #fff; color: var(--bad); border-color: rgba(192, 38, 45, .25); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-ok { background: #fff; color: var(--ok); border-color: rgba(19, 122, 62, .25); }
.btn-ok:hover { background: var(--ok-bg); color: var(--ok); }
.btn-white { background: #fff; color: var(--brand-ink); box-shadow: var(--sh-2); }
.btn-white:hover { color: var(--brand-ink); background: #fff; }
.btn-onDark { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .34); }
.btn-onDark:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.btn-xs { --btn-h: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-sm { --btn-h: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { --btn-h: 52px; padding: 0 24px; font-size: 15.5px; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-icon {
  width: 38px; height: 38px; padding: 0;
  border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .7); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: #fff; color: var(--brand-ink); }
.btn-icon svg { width: 17px; height: 17px; }
.spinner {
  width: 16px; height: 16px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: zx-spin .7s linear infinite;
}
@keyframes zx-spin { to { transform: rotate(360deg); } }

/* ---------- Cards / panels ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: 24px;
}
.card.glass {
  background: var(--glass);
  border-color: var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5);
  backdrop-filter: blur(var(--blur)) saturate(1.5);
  box-shadow: var(--sh-2), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.card.lift { transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.card.lift:hover { transform: translateY(calc(-4px * var(--depth))); box-shadow: var(--sh-3); }
.card-pad-sm { padding: 18px; }
.panel {
  background: var(--glass-2);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5);
  backdrop-filter: blur(var(--blur)) saturate(1.5);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-head h3, .card-head h2 { margin: 0; }
.card-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }

/* Icon tile */
.ico {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--sh-brand);
}
.ico svg { width: 20px; height: 20px; }
.ico.soft {
  background: linear-gradient(160deg, #fff, #eef3ff);
  color: var(--brand);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
}
.ico.sm { width: 34px; height: 34px; border-radius: 10px; }
.ico.sm svg { width: 17px; height: 17px; }
.ico.lg { width: 56px; height: 56px; border-radius: 16px; }
.ico.lg svg { width: 26px; height: 26px; }
.ico.ok { background: var(--ok-grad); box-shadow: 0 10px 22px -10px rgba(16, 138, 95, .7); }
.ico.vio { background: linear-gradient(140deg, #7c3aed, #a855f7); box-shadow: 0 10px 22px -10px rgba(124, 58, 237, .6); }
.ico.bad { background: linear-gradient(140deg, #dc2626, #b91c1c); box-shadow: 0 10px 22px -10px rgba(220, 38, 38, .6); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: var(--pill);
  font-size: 12px; font-weight: 600;
  background: var(--neu-bg); color: var(--neu);
  white-space: nowrap;
}
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}
.badge.no-dot::before { display: none; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.vio { background: var(--vio-bg); color: var(--vio); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.neu { background: var(--neu-bg); color: var(--neu); }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: var(--pill);
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.chip.grad { background: var(--grad-soft); border-color: rgba(29, 111, 242, .2); color: var(--brand-ink); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.label {
  display: block; font-size: 13.5px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 7px;
}
.label .req { color: var(--bad); margin-left: 2px; }
.inp, .sel, .ta {
  width: 100%; height: 46px; padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(20, 40, 90, .14);
  background: rgba(255, 255, 255, .85);
  color: var(--ink);
  font-size: 14.5px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.ta { height: auto; min-height: 110px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.sel {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6884' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
}
.inp::placeholder, .ta::placeholder { color: var(--faint); }
.inp:focus, .sel:focus, .ta:focus {
  outline: none;
  border-color: #5b7cf5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 99, 243, .14);
}
.inp.is-invalid, .sel.is-invalid, .ta.is-invalid {
  border-color: rgba(192, 38, 45, .6);
  box-shadow: 0 0 0 4px rgba(192, 38, 45, .08);
}
.inp[disabled], .sel[disabled], .ta[disabled] { background: rgba(240, 243, 250, .8); color: var(--muted); cursor: not-allowed; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.err {
  display: none; align-items: flex-start; gap: 6px;
  font-size: 12.5px; color: var(--bad); margin-top: 6px;
}
.err.show { display: flex; }
.err svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.inp-ico { position: relative; }
.inp-ico > svg, .inp-ico > .pfx {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--faint); pointer-events: none;
}
.inp-ico > svg { width: 17px; height: 17px; }
.inp-ico .pfx { font-size: 14px; font-weight: 600; }
.inp-ico .inp { padding-left: 42px; }
.inp-ico.has-pfx .inp { padding-left: 58px; }
.form-grid { display: grid; gap: 0 18px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid.two { grid-template-columns: repeat(2, 1fr); } }
.form-grid .full { grid-column: 1 / -1; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.checkline input { width: 17px; height: 17px; margin-top: 1px; flex: none; accent-color: var(--brand); }

/* Choice cards (radio) */
.choice-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .choice-grid.c3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 560px) { .choice-grid.c2 { grid-template-columns: repeat(2, 1fr); } }
.choice {
  display: block; position: relative; cursor: pointer;
  padding: 16px; border-radius: var(--r);
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, .7);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.choice:hover { border-color: rgba(29, 111, 242, .35); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .ct { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.choice .cd { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.choice .cdot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid rgba(20, 40, 90, .3); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s var(--ease);
}
.choice input:checked ~ .ct .cdot { border-color: var(--brand); border-width: 5px; }
.choice:has(input:checked) {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(29, 111, 242, .12);
}
.choice input:focus-visible ~ .ct { outline: 2.5px solid #4f63f3; outline-offset: 3px; border-radius: 4px; }

/* Segmented control */
.seg {
  display: inline-flex; gap: 4px; padding: 4px;
  background: rgba(20, 40, 90, .06);
  border-radius: 12px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg a {
  height: 32px; padding: 0 14px;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.seg button:hover, .seg a:hover { color: var(--ink); }
.seg .on { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }

/* Toggle */
.tgl { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.tgl input { position: absolute; opacity: 0; pointer-events: none; }
.tgl .track {
  width: 40px; height: 24px; border-radius: var(--pill);
  background: rgba(20, 40, 90, .18);
  position: relative; flex: none;
  transition: background .2s var(--ease);
}
.tgl .track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: var(--sh-1);
  transition: transform .2s var(--ease);
}
.tgl input:checked ~ .track { background: var(--brand); }
.tgl input:checked ~ .track::after { transform: translateX(16px); }

/* Upload dropzone */
.drop {
  display: block;
  border: 1.5px dashed rgba(29, 111, 242, .35);
  border-radius: 16px;
  padding: 22px 18px;
  text-align: center;
  background: linear-gradient(180deg, #fff, rgba(238, 243, 255, .6));
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--brand); border-style: solid; }
.drop input[type=file] { display: none; }
.drop .dt { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 8px; }
.drop .ds { font-size: 12px; color: var(--faint); margin-top: 3px; }
.drop .ico { margin: 0 auto; }
.filerow {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.filerow .ft {
  width: 38px; height: 38px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: #fff; letter-spacing: .02em;
}
.ft.pdf { background: #dc2626; } .ft.png { background: #1d6ff2; } .ft.jpg, .ft.jpeg { background: #7c3aed; }
.filerow .fname { font-size: 13px; font-weight: 600; color: var(--ink); word-break: break-all; }
.filerow .fmeta { font-size: 11.5px; color: var(--faint); }
.filerow .bar { height: 4px; border-radius: 2px; background: rgba(20, 40, 90, .08); margin-top: 6px; overflow: hidden; }
.filerow .bar > i { display: block; height: 100%; background: var(--grad); border-radius: 2px; transition: width .3s var(--ease); }

/* ---------- Alerts ---------- */
.alert {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--r);
  font-size: 14px; line-height: 1.6;
  border: 1px solid transparent;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert strong { color: inherit; }
.alert.info { background: #f0f5ff; border-color: #d6e3ff; color: #1e3a7a; }
.alert.ok { background: #ecf8f1; border-color: #c5ebd4; color: #0f5a2f; }
.alert.warn { background: #fff8ea; border-color: #f8e0b0; color: #7a4a0a; }
.alert.bad { background: #fdf0f0; border-color: #f5cccd; color: #861b20; }

/* ---------- Tables ---------- */
.tblwrap { overflow-x: auto; border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 11px 16px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--faint);
  background: rgba(246, 248, 252, .7);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: middle; }
.tbl tbody tr { transition: background .16s var(--ease); }
.tbl tbody tr:hover { background: rgba(29, 111, 242, .035); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .cellname { font-weight: 600; color: var(--ink); }
.tbl .cellsub { font-size: 12px; color: var(--faint); }
.tbl td.right, .tbl th.right { text-align: right; }

@media (max-width: 760px) {
  .tbl.resp thead { display: none; }
  .tbl.resp, .tbl.resp tbody, .tbl.resp tr, .tbl.resp td { display: block; width: 100%; }
  .tbl.resp tr {
    border: 1px solid var(--line);
    border-radius: var(--r);
    margin-bottom: 12px;
    padding: 6px 4px;
    background: rgba(255, 255, 255, .7);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 10px;
  }
  .tbl.resp td {
    border: 0; padding: 8px 12px;
    display: flex; flex-direction: column; gap: 2px;
  }
  .tbl.resp td::before {
    content: attr(data-l);
    font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--faint); font-weight: 700;
  }
  .tbl.resp td.full { grid-column: 1 / -1; }
  .tbl.resp td:not(:has(*)):empty { display: none; }
}

/* ---------- Avatar ---------- */
.av {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #1d6ff2, #8b5cf6);
  overflow: hidden;
  letter-spacing: .01em;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 72px; height: 72px; font-size: 24px; }
.av.xl { width: 96px; height: 96px; font-size: 32px; }
.av.g1 { background: linear-gradient(140deg, #1d6ff2, #4f63f3); }
.av.g2 { background: linear-gradient(140deg, #7c3aed, #a855f7); }
.av.g3 { background: linear-gradient(140deg, #0ea5e9, #22d3ee); }
.av.g4 { background: linear-gradient(140deg, #0f766e, #16a34a); }
.av.g5 { background: linear-gradient(140deg, #b45309, #f59e0b); }
.av-ring { padding: 3px; border-radius: 50%; background: #fff; box-shadow: var(--sh-2); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  position: relative; padding: 11px 0 13px;
  background: none; border: 0;
  font-size: 14px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .on { color: var(--brand-ink); }
.tabs .on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--grad); border-radius: 2px;
}
.tabs .count {
  font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: var(--pill); background: rgba(20, 40, 90, .07); color: var(--muted);
}
.tabs .on .count { background: rgba(29, 111, 242, .12); color: var(--brand-ink); }

/* ---------- Modal / drawer ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15, 25, 50, .35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: none;
}
.scrim.open { display: block; }
.modal {
  position: fixed; z-index: 91; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: none; flex-direction: column;
  border-radius: 22px; overflow: hidden;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--sh-4);
}
.modal.wide { width: min(760px, calc(100vw - 32px)); }
.modal.open { display: flex; animation: zx-pop .3s var(--ease); }
@keyframes zx-pop { from { opacity: 0; transform: translate(-50%, -50%) translateY(10px) scale(.98); } }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); background: rgba(246, 248, 252, .8); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.drawer {
  position: fixed; z-index: 91; top: 0; right: 0; bottom: 0;
  width: min(520px, 100%);
  display: none; flex-direction: column;
  background: #fff; border-left: 1px solid var(--line);
  box-shadow: var(--sh-4);
}
.drawer.open { display: flex; animation: zx-slide .3s var(--ease); }
@keyframes zx-slide { from { transform: translateX(30px); opacity: .4; } }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; background: rgba(246, 248, 252, .7); }

/* ---------- Toast ---------- */
.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 120;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 36px));
}
.toast {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--r);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--sh-4);
  animation: zx-pop .3s var(--ease);
}
.toast .tico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: var(--grad);
}
.toast .tico svg { width: 16px; height: 16px; }
.toast.ok .tico { background: var(--ok-grad); }
.toast.bad .tico { background: linear-gradient(140deg, #dc2626, #b91c1c); }
.toast .tt { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.toast .tb { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ---------- Empty / loading states ---------- */
.empty { text-align: center; padding: 44px 20px; }
.empty .etile {
  width: 76px; height: 76px; margin: 0 auto 18px;
  border-radius: 22px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #fff, #eef3ff);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  transform: rotate(-6deg);
  color: var(--brand);
}
.empty .etile svg { width: 30px; height: 30px; transform: rotate(6deg); }
.empty h4 { margin: 0 0 6px; font-size: 16px; }
.empty p { font-size: 13.5px; color: var(--muted); max-width: 46ch; margin: 0 auto 16px; }
.skel { background: linear-gradient(90deg, rgba(20, 40, 90, .06) 25%, rgba(20, 40, 90, .11) 37%, rgba(20, 40, 90, .06) 63%); background-size: 400% 100%; animation: zx-sh 1.3s ease infinite; border-radius: 8px; }
@keyframes zx-sh { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Timeline / stepper ---------- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 22px 42px; }
.tl li:last-child { padding-bottom: 0; }
.tl .dot {
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: rgba(20, 40, 90, .08); color: var(--muted);
  border: 2px solid #fff;
}
.tl li::before {
  content: ''; position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 2px; background: var(--line);
}
.tl li:last-child::before { display: none; }
.tl .done .dot { background: var(--grad); color: #fff; }
.tl .done::before { background: linear-gradient(180deg, #4f63f3, rgba(139, 92, 246, .3)); }
.tl .cur .dot { background: #fff; color: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 5px rgba(29, 111, 242, .14); }
.tl .tt { font-size: 14px; font-weight: 600; color: var(--ink); }
.tl .td { font-size: 12.5px; color: var(--muted); }

.stepper { display: flex; align-items: center; gap: 0; list-style: none; margin: 0 0 24px; padding: 0; overflow-x: auto; }
.stepper li { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.stepper .num {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: rgba(20, 40, 90, .08); color: var(--muted);
}
.stepper .line { width: 24px; height: 1px; background: var(--line); margin: 0 10px; flex: none; }
.stepper .on { color: var(--ink); }
.stepper .on .num { background: var(--grad); color: #fff; }
.stepper .past .num { background: rgba(29, 111, 242, .14); color: var(--brand-ink); }

/* ---------- Misc ---------- */
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.divider::before, .divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--faint); font-weight: 600; }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.ticks li svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--brand); }
.ticks.plain li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-top: 9px; flex: none; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .4; display: inline-block; }

/* Skeleton shimmer respects reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  :root { --depth: 0; }
}
