/* ============================================================
   NCA EVENTS — DESIGN SYSTEM
   "Official credential" identity: institutional navy + gold seal,
   engineered hairlines, tabular/monospaced IDs. One source of truth
   for public + admin surfaces. Pure CSS, no build step.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
    /* Brand — deep institutional navy + refined azure + gold seal */
    --ink:        #0A1B3D;   /* deepest navy — sidebar, headings */
    --ink-2:      #0E244F;   /* raised navy */
    --navy-700:   #123163;
    --azure:      #1D6FE0;   /* primary action */
    --azure-600:  #1A63C8;
    --azure-700:  #164FA3;
    --sky:        #EAF2FE;   /* primary wash */
    --sky-line:   #CFE0FA;
    --gold:       #C29B2E;   /* official seal accent — used sparingly */
    --gold-soft:  #F6EFD9;

    /* Neutrals — cool paper */
    --paper:      #F6F8FC;   /* app background */
    --surface:    #FFFFFF;
    --surface-2:  #FBFCFE;
    --line:       #E5E9F1;   /* hairline */
    --line-2:     #EEF1F7;
    --text:       #0F1B2D;
    --muted:      #556072;
    --subtle:     #8A94A6;
    --faint:      #AEB6C4;

    /* Semantic */
    --success:    #0E9F6E;  --success-bg: #E6F6EF;  --success-tx: #086A49;
    --warning:    #D9880B;  --warning-bg: #FDF3E0;  --warning-tx: #96590A;
    --danger:     #E5484D;  --danger-bg:  #FDECEC;  --danger-tx:  #A5262A;
    --info:       #1D6FE0;  --info-bg:    #EAF2FE;  --info-tx:    #164FA3;

    /* Elevation */
    --sh-xs: 0 1px 2px rgba(16,30,54,.05);
    --sh-sm: 0 1px 3px rgba(16,30,54,.06), 0 1px 2px rgba(16,30,54,.04);
    --sh-md: 0 8px 24px -8px rgba(16,30,54,.14), 0 2px 6px -2px rgba(16,30,54,.06);
    --sh-lg: 0 24px 56px -20px rgba(10,27,61,.30);
    --ring:  0 0 0 4px rgba(29,111,224,.14);

    /* Geometry */
    --r-sm: 8px;  --r: 12px;  --r-lg: 16px;  --r-xl: 22px;  --r-full: 999px;

    /* Type */
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --display: 'Space Grotesk', var(--font);
    --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, monospace;

    --sidebar-w: 264px;
    --topbar-h: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-feature-settings: "cv05" 1, "ss01" 1, "tnum" 1;
    background: var(--paper);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { font-family: var(--display); line-height: 1.2; letter-spacing: -.01em; margin: 0; }
a { color: var(--azure-700); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: var(--sky); color: var(--ink); }

/* Numbers align in tables/stats */
.tnum, .stat-value, td .num, .cred-id { font-variant-numeric: tabular-nums; }

