/* =============================================================================
   Lamsa Dawa – Smart Events | لمسة دعوة
   Design system + layout. RTL-first (uses logical properties throughout).
   ============================================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Brand */
  --navy-950: #070E1C;
  --navy-900: #0B1426;
  --navy-850: #0F1B33;
  --navy-800: #15254A;
  --navy-700: #1F3360;
  --navy-600: #2C4478;
  --gold-700: #8A6A22;
  --gold-600: #A8842F;
  --gold-500: #C9A24A;
  --gold-400: #D9B968;
  --gold-300: #E9D49F;
  --gold-200: #F3E7C6;
  --cream-50: #FFFDF8;
  --cream-100: #FBF8F1;
  --cream-200: #F5EFE2;
  --cream-300: #EAE0CB;
  --cream-400: #DCCFB2;

  /* Ink */
  --ink-900: #14213D;
  --ink-700: #36405A;
  --ink-500: #6E6A60;
  --ink-400: #8F8A7E;
  --line: #E7DFCC;
  --line-strong: #D6CAAE;

  /* Status (reserved – never used as chart series) */
  --success-700: #146C43;
  --success-600: #1E8E5A;
  --success-100: #DDF3E6;
  --danger-700: #9E2F29;
  --danger-600: #C2413A;
  --danger-100: #FBE3E1;
  --warning-700: #8F5A0B;
  --warning-600: #C77B12;
  --warning-100: #FCEED6;
  --info-600: #2A78D6;
  --info-100: #E3EEFB;

  /* Data series (validated: CVD-safe pair) */
  --series-male: #2A78D6;
  --series-female: #D55181;
  --series-activity: #1F3360;
  --seq-1: #8A6A22;
  --seq-2: #C9A24A;
  --seq-3: #E9DDBF;

  /* Gate accents */
  --gate-male: #2A78D6;
  --gate-male-soft: rgba(42, 120, 214, .16);
  --gate-female: #D55181;
  --gate-female-soft: rgba(213, 81, 129, .16);

  /* Type */
  --font-sans: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-display: "Amiri", "IBM Plex Sans Arabic", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Shape & depth */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(11, 20, 38, .06), 0 1px 1px rgba(11, 20, 38, .04);
  --shadow-md: 0 6px 20px -8px rgba(11, 20, 38, .18), 0 2px 6px rgba(11, 20, 38, .05);
  --shadow-lg: 0 24px 60px -20px rgba(11, 20, 38, .35);
  --ring: 0 0 0 3px rgba(201, 162, 74, .35);

  --sidebar-w: 264px;
  --topbar-h: 68px;
  --bottomnav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--cream-100);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy-700); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.mono { font-family: var(--font-mono); letter-spacing: .02em; }
.muted { color: var(--ink-500); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs); }
::selection { background: var(--gold-300); color: var(--navy-900); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- 3. Boot / noscript ---------- */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--navy-900); color: var(--cream-200); }
.boot-mark { width: 64px; height: 64px; border-radius: 18px; border: 2px solid var(--gold-500); position: relative; }
.boot-mark::after { content: ""; position: absolute; inset: 14px 16px 0; border: 3px solid var(--gold-500); border-bottom: 0; border-radius: 40px 40px 0 0; }
.boot-title { font-family: var(--font-display); font-size: 28px; color: var(--gold-300); }
.noscript { padding: 24px; text-align: center; background: var(--danger-100); color: var(--danger-700); }

/* ---------- 4. Spinner & skeleton ---------- */
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: middle; }
.spinner--gold { color: var(--gold-500); width: 26px; height: 26px; border-width: 3px; }
.spinner--lg { width: 40px; height: 40px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { position: relative; overflow: hidden; background: var(--cream-200); border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(-100%); } }
.sk-line { height: 12px; margin-block: 8px; }
.sk-line.w-40 { width: 40%; } .sk-line.w-60 { width: 60%; } .sk-line.w-80 { width: 80%; }
.sk-block { height: 120px; }
.sk-kpi { height: 112px; border-radius: var(--radius-md); }

