/* =====================================================================
   UMS design layer
   Tailwind (runtime CDN) handles layout utilities; this file defines the
   shared component vocabulary so every module looks identical:
   shell, nav, buttons, forms, cards, badges, tables, dropdowns, toasts.
   Plain CSS on purpose — no build step is required on shared hosting.
   ===================================================================== */

:root {
    --brand-50: #f2f5fb;  --brand-100: #e3e9f5; --brand-200: #c7d3ea; --brand-300: #9db1d8;
    --brand-500: #4a68a6; --brand-600: #37518b; --brand-700: #2c4172; --brand-800: #23345c;
    --brand-900: #1b2847; --brand-950: #111a30;
    --accent-300: #e2c27a; --accent-500: #c69a3e;

    --ink: #0f172a; --text: #334155; --muted: #64748b; --faint: #94a3b8;
    --line: #e2e8f0; --line-soft: #f1f5f9; --surface: #ffffff; --canvas: #f8fafc;

    --radius: 0.625rem;
    --sidebar-w: 16rem;
    --sidebar-w-collapsed: 4.5rem;
    --header-h: 4rem;
    --ring: 0 0 0 3px rgb(74 104 166 / 0.18);
}

html[data-sidebar="collapsed"] { --sidebar-w-current: var(--sidebar-w-collapsed); }
html:not([data-sidebar="collapsed"]) { --sidebar-w-current: var(--sidebar-w); }