/* ---------- Utility ---------- */
.mono { font-family: var(--mono); }
.eyebrow {
    font-size: 11px; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: var(--subtle);
}
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.center { text-align: center; }
.stack { display: grid; gap: 6px; }
.hide { display: none !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    --btn-bg: var(--azure); --btn-fg: #fff; --btn-bd: transparent;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; white-space: nowrap;
    padding: 10px 16px; border-radius: var(--r-sm);
    font-size: 13.5px; font-weight: 600; letter-spacing: -.005em;
    border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
    cursor: pointer; text-decoration: none;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
    box-shadow: var(--sh-xs);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn .ico { width: 16px; height: 16px; flex: none; }

.btn-primary { --btn-bg: var(--azure); }
.btn-primary:hover { background: var(--azure-600); }
.btn-dark   { --btn-bg: var(--ink); }
.btn-dark:hover { background: var(--ink-2); }
.btn-success{ --btn-bg: var(--success); }
.btn-danger { --btn-bg: var(--danger); }
.btn-ghost  { --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--sky-line); color: var(--azure-700); }
.btn-subtle { --btn-bg: var(--sky); --btn-fg: var(--azure-700); box-shadow: none; }
.btn-subtle:hover { background: #DEEAFD; }
.btn-outline { --btn-bg: transparent; --btn-fg: var(--azure-700); --btn-bd: var(--sky-line); box-shadow: none; }
.btn-outline:hover { background: var(--sky); border-color: var(--azure); color: var(--azure-700); }

.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-xs { padding: 5px 9px; font-size: 11.5px; border-radius: 6px; gap: 5px; box-shadow: none; }
.btn-block { width: 100%; }
.btn[aria-disabled="true"], .btn:disabled {
    opacity: .55; pointer-events: none; box-shadow: none; transform: none;
}
.btn-icon { padding: 8px; border-radius: var(--r-sm); }

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
}
.card-pad { padding: 22px; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .eyebrow { margin-bottom: 2px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 18px 18px 16px;
    box-shadow: var(--sh-sm);
}
.stat::after { /* thin accent rail */
    content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
    border-radius: 3px; background: var(--accent, var(--azure));
}
.stat.is-primary { --accent: var(--azure); }
.stat.is-warning { --accent: var(--warning); }
.stat.is-success { --accent: var(--success); }
.stat.is-danger  { --accent: var(--danger); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.stat-ico {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: var(--sky); color: var(--azure-700);
}
.stat.is-warning .stat-ico { background: var(--warning-bg); color: var(--warning-tx); }
.stat.is-success .stat-ico { background: var(--success-bg); color: var(--success-tx); }
.stat.is-danger  .stat-ico { background: var(--danger-bg);  color: var(--danger-tx); }
.stat-value { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.02em; margin-top: 10px; color: var(--ink); }
.stat-foot { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden; }
.table-toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 16px; border-bottom: 1px solid var(--line-2);
}
.table-toolbar .grow { flex: 1 1 auto; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
    position: sticky; top: 0; z-index: 2;
    background: var(--surface-2); text-align: left;
    padding: 12px 16px; font-size: 11px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--subtle);
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--azure-700); }
table.data th .sort-caret { opacity: .4; margin-left: 4px; font-size: 10px; }
table.data th[data-dir="asc"] .sort-caret,
table.data th[data-dir="desc"] .sort-caret { opacity: 1; color: var(--azure); }
table.data td { padding: 13px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr { transition: background .12s ease; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
.row-idx { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.cell-name { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--subtle); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Identity cell (avatar + name) */
.identity { display: flex; align-items: center; gap: 11px; }
.avatar {
    width: 34px; height: 34px; border-radius: 9px; flex: none; object-fit: cover;
    background: var(--sky); border: 1px solid var(--line);
    display: grid; place-items: center; color: var(--azure-700); font-weight: 700; font-size: 13px;
}

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px 3px 8px; border-radius: var(--r-full);
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
    background: var(--line-2); color: var(--muted); white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.no-dot::before { display: none; }
.pill-success { background: var(--success-bg); color: var(--success-tx); }
.pill-warning { background: var(--warning-bg); color: var(--warning-tx); }
.pill-danger  { background: var(--danger-bg);  color: var(--danger-tx); }
.pill-info    { background: var(--info-bg);    color: var(--info-tx); }
.pill-neutral { background: var(--line-2);     color: var(--muted); }

/* ============================================================
   FORMS
   ============================================================ */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label {
    display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px;
}
.label .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: 12px; color: var(--subtle); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.input, input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="search"], select, textarea {
    width: 100%; padding: 11px 13px;
    font-family: inherit; font-size: 14.5px; color: var(--text);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-sm); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    -webkit-appearance: none; appearance: none;
}
textarea { min-height: 108px; resize: vertical; line-height: 1.55; }
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A94A6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; cursor: pointer;
}
.input:focus, input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--azure); box-shadow: var(--ring); background: var(--surface);
}
input::placeholder, textarea::placeholder { color: var(--faint); }