/* ---------- 5. Buttons ---------- */
.btn {
  --btn-bg: var(--cream-50); --btn-fg: var(--ink-900); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease), box-shadow .15s;
  user-select: none;
}
.btn:hover { border-color: var(--gold-500); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { --btn-bg: var(--navy-800); --btn-fg: var(--cream-50); --btn-bd: var(--navy-800); }
.btn--primary:hover { --btn-bg: var(--navy-700); border-color: var(--gold-500); }
.btn--gold { --btn-bg: linear-gradient(180deg, var(--gold-400), var(--gold-500)); --btn-fg: var(--navy-900); --btn-bd: var(--gold-600); background: linear-gradient(180deg, var(--gold-400), var(--gold-500)); }
.btn--gold:hover { background: linear-gradient(180deg, var(--gold-300), var(--gold-400)); }
.btn--danger { --btn-bg: var(--danger-600); --btn-fg: #fff; --btn-bd: var(--danger-600); }
.btn--danger:hover { --btn-bg: var(--danger-700); border-color: var(--danger-700); }
.btn--success { --btn-bg: var(--success-600); --btn-fg: #fff; --btn-bd: var(--success-600); }
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn--ghost:hover { --btn-bg: var(--cream-200); border-color: transparent; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn--lg { min-height: 54px; padding: 0 22px; font-size: 16px; border-radius: var(--radius-md); }
.btn--xl { min-height: 64px; padding: 0 24px; font-size: 19px; border-radius: var(--radius-lg); }
.btn--block { width: 100%; }
.btn--icon { width: 38px; min-height: 38px; padding: 0; }
.btn--icon.btn--sm { width: 34px; min-height: 34px; }
.btn .spinner { width: 16px; height: 16px; }

/* ---------- 6. Forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .field-label { font-size: 13px; font-weight: 600; color: var(--ink-700); }
.field .req { color: var(--danger-600); margin-inline-start: 2px; }
.field .hint { font-size: 12px; color: var(--ink-500); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--cream-50); color: var(--ink-900);
  transition: border-color .15s, box-shadow .15s; font-size: 15px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold-500); box-shadow: var(--ring); }
.input[disabled], .select[disabled] { background: var(--cream-200); color: var(--ink-500); }
.input.is-invalid, .select.is-invalid { border-color: var(--danger-600); }
.input--ltr { direction: ltr; text-align: left; }
.select { appearance: none; -webkit-appearance: none; padding-inline-start: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E6A60' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; }
.input-group { position: relative; }
.input-group .input { padding-inline-start: 42px; }
.input-group > .input-icon { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; }
.input-group > .input-icon svg { width: 18px; height: 18px; }
.input-group > .input-action { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-error { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--danger-100); color: var(--danger-700); font-size: 14px; font-weight: 500; }

.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--cream-200); border-radius: var(--radius-sm); border: 1px solid var(--line); width: 100%; }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink-700); transition: background .15s, color .15s; }
.segmented span svg { width: 16px; height: 16px; }
.segmented input:checked + span { background: var(--cream-50); color: var(--navy-800); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { box-shadow: var(--ring); }
.segmented input:disabled + span { opacity: .5; }

.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--cream-50); }
.stepper button { width: 44px; border: 0; background: var(--cream-200); display: grid; place-items: center; }
.stepper button:hover { background: var(--cream-300); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper button svg { width: 18px; height: 18px; }
.stepper input { width: 64px; border: 0; text-align: center; font-weight: 700; font-size: 17px; background: transparent; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }

/* ---------- 7. Cards, badges, misc ---------- */
.card { background: var(--cream-50); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 18px; height: 18px; color: var(--gold-600); }
.card-sub { font-size: 13px; color: var(--ink-500); }
.card-body { padding: 16px 20px 20px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; border: 1px solid transparent; }
.badge svg { width: 13px; height: 13px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge--success { background: var(--success-100); color: var(--success-700); }
.badge--danger { background: var(--danger-100); color: var(--danger-700); }
.badge--warning { background: var(--warning-100); color: var(--warning-700); }
.badge--info { background: var(--info-100); color: #1D5BA6; }
.badge--neutral { background: var(--cream-200); color: var(--ink-700); border-color: var(--line); }
.badge--gold { background: var(--gold-200); color: var(--gold-700); border-color: var(--gold-300); }
.badge--navy { background: var(--navy-800); color: var(--cream-100); }
.badge--male { background: rgba(42,120,214,.12); color: #1D5BA6; }
.badge--female { background: rgba(213,81,129,.12); color: #A8325E; }

.divider { height: 1px; background: var(--line); margin-block: 16px; border: 0; }
.kbd { font-family: var(--font-mono); background: var(--cream-200); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12px; }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 20px; color: var(--ink-500); }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--cream-200); border: 1px solid var(--line); display: grid; place-items: center; color: var(--gold-600); }
.empty-icon svg { width: 28px; height: 28px; }
.empty h3 { color: var(--ink-900); font-size: 17px; }
.empty p { max-width: 380px; font-size: 14px; }
.empty .btn { margin-top: 6px; }

.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid; font-size: 14px; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert strong { display: block; margin-bottom: 2px; }
.alert--warning { background: var(--warning-100); border-color: #F1D3A1; color: var(--warning-700); }
.alert--danger { background: var(--danger-100); border-color: #F2B9B4; color: var(--danger-700); }
.alert--info { background: var(--info-100); border-color: #BFD6F3; color: #1D5BA6; }
.alert--success { background: var(--success-100); border-color: #A9DCC0; color: var(--success-700); }

/* ---------- 8. Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--cream-100); }
.login-hero {
  position: relative; overflow: hidden; color: var(--cream-100); padding: 56px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(201,162,74,.18), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(44,68,120,.6), transparent 60%),
    var(--navy-900);
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.login-hero::before { content: ""; position: absolute; inset: 24px; border: 1px solid rgba(201,162,74,.25); border-radius: var(--radius-xl); pointer-events: none; }
.login-hero::after { content: ""; position: absolute; width: 420px; height: 420px; inset-inline-start: -140px; bottom: -160px; border-radius: 50%; border: 1px solid rgba(201,162,74,.18); box-shadow: 0 0 0 40px rgba(201,162,74,.04), 0 0 0 90px rgba(201,162,74,.03); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.brand-mark { width: 48px; height: 48px; flex: none; }
.brand-name { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--gold-300); line-height: 1.1; }
.brand-sub { font-size: 12px; letter-spacing: .14em; color: rgba(245,239,226,.6); direction: ltr; text-align: right; }
.login-copy { position: relative; z-index: 1; max-width: 460px; }
.login-copy h1 { font-family: var(--font-display); font-size: 44px; line-height: 1.35; color: var(--cream-50); margin-bottom: 14px; }
.login-copy h1 em { font-style: normal; color: var(--gold-400); }
.login-copy p { color: rgba(245,239,226,.75); font-size: 16px; }
.login-features { position: relative; z-index: 1; display: grid; gap: 12px; }
.login-features li { display: flex; align-items: center; gap: 12px; color: rgba(245,239,226,.85); font-size: 14px; }
.login-features ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.login-features .fi { width: 34px; height: 34px; border-radius: 10px; background: rgba(201,162,74,.12); border: 1px solid rgba(201,162,74,.3); display: grid; place-items: center; color: var(--gold-400); flex: none; }
.login-features .fi svg { width: 17px; height: 17px; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; }
.login-form { width: 100%; max-width: 440px; display: grid; gap: 22px; }
.login-form h2 { font-size: 26px; }
.login-form .lead { color: var(--ink-500); margin-top: 4px; }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.role-card { position: relative; }
.role-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.role-card .rc { display: grid; justify-items: center; gap: 8px; padding: 16px 8px; border-radius: var(--radius-md); border: 1.5px solid var(--line); background: var(--cream-50); text-align: center; transition: border-color .15s, box-shadow .15s, background .15s; height: 100%; }
.role-card .rc-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--cream-200); color: var(--navy-700); }
.role-card .rc-icon svg { width: 22px; height: 22px; }
.role-card .rc-title { font-weight: 700; font-size: 14px; }
.role-card .rc-sub { font-size: 11.5px; color: var(--ink-500); line-height: 1.4; }
.role-card input:checked + .rc { border-color: var(--gold-500); background: #FFFBF0; box-shadow: 0 0 0 3px rgba(201,162,74,.18); }
.role-card input:focus-visible + .rc { box-shadow: var(--ring); }
.role-card[data-role="male"] input:checked + .rc .rc-icon { background: var(--gate-male); color: #fff; }
.role-card[data-role="female"] input:checked + .rc .rc-icon { background: var(--gate-female); color: #fff; }
.role-card[data-role="admin"] input:checked + .rc .rc-icon { background: var(--navy-800); color: var(--gold-400); }
.login-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-500); }
.login-note svg { width: 15px; height: 15px; color: var(--gold-600); flex: none; }
.api-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-500); }
.api-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-400); box-shadow: 0 0 0 3px rgba(143,138,126,.18); }
.api-dot.ok { background: var(--success-600); box-shadow: 0 0 0 3px rgba(30,142,90,.18); }
.api-dot.bad { background: var(--danger-600); box-shadow: 0 0 0 3px rgba(194,65,58,.18); }
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- 9. Admin shell ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: var(--cream-200); padding: 22px 16px; border-inline-end: 1px solid rgba(201,162,74,.15);
}
.sidebar .brand { padding: 4px 8px 22px; border-bottom: 1px solid rgba(201,162,74,.15); margin-bottom: 10px; }
.sidebar .brand-mark { width: 42px; height: 42px; }
.sidebar .brand-name { font-size: 24px; }
.nav { display: grid; gap: 4px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: rgba(245,239,226,.4); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-sm); color: rgba(245,239,226,.75); text-decoration: none; font-weight: 500; font-size: 14.5px; position: relative; transition: background .15s, color .15s; }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { background: rgba(255,255,255,.05); color: var(--cream-50); }
.nav a.active { background: rgba(201,162,74,.12); color: var(--gold-300); }
.nav a.active::before { content: ""; position: absolute; inset-inline-start: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--gold-500); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(201,162,74,.15); }
.sidebar-foot .api-status { color: rgba(245,239,226,.6); padding-inline: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); background: rgba(255,255,255,.04); }
.user-chip .avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--gold-500); color: var(--navy-900); display: grid; place-items: center; flex: none; }
.user-chip .avatar svg { width: 18px; height: 18px; }
.user-chip .uc-name { font-weight: 600; font-size: 14px; color: var(--cream-50); }
.user-chip .uc-role { font-size: 12px; color: rgba(245,239,226,.55); }
.user-chip .btn { margin-inline-start: auto; --btn-fg: var(--cream-200); }
.user-chip .btn:hover { --btn-bg: rgba(255,255,255,.08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: rgba(251,248,241,.88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 19px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-brand { display: none; align-items: center; gap: 10px; }
.topbar-brand .brand-mark { width: 34px; height: 34px; }
.topbar-brand .brand-name { font-size: 20px; color: var(--navy-800); }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.event-switch { display: flex; align-items: center; gap: 8px; }
.event-switch .select { min-height: 40px; max-width: 280px; font-weight: 600; background-color: var(--cream-50); }
.event-switch .es-label { font-size: 12px; color: var(--ink-500); white-space: nowrap; }
.view { padding: 26px 28px 40px; max-width: 1440px; width: 100%; margin-inline: auto; animation: fadeUp .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; }
.page-head p { color: var(--ink-500); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.bottom-nav { display: none; }

/* ---------- 10. Dashboard ---------- */
.event-hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 26px 28px; color: var(--cream-100); margin-bottom: 22px;
  background: radial-gradient(90% 120% at 0% 0%, rgba(201,162,74,.22), transparent 55%), linear-gradient(135deg, var(--navy-800), var(--navy-900));
  box-shadow: var(--shadow-md);
}
.event-hero::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(201,162,74,.22); border-radius: calc(var(--radius-xl) - 8px); pointer-events: none; }
.event-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.event-hero .eh-kicker { font-size: 12.5px; color: var(--gold-300); letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.event-hero .eh-kicker svg { width: 15px; height: 15px; flex: none; }
.event-hero h2 { font-family: var(--font-display); font-size: 32px; color: var(--cream-50); margin-top: 6px; }
.event-hero .eh-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; position: relative; z-index: 1; }
.event-hero .eh-meta span { display: inline-flex; align-items: center; gap: 8px; color: rgba(245,239,226,.85); font-size: 14px; }
.event-hero .eh-meta svg { width: 17px; height: 17px; color: var(--gold-400); }
.event-hero .eh-actions { display: flex; gap: 8px; position: relative; z-index: 1; }
.event-hero .btn--ghost { --btn-fg: var(--cream-100); border-color: rgba(245,239,226,.25); }
.event-hero .btn--ghost:hover { --btn-bg: rgba(255,255,255,.08); }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { padding: 16px 18px; display: grid; gap: 6px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 13px; color: var(--ink-500); font-weight: 500; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--cream-200); color: var(--gold-700); flex: none; }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 12.5px; color: var(--ink-500); }
.kpi--accent { background: linear-gradient(160deg, #FFF9EA, var(--cream-50)); border-color: var(--gold-300); }
.kpi--accent .kpi-icon { background: var(--gold-500); color: var(--navy-900); }

.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-12 { grid-column: span 12; }

/* Charts */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-700); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.bar-rows { display: grid; gap: 18px; }
.bar-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.bar-row-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.bar-row-val { font-size: 13px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.bar-row-val b { color: var(--ink-900); font-size: 15px; }
.track { position: relative; height: 14px; border-radius: 4px; background: var(--cream-200); overflow: hidden; }
.track-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 4px; transition: width .6s var(--ease); min-width: 0; }
.track--lg { height: 18px; }

.meter-hero { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.meter-hero .big { font-size: 46px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.meter-hero .big small { font-size: 22px; color: var(--ink-500); }
.meter-hero .cap { color: var(--ink-500); font-size: 14px; padding-bottom: 6px; }
.meter-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-500); margin-top: 6px; font-variant-numeric: tabular-nums; }
.meter-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.meter-stats div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--cream-100); border: 1px solid var(--line); }
.meter-stats dt { font-size: 12px; color: var(--ink-500); }
.meter-stats dd { margin: 2px 0 0; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }

.stack { display: flex; height: 22px; gap: 2px; border-radius: 6px; overflow: hidden; background: var(--cream-50); }
.stack > span { height: 100%; min-width: 0; transition: flex-grow .6s var(--ease); }
.stack > span:first-child { border-start-start-radius: 4px; border-end-start-radius: 4px; }
.stack > span:last-child { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.stack-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.stack-legend div { display: grid; gap: 2px; }
.stack-legend .sl-name { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-700); }
.stack-legend .sl-val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stack-legend .sl-pct { font-size: 12px; color: var(--ink-500); }

.activity { position: relative; }
.activity-plot { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 4px; padding-inline-start: 34px; border-bottom: 1px solid var(--line-strong); }
.activity-grid { position: absolute; inset: 0 0 0 0; pointer-events: none; }
.activity-grid div { position: absolute; inset-inline: 34px 0; border-top: 1px dashed var(--line); }
.activity-grid span { position: absolute; inset-inline-start: -34px; transform: translateY(-50%); font-size: 11px; color: var(--ink-500); width: 28px; text-align: end; font-variant-numeric: tabular-nums; }
.activity-col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; }
.activity-col::before { content: ""; position: absolute; inset: 0 -2px; border-radius: 4px; }
.activity-col:hover::before { background: rgba(201,162,74,.08); }
.activity-bar { width: 100%; max-width: 34px; margin-inline: auto; background: var(--series-activity); border-radius: 4px 4px 0 0; min-height: 0; position: relative; transition: height .5s var(--ease); }
.activity-col:hover .activity-bar { background: var(--navy-600); }
.activity-x { display: flex; gap: 4px; padding-inline-start: 34px; margin-top: 6px; }
.activity-x span { flex: 1; text-align: center; font-size: 11px; color: var(--ink-500); white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }

.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.li-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--cream-200); color: var(--navy-700); }
.li-icon svg { width: 17px; height: 17px; }
.li-icon--male { background: rgba(42,120,214,.12); color: #1D5BA6; }
.li-icon--female { background: rgba(213,81,129,.12); color: #A8325E; }
.li-icon--danger { background: var(--danger-100); color: var(--danger-700); }
.li-icon--gold { background: var(--gold-200); color: var(--gold-700); }
.li-main { min-width: 0; flex: 1; }
.li-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 12.5px; color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-end { text-align: end; font-size: 12.5px; color: var(--ink-500); white-space: nowrap; }
.li-end b { display: block; color: var(--ink-900); font-size: 15px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--cream-200); border-radius: var(--radius-sm); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--ink-700); white-space: nowrap; }
.tab.active { background: var(--cream-50); color: var(--navy-800); box-shadow: var(--shadow-sm); }

/* ---------- 11. Events ---------- */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.event-card { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s; }
.event-card:hover { box-shadow: var(--shadow-md); border-color: var(--gold-300); }
.event-card.is-current { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(201,162,74,.15); }
.ec-head { padding: 18px 20px 14px; background: linear-gradient(160deg, var(--navy-800), var(--navy-900)); color: var(--cream-100); position: relative; }
.ec-head::after { content: ""; position: absolute; inset-inline: 20px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-500), transparent); }
.ec-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ec-title { font-family: var(--font-display); font-size: 22px; color: var(--cream-50); line-height: 1.35; }
.ec-id { font-size: 12px; color: rgba(245,239,226,.5); direction: ltr; text-align: right; }
.ec-body { padding: 16px 20px; display: grid; gap: 10px; flex: 1; }
.ec-meta { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-700); }
.ec-meta span { display: flex; align-items: center; gap: 8px; }
.ec-meta svg { width: 16px; height: 16px; color: var(--gold-600); flex: none; }
.ec-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.ec-stats div { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--cream-100); border: 1px solid var(--line); }
.ec-stats dt { font-size: 11.5px; color: var(--ink-500); }
.ec-stats dd { margin: 0; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.ec-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ec-foot .btn { flex: 1; }

/* ---------- 12. Toolbars & tables ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px; }
.toolbar .search { flex: 1 1 260px; }
.toolbar .select { width: auto; min-width: 140px; flex: 0 1 auto; min-height: 42px; }
.toolbar-count { font-size: 13px; color: var(--ink-500); margin-inline-start: auto; white-space: nowrap; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: start; font-weight: 600; font-size: 12.5px; color: var(--ink-500); background: var(--cream-100); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #FFFBF1; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-cancelled td { color: var(--ink-500); }
.table tr.is-cancelled .g-name { text-decoration: line-through; text-decoration-color: rgba(194,65,58,.5); }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; text-align: center; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.g-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.g-sub { font-size: 12px; color: var(--ink-500); }
.mini-progress { width: 64px; height: 6px; border-radius: 3px; background: var(--cream-200); overflow: hidden; margin: 4px auto 0; }
.mini-progress span { display: block; height: 100%; background: var(--gold-500); border-radius: 3px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-500); flex-wrap: wrap; }
.pager-btns { display: flex; gap: 6px; }

/* ---------- 13. Modal & dialogs ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(7,14,28,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fadeIn .2s ease; overflow-y: auto; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; background: var(--cream-50); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100dvh - 40px); animation: pop .25s var(--ease); border: 1px solid var(--line); }
.modal--lg { max-width: 820px; }
.modal--sm { max-width: 420px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 18px; }
.modal-head .mh-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-200); color: var(--gold-700); flex: none; }
.modal-head .mh-icon svg { width: 19px; height: 19px; }
.modal-head .mh-sub { font-size: 13px; color: var(--ink-500); }
.modal-head .btn--icon { margin-inline-start: auto; }
.modal-body { padding: 20px 22px; overflow-y: auto; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--cream-100); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }
.confirm-body { display: flex; gap: 14px; align-items: flex-start; }
.confirm-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-icon--danger { background: var(--danger-100); color: var(--danger-700); }
.confirm-icon--warning { background: var(--warning-100); color: var(--warning-700); }
.confirm-icon--info { background: var(--gold-200); color: var(--gold-700); }

.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.detail-grid div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--cream-100); border: 1px solid var(--line); min-width: 0; }
.detail-grid dt { font-size: 12px; color: var(--ink-500); }
.detail-grid dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* Token box */
.token-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--navy-900); color: var(--gold-300); border: 1px solid var(--navy-700); }
.token-box code { flex: 1; font-family: var(--font-mono); font-size: 15px; direction: ltr; text-align: left; overflow-wrap: anywhere; letter-spacing: .04em; }
.token-box .btn { --btn-bg: rgba(255,255,255,.06); --btn-fg: var(--cream-100); --btn-bd: rgba(255,255,255,.14); }
.token-box--light { background: var(--cream-100); color: var(--ink-900); border-color: var(--line); }
.token-box--light .btn { --btn-bg: var(--cream-50); --btn-fg: var(--ink-900); --btn-bd: var(--line-strong); }

