/* ============================================
   AZALEA COIN - BASE STYLES (Mobile-First)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

/* GLOBAL IMAGE SAFETY - no image can ever exceed its container, so a
   missing/stale stylesheet can never blow a logo up to full width again. */
img { max-width: 100%; height: auto; }

/* GLOBAL SVG SAFETY - an inline <svg> with no width/height renders at the
   container's full width (and fills solid black without a fill override).
   This guarantees a sane ceiling even if a stylesheet is stale or missing. */
svg { max-width: 100%; }
.stat-icon svg, .card-icon svg, .action-tile-icon svg { display: block; }
html { font-size: 16px; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f7;
    color: #1f2937;
    line-height: 1.5;
}

h1, h2, h3 { font-family: 'Cinzel', serif; font-weight: 600; }

.sidebar-brand-mark { width: 28px; height: 28px; vertical-align: middle; margin-right: 4px; }

a { color: #A87C18; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    padding: 15px;
    max-width: 480px;
    margin: 0 auto;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.text-center { text-align: center; }

/* ===== AUTH ===== */
.auth-container { display: flex; align-items: center; min-height: 100vh; }
.auth-logo { width: 64px; height: 64px; margin-bottom: 16px; }
.auth-switch { margin-top: 16px; text-align: center; font-size: 14px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group small { display: block; color: #6b7280; font-size: 12px; margin-top: 4px; }

.input-field {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fafafa;
}
.input-field:focus { outline: none; border-color: #D9AC3C; background: #fff; }

.field-error { display: block; color: #dc2626; font-size: 13px; margin-top: 4px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-align: center;
    min-height: 44px;
}
.btn-block { width: 100%; }
.btn-primary { background: #D9AC3C; color: #141414; }
.btn-primary:hover { background: #A87C18; color: #141414; text-decoration: none; }
.btn-secondary { background: #e5e7eb; color: #1f2937; }
.btn-secondary:hover { background: #d1d5db; text-decoration: none; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; text-decoration: none; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; padding: 12px; }
.pagination-info { font-size: 13px; color: #6b7280; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #d1fae5; color: #065f46; }
.notice { color: #6b7280; font-size: 14px; margin: 12px 0; }

/* ===== LANDING ===== */
.landing { display: flex; flex-direction: column; min-height: 100vh; justify-content: center; }
.landing-header { text-align: center; margin-bottom: 40px; }
.landing-logo { width: 88px; height: 88px; margin-bottom: 16px; }
.landing-header h1 { font-size: 32px; color: #A87C18; font-family: 'Cinzel', serif; font-weight: 700; }
.landing-tagline { font-family: 'Cinzel', serif; color: #7C580D; letter-spacing: 0.15em; font-size: 12px; text-transform: uppercase; margin-top: 4px; }
.landing-actions { display: flex; flex-direction: column; gap: 12px; }
.landing-footer { text-align: center; margin-top: 40px; font-size: 13px; color: #9ca3af; }

/* ===== ERROR PAGES ===== */
.error-container { display: flex; align-items: center; min-height: 100vh; }
.error-container h1 { font-size: 48px; color: #A87C18; margin-bottom: 12px; font-family: 'Cinzel', serif; }

/* ===== RESPONSIVE TABLES ===== */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 480px) {
    .table thead { display: none; }
    .table tr { display: block; margin-bottom: 15px; border: 1px solid #ddd; padding: 10px; border-radius: 8px; }
    .table td { display: block; text-align: left; padding: 5px 0; border: none; }
    .table td::before { content: attr(data-label); font-weight: bold; display: inline-block; width: 120px; }
}

/* ===== TABLET (481px+) ===== */
@media (min-width: 481px) {
    .container { padding: 20px; max-width: 720px; }
    .landing-actions { flex-direction: row; justify-content: center; }
    .btn { width: auto; }
}

/* ===== DESKTOP (769px+) ===== */
@media (min-width: 769px) {
    .container { max-width: 960px; padding: 30px; }
}

/* ===== LARGE DESKTOP (1025px+) ===== */
@media (min-width: 1025px) {
    .container { max-width: 1100px; }
}

/* ============================================
   AUTH PAGE NAVIGATION
   Public auth pages (login/register/forgot/reset/2FA) previously had
   no route back to the public site - a user who landed on /login.php
   had no way home short of editing the URL. The logo is now a link,
   plus an explicit back link for anyone who doesn't think to click it.
   ============================================ */
.auth-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}
.auth-home:hover { color: #A87C18; text-decoration: none; }
.auth-home::before { content: '\2190'; font-size: 16px; }

.auth-logo-link { display: inline-block; }
.auth-logo-link:hover { text-decoration: none; }

.auth-footer-links {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}
.auth-footer-links a { color: #6b7280; margin: 0 6px; }
.auth-footer-links a:hover { color: #A87C18; }

/* ============================================
   PROGRESS BARS
   Used for cycle day progress and earning-cap usage.
   ============================================ */
.progress {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0 4px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #A87C18, #D9AC3C);
    border-radius: 999px;
    transition: width .3s ease;
}
.progress-fill.is-full { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.progress-fill.is-near { background: linear-gradient(90deg, #b45309, #f59e0b); }

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
}

/* ============================================
   REFERRAL LEVEL PILLS (spec 11.1 - level N
   unlocks at N direct referrals)
   ============================================ */
.level-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.level-pill {
    flex: 1 1 auto;
    min-width: 84px;
    text-align: center;
    padding: 8px 6px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    opacity: .55;
}
.level-pill.unlocked {
    opacity: 1;
    border-color: #A87C18;
    background: #fffaf0;
}
.level-pill-label { display: block; font-size: 13px; color: #6b7280; }
.level-pill-rate { display: block; font-size: 20px; font-weight: 700; color: #1f2937; line-height: 1.3; }
.level-pill.unlocked .level-pill-rate { color: #A87C18; }
.level-pill-state { display: block; font-size: 12px; margin-top: 3px; color: #6b7280; }


/* ============================================
   MOBILE READABILITY FLOOR (spec 19.1:
   "Readable Text - Min font size 16px on mobile")
   Small meta text is fine on desktop but drops below the
   spec's mobile minimum on phones, so it scales up there.
   ============================================ */
@media (max-width: 480px) {
    body { font-size: 16px; }
    .notice,
    .list-item-meta,
    .stat-card-sub,
    .progress-meta,
    .qualify-note,
    .action-tile-sub,
    .level-pill-label { font-size: 15px; }
    .stat-card-label { font-size: 15px; }
    .stat-card-value { font-size: 24px; }
    .level-pill { min-width: 92px; }
}

/* ============================================
   SIDEBAR ACCORDION (user + admin)
   Vanilla CSS/JS - no framework, per spec 2.2.
   Collapsed by default; the group containing the active page is
   rendered already-open server-side, so nav never hides where you are.
   ============================================ */
.sidebar-group { display: block; }

.sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #C9A45C;
    min-height: 44px;
    text-align: left;
}
.sidebar-group-toggle:hover { color: #F0D48A; background: rgba(217,172,60,0.08); }

.sidebar-chevron {
    font-size: 11px;
    transition: transform .2s ease;
    flex: 0 0 auto;
    margin-left: 8px;
}
.sidebar-group-toggle.open .sidebar-chevron { transform: rotate(180deg); }

/* Collapsed by default. max-height keeps the open/close animated without
   needing JS to measure heights. */
.sidebar-group-items {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.sidebar-group-items.open { max-height: 600px; }
.sidebar-group-items .sidebar-link { padding-left: 30px; font-size: 14px; }

/* No-JS fallback: if scripts fail, every group is left open rather than
   leaving the user with a nav they cannot expand. */
.no-js .sidebar-group-items { max-height: none; }

/* ============================================
   AUTH PAGES - centred, elevated layout
   Replaces the plain left-aligned card. The shell centres both
   axes at any viewport height, and the card widens on register
   (a 9-field form) while staying narrow on login.
   ============================================ */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    background:
        radial-gradient(1100px 520px at 50% -10%, #fdf6e6 0%, rgba(253,246,230,0) 70%),
        linear-gradient(180deg, #faf9f7 0%, #f2f1ee 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    background: #fff;
    border-radius: 18px;
    padding: 32px 26px;
    box-shadow:
        0 1px 2px rgba(24,20,10,0.05),
        0 12px 32px rgba(24,20,10,0.10);
    border-top: 3px solid #D9AC3C;
}
.auth-card.is-wide { max-width: 620px; }

/* Brand block */
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .auth-logo-link { display: inline-block; }
.auth-brand img { width: 62px; height: 62px; margin-bottom: 10px; }
.auth-brand h1 {
    font-family: 'Cinzel', serif;
    font-size: 25px;
    color: #A87C18;
    letter-spacing: .02em;
    margin-bottom: 4px;
}
.auth-brand p {
    font-size: 14px;
    color: #6b7280;
    max-width: 340px;
    margin: 0 auto;
}

/* Back link sits above the brand, out of the way */
.auth-top { margin-bottom: 6px; }

/* Inputs get a clearer focus ring than the base style */
.auth-card .input-field {
    border-radius: 10px;
    background: #fcfcfd;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.auth-card .input-field:focus {
    outline: none;
    background: #fff;
    border-color: #D9AC3C;
    box-shadow: 0 0 0 3px rgba(217,172,60,0.18);
}
.auth-card .form-group label { font-size: 14px; color: #374151; }

.auth-card .btn-primary {
    border-radius: 10px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .01em;
}

/* Two-up rows on wider screens so the register form isn't a
   nine-field column. Collapses to single column on mobile. */
.auth-row { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 560px) {
    .auth-row.cols-2 { grid-template-columns: 1fr 1fr; }
}

/* Divider between the form and the switch link */
.auth-sep {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0 14px;
    color: #9ca3af; font-size: 13px;
}
.auth-sep::before, .auth-sep::after {
    content: ''; flex: 1; height: 1px; background: #e5e7eb;
}

.auth-switch { margin-top: 0; font-size: 15px; }
.auth-switch a { font-weight: 700; }

/* Section heading inside the register form */
.auth-section {
    margin: 22px 0 10px;
    padding-top: 16px;
    border-top: 1px solid #f0efec;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #A87C18;
}
.auth-section:first-of-type { border-top: none; padding-top: 0; }
.auth-section-hint {
    font-weight: 400; text-transform: none; letter-spacing: 0;
    color: #6b7280; font-size: 13px; display: block; margin-top: 3px;
}

@media (max-width: 480px) {
    .auth-card { padding: 24px 18px; border-radius: 14px; }
    .auth-brand h1 { font-size: 22px; }
}

/* ============================================
   DARK MODE
   Toggled via [data-theme="dark"] on <html>, set server-side (see
   includes/theme.php) so there's no flash-of-light-mode on load.
   Covers the structural surface used on every page - background,
   cards, text, tables, inputs, topbar, alerts, badges - rather than a
   line-by-line reskin of every component variant across the codebase.
   The sidebar is already dark in both themes, so it needs no override.
   ============================================ */
[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] body {
    background: #16151a;
    color: #e6e4de;
}

[data-theme="dark"] a { color: #E4C36A; }

[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .about-card,
[data-theme="dark"] .tile,
[data-theme="dark"] .cd-unit {
    background: #201f26;
    border-color: #34323c;
    color: #e6e4de;
}
[data-theme="dark"] .stat-card.tint-gold,
[data-theme="dark"] .stat-card.tint-green,
[data-theme="dark"] .stat-card.tint-blue,
[data-theme="dark"] .stat-card.tint-amber,
[data-theme="dark"] .stat-card.tint-red { background: linear-gradient(180deg,#201f26 0%,#201f26 60%); }

[data-theme="dark"] .stat-card-label,
[data-theme="dark"] .notice,
[data-theme="dark"] .cell-sub,
[data-theme="dark"] .list-item-meta,
[data-theme="dark"] .fact-row span:first-child { color: #a29d8f; }

[data-theme="dark"] .stat-card-value,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] .fact-row span:last-child { color: #f1efe9; }

[data-theme="dark"] .topbar {
    background: #201f26;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    border-bottom: 1px solid #34323c;
}
[data-theme="dark"] .topbar-icon { color: #e6e4de; }

[data-theme="dark"] .input-field,
[data-theme="dark"] select.input-field,
[data-theme="dark"] textarea.input-field {
    background: #14131a;
    border-color: #3a3844;
    color: #e6e4de;
}
[data-theme="dark"] .input-field:focus { background: #17161d; border-color: #D9AC3C; }
[data-theme="dark"] .auth-card .input-field { background: #14131a; }

[data-theme="dark"] .admin-table,
[data-theme="dark"] .table {
    background: #201f26;
}
[data-theme="dark"] .admin-table th,
[data-theme="dark"] .table th { background: #17161d; color: #a29d8f; border-color: #34323c; }
[data-theme="dark"] .admin-table td,
[data-theme="dark"] .table td { border-color: #2a2833; color: #e6e4de; }
[data-theme="dark"] .admin-table tr:hover td { background: #24222b; }

[data-theme="dark"] .list-item,
[data-theme="dark"] .cycle-row,
[data-theme="dark"] .assist-row { border-color: #2a2833; }

[data-theme="dark"] .qualify-note,
[data-theme="dark"] .risk-ack {
    background: #241f14;
    border-color: #4a3d1e;
    color: #e2c98e;
}

[data-theme="dark"] .progress { background: #2a2833; }

[data-theme="dark"] .perm-group,
[data-theme="dark"] .perm-row:hover { background: #201f26; border-color: #34323c; }
[data-theme="dark"] .perm-row.is-danger { background: #241f14; }

[data-theme="dark"] .site-nav,
[data-theme="dark"] .hero,
[data-theme="dark"] .ticker-strip,
[data-theme="dark"] .section-alt {
    background: #16151a;
    border-color: #2a2833;
}
[data-theme="dark"] .section-title { color: #f1efe9; }
[data-theme="dark"] .section-sub,
[data-theme="dark"] .hero p.lede,
[data-theme="dark"] .about-split p { color: #a29d8f; }
[data-theme="dark"] .tile p { color: #a29d8f; }

/* Theme toggle control - a real <button>, not a link, since it performs
   an action on the page rather than navigating anywhere. */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; min-width: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    color: inherit;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    transition: background .15s ease, transform .15s ease;
}
.theme-toggle:hover { background: rgba(0,0,0,0.1); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle:focus-visible { outline: 2px solid #D9AC3C; outline-offset: 2px; }
.theme-toggle-icon { display: block; line-height: 1; }

[data-theme="dark"] .theme-toggle { background: rgba(255,255,255,0.10); color: #F0D48A; }
[data-theme="dark"] .theme-toggle:hover { background: rgba(255,255,255,0.18); }

/* ============================================
   PWA — INSTALL CONTROLS
   All install controls start hidden and are revealed by pwa.php only
   once the browser confirms the app is installable, so they are never
   dead buttons.
   ============================================ */
.pwa-install-btn { width: auto; }

.pwa-install-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; min-width: 40px;
    border: none; border-radius: 50%;
    background: rgba(0,0,0,.05); color: inherit;
    cursor: pointer; padding: 0; font-size: 18px; line-height: 1;
    transition: background .15s ease, transform .15s ease;
}
.pwa-install-icon:hover { background: rgba(0,0,0,.1); }
.pwa-install-icon:active { transform: scale(.92); }
[data-theme="dark"] .pwa-install-icon { background: rgba(255,255,255,.10); }

/* Sidebar variant — gold so it reads as an action, not navigation */
.pwa-install-sidebar { color: #F0D48A !important; font-weight: 700; }
.pwa-install-sidebar:hover { background: rgba(217,172,60,.16); }

/* ===== Install banner ===== */
.pwa-banner {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 200;
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid #e8d5a3; border-radius: 14px;
    padding: 12px 14px; box-shadow: 0 12px 32px rgba(24,20,10,.20);
    animation: pwaSlideUp .35s cubic-bezier(.22,.61,.36,1);
}
@keyframes pwaSlideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
[data-theme="dark"] .pwa-banner { background: #201f26; border-color: #4a3d1e; }

.pwa-banner img { flex: 0 0 46px; border-radius: 10px; }
.pwa-banner-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.pwa-banner-text strong { font-size: 15px; color: #1f2937; }
.pwa-banner-text span { font-size: 13px; color: #6b7280; }
[data-theme="dark"] .pwa-banner-text strong { color: #f1efe9; }
[data-theme="dark"] .pwa-banner-text span { color: #a29d8f; }

.pwa-banner-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pwa-banner-actions .btn { width: auto; padding: 10px 18px; min-height: 42px; font-size: 14px; }
.pwa-banner-close {
    background: none; border: none; font-size: 26px; line-height: 1;
    color: #9ca3af; cursor: pointer; padding: 0 6px; min-height: 42px;
}
.pwa-banner-close:hover { color: #4b5563; }

@media (min-width: 620px) {
    .pwa-banner { left: auto; right: 20px; bottom: 20px; max-width: 420px; }
}

/* ===== iOS instructions ===== */
.pwa-ios-help {
    position: fixed; inset: 0; z-index: 210;
    background: rgba(20,17,10,.55);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* The `hidden` attribute normally works via the browser's default
   `display: none`, but the `display: flex` above overrides it - so the
   panel stayed visible even after being hidden in JS. This restores it.
   Same guard applied to the banner, which has the same problem. */
.pwa-ios-help[hidden],
.pwa-banner[hidden] { display: none !important; }

/* Same problem for every install control: .btn, .pwa-install-icon and
   .sidebar-link all set `display`, which overrides the `hidden`
   attribute. Without this the buttons appear before the browser has
   confirmed the app is installable - i.e. dead controls that do
   nothing when tapped, which is exactly what hiding them prevents. */
[data-pwa-install][hidden] { display: none !important; }
.pwa-ios-inner {
    background: #fff; border-radius: 16px; padding: 26px 22px;
    max-width: 380px; width: 100%;
    box-shadow: 0 16px 40px rgba(0,0,0,.28);
}
[data-theme="dark"] .pwa-ios-inner { background: #201f26; color: #e6e4de; }
.pwa-ios-inner h3 { margin: 0 0 10px; color: #A87C18; font-size: 19px; }
.pwa-ios-inner p { color: #4b5563; font-size: 15px; margin: 0 0 12px; }
[data-theme="dark"] .pwa-ios-inner p { color: #a29d8f; }
.pwa-ios-inner ol { margin: 0 0 18px; padding-left: 20px; color: #4b5563; line-height: 1.9; font-size: 15px; }
[data-theme="dark"] .pwa-ios-inner ol { color: #cfc7b5; }
/* ============================================
   ACCOUNT SWITCHER DROPDOWN
   Turns the topbar avatar into a menu: current account, other linked
   accounts with one-click switch, Add Another Account, Settings, Logout.
   Shared between user and admin panels via account_switcher_dropdown().
   ============================================ */
.acct-switcher { position: relative; }

.acct-switcher-trigger {
    border: none; padding: 0; font: inherit;
    appearance: none; -webkit-appearance: none;
    /* inherits .topbar-avatar's circle/colour styling from user.css/admin.css */
}

.acct-switcher-panel {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 120;
    width: 300px; max-width: calc(100vw - 24px);
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    box-shadow: 0 14px 34px rgba(24,20,10,.16);
    padding: 10px; animation: acctPanelIn .18s ease;
}
@keyframes acctPanelIn { from { opacity:0; transform: translateY(-6px);} to { opacity:1; transform:none; } }
[data-theme="dark"] .acct-switcher-panel { background:#201f26; border-color:#34323c; }

/* The [hidden] override matters - see the PWA fix earlier this session;
   .acct-switcher-panel has no competing display rule of its own, but
   this guards against one ever being added later without re-breaking it. */
.acct-switcher-panel[hidden] { display: none !important; }

.acct-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 6px; border-radius: 10px;
}
.acct-row-current { background: #fdf6e6; }
[data-theme="dark"] .acct-row-current { background: #241f14; }

.acct-avatar {
    flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%;
    background: #D9AC3C; color: #141414;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.acct-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.acct-meta strong { font-size: 14px; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-meta small { font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="dark"] .acct-meta strong { color: #f1efe9; }
[data-theme="dark"] .acct-meta small { color: #a29d8f; }

.acct-current-tag {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: #A87C18; background: #fff; border: 1px solid #e8d5a3;
    padding: 3px 8px; border-radius: 999px; flex: 0 0 auto;
}

.acct-switch-form, .acct-remove-form { flex: 0 0 auto; margin: 0; }
.acct-switch-btn {
    font-size: 12px; font-weight: 700; color: #A87C18;
    background: #fdf6e6; border: 1px solid #e8d5a3; border-radius: 8px;
    padding: 7px 12px; cursor: pointer; min-height: 34px;
}
.acct-switch-btn:hover { background: #fff4d9; }
.acct-remove-btn {
    flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
    border: none; background: transparent; color: #9ca3af;
    font-size: 17px; line-height: 1; cursor: pointer;
}
.acct-remove-btn:hover { background: #fee2e2; color: #b91c1c; }

.acct-divider { height: 1px; background: #f0efec; margin: 8px 2px; }
[data-theme="dark"] .acct-divider { background: #2a2833; }

.acct-action-link {
    display: block; padding: 10px 8px; font-size: 14px; font-weight: 600;
    color: #4b5563; border-radius: 8px; min-height: 40px; line-height: 20px;
}
.acct-action-link:hover { background: #f4f4f6; color: #A87C18; text-decoration: none; }
[data-theme="dark"] .acct-action-link { color: #cfc7b5; }
[data-theme="dark"] .acct-action-link:hover { background: #2a2833; }
.acct-logout { color: #b91c1c; }
.acct-logout:hover { background: #fef2f2; color: #991b1b; }

/* ============================================
   LOGIN-PAGE ACCOUNT PICKER
   Shown above the normal login form when this browser already has
   linked accounts - without it the switcher is unreachable once
   someone logs out (the browser_id cookie deliberately survives
   logout, but there was no UI to use it).
   ============================================ */
.acct-login-picker { margin-bottom: 4px; }
.acct-login-heading {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: #9ca3af; margin: 0 0 10px;
}
.acct-login-form { margin: 0 0 8px; }
.acct-login-row {
    width: 100%; display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 11px 14px; cursor: pointer; text-align: left; font: inherit;
    min-height: 56px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.acct-login-row:hover { border-color: #D9AC3C; box-shadow: 0 2px 10px rgba(168,124,24,.10); }
[data-theme="dark"] .acct-login-row { background: #201f26; border-color: #34323c; }

.acct-login-row .acct-meta strong { font-size: 15px; }
.acct-login-arrow { margin-left: auto; font-size: 22px; color: #9ca3af; line-height: 1; }

/* ============================================
   ACCOUNT SWITCHER — LOGIN PAGE PICKER
   Shown above the login form when this browser already has linked
   accounts. Reuses .acct-avatar/.acct-meta from the topbar dropdown.
   ============================================ */
.acct-login-picker { margin-bottom: 4px; }
.acct-login-heading {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #9ca3af; margin: 0 0 8px 2px;
}
.acct-login-form { margin: 0 0 8px; }
.acct-login-row {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: 12px;
    border: 1px solid #e5e7eb; background: #fff;
    cursor: pointer; text-align: left; font: inherit;
    min-height: 56px;
    transition: border-color .15s ease, background .15s ease;
}
.acct-login-row:hover { border-color: #D9AC3C; background: #fffaf0; }
[data-theme="dark"] .acct-login-row { background: #201f26; border-color: #34323c; }
[data-theme="dark"] .acct-login-row:hover { background: #241f14; border-color: #4a3d1e; }
.acct-login-arrow { margin-left: auto; font-size: 22px; color: #c9c2b3; flex: 0 0 auto; }

/* ============================================
   IMPERSONATION BANNER
   Shown on every user-facing page while an admin is "logged in as" a
   member. Deliberately impossible to miss - sticky, high-contrast,
   present on every page regardless of which one loads first.
   ============================================ */
.impersonation-banner {
    position: sticky; top: 0; z-index: 300;
    display: flex; align-items: center; justify-content: center; gap: 14px;
    flex-wrap: wrap;
    background: #7f1d1d; color: #fff;
    padding: 10px 16px; font-size: 14px; text-align: center;
}
.impersonation-banner-text strong { color: #fca5a5; }
.impersonation-banner-form { margin: 0; }
.impersonation-banner-btn {
    background: #fff; color: #7f1d1d; border: none; border-radius: 8px;
    padding: 7px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
    min-height: 34px;
}
.impersonation-banner-btn:hover { background: #fef2f2; }

/* ============================================
   TICKET PROMOTIONS (BOGO)
   ============================================ */
.pkg-promo-tag {
    display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em; color: #92400e; background: #fef3c7;
    border-radius: 6px; padding: 4px 8px; margin-bottom: 8px; text-align: center;
}
.pkg-promo-tag.pkg-promo-upcoming { color: #1e40af; background: #dbeafe; }

.promo-note-active {
    background: #fef3c7 !important; border-color: #f5d78a !important; color: #78500c !important;
}
