/* ==========================================================================
   AtEventX — App UI (all roles) · "EVENT CONTROL / BADGE-TECH"
   Identity: AtEventX brand blue (#0d6efd family) on a deep navy→blue control band
   with a dotted grid, TOP navigation (event switcher pill + horizontal tabs),
   live counters strip, ticket-stub KPIs, badge/ticket components with perforated
   edges, printable QR badges. Headings in "Changa", body in Cairo (base.css).
   Builds on ../../../shared/css/base.css
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Changa:wght@500;600;700;800&display=swap");

:root {
  --brand: #0d6efd;
  --brand-600: #0b5ed7;
  --brand-700: #0a58ca;
  --brand-soft: #e7f1ff;
  --cyan: #0dcaf0;
  --primary: #0d6efd; --success: #198754; --info: #0dcaf0; --warning: #ffc107; --danger: #dc3545;
  --purple: #6f42c1; --teal: #20c997; --orange: #fd7e14; --secondary: #6c757d; --dark: #212529; --indigo: #6610f2;
  --success-soft: #e8f3ee; --warning-soft: #fff8e1; --danger-soft: #fdecee; --info-soft: #e6fafe; --purple-soft: #f0eafa; --teal-soft: #e2f8f1; --orange-soft: #fff0e3;
  --topbar: #0b1b3f;
  --topbar-2: rgba(255,255,255,.1);
  --navy: #0b1b3f;
  --navy-2: #0f2a66;
  --bg: #f5f8ff;
  --surface: #ffffff;
  --surface-2: #f3f6fc;
  --border: #dbe3f0;
  --border-2: #cfd9ea;
  --text: #0f1a33;
  --text-2: #4d5b78;
  --muted: #8592ab;
  --row-h: 58px;
  --nav-h: 46px;
  --topbar-h: calc(var(--row-h) + var(--nav-h)); /* total sticky header height (pages use it for sticky offsets) */
  --radius: 10px;
  --font-head: "Changa", "Cairo", system-ui, sans-serif;
  --shadow-sm: 0 1px 2px rgba(11,27,63,.05);
  --shadow: 0 6px 18px rgba(11,27,63,.07);
  --shadow-lg: 0 20px 44px rgba(11,27,63,.16);
  --gradient-brand: linear-gradient(135deg, #3d8bfd 0%, #0d6efd 55%, #0a58ca 100%);
  --gradient-navy: linear-gradient(135deg, #0f2a66 0%, #0b1b3f 60%, #081530 100%);
  --band: linear-gradient(100deg, #081530 0%, #0b1f4d 38%, #0d3c9e 78%, #0d6efd 115%);
  --dots: radial-gradient(rgba(255,255,255,.13) 1px, transparent 1.4px);
  --accent-line: linear-gradient(90deg, #0dcaf0, #0d6efd 55%, #0a58ca);
}

body.app { background: var(--bg); overflow-x: hidden; overflow-x: clip; }
body.app h1, body.app h2, body.app h3, body.app h4 { font-family: var(--font-head); letter-spacing: 0; }
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

/* ---------- Control band (sticky top: brand row + nav tabs) ---------- */
.atx-topbar {
  position: sticky; top: 0; z-index: 45; color: #fff;
  background: var(--dots) 0 0 / 14px 14px, var(--band);
  box-shadow: 0 10px 28px rgba(8,21,48,.22);
}
.atx-topbar::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--accent-line); opacity: .9; pointer-events: none; }
.tb-row { height: var(--row-h); display: flex; align-items: center; gap: 14px; padding: 0 22px; min-width: 0; }
.tb-brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 21px; letter-spacing: .2px; white-space: nowrap; direction: ltr; flex-shrink: 0; }
.tb-brand .tb-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; padding: 3px; background: #fff; box-shadow: 0 6px 16px rgba(13,110,253,.35), inset 0 0 0 1px rgba(255,255,255,.25); }
.tb-brand svg { width: 20px; height: 20px; stroke-width: 2.2; }
.tb-brand:hover { color: #fff; opacity: .94; }
.tb-icon { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: #c9d6f2; display: grid; place-items: center; cursor: pointer; position: relative; transition: .15s; flex-shrink: 0; }
.tb-icon:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); color: #fff; }
.tb-icon .dot-count { position: absolute; top: 1px; left: 1px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #0b1f4d; }
.menu-toggle { display: none; }
.tb-spacer { flex: 1; }
.tb-actions { display: flex; align-items: center; gap: 6px; margin-right: auto; flex-shrink: 0; }
.tb-user { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: 13px; cursor: pointer; transition: .15s; }
.tb-user:hover { background: rgba(255,255,255,.12); }
.tb-user .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.tb-user .chev { width: 14px; height: 14px; opacity: .6; }
.tb-user .meta { max-width: 160px; display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.tb-user .meta b { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-user .meta small { font-size: 11px; color: #a9bbe0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-logout { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; transition: .15s; }
.tb-logout:hover { background: #fff; color: var(--navy); }
.tb-logout svg { width: 15px; height: 15px; }
.net-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #cfe0ff; padding: 4px 11px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); white-space: nowrap; }
.net-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #2fd38a; box-shadow: 0 0 0 3px rgba(47,211,138,.22); }

/* Event switcher pill + entry point selector */
.ctx-selects { display: flex; gap: 8px; min-width: 0; align-items: center; }
.ev-switch { display: flex; align-items: center; gap: 0; min-width: 0; height: 40px; padding: 0 4px 0 12px; border-radius: 999px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.ev-switch:hover { background: rgba(255,255,255,.13); }
.ev-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-inline: 4px 2px; background: #8fa3c8; position: relative; }
.ev-dot.s-live { background: #2fd38a; }
.ev-dot.s-live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #2fd38a; opacity: .6; animation: ping 1.6s ease-out infinite; }
.ev-dot.s-open { background: #6edff6; }
.ev-dot.s-upcoming { background: #9ec5fe; }
.ev-dot.s-closed { background: #6c7a96; }
.ev-switch .ctx-select select { background-color: transparent; border-color: transparent; box-shadow: none; }
.ev-switch .ctx-select select:focus { border-color: transparent; box-shadow: none; }
.ev-dates { font-size: 11.5px; font-weight: 600; color: #cfe0ff; white-space: nowrap; padding: 3px 10px; border-radius: 999px; background: rgba(13,202,240,.16); border: 1px solid rgba(13,202,240,.3); }
.ctx-select { position: relative; display: flex; align-items: center; min-width: 0; }
.ctx-select > svg { position: absolute; right: 10px; width: 16px; height: 16px; color: #8fd8f8; pointer-events: none; }
.ctx-select select {
  appearance: none; height: 36px; max-width: 260px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23cfe0ff' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 10px center;
  color: #fff; font: inherit; font-family: var(--font-head); font-size: 14px; font-weight: 600; padding: 0 32px 0 30px; cursor: pointer; text-overflow: ellipsis; min-width: 0;
}
.ctx-select select:focus { outline: none; border-color: #6edff6; box-shadow: 0 0 0 3px rgba(13,202,240,.3); }
.ctx-select option { color: var(--text); background: #fff; font-family: var(--font); }
.ctx-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #e9f1ff; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.18); padding: 6px 13px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ctx-chip svg { width: 15px; height: 15px; color: #6edff6; }

/* Global search (on the band) */
.global-search { position: relative; flex: 1; max-width: 440px; min-width: 0; }
.global-search input { width: 100%; height: 38px; border: 1px solid rgba(255,255,255,.16); background: rgba(8,21,48,.35); color: #fff; border-radius: 999px; padding: 0 40px 0 44px; font: inherit; font-size: 13px; transition: .15s; }
.global-search input::placeholder { color: #9fb1d6; }
.global-search input:focus { outline: none; border-color: #6edff6; background: #fff; color: var(--text); box-shadow: 0 0 0 3px rgba(13,202,240,.3); }
.global-search > svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #9fb1d6; width: 16px; height: 16px; }
.global-search kbd { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font: 600 11px var(--font); color: #9fb1d6; border: 1px solid rgba(255,255,255,.22); border-radius: 5px; padding: 0 6px; }
.search-results { position: absolute; top: calc(100% + 8px); inset-inline: 0; min-width: 340px; color: var(--text); }

/* Horizontal nav tabs */
.atx-nav { height: var(--nav-h); padding: 0 14px; position: relative; }
.atx-nav .nav-scroll { height: 100%; display: flex; align-items: stretch; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.atx-nav .nav-scroll::-webkit-scrollbar { display: none; }
.nav-link { display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; color: #c9d6f2; font: inherit; font-weight: 600; font-size: 13.5px; white-space: nowrap; position: relative; transition: .14s; flex-shrink: 0; background: none; border: 0; cursor: pointer; border-radius: 10px 10px 0 0; }
.nav-link svg { width: 17px; height: 17px; color: #8fb1ea; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link:hover svg { color: #6edff6; }
.nav-link.active { color: #fff; font-weight: 700; background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.04)); }
.nav-link.active svg { color: #6edff6; }
.nav-link.active::after { content: ""; position: absolute; inset: auto 10px 0 10px; height: 3px; border-radius: 3px 3px 0 0; background: #fff; box-shadow: 0 0 12px rgba(110,223,246,.8); }
.nav-link .count { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; line-height: 18px; }
.nav-link.is-primary .count { background: #fff; color: var(--brand); }
.nav-sep { width: 1px; margin: 12px 6px; background: rgba(255,255,255,.16); flex-shrink: 0; }
.nav-drop .chev { width: 14px; height: 14px; opacity: .7; }
.nav-group { display: flex; flex-shrink: 0; }
.nav-menu {
  position: fixed; top: 0; right: 0; z-index: 70; min-width: 230px; padding: 6px; border-radius: 12px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-lg); color: var(--text);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .16s ease;
}
.nav-group.open > .nav-menu { opacity: 1; visibility: visible; transform: none; }
.nav-menu-head { font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px 10px 4px; }
.nav-menu .nav-link { display: flex; width: 100%; height: auto; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.nav-menu .nav-link svg { color: var(--muted); }
.nav-menu .nav-link:hover { background: var(--brand-soft); color: var(--brand); }
.nav-menu .nav-link.active { background: var(--brand-soft); color: var(--brand); }
.nav-menu .nav-link.active svg { color: var(--brand); }
.nav-menu .nav-link.active::after { inset: 8px auto 8px 0; width: 3px; height: auto; border-radius: 3px; background: var(--brand); box-shadow: none; }
/* legacy (kept for any page that still renders these) */
.nav-section { font-size: 11px; font-weight: 700; color: var(--muted); padding: 14px 20px 6px; }
.side-user, .sidebar-foot { display: none; }
.ver-chip { font-size: 11px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 1px 8px; direction: ltr; }

/* ---------- Event deck (scoped tabs + live counters strip) ---------- */
.main { min-height: calc(100vh - var(--topbar-h)); display: flex; flex-direction: column; }
.content { padding: 26px 28px 36px; flex: 1; width: 100%; max-width: 1600px; margin-inline: auto; }
.atx-deck { background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(11,27,63,.03); }
.deck-inner { max-width: 1600px; margin-inline: auto; padding: 10px 28px; display: flex; align-items: center; gap: 18px; min-width: 0; }
.deck-event { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.deck-label { display: flex; align-items: center; gap: 6px; flex-shrink: 0; max-width: 340px; min-width: 0; }
.deck-label > svg { width: 17px; height: 17px; color: var(--brand); }
.deck-label small { font-size: 12px; color: var(--muted); font-weight: 600; }
.deck-label b { font-family: var(--font-head); font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.deck-label .espill { font-size: 10.5px; padding: 1px 8px; }
.deck-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding: 2px; border-inline-start: 1px dashed var(--border-2); padding-inline-start: 12px; }
.deck-tabs::-webkit-scrollbar { display: none; }
.deck-tabs .nav-link { height: 34px; border-radius: 999px; color: var(--text-2); font-size: 13px; padding: 0 12px; }
.deck-tabs .nav-link svg { color: var(--muted); width: 16px; height: 16px; }
.deck-tabs .nav-link:hover { background: var(--brand-soft); color: var(--brand); }
.deck-tabs .nav-link:hover svg { color: var(--brand); }
.deck-tabs .nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 6px 14px rgba(13,110,253,.25); }
.deck-tabs .nav-link.active svg { color: #fff; }
.deck-tabs .nav-link.active::after { display: none; }
.atx-pulse { display: flex; gap: 8px; margin-right: auto; flex-shrink: 0; }
.pulse-stub {
  --notch: 6px; display: flex; align-items: center; gap: 9px; padding: 6px 14px 6px 12px; min-width: 132px;
  background: linear-gradient(180deg, #f7faff, #eef4ff); border: 1px solid #d3e2fb; border-radius: 10px; position: relative;
  -webkit-mask: radial-gradient(circle var(--notch) at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
}
.pulse-stub .ps-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #fff; color: var(--brand); border: 1px solid #d3e2fb; flex-shrink: 0; }
.pulse-stub .ps-ic svg { width: 16px; height: 16px; }
.pulse-stub small { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.pulse-stub b { display: block; font-family: var(--font-head); font-size: 19px; font-weight: 700; line-height: 1.15; color: var(--navy); font-variant-numeric: tabular-nums; }
.pulse-stub.is-live { background: var(--band); border-color: transparent; }
.pulse-stub.is-live small { color: #cfe0ff; }
.pulse-stub.is-live small .live-dot { color: #2fd38a; width: 7px; height: 7px; }
.pulse-stub.is-live b { color: #fff; }
.pulse-stub.is-live .ps-ic { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #6edff6; }

/* Footer */
.app-foot { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: 13px; }
.by-almgrat { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.by-almgrat img { width: 18px; height: 18px; }
.by-almgrat:hover { color: var(--brand); }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 240px; z-index: 60; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .16s ease;
}
.dropdown.open > .dropdown-menu, .dropdown-menu.show { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--text); font: inherit; font-size: 14px; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: right; }
.dropdown-menu a:hover, .dropdown-menu button.item:hover { background: var(--surface-2); }
.dropdown-menu a svg, .dropdown-menu button.item svg { color: var(--muted); }
.dropdown-menu .danger, .dropdown-menu .danger svg { color: var(--danger); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown-head { padding: 12px 12px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dropdown-head b { font-size: 15px; }
.notif-menu { width: 380px; padding: 0; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); position: relative; }
.notif-item .f-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.notif-item.unread { background: #f4f8ff; }
.notif-item.unread::after { content: ""; position: absolute; left: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.notif-item p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.notif-item b { font-size: 14px; display: block; }
.notif-item small { font-size: 12px; color: var(--muted); }
.notif-foot { display: block; text-align: center; padding: 12px; border-top: 1px solid var(--border); font-weight: 600; font-size: 14px; }

.search-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; max-height: 440px; overflow-y: auto; z-index: 60; }
.search-group { font-size: 11px; font-weight: 700; color: var(--muted); padding: 8px 10px 4px; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; color: var(--text); }
.search-item:hover, .search-item.focus { background: var(--brand-soft); }
.search-item .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.search-item .tail { margin-right: auto; flex-shrink: 0; }
.search-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Page header ---------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb svg { width: 14px; height: 14px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head h1 > svg { width: 26px; height: 26px; color: var(--text); }
.page-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.page-head .count-chip { font-size: 14px; font-weight: 700; background: #6c757d; color: #fff; border-radius: 7px; padding: 1px 10px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; max-width: 100%; }

/* ---------- Buttons ---------- */
.btn { border-radius: 8px; padding: 8px 15px; font-size: 14px; }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 10px; }
.btn-xl { padding: 20px 22px; font-size: 16px; border-radius: 12px; flex-direction: column; gap: 8px; }
.btn-xl svg { width: 30px; height: 30px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #157347; color: #fff; }
.btn-info { background: var(--info); color: #052c36; }
.btn-info:hover { background: #31d2f2; }
.btn-warning { background: var(--warning); color: #3d2e00; }
.btn-warning:hover { background: #ffca2c; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #bb2d3b; color: #fff; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #343a40; color: #fff; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: #59359a; color: #fff; }
.btn-light { background: #f1f3f5; color: var(--text); }
.btn-light:hover { background: #e9ecef; }
.btn-soft { background: var(--brand-soft); color: var(--brand-700); }
.btn-soft:hover { background: #d5e6ff; }
.btn-outline-primary { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-success { background: #fff; border-color: var(--success); color: var(--success); }
.btn-outline-success:hover { background: var(--success); color: #fff; }
.btn-outline-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }
.btn-outline-dark { background: #fff; border-color: var(--dark); color: var(--dark); }
.btn-outline-dark:hover { background: var(--dark); color: #fff; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 7px; border: 1px solid var(--border-2); background: #fff; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; transition: .12s; }
.btn-icon:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.btn-icon.primary { border-color: var(--primary); color: var(--primary); }
.btn-icon.dark { border-color: var(--dark); color: var(--dark); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
button:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ---------- Grid & utilities ---------- */
.grid { display: grid; gap: 18px; }
.grid > *, .stack > *, .row-between > *, .card { min-width: 0; } /* let wide tables scroll inside .table-wrap instead of stretching the page */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: #b58100; } .text-brand, .text-primary { color: var(--brand); } .text-info { color: #0aa2c0; } .text-purple { color: var(--purple); } .text-orange { color: var(--orange); }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fs-16 { font-size: 16px; } .fs-18 { font-size: 18px; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Cards ---------- */
.card { border-radius: 12px; border-color: var(--border); box-shadow: 0 1px 2px rgba(33,37,41,.04), 0 2px 10px rgba(33,37,41,.03); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h3 > svg { width: 18px; height: 18px; color: var(--text-2); }
.card-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.card-body { padding: 18px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }

/* ---------- KPI cards (pastel icon squares) ---------- */
.kpi { padding: 18px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; color: inherit; }
a.kpi:hover, .kpi.clickable:hover { border-color: #cfe2ff; box-shadow: 0 10px 26px rgba(13,110,253,.08); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--c-soft, var(--brand-soft)); color: var(--c, var(--brand)); flex-shrink: 0; }
.kpi-icon svg { width: 24px; height: 24px; stroke-width: 1.8; }
.kpi-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.kpi-foot { font-size: 12px; color: var(--muted); }
/* horizontal variant (as in the product): icon + [value / label] */
.kpi-h { flex-direction: row; align-items: center; gap: 14px; padding: 20px; }
.kpi-h .kpi-icon { width: 52px; height: 52px; }
.kpi-h .kpi-body { min-width: 0; flex: 1; }
.kpi-h .kpi-value { font-size: 26px; }
.kpi-h .kpi-label { display: block; margin-top: 2px; }
.kpi-h .kpi-foot { margin-top: 4px; }
.kpi .bar { position: absolute; inset: auto 0 0 0; height: 3px; background: var(--c, var(--brand)); opacity: .9; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.trend svg { width: 13px; height: 13px; }
.trend.up { color: var(--success); background: var(--success-soft); }
.trend.down { color: var(--danger); background: var(--danger-soft); }
.trend.flat { color: var(--text-2); background: #f1f3f5; }
.c-blue   { --c: #0d6efd; --c-soft: #e7f1ff; }
.c-green  { --c: #198754; --c-soft: #e8f3ee; }
.c-cyan   { --c: #0aa2c0; --c-soft: #e6fafe; }
.c-amber  { --c: #e0a800; --c-soft: #fff8e1; }
.c-red    { --c: #dc3545; --c-soft: #fdecee; }
.c-gray   { --c: #495057; --c-soft: #eef0f2; }
.c-purple { --c: #6f42c1; --c-soft: #f0eafa; }
.c-teal   { --c: #13a37a; --c-soft: #e2f8f1; }
.c-orange { --c: #fd7e14; --c-soft: #fff0e3; }
.c-dark   { --c: #212529; --c-soft: #e9ecef; }
.c-indigo { --c: #6610f2; --c-soft: #efe7fe; }

/* Mini stat tiles (reception style) */
.stat-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.stat-tile { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 10px; text-align: center; }
.stat-tile b { display: block; font-size: 26px; font-weight: 800; line-height: 1.15; color: var(--c, var(--text)); font-variant-numeric: tabular-nums; }
.stat-tile small { font-size: 12px; color: var(--text-2); font-weight: 600; }
.stat-tile svg { width: 26px; height: 26px; color: var(--c, var(--text-2)); }

/* Welcome / event hero banner */
.welcome {
  border-radius: 16px; padding: 24px 26px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(80% 140% at 0% 0%, rgba(13,110,253,.55) 0%, rgba(13,110,253,0) 60%), var(--gradient-navy);
}
.welcome::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(90deg, transparent, #000 75%); pointer-events: none; }
.welcome h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.welcome p { margin: 0; opacity: .85; }
.welcome > * { position: relative; z-index: 1; }
.welcome .btn-outline { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); color: #fff; }
.welcome .btn-outline:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ---------- Badges & pills ---------- */
.badge { font-size: 12px; padding: 3px 10px; gap: 6px; white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: #997404; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: #087990; }
.badge-brand, .badge-primary { background: var(--brand-soft); color: var(--brand); }
.badge-slate { background: #eef0f2; color: #495057; }
.badge-violet { background: var(--purple-soft); color: var(--purple); }
.badge-dark { background: #343a40; color: #fff; }
.badge-orange { background: var(--orange-soft); color: #c35a00; }
.badge-teal { background: var(--teal-soft); color: #13795b; }
.badge-lg { font-size: 13px; padding: 5px 12px; }
/* visitor type pill (solid) */
.tpill { display: inline-flex; align-items: center; gap: 4px; background: var(--tc); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 11px; border-radius: 999px; white-space: nowrap; line-height: 1.6; }
.tpill.soft { background: var(--ts); color: var(--tc); }
.tpill svg { width: 13px; height: 13px; }
/* registration status pill (solid, compact) */
.spill { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; padding: 1px 9px; border-radius: 6px; white-space: nowrap; line-height: 1.7; }
.sp-success { background: var(--success); color: #fff; }
.sp-warning { background: var(--warning); color: #3d2e00; }
.sp-danger { background: var(--danger); color: #fff; }
.sp-secondary { background: #adb5bd; color: #fff; }
/* attendance pill */
.apill { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; padding: 1px 9px; border-radius: 6px; white-space: nowrap; line-height: 1.7; }
.ap-inside { background: var(--primary); color: #fff; }
.ap-out { background: #6c757d; color: #fff; }
.ap-attended { background: var(--info); color: #052c36; }
.ap-none { background: #f1f3f5; color: #868e96; font-weight: 600; }
/* event status pill */
.espill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 6px; white-space: nowrap; }
.es-live { background: var(--danger); color: #fff; }
.es-open { background: var(--success); color: #fff; }
.es-upcoming { background: var(--info); color: #052c36; }
.es-draft { background: #e9ecef; color: #495057; }
.es-closed { background: #343a40; color: #fff; }
/* lead rating pill */
.rpill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.rpill svg { width: 13px; height: 13px; }
.rp-hot { background: #fdecee; color: #c62828; }
.rp-warm { background: #fff3cd; color: #946200; }
.rp-cold { background: #e7f1ff; color: #0a58ca; }
.count-dot { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; }

/* Live indicators */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; position: relative; flex-shrink: 0; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: .6; animation: ping 1.6s ease-out infinite; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--danger); background: var(--danger-soft); padding: 3px 10px; border-radius: 999px; }
.live-badge.green { color: var(--success); background: var(--success-soft); }
.counter { font-variant-numeric: tabular-nums; font-weight: 800; transition: color .3s; }
.counter.bump { animation: bump .6s ease; }
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes bump { 0% { color: inherit; } 30% { color: var(--success); transform: scale(1.06); } 100% { color: inherit; transform: none; } }
.flash { animation: flashRow 1.6s ease; }
@keyframes flashRow { 0% { background: #d1e7dd; } 100% { background: transparent; } }

/* ---------- Avatars ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; background: var(--av, var(--brand)); }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 96px; height: 96px; font-size: 34px; border: 4px solid #fff; box-shadow: var(--shadow); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person b { display: block; font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; font-size: 12px; color: var(--muted); }
a.person:hover b { color: var(--brand); }
.name-link { color: var(--brand); font-weight: 700; }
.name-link:hover { text-decoration: underline; }

/* ---------- Tables ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .search-input { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.toolbar .search-input input { padding-right: 38px; }
.toolbar .search-input svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; }
.toolbar .spacer { flex: 1; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 16px 20px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; font-weight: 700; font-size: 13px; color: var(--text); background: #fff; padding: 12px 14px; border-bottom: 2px solid var(--border-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #eceef0; vertical-align: middle; white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8f9fb; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.table .code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--text-2); direction: ltr; display: inline-block; }
.table-sm td, .table-sm th { padding: 9px 12px; }
.table-striped tbody tr:nth-child(even) { background: #fafbfc; }
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pagination button { min-width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--border-2); background: #fff; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .pg-gap { padding: 0 4px; color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; height: 40px; border: 1px solid #ced4da; border-radius: 8px; padding: 0 12px;
  font: inherit; font-size: 14px; background: #fff; color: var(--text); transition: .15s;
}
.input-lg { height: 52px; font-size: 16px; border-radius: 10px; }
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23495057' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 34px; }
.toolbar .select { width: auto; min-width: 140px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: #86b7fe; box-shadow: 0 0 0 4px rgba(13,110,253,.18); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.invalid-msg { font-size: 12px; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #ced4da; border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(-18px); }
.check { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.choice { border: 1.5px solid var(--border-2); border-radius: 12px; padding: 14px; cursor: pointer; transition: .15s; background: #fff; position: relative; text-align: center; font: inherit; color: inherit; }
.choice:hover { border-color: #9ec5fe; }
.choice.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(13,110,253,.12); }
.choice.selected::after { content: "✓"; position: absolute; top: 8px; left: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; display: grid; place-items: center; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; }
.input-icon .input { padding-right: 38px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--surface-2); border: 1px dashed var(--border-2); border-radius: 8px; padding: 6px 12px; color: var(--text-2); }
.file-chip svg { width: 15px; height: 15px; }
.dropzone { border: 2px dashed #b6d4fe; background: #f6faff; border-radius: 12px; padding: 22px; text-align: center; color: var(--text-2); font-size: 14px; }

/* Big search (reception) */
.big-search { position: relative; }
.big-search input { width: 100%; height: 56px; border: 2px solid #9ec5fe; border-radius: 12px; padding: 0 20px 0 64px; font: inherit; font-size: 17px; box-shadow: 0 0 0 4px rgba(13,110,253,.08); }
.big-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 5px rgba(13,110,253,.18); }
.big-search .bs-btn { position: absolute; left: 6px; top: 6px; bottom: 6px; width: 48px; border-radius: 9px; border: 1px solid var(--border-2); background: #fff; display: grid; place-items: center; color: var(--text); cursor: pointer; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 11px 15px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
.seg { display: inline-flex; padding: 3px; background: #eef0f2; border-radius: 9px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 5px 13px; border-radius: 7px; cursor: pointer; flex-shrink: 0; white-space: nowrap; }
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(33,37,41,.12); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(20,24,28,.55); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.modal-backdrop.show { opacity: 1; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.25); transform: translateY(12px) scale(.98); transition: transform .2s ease; }
.modal-backdrop.show .modal { transform: none; }
.modal.lg { max-width: 860px; }
.modal.xl { max-width: 1100px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
.success-mark { width: 76px; height: 76px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; margin: 4px auto 16px; animation: pop .35s ease; }
.success-mark svg { width: 38px; height: 38px; stroke-width: 2.5; }
.reg-modal { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; }
.rm-side { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; align-self: start; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 400px; background: var(--topbar); color: #fff; border-radius: 12px; padding: 13px 15px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .25s ease; }
.toast .t-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(25,135,84,.25); color: #75b798; flex-shrink: 0; }
.toast.error .t-icon { background: rgba(220,53,69,.25); color: #ea868f; }
.toast.info .t-icon { background: rgba(13,202,240,.2); color: #6edff6; }
.toast.warning .t-icon { background: rgba(255,193,7,.2); color: #ffda6a; }
.toast.hide { animation: toastOut .25s ease forwards; }

/* ---------- Lists / Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed li.new { animation: fade .4s ease; }
.feed .f-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.feed .f-icon svg { width: 17px; height: 17px; }
.feed p { margin: 0; font-size: 14px; }
.feed small { color: var(--muted); font-size: 12px; }
.t-info { background: var(--info-soft); color: #0aa2c0; }
.t-success { background: var(--success-soft); color: var(--success); }
.t-warning { background: var(--warning-soft); color: #b58100; }
.t-danger { background: var(--danger-soft); color: var(--danger); }
.t-brand { background: var(--brand-soft); color: var(--brand); }
.t-purple { background: var(--purple-soft); color: var(--purple); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #eef0f2; }
.list-row:last-child { border-bottom: 0; }
.list-plain > .list-row { padding-inline: 20px; }
.list-plain > .list-row:hover { background: #fafbfc; }

/* Ranked list (top cities / types) */
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 9px 0; font-size: 14px; border-bottom: 1px solid #f1f3f5; }
.rank-row:last-child { border-bottom: 0; }
.rank-row .progress { grid-column: 1 / -1; height: 6px; }

/* Progress */
.progress { height: 8px; background: #eef0f2; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--brand)); transition: width .6s ease; }
.ring { --p: 75; --c: var(--brand); width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #eef0f2 0); position: relative; flex-shrink: 0; }
.ring::before { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.ring > * { position: relative; text-align: center; }
.ring b { font-size: 24px; font-weight: 800; display: block; line-height: 1; }
.ring small { font-size: 12px; color: var(--muted); }

/* Chart containers */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 340px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.dash { height: 0; border-top: 2px dashed currentColor; width: 14px; border-radius: 0; }

/* Empty state */
.empty-state { padding: 44px 24px; }
.empty-state .empty-icon { background: var(--brand-soft); color: var(--brand); }

/* Info list */
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.info-list div small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.info-list div b { font-size: 14px; font-weight: 600; }

/* Event list rows */
.event-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid #eef0f2; color: inherit; }
.event-row:last-child { border-bottom: 0; }
.event-row:hover { background: #fafbfc; }
.event-row .ev-date { width: 54px; flex-shrink: 0; text-align: center; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; background: #fff; }
.event-row .ev-date small { display: block; font-size: 11px; font-weight: 700; color: #fff; background: var(--c, var(--brand)); padding: 2px 0; }
.event-row .ev-date b { display: block; font-size: 20px; font-weight: 800; line-height: 1.4; }
.event-row .ev-name { font-weight: 700; color: var(--brand); font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-row .ev-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.event-row .ev-meta span { display: inline-flex; align-items: center; gap: 4px; }
.event-row .ev-meta svg { width: 13px; height: 13px; }
.event-row .ev-side { margin-right: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

/* Timeline (entries history) */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 26px 14px 0; }
.timeline li::before { content: ""; position: absolute; right: 6px; top: 6px; bottom: -6px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; right: 1px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--secondary); }
.timeline li.done::after { border-color: var(--success); background: var(--success); }
.timeline li.ws::after { border-color: var(--purple); background: var(--purple); }
.timeline li.out::after { border-color: var(--secondary); }
.timeline b { display: block; font-size: 14px; }
.timeline small { color: var(--muted); font-size: 12px; }

/* Session (agenda) */
.session { display: flex; gap: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: #fff; align-items: center; border-right: 4px solid var(--c, var(--brand)); }
.session .time { text-align: center; min-width: 64px; }
.session .time b { display: block; font-size: 16px; font-weight: 800; }
.session .time small { font-size: 12px; color: var(--muted); }
.session h4 { margin: 0 0 2px; font-size: 15px; }
.session .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.session .meta span { display: inline-flex; align-items: center; gap: 4px; }
.session .meta svg { width: 14px; height: 14px; }

/* Small icon chip */
.cat-ic { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.cat-ic svg { width: 14px; height: 14px; }
.cat-ic.lg { width: 34px; height: 34px; border-radius: 10px; }
.cat-ic.lg svg { width: 17px; height: 17px; }
.logo-tile { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--c, var(--brand)); flex-shrink: 0; font-size: 15px; }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-strip > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.stat-strip small { display: block; font-size: 12px; color: var(--muted); }
.stat-strip b { font-size: 18px; font-weight: 800; }

/* QR (pseudo) */
.qr { width: 132px; height: 132px; background: #fff; padding: 8px; border-radius: 10px; display: grid; grid-template-columns: repeat(25, 1fr); grid-template-rows: repeat(25, 1fr); gap: 0; flex-shrink: 0; }
.qr i { display: block; }
.qr i.on { background: #111; }

/* ==========================================================================
   Printable QR badge (CP.badge) — sizes use container units so the same
   markup renders at any preview width and at real mm when printing.
   ========================================================================== */
.atx-badge {
  container-type: inline-size; position: relative; background: #fff; color: #111; overflow: hidden;
  border-radius: 2.4cqw; box-shadow: 0 10px 30px rgba(33,37,41,.14), 0 0 0 1px rgba(0,0,0,.06);
  display: flex; flex-direction: column; font-family: var(--font); max-width: 100%;
}
.atx-badge.is-print { border-radius: 0; box-shadow: none; }
.atx-badge .ab-head { background: var(--navy); color: #fff; padding: 5cqw 6cqw 4.5cqw; text-align: center; position: relative; }
.atx-badge .ab-head::after { content: ""; position: absolute; inset: auto 0 -1px 0; height: 1.6cqw; background: linear-gradient(90deg, #0d6efd, #0dcaf0, #20c997); }
.atx-badge .ab-tag { display: inline-flex; align-items: center; gap: 1.6cqw; font-weight: 800; font-size: 4cqw; letter-spacing: .4cqw; direction: ltr; color: #9ec5fe; }
.atx-badge .ab-tag svg { width: 4.6cqw; height: 4.6cqw; }
.atx-badge .ab-event { font-weight: 800; font-size: 6.2cqw; line-height: 1.3; margin-top: 1.4cqw; }
.atx-badge .ab-meta { font-size: 3cqw; opacity: .78; margin-top: .8cqw; line-height: 1.4; }
.atx-badge .ab-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: 3cqw; padding: 5cqw 6cqw 4cqw; text-align: center; min-height: 0; }
.atx-badge .ab-name { font-weight: 800; font-size: calc(var(--fs) * .46cqw); line-height: 1.25; color: #0f1729; }
.atx-badge .ab-job { font-size: calc(var(--fs) * .21cqw); color: #555c63; margin-top: 1.2cqw; line-height: 1.45; }
.atx-badge .ab-code { display: flex; flex-direction: column; align-items: center; gap: 1.6cqw; }
.atx-badge .ab-qr { width: calc(var(--qs) * 1cqw); height: calc(var(--qs) * 1cqw); padding: 1.6cqw; border-radius: 1.4cqw; border: .35cqw solid #e3e6ea; }
.atx-badge .ab-reg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 3.4cqw; font-weight: 700; letter-spacing: .3cqw; direction: ltr; color: #343a40; }
.atx-badge .ab-strip { background: var(--tc); color: #fff; text-align: center; font-weight: 800; font-size: 5.2cqw; padding: 3.2cqw 2cqw; letter-spacing: .3cqw; }
.atx-badge.q-start .ab-code { align-self: flex-start; }
.atx-badge.q-end .ab-code { align-self: flex-end; }
/* landscape (e.g. 86×54 PVC card): QR beside the name */
.atx-badge.o-land .ab-head { padding: 2.6cqw 4cqw 2.4cqw; display: flex; align-items: center; gap: 2.4cqw; text-align: right; }
.atx-badge.o-land .ab-head::after { height: 1cqw; }
.atx-badge.o-land .ab-tag { font-size: 2.8cqw; flex-shrink: 0; }
.atx-badge.o-land .ab-tag svg { width: 3.4cqw; height: 3.4cqw; }
.atx-badge.o-land .ab-event { font-size: 3.6cqw; margin-top: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atx-badge.o-land .ab-meta { display: none; }
.atx-badge.o-land .ab-main { flex-direction: row; justify-content: space-between; text-align: right; padding: 3cqw 4.4cqw; gap: 4cqw; }
.atx-badge.o-land .ab-id { flex: 1; min-width: 0; }
.atx-badge.o-land .ab-name { font-size: calc(var(--fs) * .44cqw); }
.atx-badge.o-land .ab-job { font-size: calc(var(--fs) * .22cqw); }
.atx-badge.o-land .ab-qr { width: calc(var(--qs) * .78cqw); height: calc(var(--qs) * .78cqw); padding: 1.2cqw; }
.atx-badge.o-land .ab-reg { font-size: 2.4cqw; }
.atx-badge.o-land.q-end .ab-main { flex-direction: row-reverse; }
.atx-badge.o-land .ab-strip { font-size: 3.4cqw; padding: 1.8cqw; }
.badge-stage { background: repeating-conic-gradient(#eef0f3 0% 25%, #f7f8fa 0% 50%) 0 0 / 22px 22px; border-radius: 12px; padding: 26px; display: grid; place-items: center; }

/* print area — only badges are printed while body.is-printing */
.print-area { display: none; }
@media print {
  body.is-printing { padding: 0 !important; background: #fff !important; }
  body.is-printing > *:not(#atxPrint) { display: none !important; }
  body.is-printing #atxPrint { display: block !important; }
  .print-page { page-break-after: always; break-after: page; }
  .print-page:last-child { page-break-after: auto; break-after: auto; }
  .atx-badge, .atx-badge * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body:not(.is-printing) .atx-topbar, body:not(.is-printing) .atx-deck, body:not(.is-printing) .tabbar, body:not(.is-printing) .page-actions,
  body:not(.is-printing) .toolbar, body:not(.is-printing) .toast-wrap, body:not(.is-printing) .app-foot { display: none !important; }
  body:not(.is-printing) .main { margin: 0; }
}

/* ==========================================================================
   Mobile-app roles (scanner / exhibitor / visitor)
   ========================================================================== */
body.mobile-role .content { max-width: 860px; }
.tabbar { display: none; }
.app-hero { border-radius: 18px; padding: 18px; color: #fff; background: radial-gradient(90% 140% at 100% 0%, rgba(13,202,240,.35), transparent 60%), var(--gradient-navy); position: relative; overflow: hidden; }
.app-hero h2 { font-size: 20px; font-weight: 800; margin: 0 0 2px; }
.app-hero p { margin: 0; opacity: .82; font-size: 13px; }
.big-action { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; border: 0; border-radius: 16px; padding: 22px; font: inherit; font-size: 18px; font-weight: 800; color: #fff; background: var(--success); box-shadow: 0 14px 30px rgba(25,135,84,.28); cursor: pointer; }
.big-action svg { width: 30px; height: 30px; }
.big-action.blue { background: var(--primary); box-shadow: 0 14px 30px rgba(13,110,253,.28); }
.m-list { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.m-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #f0f2f4; color: inherit; }
.m-item:last-child { border-bottom: 0; }
.m-item .grow { flex: 1; min-width: 0; }
.m-item .grow b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-item .grow small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Camera viewfinder (simulated) */
.viewfinder { position: relative; width: 100%; max-width: 420px; margin-inline: auto; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #2a3138 0%, #11161b 70%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 18px 40px rgba(0,0,0,.25); }
.viewfinder::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 2px, transparent 2px 4px); pointer-events: none; }
.vf-frame { position: absolute; inset: 16%; }
.vf-frame span { position: absolute; width: 18%; height: 18%; border: 4px solid #fff; border-radius: 6px; filter: drop-shadow(0 0 6px rgba(13,202,240,.5)); }
.vf-frame span:nth-child(1) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.vf-frame span:nth-child(2) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.vf-frame span:nth-child(3) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.vf-frame span:nth-child(4) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.vf-line { position: absolute; inset-inline: 14%; height: 3px; top: 16%; border-radius: 3px; background: linear-gradient(90deg, transparent, #0dcaf0, #20c997, #0dcaf0, transparent); box-shadow: 0 0 18px 4px rgba(13,202,240,.45); animation: scanline 2.2s ease-in-out infinite; }
.vf-hint { position: absolute; inset-inline: 0; bottom: 14px; text-align: center; color: rgba(255,255,255,.85); font-size: 13px; font-weight: 600; }
.vf-ghost { position: absolute; inset: 26%; opacity: .16; filter: blur(.4px); }
.vf-ghost .qr { width: 100%; height: 100%; background: transparent; padding: 0; }
.vf-ghost .qr i.on { background: #fff; }
.viewfinder.ok { box-shadow: inset 0 0 0 6px var(--success); }
.viewfinder.err { box-shadow: inset 0 0 0 6px var(--danger); }
.viewfinder.warn { box-shadow: inset 0 0 0 6px var(--warning); }
.viewfinder.ok .vf-line, .viewfinder.err .vf-line, .viewfinder.warn .vf-line { animation-play-state: paused; opacity: 0; }
@keyframes scanline { 0% { top: 16%; } 50% { top: 82%; } 100% { top: 16%; } }
.scan-result { border-radius: 18px; padding: 18px; display: flex; gap: 14px; align-items: center; border: 2px solid; background: #fff; animation: pop .3s ease; }
.scan-result .sr-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.scan-result .sr-icon svg { width: 30px; height: 30px; stroke-width: 2.6; }
.scan-result h3 { margin: 0; font-size: 18px; }
.scan-result p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.scan-result.ok { border-color: var(--success); background: #f3faf6; } .scan-result.ok .sr-icon { background: var(--success); }
.scan-result.err { border-color: var(--danger); background: #fff5f6; } .scan-result.err .sr-icon { background: var(--danger); }
.scan-result.warn { border-color: var(--warning); background: #fffbeb; } .scan-result.warn .sr-icon { background: var(--warning); color: #3d2e00; }

/* Phone frame (desktop preview of a mobile screen) */
.phone { width: 300px; max-width: 100%; border-radius: 40px; background: #111; padding: 12px; box-shadow: 0 30px 60px rgba(0,0,0,.25); position: relative; }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 90px; height: 22px; border-radius: 12px; background: #000; z-index: 2; }
.phone .screen { border-radius: 30px; overflow: hidden; background: var(--bg); min-height: 560px; position: relative; }

/* Animations */
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.9); opacity: 0; } 70% { transform: scale(1.02); } 100% { transform: scale(1); opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }
.fade-in { animation: fade .3s ease both; }

/* ==========================================================================
   EVENT CONTROL skin — crisp cards with a thin blue top accent, ticket-stub
   KPIs (perforated edge via radial-gradient masks), badge/QR motifs,
   high-contrast scan screens. Scoped to :where(body.app) (role pages) so login /
   live wall / kiosk keep their own look.
   ========================================================================== */
:where(body.app) .card { position: relative; border-color: var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgba(11,27,63,.04); }
:where(body.app) .card::before { content: ""; position: absolute; top: -1px; inset-inline: -1px; height: 3px; border-radius: 12px 12px 0 0; background: var(--accent-line); pointer-events: none; z-index: 1; opacity: .85; }
:where(body.app) .card-head { border-bottom-color: var(--border); }
:where(body.app) .card-head h3 { font-family: var(--font-head); font-size: 16px; font-weight: 700; }
:where(body.app) .card-head h3 > svg { color: var(--brand); }
:where(body.app) .card-foot { background: var(--surface-2); border-radius: 0 0 12px 12px; }

/* page header: Changa title + perforated rule */
:where(body.app) .page-head { position: relative; padding-bottom: 16px; }
:where(body.app) .page-head::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: repeating-linear-gradient(90deg, #cfd9ea 0 8px, transparent 8px 14px); }
:where(body.app) .page-head h1 { font-family: var(--font-head); font-weight: 700; font-size: 26px; color: var(--navy); }
:where(body.app) .page-head h1 > svg { color: var(--brand); width: 24px; height: 24px; padding: 6px; box-sizing: content-box; border-radius: 10px; background: var(--brand-soft); }
:where(body.app) .page-head .count-chip { background: var(--navy); font-family: var(--font-head); border-radius: 999px; }

/* buttons: pill-ish, brand blue */
:where(body.app) .btn { border-radius: 999px; }
:where(body.app) .btn-sm { border-radius: 999px; }
:where(body.app) .btn-xl, :where(body.app) .btn-block.btn-lg { border-radius: 14px; }
:where(body.app) .btn-primary { background: linear-gradient(135deg, #3d8bfd, #0d6efd 60%, #0a58ca); border-color: #0b5ed7; box-shadow: 0 6px 14px rgba(13,110,253,.22); }
:where(body.app) .btn-primary:hover { background: #0b5ed7; }
:where(body.app) .btn-icon { border-radius: 9px; }

/* KPI → ticket stubs: icon stub | perforation | value */
:where(body.app) .kpi { border-radius: 12px; border-color: var(--border); background: #fff; }
:where(body.app) .kpi::before { display: none; }
:where(body.app) .kpi-value { font-family: var(--font-head); font-weight: 700; color: var(--navy); letter-spacing: 0; }
:where(body.app) .kpi-label { color: var(--text-2); }
:where(body.app) .kpi-icon { border-radius: 12px; background: var(--c-soft, var(--brand-soft)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--brand)) 18%, transparent); }
:where(body.app) .kpi-h {
  --stub: 86px; --pad: 18px; --notch: 8px; padding-inline-start: var(--pad); gap: 0; overflow: visible;
  background: linear-gradient(90deg, #fff calc(100% - var(--stub)), color-mix(in srgb, var(--c-soft, var(--brand-soft)) 70%, #fff) 0);
  -webkit-mask: radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
}
:where(body.app) .kpi-h::after { content: ""; position: absolute; top: 12px; bottom: 12px; right: var(--stub); border-right: 2px dashed color-mix(in srgb, var(--c, var(--brand)) 30%, #d5deec); pointer-events: none; }
:where(body.app) .kpi-h .kpi-icon { width: calc(var(--stub) - var(--pad) - 14px); height: calc(var(--stub) - var(--pad) - 14px); margin-inline-end: 30px; background: #fff; }
:where(body.app) .kpi-h .kpi-body { padding-inline-start: 0; }
:where(body.app) .kpi:not(.kpi-h) {
  --notch: 8px; --perf: 72px;
  -webkit-mask: radial-gradient(circle var(--notch) at 0 var(--perf), #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% var(--perf), #0000 97%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 var(--perf), #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% var(--perf), #0000 97%, #000) right / 51% 100% no-repeat;
}
:where(body.app) .kpi:not(.kpi-h)::after { content: ""; position: absolute; top: calc(var(--perf) - 1px); inset-inline: 14px; border-top: 2px dashed #dbe3f0; pointer-events: none; }
:where(body.app) .kpi:not(.kpi-h) .kpi-top { min-height: 48px; }
:where(body.app) a.kpi:hover, :where(body.app) .kpi.clickable:hover { border-color: #9ec5fe; box-shadow: none; transform: translateY(-1px); }
:where(body.app) .kpi { transition: transform .15s, border-color .15s; }
:where(body.app) .kpi .bar { background: var(--c, var(--brand)); height: 3px; }

/* stat tiles → mini tickets */
:where(body.app) .stat-tile { border-color: var(--border); border-top: 3px solid var(--c, var(--brand)); border-radius: 10px; }
:where(body.app) .stat-tile b { font-family: var(--font-head); font-weight: 700; }
:where(body.app) .stat-strip > div { background: #fff; border-color: var(--border); border-inline-start: 3px solid var(--brand); }
:where(body.app) .stat-strip b { font-family: var(--font-head); font-weight: 700; color: var(--navy); }

/* welcome / hero bands follow the control band */
:where(body.app) .welcome, :where(body.app) .app-hero { background: var(--dots) 0 0 / 14px 14px, radial-gradient(70% 140% at 0% 0%, rgba(13,202,240,.32), transparent 60%), var(--band); }
:where(body.app) .welcome::before { display: none; }
:where(body.app) .app-hero > * { position: relative; z-index: 1; }
:where(body.app) .welcome h2, :where(body.app) .app-hero h2 { font-family: var(--font-head); font-weight: 700; }
:where(body.app) .welcome::after, :where(body.app) .app-hero::after {
  content: ""; position: absolute; left: 22px; top: 50%; width: 84px; height: 84px; transform: translateY(-50%) rotate(-6deg); opacity: .1; pointer-events: none; border-radius: 10px;
  background:
    linear-gradient(#fff 0 0) 0 0 / 26px 26px no-repeat, linear-gradient(#fff 0 0) 100% 0 / 26px 26px no-repeat, linear-gradient(#fff 0 0) 0 100% / 26px 26px no-repeat,
    repeating-conic-gradient(#fff 0 25%, transparent 0 50%) 0 0 / 14px 14px;
}

/* tables: crisp header */
:where(body.app) .table th { background: var(--surface-2); color: var(--navy); font-size: 12.5px; border-bottom: 1px solid var(--border-2); }
:where(body.app) .table tbody tr:hover { background: #f4f8ff; }
:where(body.app) .toolbar { background: #fbfcff; }
:where(body.app) .pagination button { border-radius: 999px; }

/* tabs / segmented */
:where(body.app) .tab.active { color: var(--brand); border-bottom-width: 3px; }
:where(body.app) .seg { background: #e9eff9; border-radius: 999px; }
:where(body.app) .seg button { border-radius: 999px; }
:where(body.app) .seg button.active { color: var(--brand); }

/* registration / badge components → ticket shapes */
:where(body.app) .rm-side {
  background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--brand); border-radius: 12px;
  -webkit-mask: radial-gradient(circle 9px at 0 70%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 70%, #0000 97%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 9px at 0 70%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 70%, #0000 97%, #000) right / 51% 100% no-repeat;
}
:where(body.app) .badge-stage { background: var(--dots) 0 0 / 14px 14px, linear-gradient(160deg, #0b1f4d, #0d3c9e); border-radius: 14px; }
:where(body.app) .badge-stage .atx-badge { box-shadow: 0 22px 44px rgba(0,0,0,.35); }
.atx-badge .ab-head { background: radial-gradient(90% 120% at 100% 0%, rgba(13,202,240,.28), transparent 60%), linear-gradient(160deg, #0f2a66, #0b1b3f); }
.atx-badge:not(.is-print).o-port .ab-head::before { content: ""; position: absolute; top: 1.8cqw; left: 50%; width: 15cqw; height: 2.4cqw; transform: translateX(-50%); border-radius: 2cqw; background: rgba(255,255,255,.85); box-shadow: inset 0 .3cqw .6cqw rgba(0,0,0,.35); }
.atx-badge.o-port .ab-head { padding-top: 6.4cqw; }
:where(body.app) .qr { border: 1px solid var(--border); }
:where(body.app) .session { border-radius: 12px; border-color: var(--border); }
:where(body.app) .session .time b { font-family: var(--font-head); color: var(--navy); }
:where(body.app) .event-row .ev-date { border-color: var(--border); border-radius: 10px; }
:where(body.app) .event-row .ev-date b { font-family: var(--font-head); font-weight: 700; color: var(--navy); }
:where(body.app) .event-row .ev-name { font-family: var(--font-head); font-weight: 600; }
:where(body.app) .ring b { font-family: var(--font-head); font-weight: 700; color: var(--navy); }
:where(body.app) .m-list { border-color: var(--border); border-top: 3px solid var(--brand); }
:where(body.app) .big-search input { border-radius: 999px; padding-inline-start: 24px; }
:where(body.app) .big-search .bs-btn { border-radius: 999px; }
:where(body.app) .choice.selected { box-shadow: 0 0 0 3px rgba(13,110,253,.16); }

/* scan screens — high contrast */
:where(body.app) .viewfinder { background: radial-gradient(circle at 50% 40%, #13265a 0%, #050b1c 72%); box-shadow: 0 0 0 1px rgba(13,202,240,.25), 0 22px 46px rgba(5,11,28,.4); }
:where(body.app) .vf-frame span { border-color: #6edff6; filter: drop-shadow(0 0 8px rgba(13,202,240,.75)); }
:where(body.app) .scan-result { border-width: 2px; border-inline-start-width: 8px; border-radius: 14px; box-shadow: 0 10px 24px rgba(11,27,63,.08); }
:where(body.app) .scan-result h3 { font-family: var(--font-head); font-weight: 700; font-size: 19px; color: var(--navy); }
:where(body.app) .scan-result.ok { background: #effaf4; }
:where(body.app) .scan-result.err { background: #fff1f2; }
:where(body.app) .scan-result.warn { background: #fff9e6; }
:where(body.app) .scan-result .sr-icon { box-shadow: 0 0 0 6px rgba(255,255,255,.9), 0 6px 14px rgba(0,0,0,.15); }
:where(body.app) .big-action { border-radius: 999px; font-family: var(--font-head); font-weight: 700; }
:where(body.app) .big-action.blue { background: linear-gradient(135deg, #0dcaf0, #0d6efd 55%, #0a58ca); }

/* modal & dropdowns */
.modal-head h3 { font-family: var(--font-head); font-weight: 700; }
:where(body.app) .modal { border-top: 3px solid var(--brand); }
:where(body.app) .dropdown-menu { border-color: var(--border); }
:where(body.app) .avatar { font-family: var(--font-head); font-weight: 600; }
:where(body.app) .counter.bump { animation: bump .6s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ev-dates { display: none; }
}
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ctx-select select { max-width: 200px; }
  .tb-user .meta { display: none; }
  .deck-inner { flex-wrap: wrap; }
  .deck-event { flex-basis: 100%; }
  .atx-pulse { margin-right: 0; width: 100%; }
  .pulse-stub { flex: 1; }
}
@media (max-width: 1100px) {
  .grid-main, .grid-side { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-search { max-width: 280px; }
}
@media (max-width: 1024px) {
  .content { padding: 22px 20px 32px; }
  .deck-inner { padding: 10px 20px; }
  .tb-row { padding: 0 16px; }
  /* mobile roles → bottom tab bar instead of the top tabs */
  body.mobile-role { --topbar-h: var(--row-h); }
  body.mobile-role .atx-nav { display: none; }
  body.mobile-role .content { padding-bottom: 96px; }
  body.mobile-role .app-foot { padding-bottom: 86px; }
  body.mobile-role .tabbar {
    display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); position: fixed; inset: auto 0 0 0; z-index: 44;
    background: rgba(255,255,255,.97); border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(11,27,63,.08);
  }
  body.mobile-role .tabbar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--accent-line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: #6b7891; padding: 4px 2px; border-radius: 10px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar a .ti { width: 42px; height: 30px; border-radius: 999px; display: grid; place-items: center; transition: .15s; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.active { color: var(--brand); }
  .tabbar a.active .ti { background: var(--brand-soft); }
  .tabbar a.primary { overflow: visible; }
  .tabbar a.primary .ti { width: 52px; height: 52px; margin-top: -26px; background: linear-gradient(135deg, #0dcaf0, #0d6efd 60%, #0a58ca); color: #fff; box-shadow: 0 8px 20px rgba(13,110,253,.4); border: 4px solid #fff; }
  .tabbar a.primary.active .ti { background: linear-gradient(135deg, #0dcaf0, #0d6efd 60%, #0a58ca); }
  .tabbar a.primary svg { width: 24px; height: 24px; }
}
@media (max-width: 860px) {
  .ctx-selects .pt-select { display: none; }
  .global-search { display: none; }
  .tb-spacer, .ctx-selects { flex: 1; }
  .ev-switch { flex: 1; min-width: 0; }
  .ev-switch .ctx-select { flex: 1; }
  .ev-switch .ctx-select select { max-width: 100%; width: 100%; }
  .reg-modal { grid-template-columns: minmax(0, 1fr); }
  .rm-side { max-width: 300px; width: 100%; margin-inline: auto; }
  .deck-label { display: none; }
  .deck-tabs { border: 0; padding-inline-start: 2px; }
}
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-5, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: auto; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .stat-strip { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .info-list { grid-template-columns: 1fr; }
  .tb-row { gap: 8px; padding: 0 10px; }
  .atx-nav { padding: 0 6px; }
  .nav-link { padding: 0 11px; font-size: 13px; }
  .tb-brand { font-size: 17px; gap: 7px; }
  .tb-brand .tb-mark { width: 30px; height: 30px; border-radius: 9px; }
  .tb-brand svg { width: 18px; height: 18px; }
  .tb-logout span { display: none; }
  .tb-logout { padding: 0 9px; }
  .ctx-select select { max-width: 100%; width: 100%; }
  .ctx-select { flex: 1; }
  .content { padding: 18px 14px 28px; }
  .deck-inner { padding: 8px 14px; gap: 10px; }
  .pulse-stub { min-width: 0; padding: 6px 10px; gap: 7px; }
  .pulse-stub .ps-ic { display: none; }
  .pulse-stub b { font-size: 17px; }
  .page-head h1, :where(body.app) .page-head h1 { font-size: 21px; }
  .card-pad, .card-body { padding: 16px 14px; }
  .card-head, .toolbar, .card-foot { padding-inline: 14px; }
  .notif-menu { position: fixed; top: calc(var(--row-h) + 6px); left: 10px; right: 10px; width: auto; }
  .toast-wrap { left: 12px; right: 12px; bottom: 12px; }
  body.mobile-role .toast-wrap { bottom: 86px; }
  .toast { max-width: none; min-width: 0; }
  .welcome { padding: 20px 18px; }
  .welcome h2 { font-size: 20px; }
  .hide-sm { display: none !important; }
  .event-row { padding: 12px 14px; }
  .list-plain > .list-row { padding-inline: 14px; }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding-inline: 16px; }
  .welcome::after, .app-hero::after { display: none; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid { gap: 12px; }
  .kpi { padding: 14px; }
  .kpi-h { padding: 14px; gap: 10px; }
  .kpi-value, .kpi-h .kpi-value { font-size: 21px; }
  .kpi-icon, .kpi-h .kpi-icon { width: 38px; height: 38px; border-radius: 10px; }
  .kpi-icon svg { width: 19px; height: 19px; }
  .kpi-label { font-size: 12px; }
  :where(body.app) .kpi-h { --stub: 58px; --pad: 10px; --notch: 6px; padding-inline-start: var(--pad); gap: 0; }
  :where(body.app) .kpi-h .kpi-icon { margin-inline-end: 22px; }
  :where(body.app) .kpi:not(.kpi-h) { --perf: 58px; }
  .ctx-chip { max-width: 130px; }
  .tb-icon { width: 34px; height: 34px; }
  .tb-logout, .tb-user .chev, .ctx-select > svg { display: none; }
  .ctx-select select { padding: 0 10px 0 26px; background-position: left 8px center; font-size: 13px; }
  .tb-user { padding: 0 3px; border-color: transparent; background: transparent; }
  .ev-switch { padding: 0 2px 0 6px; }
  .pulse-stub small { font-size: 10.5px; }
  .atx-pulse { gap: 6px; }
}

/* Product logo (AtEventX) */
.brand-logo { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-tile { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; padding: 3px; border-radius: 10px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.k-brand .brand-tile, .lw-brand .brand-tile { width: 1.9em; height: 1.9em; }
.app-foot .foot-brand { display: inline-flex; align-items: center; gap: 8px; }
.app-foot .foot-brand .brand-logo { width: 22px; height: 22px; }