/* ---------- 14. Invitation card ---------- */
.invite-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.invite-card {
  position: relative; padding: 28px 24px 22px; border-radius: 18px; text-align: center; color: var(--navy-900);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(201,162,74,.16), transparent 60%),
    linear-gradient(180deg, #FFFCF4, var(--cream-200));
  border: 1px solid var(--gold-400); box-shadow: var(--shadow-md);
  display: grid; justify-items: center; gap: 8px; max-width: 360px; margin-inline: auto; width: 100%;
}
.invite-card::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(201,162,74,.55); border-radius: 12px; pointer-events: none; }
.invite-card::after { content: ""; position: absolute; inset: 12px; border: 1px dashed rgba(201,162,74,.35); border-radius: 9px; pointer-events: none; }
.ic-brand { font-family: var(--font-display); font-size: 15px; color: var(--gold-700); letter-spacing: .04em; }
.ic-ornament { width: 120px; height: 14px; color: var(--gold-500); }
.ic-kicker { font-size: 13px; color: var(--ink-500); }
.ic-guest { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.3; color: var(--navy-800); }
.ic-event { font-family: var(--font-display); font-size: 20px; color: var(--gold-700); line-height: 1.4; }
.ic-meta { display: grid; gap: 3px; font-size: 13.5px; color: var(--ink-700); margin-top: 2px; }
.ic-qr { width: 168px; height: 168px; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--line); margin-top: 6px; display: grid; place-items: center; }
.ic-qr svg { width: 100%; height: 100%; }
.ic-qr .qr-fallback { font-size: 12px; color: var(--ink-500); }
.ic-count { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--navy-800); color: var(--gold-300); font-weight: 600; font-size: 14px; margin-top: 4px; }
.ic-count svg { width: 16px; height: 16px; }
.ic-token { font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); direction: ltr; letter-spacing: .03em; }
.ic-foot { font-size: 11.5px; color: var(--ink-500); }