/* Search input with icon */
.search { position: relative; min-width: 220px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.search input { padding-left: 38px; }

/* File upload (styled) */
.filedrop {
    display: flex; align-items: center; gap: 14px;
    border: 1.5px dashed var(--sky-line); border-radius: var(--r); padding: 14px 16px;
    background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.filedrop:hover { border-color: var(--azure); background: var(--sky); }
.filedrop input[type="file"] { display: none; }
.filedrop .fd-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--sky); color: var(--azure-700); display: grid; place-items: center; flex: none; }
.filedrop .fd-text { font-size: 13px; color: var(--muted); }
.filedrop .fd-text b { color: var(--azure-700); font-weight: 600; }
.filedrop .fd-preview { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); margin-left: auto; }

/* Checkbox row */
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text); }
.check input { width: 18px; height: 18px; accent-color: var(--azure); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px; border-radius: var(--r); font-size: 14px; margin-bottom: 20px;
    border: 1px solid transparent;
}
.alert .a-ico { flex: none; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success-tx); border-color: #C6ECDA; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger-tx);  border-color: #F6CFD0; }
.alert-warning { background: var(--warning-bg); color: var(--warning-tx); border-color: #F3DFB4; }
.alert-info    { background: var(--info-bg);    color: var(--info-tx);    border-color: var(--sky-line); }
.alert b { font-weight: 700; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty { text-align: center; padding: 56px 24px; color: var(--subtle); }
.empty .e-ico { width: 56px; height: 56px; border-radius: 15px; margin: 0 auto 16px; background: var(--sky); color: var(--azure); display: grid; place-items: center; }
.empty h4 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13.5px; margin: 0 auto 18px; max-width: 340px; }

/* ============================================================
   ADMIN SHELL (sidebar + topbar)
   ============================================================ */
.app { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
    background: linear-gradient(180deg, var(--ink) 0%, #081633 100%);
    color: #C8D4EA; display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.06);
}
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 18px 20px 16px; }
.sb-seal {
    width: 38px; height: 38px; border-radius: 11px; flex: none; position: relative;
    background: radial-gradient(circle at 30% 25%, #22468F, #0C1F44);
    border: 1px solid rgba(194,155,46,.5);
    display: grid; place-items: center; box-shadow: inset 0 0 0 3px rgba(194,155,46,.12);
}
.sb-seal span { font-family: var(--display); font-weight: 700; color: var(--gold); font-size: 15px; letter-spacing: .02em; }
.sb-brand .bt { line-height: 1.15; }
.sb-brand .bt strong { display: block; color: #fff; font-family: var(--display); font-size: 15px; letter-spacing: -.01em; }
.sb-brand .bt small { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #7E93BC; }

.sb-nav { padding: 8px 12px; overflow-y: auto; flex: 1; }
.sb-section { padding: 16px 10px 7px; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #61789F; }
.sb-link {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 2px 0;
    border-radius: 9px; color: #B7C6E2; font-size: 13.5px; font-weight: 500;
    transition: background .15s, color .15s;
}
.sb-link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.sb-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-link.active { background: rgba(29,111,224,.20); color: #fff; box-shadow: inset 2px 0 0 var(--gold); }
.sb-link.active svg { opacity: 1; color: #9EC0F5; }

.sb-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.sb-user { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); }
.sb-user .ua { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg,var(--azure),#0E244F); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.sb-user .ui { line-height: 1.2; min-width: 0; }
.sb-user .ui strong { display: block; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .ui small { font-size: 11px; color: #7E93BC; text-transform: capitalize; }
.sb-logout { margin-left: auto; color: #8CA0C6; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; }
.sb-logout:hover { background: rgba(229,72,77,.18); color: #FFB4B6; }

/* Main column */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
    display: flex; align-items: center; gap: 14px;
    padding: 0 26px; background: rgba(246,248,252,.85); backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar .tb-title { line-height: 1.2; }
.topbar .tb-title h1 { font-size: 18px; font-weight: 600; color: var(--ink); }
.topbar .tb-title .crumb { font-size: 11.5px; color: var(--subtle); font-family: var(--font); letter-spacing: 0; }
.topbar .tb-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.burger { display: none; width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); place-items: center; cursor: pointer; }

.content { padding: 26px; max-width: 1360px; width: 100%; margin: 0 auto; }
.page-lead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-lead .pl-title h2 { font-size: 22px; font-weight: 600; color: var(--ink); }
.page-lead .pl-title p { font-size: 13.5px; color: var(--muted); margin: 4px 0 0; }
.page-lead .pl-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Sticky-footer credit */
.app-foot { margin-top: auto; padding: 20px 26px; color: var(--subtle); font-size: 12px; border-top: 1px solid var(--line); }

/* Dropdown */
.dd { position: relative; }
.dd-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    box-shadow: var(--sh-md); padding: 6px; z-index: 50;
    opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
    transition: opacity .15s, transform .15s;
}
.dd.open .dd-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.dd-menu a, .dd-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 11px; border-radius: 8px; font-size: 13.5px; color: var(--text);
    background: none; border: none; cursor: pointer; text-align: left; font-weight: 500;
}
.dd-menu a:hover, .dd-menu button:hover { background: var(--surface-2); color: var(--azure-700); }
.dd-menu svg { width: 16px; height: 16px; color: var(--subtle); }
.dd-sep { height: 1px; background: var(--line-2); margin: 5px 2px; }

/* Sidebar overlay (mobile) */
.sb-overlay { display: none; position: fixed; inset: 0; background: rgba(10,27,61,.42); z-index: 55; opacity: 0; transition: opacity .2s; }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress { height: 8px; border-radius: var(--r-full); background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--azure), #4C93F2); transition: width .6s cubic-bezier(.2,.8,.2,1); }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-box { position: relative; height: 260px; }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
    display: flex; align-items: center; gap: 11px; min-width: 260px; max-width: 380px;
    padding: 13px 15px; border-radius: var(--r); background: var(--surface);
    border: 1px solid var(--line); box-shadow: var(--sh-md); font-size: 13.5px; color: var(--text);
    animation: toastIn .35s cubic-bezier(.2,.9,.3,1);
}
.toast.leaving { animation: toastOut .3s forwards; }
.toast .t-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.toast-success .t-ico { background: var(--success-bg); color: var(--success); }
.toast-danger  .t-ico { background: var(--danger-bg);  color: var(--danger); }
.toast-info    .t-ico { background: var(--info-bg);    color: var(--info); }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px) } to { opacity: 1; transform: none } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px) } }

/* ============================================================
   MODAL / CONFIRM
   ============================================================ */
.modal-back { position: fixed; inset: 0; background: rgba(10,27,61,.46); backdrop-filter: blur(3px); z-index: 210; display: grid; place-items: center; padding: 20px; opacity: 0; animation: fade .2s forwards; }
.modal {
    background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
    width: 100%; max-width: 420px; overflow: hidden; transform: translateY(8px) scale(.98); animation: pop .22s forwards;
}
.modal-body { padding: 24px 24px 8px; }
.modal-body .m-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; background: var(--danger-bg); color: var(--danger); }
.modal-body h3 { font-size: 18px; margin-bottom: 6px; color: var(--ink); }
.modal-body p { font-size: 14px; color: var(--muted); margin: 0; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 18px 24px 22px; }
@keyframes fade { to { opacity: 1 } }
@keyframes pop  { to { transform: none } }

/* ============================================================
   AUTH (login) + PUBLIC surfaces
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-panel {
    position: relative; overflow: hidden; color: #DCE6F7;
    background: linear-gradient(160deg, var(--ink) 0%, #0B2149 55%, #123163 100%);
    padding: 56px; display: none; flex-direction: column; justify-content: space-between;
}
.auth-panel::before { /* engraved guilloché grid */
    content: ""; position: absolute; inset: 0; opacity: .5;
    background-image:
        radial-gradient(circle at 78% 12%, rgba(29,111,224,.35), transparent 45%),
        radial-gradient(circle at 12% 88%, rgba(194,155,46,.12), transparent 42%),
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: auto, auto, 34px 34px, 34px 34px;
}
.auth-form-col { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
@media (min-width: 940px) { .auth-wrap { grid-template-columns: 1.05fr 1fr; } .auth-panel { display: flex; } }

/* Ambient premium background for public pages */
.gov-bg { position: fixed; inset: 0; z-index: -1; background: var(--paper); }
.gov-bg::before {
    content: ""; position: absolute; inset: 0; height: 420px;
    background: linear-gradient(160deg, var(--ink) 0%, #0C2149 60%, #143A78 100%);
}
.gov-bg::after {
    content: ""; position: absolute; inset: 0; height: 420px; opacity: .55;
    background-image:
        radial-gradient(circle at 82% 8%, rgba(29,111,224,.4), transparent 40%),
        radial-gradient(circle at 8% 70%, rgba(194,155,46,.10), transparent 38%),
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: auto, auto, 40px 40px, 40px 40px;
    -webkit-mask-image: linear-gradient(#000, transparent);
    mask-image: linear-gradient(#000, transparent);
}

/* Official seal emblem (reusable) */
.seal {
    width: 46px; height: 46px; border-radius: 13px; flex: none; position: relative;
    background: radial-gradient(circle at 32% 26%, #24499A, #0A1B3D);
    border: 1px solid rgba(194,155,46,.55); display: grid; place-items: center;
    box-shadow: inset 0 0 0 3px rgba(194,155,46,.14);
}
.seal span { font-family: var(--display); font-weight: 700; color: var(--gold); letter-spacing: .02em; }
.seal svg { color: var(--gold); }

/* ---- Login: brand (dark) panel content ---- */
.auth-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.auth-brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand-txt strong { font-family: var(--display); font-size: 18px; color: #fff; letter-spacing: .01em; }
.auth-brand-txt span { font-size: 12px; color: rgba(220,230,247,.62); letter-spacing: .03em; }
.auth-panel-body { position: relative; z-index: 1; }
.auth-headline {
    font-family: var(--display); font-weight: 700; color: #fff;
    font-size: clamp(28px, 3.2vw, 40px); line-height: 1.12; letter-spacing: -.01em; margin: 0 0 18px;
}
.auth-sub { color: rgba(220,230,247,.74); font-size: 15px; line-height: 1.65; max-width: 40ch; margin: 0 0 30px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: rgba(233,240,251,.9); font-size: 14.5px; }
.auth-tick {
    width: 24px; height: 24px; flex: none; border-radius: 7px; display: grid; place-items: center;
    font-size: 13px; font-weight: 700; color: var(--gold);
    background: rgba(194,155,46,.14); border: 1px solid rgba(194,155,46,.4);
}
.auth-panel-foot { position: relative; z-index: 1; font-size: 12.5px; color: rgba(220,230,247,.5); letter-spacing: .02em; }

/* ---- Login: form panel content ---- */
.auth-form-wrap { width: 100%; max-width: 400px; }
.auth-form-head { margin-bottom: 26px; }
.auth-form-head h2 { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--ink); margin: 0 0 6px; letter-spacing: -.01em; }
.auth-form-head p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.5; }
.auth-form .field { margin-bottom: 18px; }
.auth-form-foot { margin-top: 26px; text-align: center; font-size: 12px; color: var(--subtle); letter-spacing: .02em; }

/* ---- Input with leading icon + optional trailing toggle ---- */
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .input-ico {
    position: absolute; left: 14px; color: var(--subtle); pointer-events: none; transition: color .15s ease;
}
.input-affix input { width: 100%; padding-left: 42px; }
.input-affix input:focus ~ .input-ico,
.input-affix:focus-within .input-ico { color: var(--azure); }
.input-affix input[type="password"],
.input-affix input[type="text"].has-toggle { padding-right: 44px; }
.input-toggle {
    position: absolute; right: 8px; width: 32px; height: 32px; border: 0; background: transparent;
    color: var(--subtle); border-radius: 8px; display: grid; place-items: center; cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.input-toggle:hover { color: var(--ink); background: var(--line-2); }
.input-toggle.is-on { color: var(--azure); }

/* ---- Large block button (login CTA) ---- */
.btn-lg { padding: 14px 20px; font-size: 15px; gap: 9px; }

/* ============================================================
   DIGITAL CREDENTIAL CARD (verify result — signature element)
   ============================================================ */
.credential {
    position: relative; overflow: hidden; border-radius: var(--r-xl);
    background: linear-gradient(158deg, #0B1E44 0%, #123163 100%); color: #EAF0FB;
    box-shadow: var(--sh-lg); border: 1px solid rgba(194,155,46,.28);
}
.credential::before { /* guilloché security texture */
    content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image:
        repeating-linear-gradient(48deg, rgba(255,255,255,.04) 0 1px, transparent 1px 11px),
        radial-gradient(circle at 88% 0%, rgba(194,155,46,.18), transparent 42%);
}
.cred-top { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.10); position: relative; }
.cred-top .ct-t { line-height: 1.15; }
.cred-top .ct-t strong { display: block; font-family: var(--display); font-size: 14px; color: #fff; }
.cred-top .ct-t small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #93A9D2; }
.cred-verified { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #7BE0B4; background: rgba(14,159,110,.16); padding: 5px 10px; border-radius: var(--r-full); border: 1px solid rgba(14,159,110,.35); }
.cred-body { position: relative; padding: 22px 20px; text-align: center; }
.cred-photo { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; margin: 0 auto 14px; border: 2px solid rgba(194,155,46,.5); background: #0A1B3D; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.cred-name { font-family: var(--display); font-size: 21px; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.cred-inst { font-size: 13px; color: #A9BEE3; margin-top: 3px; }
.cred-meta { margin-top: 16px; padding-top: 16px; border-top: 1px dashed rgba(255,255,255,.16); display: grid; gap: 4px; }
.cred-meta .cm-event { font-size: 13.5px; font-weight: 600; color: #EAF0FB; }
.cred-meta .cm-when { font-size: 12px; color: #93A9D2; }
.cred-id { margin-top: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: #7E96C4; }

/* ============================================================
   PUBLIC event cards
   ============================================================ */
.evt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.evt-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--sh-md); padding: 24px; display: flex; flex-direction: column;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.evt-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--sky-line); }
.evt-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.evt-date-chip { display: inline-flex; flex-direction: column; align-items: center; padding: 7px 12px; border-radius: 10px; background: var(--sky); color: var(--azure-700); line-height: 1; }
.evt-date-chip .d { font-family: var(--display); font-size: 19px; font-weight: 700; }
.evt-date-chip .m { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-top: 3px; }
.evt-card h3 { font-size: 18px; color: var(--ink); margin-bottom: 8px; }
.evt-card .desc { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0 0 18px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.evt-meta { display: grid; gap: 8px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); margin-bottom: 16px; }
.evt-meta .mi { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); font-weight: 500; }
.evt-meta .mi svg { color: var(--subtle); flex: none; }
.evt-seats { margin-bottom: 16px; }
.evt-seats .st { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 7px; }
.evt-seats .st b { color: var(--ink); font-variant-numeric: tabular-nums; }
.evt-cta { margin-top: auto; }

/* ============================================================
   UTILITY RESULT (regenerate badges, etc.)
   ============================================================ */
.util-result { max-width: 560px; margin: 8px auto; }
.util-card { padding: 40px 36px; text-align: center; }
.util-icon {
    width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 20px; display: grid; place-items: center;
    color: var(--success); background: var(--success-bg);
    box-shadow: inset 0 0 0 1px rgba(14,159,110,.18);
}
.util-title { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--ink); margin: 0 0 8px; letter-spacing: -.01em; }
.util-sub { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 auto 24px; max-width: 42ch; }
.util-stat {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 20px; margin-bottom: 26px; border-radius: var(--r-lg);
    background: var(--surface-2); border: 1px solid var(--line);
}
.util-stat-num { font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1; color: var(--azure); font-variant-numeric: tabular-nums; }
.util-stat-lbl { font-size: 13px; color: var(--muted); }
.util-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   PUBLIC PORTAL (index landing)
   ============================================================ */
.portal-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 20px; }
.portal-card {
    width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-xl);
    border: 1px solid var(--line); box-shadow: var(--sh-lg); overflow: hidden;
}
.portal-head {
    position: relative; text-align: center; color: #EAF0FB; padding: 44px 34px 38px;
    background: linear-gradient(158deg, var(--ink) 0%, #0B2149 55%, #123163 100%);
}
.portal-head::before {
    content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image:
        radial-gradient(circle at 80% 12%, rgba(29,111,224,.4), transparent 44%),
        radial-gradient(circle at 12% 90%, rgba(194,155,46,.12), transparent 42%),
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: auto, auto, 32px 32px, 32px 32px;
}
.portal-kicker {
    position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 9px;
    padding: 6px 14px 6px 6px; border-radius: 999px; margin-bottom: 22px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(194,155,46,.32);
    font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-soft);
}
.portal-kicker .seal { width: 30px; height: 30px; border-radius: 9px; }
.portal-logo { position: relative; z-index: 1; max-width: 360px; width: 100%; margin: 0 auto 20px; display: block; filter: drop-shadow(0 6px 16px rgba(0,0,0,.28)); }
.portal-head h1 { position: relative; z-index: 1; font-family: var(--display); font-weight: 700; font-size: 28px; margin: 0; letter-spacing: -.01em; color: #fff; }
.portal-head p { position: relative; z-index: 1; margin: 10px 0 0; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: rgba(180,206,247,.85); }

.portal-body { padding: 40px 38px 30px; text-align: center; }
.portal-body h2 { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--ink); margin: 0 0 12px; }
.portal-lead { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0 auto 30px; max-width: 46ch; }
.portal-lead strong { color: var(--azure-700); }
.portal-actions { display: grid; gap: 13px; }
.portal-actions .btn { width: 100%; }
@media (min-width: 480px) { .portal-actions { grid-template-columns: 1fr 1fr; } }
.portal-link {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 22px;
    color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none;
    transition: color .15s ease, gap .15s ease;
}
.portal-link:hover { color: var(--azure-700); gap: 9px; }
.portal-trust {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 28px;
    padding-top: 22px; border-top: 1px solid var(--line);
}
.portal-trust span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--subtle); }
.portal-trust svg { color: var(--gold); }
.portal-foot { text-align: center; font-size: 12px; color: var(--subtle); padding: 20px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* ============================================================
   PUBLIC PAGE CHROME (events / register / verify)
   ============================================================ */
.pub-shell { position: relative; max-width: 1120px; margin: 0 auto; padding: 30px 20px 50px; }
.pub-head { margin-bottom: 34px; }
.pub-back {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); color: #EAF0FB;
    text-decoration: none; font-size: 13.5px; font-weight: 600; margin-bottom: 30px;
    transition: background .15s ease, border-color .15s ease;
}
.pub-back:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.28); }
.pub-hero { text-align: center; color: #fff; }
.pub-kicker {
    display: inline-flex; align-items: center; gap: 9px; padding: 6px 15px 6px 6px; border-radius: 999px; margin-bottom: 18px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(194,155,46,.32);
    font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-soft);
}
.pub-kicker .seal { width: 28px; height: 28px; border-radius: 8px; }
.pub-hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5vw, 44px); margin: 0 0 10px; letter-spacing: -.02em; color: #fff; }
.pub-hero p { font-size: 16px; color: rgba(198,218,247,.9); margin: 0; max-width: 52ch; margin-inline: auto; }