[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* ── Shell ─────────────────────────────────────────────────────────── */
.app-brand { width: auto; }
.app-sidebar {
    width: min(var(--sidebar-w), 86vw);
    transform: translateX(-100%);
    transition: transform .22s ease, width .18s ease;
    padding-bottom: env(safe-area-inset-bottom);
}
body.sidebar-open .app-sidebar { transform: translateX(0); box-shadow: 0 20px 50px -12px rgb(15 23 42 / .35); }
body.sidebar-open { overflow: hidden; }

@media (min-width: 1024px) {
    .app-brand { width: var(--sidebar-w-current); transition: width .18s ease; }
    .app-sidebar { width: var(--sidebar-w-current); transform: none; }
    .app-main { padding-left: var(--sidebar-w-current); transition: padding-left .18s ease; }

    html[data-sidebar="collapsed"] .brand-text,
    html[data-sidebar="collapsed"] .nav-text,
    html[data-sidebar="collapsed"] .nav-pill,
    html[data-sidebar="collapsed"] .nav-caret,
    html[data-sidebar="collapsed"] .nav-children { display: none; }
    html[data-sidebar="collapsed"] .nav-section-label { visibility: hidden; height: .5rem; margin: 0; overflow: hidden; }
    html[data-sidebar="collapsed"] .nav-link { justify-content: center; padding-inline: 0; }
    html[data-sidebar="collapsed"] .app-brand { justify-content: center; gap: 0; }
    html[data-sidebar="collapsed"] .app-brand > a { display: none; }
    html[data-sidebar="collapsed"] .app-brand [data-sidebar-collapse] { margin: 0; }
    html[data-sidebar="collapsed"] .sidebar-footer > div { justify-content: center; padding-inline: 0; }
}

.sidebar-scroll { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }

/* ── Navigation ────────────────────────────────────────────────────── */
.nav-link {
    display: flex; align-items: center; gap: .75rem;
    min-height: 2.5rem; padding: .5rem .75rem;
    border-radius: .5rem; font-size: .875rem; font-weight: 500; color: var(--text);
    cursor: pointer; list-style: none; user-select: none;
    transition: background-color .12s, color .12s;
}
.nav-link::-webkit-details-marker { display: none; }
.nav-link:hover { background: var(--line-soft); color: var(--ink); }
.nav-link .nav-icon { display: inline-flex; color: var(--faint); flex-shrink: 0; }
.nav-link:hover .nav-icon { color: var(--muted); }
.nav-link.is-active { background: var(--brand-50); color: var(--brand-800); }
.nav-link.is-active .nav-icon { color: var(--brand-600); }
a.nav-link.is-active { box-shadow: inset 3px 0 0 var(--brand-600); }
.nav-link.is-upcoming { color: var(--faint); cursor: default; }
.nav-link.is-upcoming:hover { background: transparent; color: var(--faint); }
.nav-link.is-upcoming .nav-icon { color: #cbd5e1; }
.nav-link-child { min-height: 2.25rem; padding-left: 2.75rem; font-weight: 400; font-size: .8125rem; }
.nav-caret { color: var(--faint); transition: transform .15s; }
.nav-count { min-width: 1.25rem; padding: 0 .375rem; border-radius: 999px; background: var(--brand-100); color: var(--brand-800); font-size: .6875rem; font-weight: 600; line-height: 1.25rem; text-align: center; }
html[data-sidebar="collapsed"] .nav-count { display: none; }
.nav-group[open] > summary .nav-caret { transform: rotate(90deg); }
.nav-pill {
    font-size: .625rem; font-weight: 600; letter-spacing: .02em;
    color: var(--faint); border: 1px solid var(--line); border-radius: 999px; padding: 0 .4rem; line-height: 1.1rem;
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    min-height: 2.5rem; padding: .5rem 1rem;
    border-radius: .5rem; border: 1px solid transparent;
    font-size: .875rem; font-weight: 500; line-height: 1.25rem; white-space: nowrap;
    transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s;
    cursor: pointer;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-sm { min-height: 2rem; padding: .25rem .625rem; font-size: .8125rem; }
.btn-primary { background: var(--brand-700); color: #fff; box-shadow: 0 1px 2px rgb(16 24 40 / .08); }
.btn-primary:hover { background: var(--brand-800); }
.btn-primary:focus-visible { box-shadow: var(--ring); outline: none; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: 0 1px 2px rgb(16 24 40 / .04); }
.btn-secondary:hover { background: var(--canvas); border-color: #cbd5e1; }
.btn-ghost { color: var(--brand-700); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-danger { background: #be123c; color: #fff; }
.btn-danger:hover { background: #9f1239; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 1rem; height: 1rem;
    border: 2px solid rgb(255 255 255 / .5); border-top-color: #fff; border-radius: 999px;
    animation: spin .7s linear infinite;
}
.btn-secondary.is-loading::after { border-color: var(--line); border-top-color: var(--brand-600); }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.5rem; height: 2.5rem; border-radius: .5rem; color: var(--muted);
    transition: background-color .12s, color .12s;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-label { display: block; margin-bottom: .375rem; font-size: .875rem; font-weight: 500; color: var(--ink); }
.form-label .req { color: #e11d48; margin-left: .125rem; }
.form-input, .form-select, .form-textarea {
    display: block; width: 100%; min-height: 2.75rem;
    border-radius: .5rem; border: 1px solid #cbd5e1; background: #fff;
    padding: .5rem .75rem; font-size: 1rem; color: var(--ink);
    transition: border-color .12s, box-shadow .12s;
}
@media (min-width: 640px) { .form-input, .form-select, .form-textarea { font-size: .875rem; min-height: 2.5rem; } }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--brand-500); box-shadow: var(--ring); outline: none; }
.form-input::placeholder { color: var(--faint); }
.form-input.is-invalid, .form-select.is-invalid { border-color: #f43f5e; }
.form-input.is-invalid:focus { box-shadow: 0 0 0 3px rgb(244 63 94 / .15); }
.form-help { margin-top: .375rem; font-size: .75rem; color: var(--muted); }
.form-error { margin-top: .375rem; font-size: .8125rem; color: #e11d48; }

/* ── Cards ─────────────────────────────────────────────────────────── */
/* Grid items default to min-width:auto, so a wide child (nowrap button, long word)
   can widen a single-column grid past the phone screen. Let them shrink instead. */
#main .grid > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 1px 2px 0 rgb(16 24 40 / .04); min-width: 0; /* cards are often grid items: let long content truncate instead of widening the track */ }
.card-header {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem 1rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-soft);
}
.card-title { font-size: .9375rem; font-weight: 600; color: var(--ink); }
.card-subtitle { margin-top: .125rem; font-size: .8125rem; color: var(--muted); }

/* Key/value rows inside cards */
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 1.25rem; }
.kv dt { color: var(--muted); flex-shrink: 0; }
.kv dd { color: var(--ink); font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: .25rem;
    border-radius: 999px; padding: .125rem .5rem;
    font-size: .75rem; font-weight: 500; line-height: 1.125rem; white-space: nowrap;
    border: 1px solid transparent;
}
.badge-success { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.badge-info    { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.badge-warning { background: #fffbeb; color: #b45309; border-color: #fef3c7; }
.badge-danger  { background: #fff1f2; color: #be123c; border-color: #ffe4e6; }
.badge-neutral { background: #f8fafc; color: #475569; border-color: var(--line); }

/* ── Tables ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.data-table thead th {
    position: sticky; top: 0; background: var(--canvas);
    padding: .625rem 1.25rem; text-align: left;
    font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--line);
}
.data-table tbody td { padding: .75rem 1.25rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table thead th:not(:first-child):not(:last-child), .data-table tbody td:not(:first-child):not(:last-child) { padding-left: .875rem; padding-right: .875rem; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfcfe; }

/* ── Dropdowns ─────────────────────────────────────────────────────── */
.dropdown-panel {
    position: absolute; top: calc(100% + .5rem); z-index: 60;
    background: #fff; border: 1px solid var(--line); border-radius: .75rem;
    box-shadow: 0 12px 32px -8px rgb(16 24 40 / .18), 0 4px 8px -4px rgb(16 24 40 / .06);
    padding: .25rem; max-width: calc(100vw - 1.5rem);
}
.dropdown-item {
    display: flex; align-items: center; gap: .625rem;
    min-height: 2.5rem; padding: .5rem .75rem; border-radius: .5rem;
    font-size: .875rem; color: var(--text); text-align: left;
}
.dropdown-item:hover, .dropdown-item:focus-visible { background: var(--line-soft); color: var(--ink); outline: none; }
.dropdown-item.is-disabled { color: var(--faint); cursor: default; }
.dropdown-item.is-disabled:hover { background: transparent; }
.dropdown-item.is-current { color: var(--brand-800); font-weight: 500; }

/* ── Notifications badge ───────────────────────────────────────────── */
.notif-badge {
    position: absolute; top: .3rem; right: .3rem; min-width: 1.05rem; height: 1.05rem;
    padding: 0 .25rem; border-radius: 999px; background: #e11d48; color: #fff;
    font-size: .625rem; font-weight: 700; line-height: 1.05rem; text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

/* ── Notification items (bell dropdown + /notifications) ───────────── */
.notif-panel { width: 23rem; }
.notif-item { display: flex; align-items: flex-start; gap: .75rem; width: 100%; padding: .625rem .75rem; border-radius: .5rem; text-align: left; }
.notif-item:hover, .notif-item:focus-visible { background: var(--line-soft); outline: none; }
.notif-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 999px; background: var(--brand-100); color: var(--brand-700); }
.notif-icon.is-success { background: #ecfdf5; color: #047857; }
.notif-icon.is-warning { background: #fffbeb; color: #b45309; }
.notif-icon.is-urgent { background: #fff1f2; color: #be123c; }
.notif-dot { flex: none; width: .5rem; height: .5rem; margin-top: .45rem; border-radius: 999px; background: var(--brand-600); }
.notif-item.is-read .notif-title { font-weight: 400; color: var(--text); }

/* ── Header search suggestions ─────────────────────────────────────── */
.search-pop { position: absolute; top: calc(100% + .375rem); left: 0; right: 0; z-index: 60; max-height: 70vh; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: .25rem;
    box-shadow: 0 12px 32px -8px rgb(16 24 40 / .18), 0 4px 8px -4px rgb(16 24 40 / .06); }
.search-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border-radius: .5rem; }
.search-item:hover, .search-item.is-active { background: var(--line-soft); }

/* ── Idle sign-out warning ─────────────────────────────────────────── */
.idle-warning { position: fixed; z-index: 90; right: 1rem; bottom: 1rem; width: min(22rem, calc(100vw - 2rem)); padding: 1rem 1.125rem;
    box-shadow: 0 16px 40px -8px rgb(16 24 40 / .28); animation: fade-in .15s ease-out; }
@media (max-width: 639px) { .idle-warning { left: 1rem; right: 1rem; width: auto; bottom: calc(1rem + env(safe-area-inset-bottom)); } }

/* ── Public website (layouts/public) ──────────────────────────────── */
body.site { background: var(--surface); }
html:has(body.site) { scroll-behavior: smooth; }
.site [id] { scroll-margin-top: 5rem; }
.site-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .site-container { padding: 0 1.5rem; } }
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-nav-link { padding: .5rem .75rem; border-radius: .5rem; font-size: .875rem; font-weight: 500; color: var(--text); }
.site-nav-link:hover { background: var(--line-soft); color: var(--ink); }
.site-mobile-menu { border-top: 1px solid var(--line); background: var(--surface); }
.site-mobile-link { padding: .75rem .25rem; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.site-hero { position: relative; overflow: hidden; color: #fff;
    background: radial-gradient(900px 480px at 88% -10%, rgb(198 154 62 / .28), transparent 60%), radial-gradient(700px 400px at -10% 110%, rgb(74 104 166 / .35), transparent 60%),
                linear-gradient(135deg, var(--brand-950), var(--brand-800)); }
.site-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px);
    background-size: 44px 44px; -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent); mask-image: linear-gradient(to bottom, #000 30%, transparent); }
.site-hero > * { position: relative; z-index: 1; }
.site-hero-title { margin-top: 1.25rem; font-family: "Source Serif 4", Georgia, serif; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; font-weight: 700; letter-spacing: -.01em; }
.site-hero-lead { margin-top: 1.25rem; max-width: 36rem; font-size: 1.0625rem; line-height: 1.7; color: rgb(255 255 255 / .8); }
.site-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .375rem .875rem; border-radius: 999px; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .18); font-size: .8125rem; color: #fff; }
.site-pill:hover { background: rgb(255 255 255 / .16); }
.site-pill-dot { width: .5rem; height: .5rem; border-radius: 999px; background: #34d399; box-shadow: 0 0 0 4px rgb(52 211 153 / .25); }
.site-btn { display: inline-flex; align-items: center; gap: .5rem; height: 2.875rem; padding: 0 1.25rem; border-radius: .625rem; font-weight: 600; font-size: .9375rem; transition: background .15s, border-color .15s, transform .15s; }
.site-btn:active { transform: translateY(1px); }
.site-btn-accent { background: #c69a3e; color: #1d1606; }
.site-btn-accent:hover { background: #d4aa52; }
.site-btn-ghost { border: 1px solid rgb(255 255 255 / .3); color: #fff; }
.site-btn-ghost:hover { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .5); }
.site-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.site-stat { display: flex; flex-direction: column; padding: 1.25rem; border-radius: 1rem; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .14); backdrop-filter: blur(6px); }
.site-stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: .75rem; background: rgb(255 255 255 / .12); color: #e2c27a; }
.site-stat-value { margin-top: 1rem; font-size: 2rem; font-weight: 700; line-height: 1; }
.site-stat-label { margin-top: .375rem; font-size: .875rem; color: rgb(255 255 255 / .75); }
.site-section { padding: 4.5rem 0; }
@media (min-width: 1024px) { .site-section { padding: 6rem 0; } }
.site-section-alt { background: var(--canvas); }
.site-section-head { max-width: 42rem; margin: 0 auto 2.5rem; text-align: center; }
.site-eyebrow { font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #a97f2c; }
.site-h2 { margin-top: .5rem; font-family: "Source Serif 4", Georgia, serif; font-size: clamp(1.75rem, 3vw, 2.35rem); font-weight: 700; line-height: 1.2; color: var(--ink); }
.site-lead { margin-top: .75rem; font-size: 1.0625rem; color: var(--muted); }
.site-chip { padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .875rem; font-weight: 500; color: var(--text); }
.site-chip:hover { border-color: var(--brand-300); }
.site-chip.is-active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.site-card { display: block; padding: 1.5rem; border-radius: 1rem; background: var(--surface); border: 1px solid var(--line); transition: box-shadow .2s, transform .2s, border-color .2s; }
a.site-card:hover { border-color: var(--brand-300); box-shadow: 0 14px 32px -14px rgb(16 24 40 / .22); transform: translateY(-2px); }
.site-card[hidden] { display: none; }
.site-tag { display: inline-flex; padding: .25rem .625rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--brand-50); color: var(--brand-700); }
.site-tag.is-success { background: #ecfdf5; color: #047857; }
.site-tag.is-warning { background: #fffbeb; color: #b45309; }
.site-feature, .site-step { padding: 1.5rem; border-radius: 1rem; background: var(--surface); border: 1px solid var(--line); }
.site-feature-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: .75rem; background: var(--brand-50); color: var(--brand-700); }
.site-step-no { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 999px; background: var(--brand-700); color: #fff; font-weight: 700; }
.site-check { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; margin-top: .125rem; border-radius: 999px; background: #ecfdf5; color: #047857; }
.site-event { display: flex; align-items: center; gap: 1rem; padding: .875rem 1rem; border-radius: .875rem; background: var(--surface); border: 1px solid var(--line); }
.site-date { display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; border-radius: .75rem; background: var(--brand-50); color: var(--brand-800); }
.site-date.is-warning { background: #fffbeb; color: #92400e; }
.site-date.is-success { background: #ecfdf5; color: #065f46; }
.site-date.is-danger { background: #fff1f2; color: #9f1239; }
.site-date.is-accent { background: #fbf6ea; color: #86631f; }
.site-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.site-cta { background: radial-gradient(700px 300px at 50% 0%, rgb(198 154 62 / .22), transparent 70%), linear-gradient(135deg, var(--brand-900), var(--brand-700)); }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.site-footer-link { color: var(--text); }
.site-footer-link:hover { color: var(--brand-700); }

/* ── Website Manager: editable rows (website/edit) ─ */
.rep-item { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--canvas); }
.rep-body { flex: 1; min-width: 0; }
.rep-actions { display: flex; flex-direction: column; gap: .125rem; }
.rep-actions .btn:disabled { opacity: .35; }

/* ── Public website v3: bright, friendly university landing (layouts/public, public/home) ─ */
body.site {
    --pw-bg: #ffffff; --pw-soft: #f2f9ff; --pw-soft-2: #e3f2fd; --pw-card: #ffffff;
    --pw-ink: #0f1f3d; --pw-text: #46536b; --pw-muted: #7b879b; --pw-line: #e5edf5;
    --pw-sky: #3ba6ec; --pw-sky-2: #2893dc; --pw-sky-ink: #1583cf; --pw-orange: #f7b562; --pw-orange-soft: #fff1dc;
    --pw-sky-rgb: 59 166 236; --pw-on-sky: #fff; --pw-blob-1: #d6eefd; --pw-blob-2: #bfe3fb; --pw-blob-3: #acd9f8; --pw-banner-1: #7cc8f7; --pw-banner-2: #3ba6ec; --pw-banner-3: #56b8f2;
    --pw-shadow: 0 18px 40px -18px rgb(15 31 61 / .22);
    background: var(--pw-bg); color: var(--pw-text);
    font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
body.site .form-label { color: var(--pw-ink); }
.pw-container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 640px) { .pw-container { padding: 0 2rem; } }
.site [id] { scroll-margin-top: 5.5rem; }

/* Type */
.pw-eyebrow { font-size: .9375rem; font-weight: 600; color: var(--pw-sky-ink); }
.pw-h1 { font-size: clamp(2.5rem, 5.4vw, 4rem); line-height: 1.07; font-weight: 700; letter-spacing: -.025em; color: var(--pw-ink); }
.pw-h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); line-height: 1.18; font-weight: 700; letter-spacing: -.02em; color: var(--pw-ink); }
.pw-h3 { font-size: 1rem; line-height: 1.35; font-weight: 700; color: var(--pw-ink); }
.pw-lead { max-width: 32rem; font-size: 1.0625rem; line-height: 1.7; color: var(--pw-text); }
.pw-small { font-size: .875rem; line-height: 1.6; color: var(--pw-muted); }
.pw-squiggle { display: block; width: 4.5rem; height: .75rem; margin: .75rem auto 0; color: var(--pw-orange); }
.pw-section { padding: 5rem 0; }
@media (min-width: 1024px) { .pw-section { padding: 6.5rem 0; } }
.pw-section-soft { background: var(--pw-soft); }
.pw-head { max-width: 40rem; margin: 0 auto 3rem; text-align: center; }

/* Buttons */
.pw-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 3rem; padding: 0 1.625rem; border-radius: 999px; font-size: .9375rem; font-weight: 700; white-space: nowrap; transition: background .2s, box-shadow .2s, transform .2s, color .2s; }
.pw-btn:active { transform: translateY(1px); }
.pw-btn-lg { height: 3.5rem; padding: 0 2rem; font-size: 1rem; }
.pw-btn-sky { background: var(--pw-sky); color: var(--pw-on-sky); box-shadow: 0 12px 24px -12px rgb(var(--pw-sky-rgb) / .8); }
.pw-btn-sky:hover { background: var(--pw-sky-2); }
.pw-btn-white { background: #fff; color: var(--pw-sky-ink); }
.pw-btn-white:hover { box-shadow: 0 10px 24px -12px rgb(0 0 0 / .35); }
.pw-btn-ghost { border: 1.5px solid var(--pw-line); background: var(--pw-card); color: var(--pw-ink); }
.pw-btn-ghost:hover { border-color: var(--pw-sky); color: var(--pw-sky-ink); }
.pw-play { display: inline-flex; align-items: center; gap: .75rem; font-size: .9375rem; font-weight: 600; color: var(--pw-ink); }
.pw-play-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 999px; border: 1.5px solid var(--pw-sky); color: var(--pw-sky); transition: background .2s, color .2s; }
.pw-play:hover .pw-play-icon { background: var(--pw-sky); color: var(--pw-on-sky); }
.pw-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 999px; color: var(--pw-text); }
.pw-icon-btn:hover { background: var(--pw-soft); color: var(--pw-ink); }

/* Header */
.pw-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--pw-bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .25s; }
.pw-header.is-scrolled { border-bottom-color: var(--pw-line); }
.pw-brand { display: flex; min-width: 0; align-items: center; gap: .625rem; }
@media (min-width: 1280px) { .pw-brand { flex: none; } }
.pw-brand-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9375rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--pw-ink); }
.pw-brand-motto { display: block; white-space: nowrap; font-size: .625rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--pw-muted); }
@media (max-width: 419px) { .pw-brand-name { font-size: .8125rem; } }
.pw-nav-link { display: inline-flex; align-items: center; height: 2.5rem; padding: 0 .9rem; border-radius: 999px; font-size: .875rem; font-weight: 500; color: var(--pw-ink); transition: background .2s, color .2s; }
.pw-nav-link:hover { background: var(--pw-soft); }
.pw-header-inner { gap: 2rem; }
@media (min-width: 1280px) {
    .pw-header-actions { gap: .75rem; padding-left: 1.25rem; border-left: 1px solid var(--pw-line); }
    .pw-header-actions .pw-icon-btn { width: 2.5rem; height: 2.5rem; }
}
.pw-nav-link:hover { color: var(--pw-sky-ink); }
.pw-burger { position: relative; display: block; width: 18px; height: 12px; }
.pw-burger span { position: absolute; left: 0; width: 100%; height: 1.75px; border-radius: 2px; background: currentColor; transition: transform .25s, top .25s; }
.pw-burger span:first-child { top: 2px; } .pw-burger span:last-child { top: 9px; }
[aria-expanded="true"] .pw-burger span:first-child { top: 5.5px; transform: rotate(45deg); }
[aria-expanded="true"] .pw-burger span:last-child { top: 5.5px; transform: rotate(-45deg); }
.pw-mobile { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.pw-mobile > div { overflow: hidden; }
.pw-mobile.is-open { grid-template-rows: 1fr; border-top: 1px solid var(--pw-line); }
.pw-mobile-link { display: flex; align-items: center; min-height: 3.25rem; border-bottom: 1px solid var(--pw-line); font-weight: 500; color: var(--pw-ink); }

/* Confetti */
.pw-confetti { position: absolute; pointer-events: none; border-radius: 60% 40% 55% 45% / 55% 45% 55% 45%; }
@media (max-width: 1023px) { .pw-hero > .pw-confetti { display: none; } }
.pw-confetti.is-orange { background: var(--pw-orange); }
.pw-confetti.is-sky { background: #8fd0f7; }

/* Hero */
.pw-hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--pw-bg) 0%, var(--pw-soft) 100%); }
.pw-hero-visual { position: relative; min-height: 26rem; }
@media (min-width: 640px) { .pw-hero-visual { min-height: 32rem; } }
.pw-blob { position: absolute; right: -12%; top: 4%; width: 92%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 35%, var(--pw-blob-1), var(--pw-blob-2) 60%, var(--pw-blob-3)); }
.pw-photo { position: absolute; left: 12%; right: 10%; top: 8%; bottom: 6%; border-radius: 2rem; overflow: hidden; background: #fff; box-shadow: var(--pw-shadow); }
.pw-photo img.pw-photo-img { width: 100%; height: 100%; object-fit: cover; }
.pw-photo-brand { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; text-align: center; background: linear-gradient(160deg, #ffffff, #eef7ff); }
.pw-float { position: absolute; z-index: 2; display: flex; gap: .75rem; padding: .875rem 1rem; border-radius: 1rem; background: var(--pw-card); box-shadow: var(--pw-shadow); max-width: 15rem; }
.pw-float-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: .75rem; background: var(--pw-soft-2); color: var(--pw-sky-ink); }
.pw-float-1 { right: 0; top: 2%; }
.pw-float-2 { right: -2%; top: 38%; }
.pw-float-3 { left: 0; bottom: 4%; }
@media (max-width: 639px) { .pw-float { max-width: 12rem; padding: .625rem .75rem; } .pw-float-2 { display: none; } .pw-float-1 { right: 2%; } }
.pw-spark { width: 100%; height: 2.25rem; margin-top: .375rem; color: var(--pw-sky); }
.pw-avatars { display: flex; }
.pw-avatars span { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; margin-left: -.5rem; border-radius: 999px; border: 2px solid var(--pw-bg); color: #fff; }
.pw-avatars span:first-child { margin-left: 0; }

/* Faculties strip */
.pw-trust { background: var(--pw-soft); border-top: 1px solid var(--pw-line); border-bottom: 1px solid var(--pw-line); }
.pw-trust-item { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; color: #6a7891; }

/* Feature tiles */
.pw-tile { padding: 1.75rem 1.25rem; border-radius: 1.25rem; background: var(--pw-card); border: 1px solid var(--pw-line); text-align: center; transition: transform .2s, box-shadow .2s, border-color .2s; }
.pw-tile:hover { transform: translateY(-4px); box-shadow: var(--pw-shadow); border-color: transparent; }
.pw-tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; border-radius: 1rem; }
.tone-sky { background: #e3f2fd; color: #1583cf; } .tone-orange { background: #fff1dc; color: #d98a1c; } .tone-green { background: #e3f8ee; color: #1f9d63; }
.tone-violet { background: #efeafe; color: #6d4fd8; } .tone-pink { background: #fde9f1; color: #d0457a; } .tone-teal { background: #dff6f6; color: #1a9a9a; }

/* Programs */
.pw-program { display: flex; flex-direction: column; padding: 1.5rem; border-radius: 1.25rem; background: var(--pw-card); border: 1px solid var(--pw-line); transition: transform .2s, box-shadow .2s, border-color .2s; }
.pw-program:hover { transform: translateY(-4px); box-shadow: var(--pw-shadow); border-color: transparent; }
.pw-pill { display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .75rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--pw-soft-2); color: var(--pw-sky-ink); }
.pw-chip { padding: .5rem 1.125rem; border-radius: 999px; border: 1.5px solid var(--pw-line); background: var(--pw-card); font-size: .875rem; font-weight: 600; color: var(--pw-text); }
.pw-chip:hover { border-color: var(--pw-sky); color: var(--pw-sky-ink); }
.pw-chip.is-active { background: var(--pw-sky); border-color: var(--pw-sky); color: #fff; }
.pw-program[hidden] { display: none; }

/* Welcome banner */
.pw-banner { position: relative; overflow: hidden; border-radius: 2rem; background: radial-gradient(90% 120% at 100% 0%, var(--pw-banner-1), transparent 60%), linear-gradient(120deg, var(--pw-banner-2), var(--pw-banner-3)); color: #fff; }
.pw-banner-photo { position: relative; aspect-ratio: 16 / 9; max-height: 15rem; width: 100%; border-radius: 1.5rem; overflow: hidden; background: #fff; }
@media (min-width: 1024px) { .pw-banner-photo { aspect-ratio: 4 / 3.4; max-height: none; } }
.pw-banner-item { display: flex; align-items: center; gap: .875rem; font-size: .9375rem; font-weight: 600; }
.pw-banner-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; border: 1.5px solid rgb(255 255 255 / .6); }

/* Apply / fee card */
.pw-price { position: relative; padding: 2.25rem; border-radius: 1.75rem; background: var(--pw-card); box-shadow: var(--pw-shadow); text-align: center; }
.pw-price-amount { font-size: clamp(2.5rem, 5vw, 3.25rem); font-weight: 700; letter-spacing: -.03em; color: var(--pw-ink); }
.pw-note { display: inline-block; padding: 1.25rem 1.5rem; border-radius: 1.25rem; background: var(--pw-card); box-shadow: var(--pw-shadow); transform: rotate(-3deg); }
.pw-check { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 1.375rem; height: 1.375rem; border-radius: 999px; background: var(--pw-sky); color: var(--pw-on-sky); }

/* Steps, dates, FAQ, verify, contact */
.pw-step-no { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; background: var(--pw-sky); color: var(--pw-on-sky); font-weight: 700; }
.pw-date { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.125rem; border-radius: 1.125rem; background: var(--pw-card); border: 1px solid var(--pw-line); }
.pw-date-badge { display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: var(--pw-soft-2); color: var(--pw-sky-ink); }
.pw-faq { border-radius: 1.125rem; background: var(--pw-card); border: 1px solid var(--pw-line); }
.pw-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.125rem 1.25rem; font-weight: 600; color: var(--pw-ink); cursor: pointer; list-style: none; }
.pw-faq summary::-webkit-details-marker { display: none; }
.pw-faq summary svg { flex: none; transition: transform .2s; color: var(--pw-sky-ink); }
.pw-faq[open] summary svg { transform: rotate(45deg); }
.pw-faq p { padding: 0 1.25rem 1.25rem; font-size: .9375rem; line-height: 1.7; color: var(--pw-text); }
.pw-card { padding: 2rem; border-radius: 1.5rem; background: var(--pw-card); border: 1px solid var(--pw-line); }
.pw-input { height: 3rem; flex: 1; min-width: 0; padding: 0 1.25rem; border-radius: 999px; border: 1.5px solid var(--pw-line); background: var(--pw-card); color: var(--pw-ink); font-size: 1rem; }
.pw-input:focus { outline: none; border-color: var(--pw-sky); box-shadow: 0 0 0 4px rgb(var(--pw-sky-rgb) / .15); }

/* Footer */
.pw-footer { background: var(--pw-soft); border-top: 1px solid var(--pw-line); }
.pw-footer-title { font-size: .875rem; font-weight: 700; color: var(--pw-ink); }
.pw-footer-link { font-size: .875rem; color: var(--pw-text); }
.pw-footer-link:hover { color: var(--pw-sky-ink); }

@media (prefers-reduced-motion: reduce) { .pw-mobile, .pw-burger span, .pw-tile, .pw-program { transition: none; } }

/* Website Manager options: corner style and decorations */
.pw-corners-soft .pw-btn, .pw-corners-soft .pw-input, .pw-corners-soft .pw-chip, .pw-corners-soft .pw-nav-link { border-radius: .75rem; }
.pw-corners-soft :is(.pw-tile, .pw-program, .pw-card, .pw-faq, .pw-date, .pw-price, .pw-note, .pw-float) { border-radius: .875rem; }
.pw-corners-soft :is(.pw-banner, .pw-photo, .pw-banner-photo) { border-radius: 1.125rem; }
.pw-corners-square .pw-btn, .pw-corners-square .pw-input, .pw-corners-square .pw-chip, .pw-corners-square .pw-nav-link, .pw-corners-square .pw-pill { border-radius: .25rem; }
.pw-corners-square :is(.pw-tile, .pw-program, .pw-card, .pw-faq, .pw-date, .pw-price, .pw-note, .pw-float, .pw-banner, .pw-photo, .pw-banner-photo, .pw-tile-icon, .pw-date-badge, .pw-float-icon) { border-radius: .375rem; }
.pw-corners-square .pw-blob { border-radius: 1.5rem; }
.pw-no-deco .pw-confetti, .pw-no-deco .pw-squiggle { display: none; }
.pw-no-deco .pw-note { transform: none; }
.pw-announce { background: #0f1f3d; color: #fff; font-size: .875rem; }
.pw-announce a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pw-social { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; border: 1px solid var(--pw-line); color: var(--pw-text); transition: color .2s, border-color .2s; }
.pw-social:hover { color: var(--pw-sky-ink); border-color: var(--pw-sky); }
.pw-preview-note { background: #fef3c7; color: #78350f; font-size: .8125rem; }

/* ── Toasts ────────────────────────────────────────────────────────── */
.toast-region {
    position: fixed; z-index: 90; right: 1rem; left: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; pointer-events: none;
}
@media (min-width: 640px) { .toast-region { left: auto; width: 24rem; } }
.toast {
    pointer-events: auto; width: 100%; display: flex; gap: .625rem; align-items: flex-start;
    padding: .75rem .75rem .75rem 1rem; border-radius: .75rem; background: #0f172a; color: #fff; font-size: .875rem; line-height: 1.35rem;
    box-shadow: 0 12px 32px -8px rgb(16 24 40 / .35);
    animation: toast-in .18s ease-out;
}
.toast-icon { width: 1.125rem; height: 1.125rem; flex-shrink: 0; margin-top: .125rem; color: #93c5fd; }
.toast[data-type="success"] .toast-icon { color: #6ee7b7; }
.toast[data-type="error"] .toast-icon { color: #fda4af; }
.toast[data-type="warning"] .toast-icon { color: #fcd34d; }
.toast-close { margin: -.125rem 0 0; padding: 0 .375rem; font-size: 1.25rem; line-height: 1.5rem; color: rgb(255 255 255 / .6); border-radius: .375rem; }
.toast-close:hover { color: #fff; background: rgb(255 255 255 / .1); }

/* ── Auth panel ────────────────────────────────────────────────────── */
.auth-panel::before {
    content: ""; position: absolute; inset: 0;
    background-image:
        radial-gradient(ellipse 60% 50% at 85% 10%, rgb(74 104 166 / .35), transparent 70%),
        linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px);
    background-size: auto, 40px 40px, 40px 40px;
}

/* =====================================================================
   Phase 1 components
   ===================================================================== */

/* ── Buttons (extra variants) ──────────────────────────────────────── */
.btn-lg { min-height: 2.75rem; padding: .625rem 1.25rem; font-size: .9375rem; }
.btn-icon { width: 2.5rem; padding: 0; justify-content: center; }
.btn-sm.btn-icon { width: 2rem; }
.btn-danger-soft { background: #fff1f2; color: #be123c; border-color: #ffe4e6; }
.btn-danger-soft:hover { background: #ffe4e6; }
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-radius: .5rem 0 0 .5rem; }
.btn-group > .btn:last-child { border-radius: 0 .5rem .5rem 0; }
.btn-group > .btn + .btn { margin-left: -1px; }
.spinner { display: inline-block; width: 1rem; height: 1rem; border: 2px solid var(--line); border-top-color: var(--brand-600); border-radius: 999px; animation: spin .7s linear infinite; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card-body { padding: 1.25rem; }
.card-footer { padding: .875rem 1.25rem; border-top: 1px solid var(--line-soft); background: #fcfdfe; border-radius: 0 0 .75rem .75rem; }
.stat-card { display: block; padding: 1.125rem 1.25rem; }
.stat-card.is-link { transition: border-color .12s, box-shadow .12s; }
.stat-card.is-link:hover { border-color: var(--brand-200); box-shadow: 0 4px 12px -4px rgb(16 24 40 / .08); }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: .5rem; background: var(--brand-50); color: var(--brand-600); }

/* ── Forms (extras) ────────────────────────────────────────────────── */
.form-field + .form-field { margin-top: 1rem; }
.form-grid { display: grid; gap: 1rem 1.25rem; }
@media (min-width: 640px) { .form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-grid > .form-field + .form-field, .grid > .form-field + .form-field { margin-top: 0; } /* grids space fields with gap */
.form-grid .col-span-full { grid-column: 1 / -1; }
.form-section + .form-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line-soft); }
.form-section-title { font-size: .9375rem; font-weight: 600; color: var(--ink); }
.form-section-desc { margin-top: .125rem; margin-bottom: 1.25rem; font-size: .8125rem; color: var(--muted); }
.form-select { appearance: none; padding-right: 2.25rem; background-repeat: no-repeat; background-position: right .625rem center; background-size: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.form-textarea { min-height: 6rem; resize: vertical; }
.form-input:disabled, .form-select:disabled, .form-textarea:disabled, .form-input[readonly] { background: var(--canvas); color: var(--muted); cursor: not-allowed; }
.input-group { display: flex; align-items: stretch; border: 1px solid #cbd5e1; border-radius: .5rem; background: #fff; overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.input-group:focus-within { border-color: var(--brand-500); box-shadow: var(--ring); }
.input-group.is-invalid { border-color: #f43f5e; }
.input-group .form-input { border: 0; border-radius: 0; box-shadow: none !important; min-width: 0; flex: 1; }
.input-addon { display: flex; align-items: center; padding: 0 .75rem; background: var(--canvas); color: var(--muted); font-size: .875rem; white-space: nowrap; }
.input-addon:first-child { border-right: 1px solid var(--line); }
.input-addon:last-child { border-left: 1px solid var(--line); }
.form-textarea.is-invalid, .form-select.is-invalid, .combo-button.is-invalid { border-color: #f43f5e; }
.form-alert { margin-bottom: 1rem; padding: .625rem .875rem; border-radius: .5rem; border: 1px solid #fecdd3; background: #fff1f2; color: #9f1239; font-size: .875rem; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-700); }
.form-checkbox { width: 1.0625rem; height: 1.0625rem; margin-top: .125rem; flex-shrink: 0; cursor: pointer; }
.switch { appearance: none; position: relative; width: 2.25rem; height: 1.25rem; margin-top: .125rem; flex-shrink: 0; border-radius: 999px; background: #cbd5e1; cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: .125rem; left: .125rem; width: 1rem; height: 1rem; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .15s; }
.switch:checked { background: var(--brand-600); }
.switch:checked::after { transform: translateX(1rem); }
.switch:focus-visible { box-shadow: var(--ring); outline: none; }

.choice-grid { display: grid; gap: .625rem; }
@media (min-width: 640px) { .choice-grid { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); } }
.choice-card { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem .875rem; border: 1px solid var(--line); border-radius: .625rem; cursor: pointer; transition: border-color .12s, background .12s; }
.choice-card:hover { border-color: #cbd5e1; }
.choice-card input { margin-top: .2rem; width: 1rem; height: 1rem; flex-shrink: 0; }
.choice-card:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand-500); }
.choice-card:has(input:focus-visible) { box-shadow: var(--ring); }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: .375rem; padding: 1.25rem 1rem; text-align: center;
    border: 1.5px dashed #cbd5e1; border-radius: .75rem; background: var(--canvas); cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.is-dragging { border-color: #6c88bf; background: var(--brand-50); }
.dropzone:focus-within { border-color: var(--brand-500); box-shadow: var(--ring); }
.dropzone.is-invalid { border-color: #f43f5e; background: #fff1f2; }
.file-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .5rem .5rem .625rem; border: 1px solid var(--line); border-radius: .625rem; background: #fff; }

/* Searchable select */
.combo { position: relative; }
.combo-button { display: flex; align-items: center; text-align: left; cursor: pointer; }
.combo-pop { position: absolute; z-index: 70; left: 0; right: 0; top: calc(100% + .375rem); background: #fff; border: 1px solid var(--line); border-radius: .75rem;
    box-shadow: 0 12px 32px -8px rgb(16 24 40 / .18); }
.combo-list { max-height: 15rem; overflow-y: auto; padding: 0 .25rem .25rem; overscroll-behavior: contain; }
.combo-option { padding: .5rem .625rem; border-radius: .5rem; font-size: .875rem; color: var(--text); cursor: pointer; }
.combo-option.is-active { background: var(--line-soft); color: var(--ink); }
.combo-option[aria-selected="true"] { color: var(--brand-800); font-weight: 500; }
.combo-empty { padding: .75rem; font-size: .8125rem; color: var(--muted); text-align: center; }

/* ── Chips, avatars, badge dot ─────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .5rem .25rem .625rem; border-radius: 999px; background: var(--brand-50); color: var(--brand-800); font-size: .75rem; font-weight: 500; border: 1px solid var(--brand-100); }
.chip:hover { background: var(--brand-100); }
.badge-dot { width: .375rem; height: .375rem; border-radius: 999px; background: currentColor; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; border-radius: 999px; background: var(--brand-100); color: var(--brand-800); font-weight: 600; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: .625rem; }
.avatar-md { width: 2.25rem; height: 2.25rem; font-size: .75rem; }
.avatar-lg { width: 3rem; height: 3rem; font-size: .9375rem; }
.avatar-xl { width: 4.5rem; height: 4.5rem; font-size: 1.25rem; }
.avatar-2xl { width: 7rem; height: 7rem; font-size: 2rem; }
/* Camera button on the profile photo */
.avatar-edit { position: absolute; right: .125rem; bottom: .125rem; display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: 999px; background: var(--brand-700); color: #fff; box-shadow: 0 0 0 3px var(--surface); }
.avatar-edit:hover { background: var(--brand-800); }
.avatar-edit:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* ── Dropdown extras ───────────────────────────────────────────────── */
.dropdown-item.is-danger { color: #be123c; }
.dropdown-item.is-danger:hover { background: #fff1f2; color: #9f1239; }
[data-dropdown-fixed] .dropdown-panel { z-index: 65; }

/* ── Table system ──────────────────────────────────────────────────── */
.table-toolbar { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; border-bottom: 1px solid var(--line-soft); }
@media (min-width: 640px) { .table-toolbar { flex-direction: row; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; } }
[data-filter-form].is-submitting { opacity: .7; pointer-events: none; }
.sort-link { display: inline-flex; align-items: center; gap: .25rem; color: inherit; }
.sort-link:hover { color: var(--ink); }
.sort-link .sort-icon { opacity: .45; }
.sort-link.is-active { color: var(--ink); }
.sort-link.is-active .sort-icon { opacity: 1; color: var(--brand-600); }
.data-table th.w-check, .data-table td.w-check { width: 2.75rem; padding-right: 0; }
.data-table tbody tr.is-selected td { background: var(--brand-50); }
.data-table td.actions, .data-table th.actions { width: 1%; white-space: nowrap; text-align: right; }
.cell-primary { font-weight: 500; color: var(--ink); }
.cell-secondary { font-size: .8125rem; color: var(--muted); }

.bulk-bar { position: sticky; bottom: max(.75rem, env(safe-area-inset-bottom)); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
    margin: .75rem; padding: .625rem .875rem; border-radius: .75rem; background: #fff; border: 1px solid var(--brand-200); box-shadow: 0 8px 24px -8px rgb(16 24 40 / .2); }

.pagination-bar { display: flex; flex-direction: column; gap: .75rem; padding: .875rem 1rem; border-top: 1px solid var(--line-soft); }
@media (min-width: 640px) { .pagination-bar { flex-direction: row; align-items: center; justify-content: space-between; padding: .875rem 1.25rem; } }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; height: 2.25rem; padding: 0 .5rem; border-radius: .5rem; font-size: .875rem; color: var(--text); }
a.page-link:hover { background: var(--line-soft); color: var(--ink); }
.page-link.is-current { background: var(--brand-700); color: #fff; font-weight: 600; }
.page-link.is-disabled { color: #cbd5e1; }
.page-link.is-gap { color: var(--faint); }

/* Stacked rows on phones: add .table-stack to .data-table and data-label to cells. */
@media screen and (max-width: 639px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { position: relative; padding: .75rem 1rem; border-bottom: 1px solid var(--line-soft); }
    .table-stack tbody td { padding: .1875rem 0; border: 0; }
    .table-stack td[data-label]::before { content: attr(data-label); display: block; font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
    .table-stack td.w-check { position: absolute; top: .9rem; left: 1rem; width: auto; }
    .table-stack td.w-check ~ td { padding-left: 2rem; }
    .table-stack td.actions { position: absolute; top: .5rem; right: .5rem; width: auto; padding: 0 !important; }
    .table-stack tbody tr:hover td, .table-stack tbody tr.is-selected td { background: transparent; }
    .table-stack tbody tr.is-selected { background: var(--brand-50); }
}

/* ── Tabs ──────────────────────────────────────────────────────────── */
.tabs-list { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.tabs-list::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: .5rem; flex-shrink: 0; min-height: 2.75rem; padding: 0 .875rem;
    font-size: .875rem; font-weight: 500; color: var(--muted); white-space: nowrap; border-radius: .5rem .5rem 0 0; }
.tab:hover { color: var(--ink); background: var(--canvas); }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--brand-800); }
.tab[aria-selected="true"]::after, .tab[aria-current="page"]::after { content: ""; position: absolute; left: .5rem; right: .5rem; bottom: 0; height: 2px; border-radius: 2px; background: var(--brand-600); }
.tab-count { min-width: 1.25rem; padding: 0 .375rem; border-radius: 999px; background: var(--line-soft); color: var(--muted); font-size: .6875rem; font-weight: 600; line-height: 1.25rem; text-align: center; }
.tab[aria-selected="true"] .tab-count, .tab[aria-current="page"] .tab-count { background: var(--brand-100); color: var(--brand-800); }
[role="tabpanel"]:focus-visible { outline: 2px solid var(--brand-200); outline-offset: 4px; border-radius: .5rem; }

/* ── Steps ─────────────────────────────────────────────────────────── */
.steps { display: grid; gap: .875rem; }
@media (min-width: 768px) { .steps { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1rem; } }
.step { position: relative; isolation: isolate; display: flex; gap: .75rem; align-items: flex-start; color: var(--muted); }
.step-marker { display: flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; flex-shrink: 0; border-radius: 999px;
    border: 1.5px solid #cbd5e1; background: #fff; font-size: .75rem; font-weight: 600; color: var(--muted); }
.step.is-complete .step-marker { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.step.is-current .step-marker { border-color: var(--brand-600); color: var(--brand-700); box-shadow: 0 0 0 4px var(--brand-100); }
.step.is-current { color: var(--ink); }
.step.is-complete { color: var(--text); }
.step.is-rejected .step-marker { background: #e11d48; border-color: #e11d48; color: #fff; }
@media (min-width: 768px) {
    .step { flex-direction: column; }
    .step:not(:last-child)::before { content: ""; position: absolute; top: .875rem; left: 2.25rem; right: -.5rem; height: 1.5px; background: var(--line); }
    .step.is-complete:not(:last-child)::before { background: var(--brand-600); }
}

/* ── Loading ───────────────────────────────────────────────────────── */
.skeleton { border-radius: .375rem; background: linear-gradient(90deg, #eef2f6 25%, #f6f8fa 50%, #eef2f6 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
[aria-busy="true"] { cursor: progress; }

/* ── Modals ────────────────────────────────────────────────────────── */
html.modal-open { overflow: hidden; }
.modal { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; margin: 0; overflow: hidden; color: inherit; }
.modal[open] { display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal[open] { align-items: center; padding: 1.5rem; } }
.modal::backdrop { background: rgb(15 23 42 / .45); animation: fade-in .15s ease-out; }
.modal-card { display: flex; flex-direction: column; width: 100%; max-height: calc(100dvh - 2rem); background: #fff; border-radius: 1rem 1rem 0 0;
    box-shadow: 0 24px 48px -12px rgb(16 24 40 / .3); animation: sheet-in .2s ease-out; }
@media (min-width: 640px) { .modal-card { border-radius: .875rem; max-height: calc(100dvh - 3rem); animation: pop-in .16s ease-out; } }
.modal-sm .modal-card { max-width: 26rem; }
.modal-md .modal-card { max-width: 32rem; }
.modal-lg .modal-card { max-width: 44rem; }
.modal-xl .modal-card { max-width: 60rem; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.125rem 1.25rem .75rem; }
@media (min-width: 640px) { .modal-header { padding: 1.25rem 1.5rem .75rem; } }
.modal-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: .5rem 1.25rem 1.25rem; }
@media (min-width: 640px) { .modal-body { padding: .5rem 1.5rem 1.5rem; } }
.modal-footer { display: flex; flex-direction: column-reverse; gap: .5rem; padding: .875rem 1.25rem; border-top: 1px solid var(--line-soft);
    padding-bottom: max(.875rem, env(safe-area-inset-bottom)); }
.modal-footer .btn { justify-content: center; }
@media (min-width: 640px) { .modal-footer { flex-direction: row; justify-content: flex-end; padding: 1rem 1.5rem; } }
.confirm-icon { background: var(--brand-50); color: var(--brand-600); }
#confirm-dialog[data-tone="danger"] .confirm-icon { background: #fff1f2; color: #e11d48; }

/* ── Printable documents (letters, receipts, transcripts) ─────────── */
.letter-sheet { width: 100%; max-width: 210mm; min-height: 297mm; }
/* ── Reports ───────────────────────────────────────────────────────── */
.report-bar-track { display: block; height: .5rem; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.report-bar { display: block; height: 100%; border-radius: 999px; background: var(--brand-600); }
.report-total td { font-weight: 600; color: var(--ink); background: var(--line-soft); border-top: 1px solid var(--line); }
.print-only { display: none; }

@media print {
    @page { size: A4; margin: 14mm; }
    .no-print, .app-header, .app-sidebar, .toast-region, .page-actions, nav[aria-label="Breadcrumb"], .app-footer { display: none !important; }
    .print-only { display: block !important; }
    body:has(.print-only) .page-header { display: none !important; }
    .app-main { padding: 0 !important; }
    #main { max-width: none !important; padding: 0 !important; }
    .card { box-shadow: none !important; break-inside: avoid; }
    .report-table { break-inside: auto; }
    .report-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .table-wrap { overflow: visible !important; }
    .data-table { font-size: 10px; }
    .data-table th, .data-table td { padding: 4px 6px !important; }
    body { background: #fff !important; }
    .letter-sheet { max-width: none; min-height: 0; padding: 0 !important; margin: 0 !important; }
}

/* ── Style guide helpers ───────────────────────────────────────────── */
.swatch { height: 3rem; border-radius: .5rem; border: 1px solid rgb(0 0 0 / .05); }
.guide-section { scroll-margin-top: 5rem; }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

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