/* ---------- 15. Gate screen ---------- */
.gate {
  --gate-accent: var(--gate-male); --gate-soft: var(--gate-male-soft);
  min-height: 100vh; min-height: 100dvh; background: var(--navy-900); color: var(--cream-100);
  display: flex; flex-direction: column; padding-bottom: calc(24px + var(--safe-b));
  background-image: radial-gradient(100% 50% at 50% 0%, var(--gate-soft), transparent 70%);
}
.gate--female { --gate-accent: var(--gate-female); --gate-soft: var(--gate-female-soft); }
.gate-top { display: flex; align-items: center; gap: 10px; padding: 14px 18px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid rgba(255,255,255,.06); }
.gate-top .brand-mark { width: 34px; height: 34px; }
.gate-top .brand-name { font-size: 20px; }
.gate-top .gt-actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.gate-top .btn { --btn-bg: rgba(255,255,255,.06); --btn-fg: var(--cream-100); --btn-bd: rgba(255,255,255,.14); }
.gate-inner { width: 100%; max-width: 560px; margin-inline: auto; padding: 18px 16px 0; display: grid; gap: 16px; }
.gate-banner { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 18px 20px; background: var(--gate-accent); color: #fff; display: flex; align-items: center; gap: 16px; box-shadow: 0 16px 40px -18px var(--gate-accent); }
.gate-banner::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; border: 22px solid rgba(255,255,255,.1); inset-inline-end: -60px; top: -60px; }
.gb-icon { width: 58px; height: 58px; border-radius: 16px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.gb-icon svg { width: 30px; height: 30px; }
.gb-title { font-size: 28px; font-weight: 700; line-height: 1.2; }
.gb-sub { font-size: 14px; opacity: .9; }
.gb-event { font-size: 13px; opacity: .85; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.gb-event svg { width: 14px; height: 14px; }
.gate-panel { background: var(--navy-850); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-lg); padding: 18px; }
.scan-btn {
  width: 100%; border: 2px dashed rgba(201,162,74,.5); background: rgba(201,162,74,.06); color: var(--cream-50);
  border-radius: var(--radius-lg); padding: 26px 16px; display: grid; justify-items: center; gap: 10px; transition: background .15s, border-color .15s;
}
.scan-btn:hover { background: rgba(201,162,74,.12); border-color: var(--gold-500); }
.scan-btn .sb-icon { width: 76px; height: 76px; border-radius: 22px; background: var(--gold-500); color: var(--navy-900); display: grid; place-items: center; }
.scan-btn .sb-icon svg { width: 40px; height: 40px; }
.scan-btn .sb-title { font-size: 20px; font-weight: 700; }
.scan-btn .sb-sub { font-size: 13px; color: rgba(245,239,226,.6); }
.gate-or { display: flex; align-items: center; gap: 12px; color: rgba(245,239,226,.45); font-size: 13px; margin-block: 14px; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.1); }
.manual-form { display: flex; gap: 8px; }
.manual-form .input { background: var(--navy-950); border-color: rgba(255,255,255,.14); color: var(--cream-50); min-height: 54px; font-family: var(--font-mono); font-size: 16px; direction: ltr; text-align: left; text-transform: uppercase; }
.manual-form .input::placeholder { color: rgba(245,239,226,.35); text-transform: none; font-family: var(--font-sans); }
.manual-form .btn { min-height: 54px; }