.evt-btn-off { --btn-bg: var(--line-2); --btn-fg: var(--subtle); --btn-bd: var(--line); box-shadow: none; cursor: not-allowed; pointer-events: none; }

.pub-empty {
    max-width: 460px; margin: 10px auto; text-align: center; padding: 44px 32px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-md);
}
.pub-empty-ico { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; color: var(--azure); background: var(--sky); }
.pub-empty h3 { font-family: var(--display); font-size: 20px; color: var(--ink); margin: 0 0 8px; }
.pub-empty p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.6; }

.pub-foot { text-align: center; margin-top: 46px; color: var(--subtle); font-size: 13px; }

/* Narrow public column (forms) */
.pub-narrow { max-width: 660px; }

/* Kicker variant on light surfaces */
.pub-kicker.on-light {
    background: var(--sky); border-color: var(--sky-line); color: var(--azure-700); text-transform: none;
    letter-spacing: 0; padding: 6px 13px; font-size: 12.5px;
}
.pub-kicker.on-light svg { color: var(--azure); }

/* Public form card */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-lg); overflow: hidden; }
.form-card-head { padding: 30px 34px 26px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.form-card-head h2 { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--ink); margin: 14px 0 12px; line-height: 1.2; letter-spacing: -.01em; }
.form-card-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.form-card-meta span { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.form-card-meta svg { color: var(--azure); }
.form-card-body { padding: 30px 34px 34px; }
.stack-form .field-row { margin-bottom: 0; }
.stack-form .field-row .field { margin-bottom: 20px; }

/* Inline notice line */
.notice-line {
    display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; margin: 4px 0 24px;
    background: var(--warning-bg); border: 1px solid #F6E2BC; border-radius: var(--r);
    color: var(--warning-tx); font-size: 13px; line-height: 1.45; font-weight: 500;
}
.notice-line svg { flex: none; margin-top: 1px; color: var(--warning); }

/* Success state (registration complete) */
.success-state { text-align: center; padding: 20px 8px 8px; }
.success-ico { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 22px; display: grid; place-items: center; color: var(--success); background: var(--success-bg); box-shadow: inset 0 0 0 1px rgba(14,159,110,.18); }
.success-state h3 { font-family: var(--display); font-weight: 700; font-size: 23px; color: var(--ink); margin: 0 0 10px; }
.success-state p { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0 auto 26px; max-width: 44ch; }
.success-state p strong { color: var(--success-tx); }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } .chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    :root { --sidebar-w: 0px; }
    .sidebar { transform: translateX(-100%); transition: transform .26s cubic-bezier(.3,.8,.3,1); width: 272px; }
    body.sb-open .sidebar { transform: translateX(0); }
    body.sb-open .sb-overlay { display: block; opacity: 1; }
    .main { margin-left: 0; }
    .burger { display: grid; }
    .content { padding: 18px; }
    .topbar { padding: 0 16px; }
}
@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .field-row { grid-template-columns: 1fr; }
    .stat-value { font-size: 28px; }
    .page-lead .pl-actions { width: 100%; }
    .page-lead .pl-actions .btn { flex: 1; }
}

/* ============================================================
   MOTION PREFERENCES
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Page-load reveal */
.reveal { animation: reveal .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