.guest-card { background: var(--cream-50); color: var(--ink-900); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); animation: pop .25s var(--ease); }
.gc-head { padding: 18px 20px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.gc-avatar { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--gate-accent); color: #fff; flex: none; font-weight: 700; font-size: 22px; }
.gc-name { font-size: 22px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.gc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gc-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; border-bottom: 1px solid var(--line); }
.gc-stats div { padding: 14px 8px; }
.gc-stats div + div { border-inline-start: 1px solid var(--line); }
.gc-stats dt { font-size: 12.5px; color: var(--ink-500); }
.gc-stats dd { margin: 2px 0 0; font-size: 32px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.gc-stats .is-remaining dd { color: var(--success-700); }
.gc-stats .is-zero dd { color: var(--danger-700); }
.gc-body { padding: 18px 20px 20px; display: grid; gap: 16px; }
.gc-rows { display: grid; gap: 8px; font-size: 14px; }
.gc-rows div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gc-rows dt { color: var(--ink-500); }
.gc-rows dd { margin: 0; }
.count-pick { display: grid; gap: 10px; }
.count-pick-label { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; }
.count-pick-label span { font-weight: 500; color: var(--ink-500); font-size: 13px; }
.count-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.count-chip { min-height: 52px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong); background: var(--cream-50); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.count-chip.active { background: var(--navy-800); color: var(--gold-300); border-color: var(--navy-800); }
.count-stepper { display: flex; align-items: center; justify-content: center; gap: 12px; }
.count-stepper .stepper { border-radius: var(--radius-md); }
.count-stepper .stepper button { width: 56px; }
.count-stepper .stepper input { width: 80px; font-size: 26px; min-height: 56px; }
.reason { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); font-weight: 600; }
.reason svg { width: 24px; height: 24px; flex: none; }
.reason--danger { background: var(--danger-100); color: var(--danger-700); }
.reason--warning { background: var(--warning-100); color: var(--warning-700); }

.gate-error { border-radius: var(--radius-lg); padding: 24px 20px; text-align: center; display: grid; justify-items: center; gap: 10px; animation: pop .25s var(--ease); }
.gate-error .ge-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.gate-error .ge-icon svg { width: 38px; height: 38px; }
.gate-error h3 { font-size: 24px; }
.gate-error p { font-size: 15px; opacity: .92; max-width: 380px; }
.gate-error .btn { margin-top: 6px; }
.gate-error--danger { background: var(--danger-600); color: #fff; }
.gate-error--warning { background: var(--warning-600); color: #fff; }
.gate-error--neutral { background: var(--navy-700); color: var(--cream-50); }
.gate-error .btn { --btn-bg: rgba(255,255,255,.95); --btn-fg: var(--navy-900); --btn-bd: transparent; }

.gate-success {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; text-align: center; color: #fff;
  background: radial-gradient(80% 60% at 50% 30%, #2BB074, var(--success-700)); animation: fadeIn .2s ease;
}
.gate-success--dup { background: radial-gradient(80% 60% at 50% 30%, #E39A2C, var(--warning-700)); }
.gs-inner { display: grid; justify-items: center; gap: 12px; max-width: 420px; width: 100%; }
.gs-check { width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; animation: popIn .4s var(--ease); }
.gs-check svg { width: 70px; height: 70px; stroke-width: 2.6; }
@keyframes popIn { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.gs-title { font-size: 30px; font-weight: 700; }
.gs-name { font-size: 22px; font-weight: 600; opacity: .95; overflow-wrap: anywhere; }
.gs-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-top: 8px; }
.gs-nums div { background: rgba(255,255,255,.14); border-radius: var(--radius-md); padding: 14px 10px; }
.gs-nums dt { font-size: 14px; opacity: .9; }
.gs-nums dd { margin: 0; font-size: 44px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.gs-note { font-size: 14px; opacity: .9; }
.gate-success .btn { margin-top: 10px; --btn-bg: #fff; --btn-fg: var(--success-700); --btn-bd: #fff; min-width: 220px; }
.gate-success--dup .btn { --btn-fg: var(--warning-700); }

.gate-log h4 { font-size: 13px; color: rgba(245,239,226,.55); font-weight: 600; margin-bottom: 8px; }
.gate-log ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gate-log li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255,255,255,.04); font-size: 14px; }
.gate-log li svg { width: 16px; height: 16px; flex: none; }
.gate-log .ok svg { color: #4FD195; }
.gate-log .bad svg { color: #FF8E86; }
.gate-log .gl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate-log .gl-time { color: rgba(245,239,226,.5); font-size: 12px; white-space: nowrap; }
.gate-loading { display: grid; justify-items: center; gap: 12px; padding: 30px; color: rgba(245,239,226,.7); }

/* Scanner */
.scanner { position: fixed; inset: 0; z-index: 95; background: #000; display: flex; flex-direction: column; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scanner-frame div { width: min(72vw, 300px); aspect-ratio: 1; border-radius: 24px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); position: relative; }
.scanner-frame div::before { content: ""; position: absolute; inset: -3px; border-radius: 26px; border: 3px solid var(--gold-500); }
.scanner-frame div::after { content: ""; position: absolute; inset-inline: 12px; height: 2px; top: 12px; background: var(--gold-400); box-shadow: 0 0 12px var(--gold-400); animation: scanline 2s ease-in-out infinite alternate; }
@keyframes scanline { to { top: calc(100% - 14px); } }
.scanner-top, .scanner-bottom { position: relative; z-index: 2; padding: 18px; color: #fff; text-align: center; }
.scanner-top { padding-top: calc(18px + env(safe-area-inset-top, 0px)); font-weight: 600; font-size: 16px; background: linear-gradient(180deg, rgba(0,0,0,.6), transparent); }
.scanner-bottom { margin-top: auto; padding-bottom: calc(24px + var(--safe-b)); background: linear-gradient(0deg, rgba(0,0,0,.6), transparent); display: grid; gap: 10px; justify-items: center; }
.scanner-bottom .btn { min-width: 200px; }
.scanner-msg { font-size: 14px; opacity: .85; }

/* ---------- 16. Toasts & tooltip ---------- */
.toasts { position: fixed; z-index: 200; top: 16px; inset-inline: 16px; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 460px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--navy-900); color: var(--cream-50); box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .3s var(--ease); border: 1px solid rgba(255,255,255,.08); }
.toast.leaving { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }
.toast svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.toast--success svg { color: #4FD195; }
.toast--error svg { color: #FF8E86; }
.toast--warning svg { color: #FFC266; }
.toast--info svg { color: var(--gold-400); }
.toast .t-title { font-weight: 700; }
.toast .t-msg { opacity: .85; font-size: 13px; }
.toast .t-close { margin-inline-start: auto; background: none; border: 0; color: inherit; opacity: .6; padding: 0; }
.toast .t-close svg { width: 16px; height: 16px; }

.tooltip { position: fixed; z-index: 300; pointer-events: none; background: var(--navy-900); color: var(--cream-50); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; box-shadow: var(--shadow-md); max-width: 240px; line-height: 1.5; white-space: pre-line; }

/* ---------- 17. Responsive ---------- */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12; }
  .invite-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 36px 28px; gap: 22px; }
  .login-hero::after { display: none; }
  .login-copy h1 { font-size: 30px; }
  .login-features { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; height: 60px; gap: 10px; }
  .topbar-title { display: none; }
  .topbar-brand { display: flex; }
  .event-switch .es-label { display: none; }
  .event-switch .select { max-width: 46vw; min-height: 38px; font-size: 14px; }
  .view { padding: 18px 16px calc(var(--bottomnav-h) + 28px + var(--safe-b)); }
  .page-head h1 { font-size: 22px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
    height: calc(var(--bottomnav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: rgba(11,20,38,.97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid rgba(201,162,74,.2);
  }
  .bottom-nav a { display: grid; justify-items: center; align-content: center; gap: 3px; color: rgba(245,239,226,.6); text-decoration: none; font-size: 11px; font-weight: 500; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--gold-400); }
  .event-hero { padding: 22px 20px; }
  .event-hero h2 { font-size: 26px; }
}
@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .kpi-icon { width: 30px; height: 30px; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .role-grid { gap: 8px; }
  .role-card .rc { padding: 12px 6px; }
  .role-card .rc-sub { display: none; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-width: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 94dvh; animation: sheet .3s var(--ease); }
  .modal-foot { border-radius: 0; padding-bottom: calc(16px + var(--safe-b)); }
  .modal-foot .btn { flex: 1; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .5; } }
  .toolbar .select { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .toolbar-count { width: 100%; margin: 0; }
  .meter-hero .big { font-size: 38px; }
  .stack-legend .sl-val { font-size: 17px; }

  /* Tables become cards */
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 10px; }
  .table--cards td { padding: 0; border: 0; }
  .table--cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--ink-500); font-weight: 500; }
  .table--cards td.td-main { grid-column: 1 / -1; }
  .table--cards td.td-wide { grid-column: span 3; }
  .table--cards .num { text-align: start; }
  .table--cards .mini-progress { margin: 4px 0 0; }
  .table--cards td.td-actions { grid-column: 1 / -1; }
  .table--cards .actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 4px; }
  .table--cards tbody tr:hover { background: transparent; }
}
@media (max-width: 420px) {
  .gc-stats dd { font-size: 27px; }
  .gb-title { font-size: 24px; }
  .gs-nums dd { font-size: 38px; }
}

/* ---------- 18. Print (invitation card) ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; inset: 0 0 auto 0; margin: 0 auto; box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .modal-backdrop { position: static; background: none; backdrop-filter: none; }
}
