/* ==========================================================================
   MITTITOMAT — PORTAL DESIGN SYSTEM
   Flat, bold, clean Kabaddi design system ("MatHeroes").
   Palette: Ink (#17130F), Mitti Terracotta (#B5532B / #D9693A dark),
   Mat Blue (#1D4FB8 / #4A86F2 dark), Haldi Turmeric (#F2A516),
   Cream (#FAF4EA), White (#FFFFFF).
   ========================================================================== */

/* Fonts: self-hosted Outfit (+ Mukta fallback for Devanagari) */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
    /* MittiToMat Official Palette (flat, solid) */
    --brand-ink-bg: #17130F;
    --brand-ink-surface: #221C16;
    --brand-terracotta: #B5532B;
    --brand-terracotta-hover: #96411F;
    --brand-terracotta-active: #7A3316;
    --brand-terracotta-soft: #F7EAE3;
    --brand-blue: #1D4FB8;
    --brand-blue-hover: #163E93;
    --brand-blue-soft: #EBF1FC;
    --brand-haldi: #F2A516;
    --brand-haldi-hover: #D9920F;
    --brand-haldi-soft: #FDF3DC;
    --brand-cream: #FAF4EA;

    /* Core semantic aliases mapped to MittiToMat palette */
    --brand-navy-950: #17130F;
    --brand-navy-900: #17130F;
    --brand-navy: #17130F;          /* Ink for dark chrome, headers, footers */
    --brand-navy-700: #96411F;      /* terracotta hover */
    --brand-navy-600: #1D4FB8;      /* Mat Blue */
    --brand-navy-100: #EBF1FC;      /* Mat Blue soft */
    --brand-navy-50: #F7EAE3;       /* Mitti Terracotta soft tint */
    --brand-gold: #F2A516;          /* Haldi Turmeric: accent badges & marks only */
    --brand-gold-600: #B5532B;      /* Mitti Terracotta for icon highlights on light */
    --brand-gold-700: #B5532B;      /* Accessible terracotta text on light (never Haldi text on light!) */
    --brand-gold-300: #F2A516;      /* Haldi Turmeric on dark Ink surfaces */
    --brand-gold-100: #FDF3DC;      /* Haldi soft wash (always paired with Ink text) */

    /* Surfaces (~60% Cream/White) */
    --surface-page: #FAF4EA;
    --surface-card: #FFFFFF;
    --surface-sunken: #F5ECDC;
    --surface-muted: #EFE3CE;
    --surface-header: #17130F;
    --surface-sidebar: #17130F;

    /* Text (Ink on light, Cream on dark) */
    --text-strong: #17130F;
    --text: #17130F;
    --text-muted: #4A3E33;
    --text-subtle: #66584B;
    --text-on-brand: #FAF4EA;
    --text-on-brand-muted: #D8CEBE;

    /* Lines */
    --border: #E2D5C0;
    --border-strong: #C8B79D;
    --divider: #EAE0CF;

    /* Interaction */
    --hover-bg: #F3EAD9;
    --active-bg: #EBF1FC;
    --focus-ring: 0 0 0 2px var(--surface-card), 0 0 0 4px #1D4FB8;
    --disabled-bg: #EFE3CE;
    --disabled-text: #7A6C5E;

    /* Semantic (on-palette where possible, AA contrast everywhere) */
    --success: #166534;  --success-soft: #E9F5EE;  --success-text: #14532D;
    --warning: #F2A516;  --warning-soft: #FDF3DC;  --warning-text: #17130F;
    --danger:  #B5532B;  --danger-soft:  #FBEAE3;  --danger-text:  #8F3D1C;
    --info:    #1D4FB8;  --info-soft:    #EBF1FC;  --info-text:    #1D4FB8;

    /* Category accents */
    --cat-technical: #1D4FB8;
    --cat-cultural: #B5532B;
    --cat-sports: #B5532B;
    --cat-management: #1D4FB8;
    --cat-general: #17130F;

    /* Typography: Outfit 800/600/400 + Mukta for Devanagari */
    --font-sans: 'Outfit', 'Mukta', 'Noto Sans Devanagari', sans-serif;
    --font-heading: 'Outfit', 'Mukta', 'Noto Sans Devanagari', sans-serif;
    --brand-ink: #B5532B;           /* Key headings & highlights in terracotta */
    --font-body: var(--font-sans);
    --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.0625rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.375rem;
    --fs-2xl: clamp(1.6rem, 2.8vw, 2rem);
    --fs-3xl: clamp(2.1rem, 4.6vw, 3.35rem);

    /* Spacing scale */
    --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
    --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem; --sp-12: 3rem;

    /* Geometry: rounded corners 12–16px on cards, buttons and images */
    --radius-xs: 12px;
    --radius-sm: 12px;
    --radius: 14px;
    --radius-lg: 16px;
    --radius-xl: 16px;
    --radius-pill: 999px;

    /* Flat crisp depth — solid borders over blurry chrome */
    --shadow-xs: 0 1px 0 rgba(23, 19, 15, 0.06);
    --shadow-sm: 0 2px 6px rgba(23, 19, 15, 0.06);
    --shadow: 0 4px 12px rgba(23, 19, 15, 0.07);
    --shadow-md: 0 6px 18px rgba(23, 19, 15, 0.08);
    --shadow-lg: 0 10px 26px rgba(23, 19, 15, 0.10);

    /* Layout */
    --container-max: 1240px;
    --page-max: 1320px;
    --safe-pad-x: clamp(1rem, 3vw, 2rem);
    --sidebar-width: 264px;
    --header-height: 68px;
    --card-pad: 1.25rem;
    --grid-gap: 1.25rem;
    --section-gap: 2rem;
    --control-h: 44px;
    --control-h-sm: 36px;
    --control-h-lg: 50px;
    --modal-w: 560px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 120ms var(--ease);
    --t: 180ms var(--ease);
    --t-slow: 280ms var(--ease);

    /* Layers */
    --z-header: 1030;
    --z-sidebar: 1045;
    --z-toast: 11000;

    /* ── Legacy tokens mapped cleanly to MittiToMat ── */
    --snpsu-blue: #1D4FB8;
    --snpsu-blue-dark: #17130F;
    --snpsu-blue-light: #4A86F2;
    --snpsu-blue-lighter: #1D4FB8;
    --snpsu-gold: #F2A516;
    --snpsu-gold-dark: #B5532B;
    --snpsu-gold-light: #F2A516;
    --snpsu-gold-lighter: #FDF3DC;
    --snpsu-amber: #F2A516;
    --snpsu-indigo: #1D4FB8;
    --snpsu-orange: #B5532B;
    --snpsu-orange-dark: #96411F;
    --snpsu-orange-light: #D9693A;
    --bg-app: var(--surface-page);
    --bg-card: var(--surface-card);
    --bg-soft: var(--surface-sunken);
    --bg-muted: var(--surface-muted);
    --glass-bg: var(--surface-card);
    --glass-border: var(--border);
    --glass-glow: transparent;
    --glass-backdrop: none;
    --shadow-brand: var(--shadow-md);
    --shadow-gold: var(--shadow-md);
    --ease-spring: var(--ease);
    --ink-950: #17130F;
    --ink-900: #17130F;
    --ink-800: #29221B;
    --ink-700: #4A3E33;
    --ink-600: #66584B;
    --ink-500: #7A6C5E;
    --ink-400: #8D7E6F;
    --ink-300: var(--border-strong);
    --ink-200: var(--border);
    --ink-100: var(--surface-muted);
    --ink-50: var(--surface-sunken);
    --blue: #1D4FB8;
    --navy: #17130F;
    --orange: #B5532B;
    --gold: #F2A516;
    --purple: #1D4FB8;
    --primary-50: #F7EAE3;
    --primary-100: #F0D9CD;
    --primary-300: #D9693A;
    --primary-500: #B5532B;
    --primary-700: #7A3316;
    --neutral-100: var(--surface-muted);
    --border-subtle: var(--divider);
    --t-normal: var(--t);

    /* ── Bootstrap 5.3 variables mapped to MittiToMat ── */
    --bs-primary: #B5532B;
    --bs-primary-rgb: 181, 83, 43;
    --bs-secondary: #17130F;
    --bs-secondary-rgb: 23, 19, 15;
    --bs-success: #166534;
    --bs-success-rgb: 22, 101, 52;
    --bs-warning: #F2A516;
    --bs-warning-rgb: 242, 165, 22;
    --bs-danger: #B5532B;
    --bs-danger-rgb: 181, 83, 43;
    --bs-info: #1D4FB8;
    --bs-info-rgb: 29, 79, 184;
    --bs-body-font-family: var(--font-sans);
    --bs-body-color: var(--text);
    --bs-body-bg: var(--surface-page);
    --bs-emphasis-color: #17130F;
    --bs-secondary-color: var(--text-subtle);
    --bs-border-color: var(--border);
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-lg: var(--radius);
    --bs-link-color: #1D4FB8;
    --bs-link-color-rgb: 29, 79, 184;
    --bs-link-hover-color: #163E93;
    --bs-link-hover-color-rgb: 22, 62, 147;
    --bs-focus-ring-color: rgba(29, 79, 184, 0.35);
}

/* --------------------------------------------------------------------------
   2. DARK TOKENS — Ink #17130F bg, Cream #FAF4EA text, #D9693A, #4A86F2
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
    --surface-page: #17130F;
    --surface-card: #211B15;
    --surface-sunken: #1C1712;
    --surface-muted: #2B231B;
    --surface-header: #17130F;
    --surface-sidebar: #17130F;
    --text-strong: #FAF4EA;
    --text: #FAF4EA;
    --text-muted: #DDD2C1;
    --text-subtle: #B5A896;
    --border: #3B3025;
    --border-strong: #524334;
    --divider: #30271E;
    --hover-bg: #2B231B;
    --active-bg: #222B42;
    --disabled-bg: #2B231B;
    --brand-terracotta: #B5532B;
    --brand-terracotta-soft: rgba(217, 105, 58, 0.16);
    --brand-blue: #4A86F2;
    --brand-blue-soft: rgba(74, 134, 242, 0.16);
    --brand-navy-100: rgba(74, 134, 242, 0.18);
    --brand-navy-50: rgba(217, 105, 58, 0.14);
    --brand-ink: #D9693A;
    --brand-gold-100: rgba(242, 165, 22, 0.18);
    --brand-gold-600: #D9693A;
    --brand-gold-700: #D9693A;
    --success-soft: rgba(22, 163, 74, 0.18);  --success-text: #86efac;
    --warning-soft: #F2A516;  --warning-text: #17130F;
    --danger-soft: rgba(217, 105, 58, 0.18);   --danger-text: #F4A688;
    --info-soft: rgba(74, 134, 242, 0.18);     --info-text: #9AC0FA;
    --ink-950: #FAF4EA;
    --ink-700: #DDD2C1;
    --ink-400: #8D7E6F;
    --ink-100: #2B231B;
    --ink-50: #17130F;
    --shadow-xs: 0 1px 0 rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 10px 26px rgba(0, 0, 0, 0.5);
    --bs-body-color: #FAF4EA;
    --bs-body-bg: #17130F;
    --bs-emphasis-color: #FAF4EA;
    --bs-link-color: #4A86F2;
    --bs-link-hover-color: #FAF4EA;
    color-scheme: dark;
}

/* --------------------------------------------------------------------------
   3. LOGO, CLEAR SPACE & SIGNATURE DIVIDER
   Rules: no stretching, rotating, recolouring, shadows, outlines or gradients.
   Keep clear space >= height of "M". Horizontal min width 120px.
   -------------------------------------------------------------------------- */
.brand-logo {
    display: block;
    height: 28px;
    width: auto;
    min-width: 120px;
    max-width: 100%;
    object-fit: contain;
    flex-shrink: 0;
}
.brand-logo--sm { height: 24px; min-width: 120px; }
.brand-logo--lg { height: 34px; min-width: 120px; }
.brand-logo--xl { height: 42px; min-width: 120px; }
.brand-mark {
    display: block;
    height: 26px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.navbar-brand, .app-bar__brand {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}
/* Over photos or coloured surfaces, normal dark-Ink logo sits on Cream #FAF4EA panel */
.brand-lockup, .mtm-cream-panel {
    display: inline-flex;
    align-items: center;
    background: #FAF4EA;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
}
img[src*="mittitomat-logo"].light-tile {
    background: #FAF4EA;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    object-fit: contain;
}
.app-bar img:not(.team-logo), .sidebar-brand img, .snav img:not(.team-logo), .site-ft img, .auth-brand img,
.topnav img, .topbar img, .brand-lockup img, .mtm-cream-panel img, .on-brand img:not(.team-logo) {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    filter: none !important;
}

/* Signature divider: Mitti Terracotta + small Haldi mark + short Mat Blue end */
.mtm-divider {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0.5rem 0 0.9rem;
    height: 4px;
}
.mtm-divider__mitti { width: 58px; height: 4px; border-radius: 999px; background: var(--brand-terracotta); }
.mtm-divider__haldi { width: 10px; height: 4px; border-radius: 999px; background: var(--brand-haldi); }
.mtm-divider__mat   { width: 22px; height: 4px; border-radius: 999px; background: var(--brand-blue); }
.section-block--brand .mtm-divider__mitti,
.hero-section .mtm-divider__mitti { background: #D9693A; }
.section-block--brand .mtm-divider__mat,
.hero-section .mtm-divider__mat { background: #4A86F2; }

/* Full-bleed flat court stripe at the base of header / hero / footer */
.mtm-court-strip {
    display: grid;
    grid-template-columns: 1fr 22px 96px;
    height: 4px;
    width: 100%;
}
.mtm-court-strip__mitti { background: #B5532B; }
.mtm-court-strip__haldi { background: #F2A516; }
.mtm-court-strip__mat   { background: #1D4FB8; }

/* --------------------------------------------------------------------------
   4. BASE / TYPOGRAPHY
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background: var(--surface-page);
    color: var(--text);
    font-size: var(--fs-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    color: var(--text-strong);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
}
h1, .h1 { font-size: var(--fs-2xl); font-weight: 800; }
h2, .h2 { font-size: clamp(1.35rem, 2.3vw, 1.6rem); font-weight: 800; }
h3, .h3 { font-size: clamp(1.2rem, 2vw, 1.375rem); }
h4, .h4 { font-size: var(--fs-lg); }
h5, .h5 { font-size: 1.0625rem; }
h6, .h6 { font-size: var(--fs-base); }

p { color: inherit; font-weight: 400; }
a { color: var(--bs-link-color); text-underline-offset: 2px; transition: color var(--t-fast); }
a:hover { color: var(--bs-link-hover-color); }
::selection { background: #F2A516; color: #17130F; }
img { max-width: 100%; height: auto; }
hr { border-color: var(--border); opacity: 1; }
code, kbd, pre, samp { font-family: var(--font-mono); }
small, .small { font-size: var(--fs-sm); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); }

:focus-visible {
    outline: 2px solid #1D4FB8;
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 1rem;
    background: #B5532B;
    color: #fff;
    padding: 10px 16px;
    font-weight: 600;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 100000;
    text-decoration: none;
    transition: top var(--t-fast);
}
.skip-link:focus { top: 0; color: #fff; }

/* Text roles */
.text-strong { color: var(--text-strong) !important; }
.text-subtle { color: var(--text-subtle) !important; }
.eyebrow, .section-eyebrow {
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-ink);
    margin-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   5. LAYOUT
   -------------------------------------------------------------------------- */
.container, .container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
    padding-left: var(--safe-pad-x);
    padding-right: var(--safe-pad-x);
}
.container, .container-lg, .container-xl { max-width: var(--container-max); }

/* The content area of every role page under the app bar */
.app-main {
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: var(--sp-6) var(--safe-pad-x) var(--sp-12);
}
.app-main--narrow { max-width: 880px; }
.app-main--form { max-width: 960px; }
.app-section { margin-bottom: var(--section-gap); }
.grid-auto {
    display: grid;
    gap: var(--grid-gap);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.grid-2 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}
.toolbar .spacer { flex: 1; }

/* --------------------------------------------------------------------------
   6. APP BAR — the one header on every signed-in page (includes/ui.html app_bar)
   -------------------------------------------------------------------------- */
.app-bar {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--surface-header);
    color: var(--text-on-brand);
    border-bottom: 3px solid var(--brand-gold);
}
.app-bar__inner {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    min-height: var(--header-height);
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--safe-pad-x);
}
.app-bar__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    color: #fff;
    text-decoration: none;
    min-width: 0;
}
.app-bar__brand:hover { color: #fff; }
/* Back (UPG-103): before the logo; on narrow phones it takes the logo's place */
.app-bar__back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 38px;
    padding: 0 0.7rem;
    margin-left: -0.35rem;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.app-bar__back:hover { color: #fff; background: rgba(255, 255, 255, 0.10); }
.page-back-float {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    z-index: var(--z-header, 1000);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-pill, 999px);
    background: var(--brand-navy, #00185e);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.page-back-float:hover { color: #fff; filter: brightness(1.15); }
@media print { .page-back-float, .app-bar__back { display: none !important; } }
.app-bar__divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
}
.app-bar__title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex-shrink: 0;   /* the page's name stays whole; a long user name shortens instead (UPG-297 (b)) */
    line-height: 1.2;
}
.app-bar__name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-bar__sub {
    font-size: var(--fs-xs);
    color: var(--text-on-brand-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-bar__nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-wrap: nowrap;
}
.app-bar__link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 38px;
    padding: 0 0.8rem;
    border-radius: var(--radius-sm);
    color: var(--text-on-brand-muted);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}
.app-bar__link i { font-size: 0.95rem; }
.app-bar__link:hover { color: #fff; background: rgba(255, 255, 255, 0.10); }
.app-bar__link.is-active, .app-bar__link[aria-current="page"] {
    color: #FAF4EA;
    background: rgba(74, 134, 242, 0.22);
    box-shadow: inset 0 -3px 0 #F2A516;
}
.app-bar__link--cta {
    background: #B5532B;
    color: #FFFFFF;
    margin-left: var(--sp-2);
}
.app-bar__link--cta:hover { background: #96411F; color: #FFFFFF; }
.app-bar__user {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding-left: var(--sp-3);
    margin-left: var(--sp-2);
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 600;
    max-width: 220px;
}
.app-bar__user { text-decoration: none; min-width: 0; }
.app-bar__nav { min-width: 0; }
.app-bar__user:hover { color: #fff; }
.app-bar__user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bar__more { position: relative; }
.app-bar__more > summary { list-style: none; }
.app-bar__more > summary::-webkit-details-marker { display: none; }
.app-bar__more[open] > summary { color: #fff; background: rgba(255, 255, 255, 0.14); }
.app-bar__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.35rem;
    z-index: calc(var(--z-header) + 1);
}
.app-bar__menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: var(--fs-sm);
    font-weight: 500;
    text-decoration: none;
}
.app-bar__menu a i { width: 16px; text-align: center; color: var(--text-subtle); }
.app-bar__menu a:hover { background: var(--hover-bg); color: var(--text-strong); }
.app-bar__menu hr { margin: 0.35rem 0; }
.app-bar__avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--brand-gold);
    color: var(--brand-navy-900);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--fs-xs);
    flex-shrink: 0;
}
.app-bar__menu-btn { display: none; }
.app-bar .badge-count {
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   7. PAGE HEADER — title, subtitle, breadcrumbs, actions
   -------------------------------------------------------------------------- */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
}
.page-head__text { min-width: 0; }
.page-head__title {
    font-size: var(--fs-2xl);
    margin: 0;
    color: var(--text-strong);
}
.page-head__sub {
    margin: 0.35rem 0 0;
    color: var(--text-subtle);
    font-size: var(--fs-base);
}
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--fs-sm);
    color: var(--text-subtle);
    margin-bottom: var(--sp-2);
    list-style: none;
    padding: 0;
}
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-ink); text-decoration: underline; }
.crumbs li + li::before { content: '/'; margin-right: 0.4rem; color: var(--border-strong); }
.crumbs [aria-current] { color: var(--text-strong); font-weight: 600; }

/* Legacy page title / hero blocks use the same look */
.page-title { margin-bottom: var(--sp-6); }
.page-title h1 { margin: 0 0 0.35rem; }
.page-title p { margin: 0; color: var(--text-subtle); }
.page-hero {
    background: var(--brand-navy);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: var(--sp-6);
    border-bottom: 3px solid var(--brand-gold);
}
.page-hero h1, .page-hero h2 { color: #fff; margin-bottom: 0.35rem; }
.page-hero p { color: var(--text-on-brand-muted); margin-bottom: 0; }

/* --------------------------------------------------------------------------
   8. CARDS
   -------------------------------------------------------------------------- */
.card, .panel {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    color: var(--text);
}
.card { overflow: hidden; }
.panel { padding: var(--card-pad); }
.card-header, .panel__head {
    background: var(--surface-card);
    border-bottom: 1px solid var(--divider);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--fs-md);
    color: var(--text-strong);
    padding: 0.95rem var(--card-pad);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}
.card-header i, .panel__head i { color: var(--brand-gold-600); }
.panel__head { margin: calc(var(--card-pad) * -1) calc(var(--card-pad) * -1) var(--card-pad); }
.panel__title { font-family: var(--font-heading); font-size: var(--fs-md); font-weight: 700; margin: 0; color: var(--text-strong); }
.card-body { padding: var(--card-pad); }
.card-footer {
    background: var(--surface-sunken);
    border-top: 1px solid var(--divider);
    padding: 0.85rem var(--card-pad);
}
.card-title { color: var(--text-strong); }
.card-text { color: var(--text-muted); }
/* Clickable cards may lift; plain content cards stay still */
.card-link, a.card, .card--interactive {
    transition: box-shadow var(--t), border-color var(--t), transform var(--t);
    text-decoration: none;
}
.card-link:hover, a.card:hover, .card--interactive:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* Info / feature blocks */
.info-box, .callout {
    background: var(--brand-gold-100);
    border: 1px solid rgba(198, 157, 103, 0.35);
    border-left: 4px solid var(--brand-gold);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: var(--sp-6);
    color: var(--text);
}
.info-box i, .callout i { color: var(--brand-gold-700); margin-right: 0.5rem; }
.info-box.warning, .callout--warning { background: var(--warning-soft); border-color: rgba(217, 119, 6, 0.3); border-left-color: var(--warning); }
.info-box.success, .callout--success { background: var(--success-soft); border-color: rgba(22, 163, 74, 0.3); border-left-color: var(--success); }
.callout--info { background: var(--info-soft); border-color: rgba(37, 99, 235, 0.25); border-left-color: var(--info); }
.callout--danger { background: var(--danger-soft); border-color: rgba(220, 38, 38, 0.3); border-left-color: var(--danger); }
.callout--brand { background: var(--brand-navy-50); border-color: var(--brand-navy-100); border-left-color: var(--brand-navy); }

.feature-card {
    background: var(--brand-navy);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 3vw, 2rem);
    border-bottom: 3px solid var(--brand-gold);
}
.feature-card h2, .feature-card h3, .feature-card h4, .feature-card h5 { color: #fff; }
.feature-card p { color: var(--text-on-brand-muted); }

.event-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--t), border-color var(--t);
}
.event-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }

/* --------------------------------------------------------------------------
   9. STAT TILES — one neutral style for every dashboard metric
   -------------------------------------------------------------------------- */
.stat-grid {
    display: grid;
    gap: var(--grid-gap);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    margin-bottom: var(--section-gap);
}
.stat-tile, .stat-card, .stat-widget, .kpi-card-v8 {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    position: relative;
    min-width: 0;
}
.stat-card { display: block; }
.stat-tile__icon, .stat-icon, .kpi-icon-glow {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--brand-navy-50);
    color: var(--brand-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.stat-tile__body, .stat-content { min-width: 0; }
.stat-tile__value, .stat-value, .kpi-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
}
.stat-tile__label, .stat-label, .kpi-title {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-top: 0.2rem;
}
.stat-tile__meta { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 0.15rem; }
.stat-card h2, .stat-card .h2 { font-size: 1.6rem; margin-bottom: 0.2rem; }
.stat-card p { margin-bottom: 0.25rem; font-size: var(--fs-xs); letter-spacing: 0.04em; color: var(--text-subtle); }
.stat-change, .kpi-trend-pill { font-size: var(--fs-xs); color: var(--success-text); }
.stat-change.negative, .kpi-trend-down { color: var(--danger-text); }
.kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); width: 100%; }
.kpi-card-v8 { flex-direction: column; align-items: stretch; }
.kpi-icon-blue, .kpi-icon-indigo { background: var(--brand-navy-50); color: var(--brand-ink); }
.kpi-icon-gold { background: var(--brand-gold-100); color: var(--brand-gold-700); }
.kpi-icon-green { background: var(--success-soft); color: var(--success-text); }
.kpi-trend-up { color: var(--success-text); }

/* --------------------------------------------------------------------------
   10. BUTTONS — flat fills, one primary per view
   -------------------------------------------------------------------------- */
.btn {
    --bs-btn-font-weight: 600;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: var(--fs-sm);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    min-height: var(--control-h);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    line-height: 1.25;
    border: 1px solid transparent;
    transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
    text-decoration: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-lg { min-height: var(--control-h-lg); padding: 0.7rem 1.4rem; font-size: var(--fs-base); border-radius: var(--radius-sm); }
.btn-sm { min-height: var(--control-h-sm); padding: 0.3rem 0.75rem; font-size: var(--fs-xs); border-radius: var(--radius-xs); }
.btn-block, .btn.w-100 { width: 100%; }

.btn-primary, .btn-v8-primary, .modal-btn-primary {
    background: #B5532B;
    border-color: #B5532B;
    color: #FFFFFF !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-v8-primary:hover, .modal-btn-primary:hover {
    background: #96411F;
    border-color: #96411F;
    color: #FFFFFF !important;
}
.btn-primary:active { background: #7A3316 !important; border-color: #7A3316 !important; }

/* Primary accent CTA matches Mitti Terracotta + White; badge pills use Haldi + Ink */
.btn-gold, .btn-accent, .btn-orange, .btn-warning, .btn-v8-gold, .btn-reg-gold {
    background: #B5532B;
    border-color: #B5532B;
    color: #FFFFFF !important;
}
.btn-gold:hover, .btn-accent:hover, .btn-orange:hover, .btn-warning:hover, .btn-v8-gold:hover {
    background: #96411F;
    border-color: #96411F;
    color: #FFFFFF !important;
}

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #14532D; border-color: #14532D; color: #fff; }
.btn-danger { background: #B5532B; border-color: #B5532B; color: #fff; }
.btn-danger:hover { background: #96411F; border-color: #96411F; color: #fff; }
.btn-info { background: #1D4FB8; border-color: #1D4FB8; color: #fff; }
.btn-info:hover { background: #163E93; border-color: #163E93; color: #fff; }

.btn-secondary, .btn-light, .btn-v8-glass, .modal-btn-secondary {
    background: transparent;
    border: 1.5px solid var(--text-strong);
    color: var(--text-strong) !important;
}
.btn-secondary:hover, .btn-light:hover, .btn-v8-glass:hover, .modal-btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--text-strong);
    color: var(--text-strong) !important;
}
.btn-dark { background: #17130F; border-color: #17130F; color: #FAF4EA; }

.btn-outline-primary { background: transparent; border: 1.5px solid var(--text-strong); color: var(--text-strong) !important; }
.btn-outline-primary:hover { background: var(--text-strong); border-color: var(--text-strong); color: var(--surface-page) !important; }
.btn-outline-secondary, .btn-outline-dark { background: transparent; border: 1.5px solid var(--text-strong); color: var(--text-strong) !important; }
.btn-outline-secondary:hover, .btn-outline-dark:hover { background: var(--hover-bg); color: var(--text-strong) !important; border-color: var(--text-strong); }
.btn-outline-success { border-color: var(--success); color: var(--success-text); }
.btn-outline-success:hover { background: var(--success); color: #fff; }
.btn-outline-danger { border-color: #B5532B; color: #B5532B; }
.btn-outline-danger:hover { background: #B5532B; color: #fff; }
.btn-outline-warning, .btn-outline-gold { border-color: var(--text-strong); color: var(--text-strong); }
.btn-outline-warning:hover, .btn-outline-gold:hover { background: #F2A516; border-color: #F2A516; color: #17130F; }
.btn-outline-info { border-color: #1D4FB8; color: #1D4FB8; }
.btn-outline-info:hover { background: #1D4FB8; color: #fff; }
.btn-outline-light { border: 1.5px solid #FAF4EA; color: #FAF4EA; }
.btn-outline-light:hover { background: rgba(250, 244, 234, 0.14); color: #FAF4EA; }
.btn-link { color: var(--bs-link-color); font-weight: 600; }
.btn-icon {
    width: var(--control-h); height: var(--control-h);
    padding: 0;
    border-radius: var(--radius-sm);
}
.btn-icon.btn-sm { width: var(--control-h-sm); height: var(--control-h-sm); }

button:disabled, .btn:disabled, .btn.disabled {
    opacity: 1;
    background: var(--disabled-bg) !important;
    border-color: var(--border) !important;
    color: var(--disabled-text) !important;
    cursor: not-allowed;
    box-shadow: none;
}

.action-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

/* --------------------------------------------------------------------------
   11. FORMS
   -------------------------------------------------------------------------- */
.form-label, .form-label-v8 {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.35rem;
    text-transform: none;
    letter-spacing: 0;
}
.form-label .req, .required-mark { color: var(--danger); margin-left: 2px; }
.form-control, .form-select, .form-input-v8 {
    background-color: var(--surface-card);
    color: var(--text-strong);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.8rem;
    font-size: var(--fs-base);
    min-height: var(--control-h);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-control-sm, .form-select-sm { min-height: var(--control-h-sm); font-size: var(--fs-sm); padding: 0.3rem 0.6rem; }
.form-control-lg, .form-select-lg { min-height: var(--control-h-lg); }
.form-control:hover, .form-select:hover { border-color: var(--text-subtle); }
.form-control:focus, .form-select:focus, .form-input-v8:focus {
    background-color: var(--surface-card);
    color: var(--text-strong);
    border-color: var(--brand-ink);
    box-shadow: 0 0 0 3px var(--bs-focus-ring-color);
    outline: none;
}
.form-control::placeholder { color: var(--ink-400); }
.form-control:disabled, .form-select:disabled, .form-control[readonly] {
    background-color: var(--disabled-bg);
    color: var(--text-muted);
}
textarea.form-control { min-height: 96px; resize: vertical; }
.form-text, .form-help { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 0.3rem; }
.form-error, .invalid-feedback { font-size: var(--fs-xs); color: var(--danger-text); margin-top: 0.3rem; }
.form-group, .form-group-v8 { margin-bottom: var(--sp-4); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4); }
.form-section {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--card-pad);
    margin-bottom: var(--sp-5);
}
.form-section__title {
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text-strong);
    margin: 0 0 var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--divider);
}
.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--sp-2);
    padding-top: var(--sp-4);
}

.form-check-input {
    width: 1.1rem; height: 1.1rem;
    border: 1px solid var(--border-strong);
    background-color: var(--surface-card);
}
.form-check-input:checked { background-color: var(--brand-navy); border-color: var(--brand-navy); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(0, 24, 94, 0.16); border-color: var(--brand-navy); }
.form-check-label { color: var(--text); }
.form-switch .form-check-input { width: 2.2rem; }

.input-group-text {
    background: var(--surface-sunken);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-weight: 600;
}

.form-control.is-invalid, .was-validated .form-control:invalid { border-color: var(--danger); }
.form-control.is-valid, .was-validated .form-control:valid { border-color: var(--success); }
.input-feedback, .input-feedback-msg { font-size: var(--fs-xs); margin-top: 4px; font-weight: 600; }
.input-feedback { display: none; }
.input-feedback.success, .input-feedback-msg.is-valid { color: var(--success-text); display: block; }
.input-feedback.error, .input-feedback-msg.is-invalid { color: var(--danger-text); display: block; }

/* Field icon / password reveal helpers */
.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control, .input-icon-wrap .form-select { padding-left: 2.4rem; }
.input-icon-wrap .inp-icon {
    position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%);
    color: var(--text-subtle); font-size: 0.875rem; pointer-events: none; z-index: 4;
}
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 2.8rem; }
.pw-toggle {
    position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--text-subtle); font-size: 0.9rem; padding: 6px;
}
.pw-toggle:hover { color: var(--brand-ink); }

/* File inputs */
input[type="file"].form-control { padding: 0.4rem 0.6rem; }
input[type="file"]::file-selector-button {
    background: var(--surface-muted);
    border: 0;
    border-right: 1px solid var(--border);
    color: var(--text-strong);
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    margin-right: 0.8rem;
}

/* --------------------------------------------------------------------------
   12. MODALS
   -------------------------------------------------------------------------- */
.modal { z-index: 10500 !important; }
.modal-backdrop { z-index: 10400 !important; }
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.modal-header {
    background: var(--surface-card);
    color: var(--text-strong);
    border-bottom: 1px solid var(--divider);
    padding: 1rem 1.25rem;
}
.modal-title { font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-lg); color: var(--text-strong); }
.modal-body { padding: 1.25rem; }
.modal-footer {
    border-top: 1px solid var(--divider);
    padding: 0.85rem 1.25rem;
    background: var(--surface-sunken);
    gap: var(--sp-2);
}
.modal-footer > * { margin: 0; }
[data-theme="dark"] .btn-close { filter: invert(1); }
.modal-dialog:not(.modal-lg):not(.modal-xl):not(.modal-sm):not(.modal-fullscreen) { max-width: var(--modal-w); }
/* A modal header that carries brand colour must say so explicitly */
.modal-header.on-brand { background: var(--brand-navy); color: #fff; border-bottom: 3px solid var(--brand-gold); }
.modal-header.on-brand .modal-title { color: #fff; }
.modal-header.on-brand .btn-close { filter: invert(1) brightness(2); }

/* --------------------------------------------------------------------------
   13. TABLES
   -------------------------------------------------------------------------- */
.table {
    --bs-table-bg: var(--surface-card);
    --bs-table-color: var(--text);
    --bs-table-striped-bg: var(--surface-sunken);
    --bs-table-hover-bg: var(--hover-bg);
    --bs-table-border-color: var(--divider);
    color: var(--text);
    margin-bottom: 0;
    font-size: var(--fs-sm);
}
.table > :not(caption) > * > * { padding: 0.75rem 1rem; }
.table thead th, .table > thead > tr > th {
    background: var(--surface-sunken);
    color: var(--text-muted);
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table tbody td { border-color: var(--divider); color: var(--text); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-dark, .table thead.table-dark th {
    --bs-table-bg: var(--surface-sunken);
    --bs-table-color: var(--text-muted);
    background: var(--surface-sunken) !important;
    color: var(--text-muted) !important;
}
.table-responsive, .table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-card);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive > .table, .table-wrap > .table { margin: 0; }
.card > .table-responsive, .card-body > .table-responsive:only-child { border: 0; border-radius: 0; }
.table-custom { width: 100%; border-collapse: collapse; background: var(--surface-card); }
.table-custom th {
    background: var(--surface-sunken);
    color: var(--text-muted); font-weight: 600; text-transform: uppercase;
    font-size: var(--fs-xs); padding: 0.75rem 1rem; text-align: left;
    border-bottom: 1px solid var(--border); letter-spacing: 0.05em;
}
.table-custom td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--divider); color: var(--text); vertical-align: middle; }

/* --------------------------------------------------------------------------
   14. BADGES / STATUS
   -------------------------------------------------------------------------- */
.badge {
    font-weight: 600;
    border-radius: var(--radius-pill);
    padding: 0.35em 0.7em;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
}
.badge.bg-primary { background: #1D4FB8 !important; color: #FFFFFF !important; }
.badge.bg-warning { background: #F2A516 !important; color: #17130F !important; }
.badge.bg-success { background: var(--success-soft) !important; color: var(--success-text) !important; }
.badge.bg-danger { background: var(--danger-soft) !important; color: var(--danger-text) !important; }
.badge.bg-info { background: #EBF1FC !important; color: #1D4FB8 !important; }
.badge.bg-secondary, .badge.bg-light { background: var(--surface-muted) !important; color: var(--text-muted) !important; }
.badge.bg-dark { background: #17130F !important; color: #FAF4EA !important; }

/* The status badge: one shape, palette colour, always with text */
.se-badge, .status-badge, .pill-badge-v8 {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid transparent;
}
.se-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.se-badge--plain::before { display: none; }
.se-badge--success, .status-active, .badge-success { background: var(--success-soft); color: var(--success-text); }
.se-badge--warning, .status-pending, .badge-warning { background: #F2A516; color: #17130F; }
.se-badge--danger, .status-closed, .badge-danger { background: var(--danger-soft); color: var(--danger-text); }
.se-badge--info, .status-free, .badge-info { background: #EBF1FC; color: #1D4FB8; }
.se-badge--brand, .badge-primary { background: #F7EAE3; color: #B5532B; }
.se-badge--gold { background: #F2A516; color: #17130F; }
.se-badge--neutral { background: var(--surface-muted); color: var(--text-muted); }
.pill-technical { background: var(--brand-navy-50); color: var(--cat-technical); }
.pill-cultural { background: var(--brand-gold-100); color: var(--brand-gold-700); }
.pill-sports { background: var(--success-soft); color: var(--success-text); }
.pill-live { background: var(--danger-soft); color: var(--danger-text); }

/* --------------------------------------------------------------------------
   15. ALERTS / FLASH / TOASTS
   -------------------------------------------------------------------------- */
.alert {
    border: 1px solid transparent;
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    font-size: var(--fs-sm);
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}
.alert.alert-dismissible { padding-right: 3rem; }
.alert i { flex-shrink: 0; margin-top: 0.15rem; }
.alert-success { background: var(--success-soft); color: var(--success-text); border-color: rgba(22, 163, 74, 0.25); border-left-color: var(--success); }
.alert-danger, .alert-error { background: var(--danger-soft); color: var(--danger-text); border-color: rgba(220, 38, 38, 0.25); border-left-color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning-text); border-color: rgba(217, 119, 6, 0.25); border-left-color: var(--warning); }
.alert-info, .alert-primary, .alert-message { background: var(--info-soft); color: var(--info-text); border-color: rgba(37, 99, 235, 0.2); border-left-color: var(--info); }
.alert-secondary, .alert-light { background: var(--surface-muted); color: var(--text-muted); border-color: var(--border); border-left-color: var(--border-strong); }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.flash-stack { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }

/* Toasts (global.js showToast) */
#sp-toast-container {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    right: 16px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.se-toast {
    background: var(--surface-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 4px solid var(--info);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 0.7rem 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.45;
    pointer-events: auto;
    cursor: pointer;
    word-break: break-word;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity var(--t), transform var(--t);
}
.se-toast.is-shown { opacity: 1; transform: none; }
/* On a phone the toast sits at the bottom, above the bottom menu, clear of the page's title (UPG-363) */
@media (max-width: 767.98px) {
    #sp-toast-container {
        top: auto;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 12px);
        left: 16px;
        right: 16px;
        max-width: none;
    }
    .se-toast { transform: translateY(6px); }
}
.se-toast__icon { flex-shrink: 0; margin-top: 1px; font-size: 1rem; }
.se-toast__msg { flex: 1; }
.se-toast__close { background: none; border: 0; color: var(--text-subtle); font-size: 1.1rem; line-height: 1; padding: 0 0 0 4px; cursor: pointer; }
.se-toast--success { border-left-color: var(--success); } .se-toast--success .se-toast__icon { color: var(--success); }
.se-toast--danger { border-left-color: var(--danger); }   .se-toast--danger .se-toast__icon { color: var(--danger); }
.se-toast--warning { border-left-color: var(--warning); } .se-toast--warning .se-toast__icon { color: var(--warning); }
.se-toast--info { border-left-color: var(--info); }       .se-toast--info .se-toast__icon { color: var(--info); }

/* --------------------------------------------------------------------------
   16. LIST GROUPS / DROPDOWNS
   -------------------------------------------------------------------------- */
.list-group-item {
    background: var(--surface-card);
    border-color: var(--divider);
    color: var(--text);
    padding: 0.8rem 1rem;
}
.list-group-item-action:hover { background: var(--hover-bg); color: var(--text-strong); }
.list-group-item.active { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.dropdown-menu {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.35rem;
    font-size: var(--fs-sm);
}
.dropdown-item { border-radius: var(--radius-xs); padding: 0.5rem 0.75rem; color: var(--text); font-weight: 500; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--hover-bg); color: var(--text-strong); }
.dropdown-item.active, .dropdown-item:active { background: var(--brand-navy); color: #fff; }
.dropdown-divider { border-color: var(--divider); }

/* --------------------------------------------------------------------------
   17. AUTH PAGES (login, register, reset) — navy brand panel + white card
   -------------------------------------------------------------------------- */
.auth-shell, body.auth {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--surface-page);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-4);
    padding: clamp(1rem, 3vw, 2.5rem);
}
body.auth > .site-footer { border-top: 0; padding: 0; }
.auth-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    margin: auto;
}
.auth-info-panel { display: none; }
.auth-form-panel { width: 100%; }
.auth-card, .login-card {
    overflow: hidden;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    width: 100%;
    max-width: 460px;
    margin: auto;
    color: var(--text);
}
.auth-brand {
    background: #17130F;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: center;
    border-bottom: 3px solid #B5532B;
    margin: calc(clamp(1.5rem, 4vw, 2.25rem) * -1) calc(clamp(1.5rem, 4vw, 2.25rem) * -1) 1.5rem;
}
.auth-brand img { height: 28px; width: auto; min-width: 120px; }
.auth-card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-strong);
    margin-bottom: 0.25rem;
}
.auth-card-sub { color: var(--text-subtle); font-size: var(--fs-sm); margin-bottom: 1.5rem; }
.secret-key-group {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--divider);
    display: none;
}
.secret-key-group.show { display: block; }

@media (min-width: 992px) {
    .auth-container {
        max-width: 1040px;
        flex-direction: row;
        background: var(--surface-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-lg);
        overflow: hidden;
        min-height: 600px;
    }
    .auth-info-panel {
        display: flex;
        flex: 1.1;
        background: #17130F;
        padding: 3.5rem 3rem;
        color: #FAF4EA;
        align-items: center;
        border-right: 4px solid #B5532B;
    }
    .auth-info-content { max-width: 440px; width: 100%; }
    .info-logo { height: 34px; width: auto; min-width: 120px; max-width: 100%; margin-bottom: 2rem; }
    .info-title {
        font-family: var(--font-heading);
        font-size: 2.1rem;
        font-weight: 800;
        color: #FAF4EA;
        letter-spacing: -0.02em;
        margin-bottom: 0.5rem;
    }
    .info-subtitle { font-size: 1rem; color: #D8CEBE; margin-bottom: 2.5rem; }
    .feature-list { display: flex; flex-direction: column; gap: 1.5rem; }
    .feature-item { display: flex; gap: 1rem; align-items: flex-start; }
    .feature-icon {
        width: 42px; height: 42px;
        border-radius: var(--radius-sm);
        background: #2B231B;
        border: 1px solid #B5532B;
        color: #F2A516;
        display: flex; align-items: center; justify-content: center;
        flex-shrink: 0;
    }
    .feature-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; color: #FAF4EA; margin-bottom: 0.2rem; }
    .feature-desc { font-size: var(--fs-sm); color: var(--text-on-brand-muted); margin: 0; line-height: 1.5; }
    .auth-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 3rem; }
    .auth-form-panel .login-card, .auth-form-panel .auth-card {
        border: 0; box-shadow: none; padding: 0; max-width: 380px;
    }
}
/* Info content is also used without the desktop panel */
.feature-icon { display: inline-flex; align-items: center; justify-content: center; }

/* --------------------------------------------------------------------------
   18. SIDEBAR LAYOUT (base_classic.html)
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface-sidebar);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: var(--z-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform var(--t-slow);
}
.sidebar-brand {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 3px solid var(--brand-gold);
    background: var(--brand-navy);
}
.sidebar-brand img { height: 32px; width: auto; }
.brand-text { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 800; color: #fff; }
.brand-text span { color: var(--brand-gold); }
.sidebar-menu { flex: 1; padding: 1rem 0; overflow-y: auto; scrollbar-width: thin; }
.nav-section { padding: 0.5rem 0; }
.nav-section + .nav-section { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.nav-section-title {
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; color: rgba(255, 255, 255, 0.45);
    padding: 0.5rem 1.25rem; letter-spacing: 0.1em;
}
.sidebar .nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    margin: 1px 0.6rem;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500; font-size: var(--fs-sm);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast);
}
.sidebar .nav-link i { width: 18px; text-align: center; color: rgba(255, 255, 255, 0.6); }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar .nav-link.active, .sidebar .nav-link[aria-current="page"] {
    background: rgba(198, 157, 103, 0.16);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--brand-gold);
}
.sidebar .nav-link.active i { color: var(--brand-gold); }
.sidebar-footer {
    padding: 0.9rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, 0.55);
}
.sidebar-footer a { color: rgba(255, 255, 255, 0.75); }
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 10, 46, 0.5);
    z-index: calc(var(--z-sidebar) - 1);
}
.sidebar-overlay.active { display: block; }

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface-page);
}
.main-content.public-layout { margin-left: 0; }
.top-header {
    min-height: var(--header-height);
    background: var(--surface-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: 0 var(--safe-pad-x);
    position: sticky; top: 0; z-index: var(--z-header);
}
.header-left, .header-right { display: flex; align-items: center; gap: var(--sp-3); }
.header-title { font-family: var(--font-heading); font-size: var(--fs-lg); font-weight: 700; color: var(--text-strong); margin: 0; }
.header-icon-btn {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: none; border: 0;
    position: relative;
    text-decoration: none;
}
.header-icon-btn:hover { background: var(--hover-bg); color: var(--text-strong); }
.header-icon-btn .badge { position: absolute; top: 2px; right: 0; font-size: 0.6rem; }
.content-wrapper {
    padding: var(--sp-6) var(--safe-pad-x) var(--sp-10);
    flex: 1;
    max-width: var(--page-max);
    margin: 0 auto;
    width: 100%;
}
.user-menu { display: flex; align-items: center; gap: var(--sp-3); }
.menu-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 1.15rem;
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
}
.menu-toggle:hover { background: var(--hover-bg); }

/* --------------------------------------------------------------------------
   19. BOOTSTRAP UTILITY OVERRIDES
   -------------------------------------------------------------------------- */
.text-primary { color: var(--brand-ink) !important; }
.text-warning { color: var(--warning-text) !important; }
.text-success { color: var(--success-text) !important; }
.text-danger { color: var(--danger-text) !important; }
.text-info { color: var(--info-text) !important; }
.text-muted, .text-secondary { color: var(--text-subtle) !important; }
.text-dark, .text-body { color: var(--text-strong) !important; }
.text-gold, .text-accent { color: var(--brand-gold-700) !important; }
.bg-primary { background-color: var(--brand-navy) !important; }
.bg-warning { background-color: var(--warning-soft) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-light { background-color: var(--surface-sunken) !important; }
.bg-white { background-color: var(--surface-card) !important; }
.bg-dark { background-color: var(--text-strong) !important; }
.bg-body, .bg-body-tertiary { background-color: var(--surface-page) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.rounded { border-radius: var(--radius-sm) !important; }
.rounded-3 { border-radius: var(--radius) !important; }
.rounded-4 { border-radius: var(--radius-lg) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--border) !important; }

/* --------------------------------------------------------------------------
   20. AVATARS / CHIPS
   -------------------------------------------------------------------------- */
.avatar-circle, .user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--brand-navy);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--fs-xs);
    border: 2px solid var(--brand-gold);
    flex-shrink: 0;
}
.chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: 600;
    border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   21. TABS / PILLS / SEGMENTED FILTERS
   -------------------------------------------------------------------------- */
.nav-tabs { border-bottom: 1px solid var(--border); gap: var(--sp-1); }
.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: var(--fs-sm);
    padding: 0.65rem 0.9rem;
    margin-bottom: -1px;
    background: transparent;
}
.nav-tabs .nav-link:hover { color: var(--brand-ink); }
.nav-tabs .nav-link.active { color: var(--brand-ink); background: transparent; border-bottom-color: var(--brand-gold); }
.nav-pills .nav-link { border-radius: var(--radius-pill); color: var(--text-muted); font-weight: 600; font-size: var(--fs-sm); }
.nav-pills .nav-link.active { background: var(--brand-navy); color: #fff; }
.ftabs, .seg {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}
.ftab, .seg__btn {
    padding: 0.4rem 0.95rem;
    min-height: 36px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-sm);
    font-weight: 600;
    border: 1px solid var(--border-strong);
    background: var(--surface-card);
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.ftab:hover, .seg__btn:hover { border-color: #1D4FB8; color: #1D4FB8; }
.ftab.active, .seg__btn.active, .seg__btn[aria-pressed="true"], .seg__btn[aria-current] {
    background: #1D4FB8;
    border-color: #1D4FB8;
    color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   22. PROGRESS
   -------------------------------------------------------------------------- */
.progress { background: var(--surface-muted); border-radius: var(--radius-pill); height: 8px; overflow: hidden; }
.progress-bar { background: var(--brand-navy); }
.progress-bar.bg-success { background: var(--success) !important; }
.progress-bar.bg-warning { background: var(--brand-gold) !important; }

/* --------------------------------------------------------------------------
   23. EMPTY / LOADING STATES
   -------------------------------------------------------------------------- */
.empty-state, .no-events-box {
    text-align: center;
    padding: clamp(2rem, 6vw, 3.5rem) 1.5rem;
    color: var(--text-subtle);
    background: var(--surface-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}
.empty-state i, .empty-state .empty-icon, .no-events-box i {
    font-size: 2.25rem; color: var(--border-strong); margin-bottom: 0.75rem; display: block;
}
.empty-state h3, .empty-state h4, .empty-state h5 { color: var(--text-strong); margin-bottom: 0.35rem; font-size: var(--fs-md); }
.empty-state p { font-size: var(--fs-sm); color: var(--text-subtle); margin-bottom: 1rem; }

.sp-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sp-spin 0.7s linear infinite;
    vertical-align: middle;
}
.loading {
    display: inline-block;
    width: 20px; height: 20px;
    border: 3px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--brand-navy);
    animation: sp-spin 0.9s linear infinite;
}
@keyframes sp-spin { to { transform: rotate(360deg); } }
.skeleton, .skeleton-v8 {
    background: var(--surface-muted);
    animation: sp-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-xs);
}
@keyframes sp-pulse { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-title { height: 22px; margin-bottom: 12px; width: 60%; }
.skeleton-card { height: 120px; border-radius: var(--radius); }
.skeleton-btn { height: 40px; width: 120px; border-radius: var(--radius-sm); }
.skeleton-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   24. TIMELINE / TOOLTIP / HELPERS
   -------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { margin-bottom: 1.5rem; position: relative; }
.timeline-item::before {
    content: '';
    position: absolute; left: -1.75rem; top: 0.4rem;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--surface-card);
    border: 3px solid var(--brand-gold);
}
.timeline-date { font-size: var(--fs-xs); color: var(--text-subtle); font-weight: 600; }
.timeline-title { font-weight: 700; color: var(--text-strong); }

[data-tip] { position: relative; }
[data-tip]::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%);
    background: var(--text-strong); color: #fff;
    font-size: 11px; font-weight: 500; line-height: 1.4;
    padding: 5px 8px; border-radius: var(--radius-xs);
    white-space: pre-wrap; width: max-content; max-width: 220px;
    pointer-events: none; opacity: 0;
    transition: opacity var(--t-fast);
    z-index: 9000;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; }

.notif-dot {
    position: absolute; top: -3px; right: -3px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--danger); border: 2px solid var(--surface-card);
}
.divider { height: 1px; background: var(--border); margin: var(--sp-8) 0; }
.section-rule { border: 0; height: 2px; width: 48px; background: var(--brand-gold); margin: 0.6rem 0 1.25rem; opacity: 1; }
.kbd, kbd {
    font-size: 0.72rem; padding: 1px 6px; border-radius: 4px;
    background: var(--surface-muted); color: var(--text-muted); border: 1px solid var(--border);
}

/* QR codes must stay crisp and high-contrast */
.qr-frame {
    display: inline-flex;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.qr-frame img, .qr-frame canvas, .qr-frame svg { display: block; image-rendering: pixelated; }

/* --------------------------------------------------------------------------
   25. MOTION — short, purposeful, and off for reduced-motion users
   -------------------------------------------------------------------------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes slideOutRight { from { opacity: 1; } to { opacity: 0; transform: translateX(16px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes float { 0%, 100% { transform: none; } 50% { transform: translateY(-3px); } }
@keyframes pulse-glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.85; } }
.animate-fade-in { animation: fadeIn var(--t-slow) var(--ease); }
.animate-slide-up { animation: slideUp var(--t-slow) var(--ease); }
.animate-scale-in { animation: scaleIn var(--t) var(--ease); }
/* Scroll-reveal classes are kept for markup compatibility but content is
   always visible: nothing waits on JavaScript to appear (UPG-63). */
.scroll-animator, .animate-on-scroll { opacity: 1; transform: none; }

/* Decorative backdrops from earlier designs are retired; markup that still
   carries them renders nothing (UPG-63). */
.aurora-bg, .aurora-bg-home, .grid-overlay, .grid-overlay-home, .grid-bg,
.liquid-blob, .blob-1, .blob-2, .blob-3, .blob-4, .hero-shapes, .hero-shape { display: none !important; }

/* --------------------------------------------------------------------------
   26. UTILITIES
   -------------------------------------------------------------------------- */
.glass, .glass-panel, .glass-card, .card-glass, .glass-card-v8 {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.hover-lift { transition: transform var(--t), box-shadow var(--t); }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.text-gradient { color: var(--brand-ink); }
.zero-scroll { height: 100dvh; overflow: hidden; margin: 0; padding: 0; }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; }
.on-brand { background: var(--brand-navy); color: #fff; }

/* --------------------------------------------------------------------------
   27. PUBLIC SITE — navigation, hero, event cards, sections, footer
   -------------------------------------------------------------------------- */
.navbar { padding: 0.6rem 0; }
.navbar-brand { font-family: var(--font-heading); font-weight: 800; color: var(--brand-ink); display: inline-flex; align-items: center; gap: 0.6rem; }
.navbar-toggler { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.35rem 0.55rem; }
.navbar-toggler:focus { box-shadow: var(--focus-ring); }

/* Public navigation bar (.snav) — same navy bar as the app bar */
.snav {
    background: #17130F !important;
    border-bottom: 3px solid #B5532B;
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    padding: 0.4rem 0;
}
.snav .navbar-brand { gap: 0.75rem; padding: 6px 10px; }
.snav .navbar-brand img { height: 28px; width: auto; min-width: 120px; }
.snav .nav-link {
    color: #D8CEBE !important;
    font-size: var(--fs-sm);
    font-weight: 600;
    padding: 0.5rem 0.9rem !important;
    border-radius: var(--radius-sm);
}
.snav .nav-link:hover, .snav .nav-link.active { color: #FAF4EA !important; background: rgba(74, 134, 242, 0.20); }
.snav .navbar-toggler { border-color: rgba(250, 244, 234, 0.4); }
.snav .navbar-toggler-icon { filter: invert(1); }
.snav .btn-login, .btn-login-mini {
    background: #B5532B !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    font-size: var(--fs-sm);
    padding: 0.5rem 1.15rem !important;
    border-radius: var(--radius-sm) !important;
    border: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}
.snav .btn-login:hover, .btn-login-mini:hover { background: #96411F !important; color: #FFFFFF !important; }
@media (max-width: 991.98px) {
    .snav .navbar-collapse {
        background: #17130F;
        margin-top: 0.5rem;
        padding: 0.75rem;
        border-radius: var(--radius);
    }
}
.brand-n { font-family: var(--font-heading); font-weight: 800; font-size: 1.1rem; color: #FAF4EA; line-height: 1.1; display: block; }
.brand-s { font-size: 0.65rem; color: #D8CEBE; letter-spacing: 0.08em; display: block; font-weight: 600; }
.nav-logo-sq {
    width: 40px; height: 40px;
    background: #F2A516; color: #17130F;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; font-weight: 800;
}

/* Hero — solid Ink with Mitti/Haldi/Mat kabaddi accents */
.hero-section {
    background: #17130F;
    position: relative;
    padding: clamp(56px, 8vw, 108px) 0 clamp(48px, 7vw, 88px);
    color: #FAF4EA;
    overflow: hidden;
    border-bottom: 4px solid #B5532B;
}
.hero-container { position: relative; z-index: 2; }
.hero-branding {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #F2A516;
    border: 0;
    color: #17130F;
    font-size: var(--fs-xs);
    font-weight: 800;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: var(--fs-3xl);
    font-weight: 800;
    color: #FAF4EA;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}
.hero-title .accent { color: #D9693A; }
.hero-title .accent-mat { color: #4A86F2; }
.hero-desc {
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    color: #DDD2C1;
    margin-bottom: 2rem;
    max-width: 580px;
    line-height: 1.6;
}
.hero-btn-primary { background: #B5532B; color: #FFFFFF !important; border: 0; font-weight: 600; border-radius: var(--radius-sm); }
.hero-btn-primary:hover { background: #96411F; color: #FFFFFF !important; }
.hero-btn-outline { background: transparent; border: 1.5px solid #FAF4EA; color: #FAF4EA !important; font-weight: 600; border-radius: var(--radius-sm); }
.hero-btn-outline:hover { background: rgba(250, 244, 234, 0.14); border-color: #FAF4EA; color: #FAF4EA !important; }

/* Hero summary card */
.hero-stats-card {
    background: #221C16;
    border: 1px solid #3B3025;
    border-top: 4px solid #F2A516;
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 2;
}
.hsc-header { margin-bottom: 1.1rem; }
.hsc-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #F2A516;
    border: 0;
    color: #17130F;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 4px 10px; border-radius: var(--radius-pill); margin-bottom: 0.6rem;
}
.hsc-live-dot { width: 7px; height: 7px; background: #166534; border-radius: 50%; display: inline-block; animation: livePulse 2s infinite; }
.hsc-title { font-family: var(--font-heading); font-size: clamp(1.3rem, 2.6vw, 1.6rem); font-weight: 800; color: #FAF4EA; margin: 0 0 0.2rem; }
.hsc-subtitle { color: #D8CEBE; font-size: var(--fs-sm); margin: 0; }
.hsc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.1rem; }
.hsc-stat {
    display: flex; align-items: center; gap: 0.7rem;
    background: #2B231B;
    border: 1px solid #3B3025;
    border-radius: var(--radius);
    padding: 0.8rem 0.9rem;
}
.hsc-stat-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    background: #F2A516 !important; color: #17130F !important;
}
.hsc-stat-value { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 800; color: #FAF4EA; line-height: 1; margin-bottom: 2px; }
.hsc-stat-label { font-size: 0.66rem; color: #D8CEBE; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.hsc-cats { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.1rem; }
.hsc-cat {
    padding: 0.3rem 0.75rem; border-radius: var(--radius-pill);
    font-size: 0.72rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: 5px;
    background: #2B231B !important;
    color: #FAF4EA !important;
    border: 1px solid #524334 !important;
    cursor: pointer; text-decoration: none;
}
.hsc-cat:hover { background: #3B3025 !important; }
.hsc-cta {
    display: block; text-align: center;
    padding: 0.75rem 1.25rem;
    background: #B5532B; color: #FFFFFF;
    font-weight: 600; font-size: var(--fs-sm);
    border-radius: var(--radius-sm);
    text-decoration: none;
}
.hsc-cta:hover { background: #96411F; color: #FFFFFF; }

/* Section headings on public pages */
.sec-eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 0.35rem; }
.sec-h { font-family: var(--font-heading); font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 800; color: var(--text-strong); letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.sec-p { color: var(--text-muted); font-size: var(--fs-md); max-width: 640px; }
.section-block { padding: clamp(48px, 7vw, 88px) 0; }
.section-block--alt { background: var(--surface-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-block--brand { background: #17130F; color: #FAF4EA; }
.section-block--brand .sec-h { color: #FAF4EA; }
.section-block--brand .sec-p { color: #D8CEBE; }
.section-block--brand .sec-eyebrow { color: #F2A516; }

/* Event cards (home, catalogue, related events) */
.ev-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--t), border-color var(--t), transform var(--t);
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: left;
}
.ev-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.ev-card:focus-within { outline: 2px solid var(--brand-gold); outline-offset: 2px; }
.ev-banner {
    height: 152px;
    position: relative;
    overflow: hidden;
    background: #17130F;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ev-banner img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.ev-overlay { position: absolute; inset: 0; background: rgba(23, 19, 15, 0.42); z-index: 1; }
.ev-banner-icon { font-size: 3rem; position: relative; z-index: 2; color: #F2A516; }
.ev-cat, .event-category-badge {
    position: absolute; top: 12px; left: 12px; z-index: 3;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    padding: 4px 10px; border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.95); color: var(--brand-navy);
}
.cat-technical { color: var(--cat-technical) !important; }
.cat-sports { color: var(--cat-sports) !important; }
.cat-cultural { color: var(--cat-cultural) !important; }
.cat-management { color: var(--cat-management) !important; }
.cat-general { color: var(--cat-general) !important; }
.ev-cat.cat-technical, .ev-cat.cat-sports, .ev-cat.cat-cultural, .ev-cat.cat-management, .ev-cat.cat-general { background: rgba(255, 255, 255, 0.95); }
.ev-deadline, .event-date-chip {
    position: absolute; top: 12px; right: 12px; z-index: 3;
    font-size: 0.68rem; font-weight: 700;
    padding: 4px 10px; border-radius: var(--radius-pill);
    background: rgba(0, 16, 70, 0.82); color: #fff;
    display: flex; align-items: center; gap: 4px;
}
.event-date-chip { top: auto; bottom: 12px; }
.ev-body, .event-body-v8 { padding: 1.1rem 1.15rem 1.15rem; flex: 1; display: flex; flex-direction: column; }
.ev-title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; color: var(--text-strong); margin-bottom: 0.4rem; line-height: 1.3; }
.ev-desc { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.5; margin-bottom: 1rem; flex: 1; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin-bottom: 1rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--divider); }
.ev-meta span { font-size: var(--fs-xs); color: var(--text-subtle); display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.ev-meta i { color: var(--brand-gold-600); }
.ev-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: auto; }
.ev-fee-free { font-family: var(--font-heading); font-size: 1rem; font-weight: 800; color: var(--success-text); }
.ev-fee-paid { font-family: var(--font-heading); font-size: 1rem; font-weight: 800; color: var(--brand-ink); }
.ev-reg-count { font-size: 0.7rem; color: var(--text-subtle); font-weight: 600; margin-top: 2px; }
.btn-reg {
    background: #B5532B;
    color: #FFFFFF !important;
    font-size: var(--fs-sm);
    font-weight: 600;
    padding: 0.5rem 1rem;
    min-height: 40px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    transition: background var(--t-fast);
}
.btn-reg:hover { background: #96411F; color: #FFFFFF !important; }
.event-card-v8 { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.event-media-wrap { position: relative; height: 172px; overflow: hidden; background: var(--brand-navy); }
.event-media-img { width: 100%; height: 100%; object-fit: cover; }

/* Search box on public listings */
.search-box { position: relative; }
.search-box input {
    width: 100%;
    min-height: var(--control-h);
    padding: 0.55rem 0.9rem 0.55rem 2.4rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    color: var(--text-strong);
    font-size: var(--fs-base);
}
.search-box input:focus { border-color: var(--brand-navy); box-shadow: 0 0 0 3px rgba(0, 24, 94, 0.14); outline: none; }
.search-box i, .search-box .search-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }

/* How it works */
.hiw-section { background: var(--brand-navy); color: #fff; position: relative; }
.step-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.4rem;
    text-align: center;
    height: 100%;
}
.step-ico {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(198, 157, 103, 0.16);
    border: 1px solid rgba(198, 157, 103, 0.45);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.1rem;
    font-size: 1.5rem;
    color: var(--brand-gold-300);
}
.step-title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 0.45rem; }
.step-desc { font-size: var(--fs-sm); color: var(--text-on-brand-muted); line-height: 1.6; margin: 0; }

/* Testimonials */
.social-proof-section { background: var(--surface-page); }
.testimonial-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.4rem;
    box-shadow: var(--shadow-xs);
    position: relative;
    height: 100%;
}
.testimonial-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; }
.testimonial-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--brand-navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--fs-sm);
}
.testimonial-name { font-family: var(--font-heading); font-weight: 700; color: var(--text-strong); font-size: var(--fs-base); }
.testimonial-role { font-size: var(--fs-xs); color: var(--text-subtle); font-weight: 600; }
.testimonial-rating { color: var(--brand-gold-600); font-size: 0.75rem; margin-bottom: 0.6rem; }
.testimonial-text { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-muted); margin-bottom: 0; }
.testimonial-quote { position: absolute; top: 12px; right: 18px; font-size: 2.75rem; color: var(--brand-gold-100); font-family: Georgia, serif; line-height: 1; }

.stat-counter { font-family: var(--font-heading); font-weight: 800; font-size: clamp(1.75rem, 3vw, 2.4rem); color: var(--brand-gold-700); line-height: 1; }

/* Public footer — solid Ink with Haldi link hover accents */
.site-ft {
    background: #17130F;
    color: #D8CEBE;
    border-top: 3px solid #B5532B;
}
.site-ft a { color: #D8CEBE; text-decoration: none; }
.site-ft a:hover { color: #FAF4EA; }
.ft-brand { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 800; color: #FAF4EA; }
.ft-lnk { font-size: var(--fs-sm); display: block; margin-bottom: 0.55rem; }
.ft-heading { font-family: var(--font-heading); font-size: var(--fs-xs); font-weight: 600; color: #FAF4EA; margin-bottom: 1rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ft-contact-row { display: flex; gap: 0.7rem; margin-bottom: 0.65rem; font-size: var(--fs-sm); align-items: flex-start; }
.ft-contact-row i { color: #F2A516; margin-top: 3px; flex-shrink: 0; }
.soc-btn {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: #221C16;
    border: 1px solid #3B3025;
    color: #F2A516 !important;
    display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none !important;
}
.soc-btn:hover { background: #F2A516; border-color: #F2A516; color: #17130F !important; }
.ft-divider { border-color: #3B3025; margin: 2rem 0 !important; opacity: 1; }
.ft-bottom { font-size: var(--fs-xs); color: #B5A896; }

/* The small shared footer (includes/site_footer.html) */
.site-footer {
    text-align: center;
    font-size: var(--fs-xs);
    padding: 1.25rem 1rem;
    color: var(--text-subtle);
    border-top: 1px solid var(--border);
    background: transparent;
}
.site-footer a { color: var(--text-muted); text-decoration: underline; }
.site-footer--fixed { border-top: 0; }

/* Event detail modal on the home page */
.event-modal-banner { width: 100%; height: 220px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 1.1rem; }
.event-modal-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1.1rem 0; }
.event-modal-meta-item {
    display: flex; gap: 10px; padding: 0.7rem 0.8rem;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    align-items: center;
}
.event-modal-meta-item i { color: var(--brand-gold-600); flex-shrink: 0; }
.event-modal-meta-item span { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
.event-modal-section { margin: 1.1rem 0; }
.event-modal-section h5 { font-weight: 700; color: var(--brand-ink); margin-bottom: 0.4rem; font-size: var(--fs-base); }
.event-modal-section p { font-size: var(--fs-sm); line-height: 1.7; color: var(--text-muted); }
.modal-btn-group { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.modal-btn { flex: 1; padding: 0.55rem 1.1rem; font-weight: 700; border-radius: var(--radius-sm); font-size: var(--fs-sm); border: 1px solid transparent; min-height: var(--control-h); }

/* --------------------------------------------------------------------------
   28. CHAT ASSISTANT (floating)
   -------------------------------------------------------------------------- */
.chat-fab { position: fixed; bottom: 20px; right: 20px; z-index: 1040; }
.chat-btn {
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--brand-navy);
    border: 2px solid var(--brand-gold);
    color: #fff;
    font-size: 1.35rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    position: relative;
}
.chat-btn:hover { background: var(--brand-navy-700); }
.chat-ai-dot {
    position: absolute; top: -3px; right: -3px;
    width: 18px; height: 18px;
    background: var(--brand-gold); color: var(--brand-navy-900);
    border-radius: 50%; border: 2px solid #fff;
    font-size: 0.5rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.chat-win {
    position: absolute; bottom: 68px; right: 0;
    width: min(340px, calc(100vw - 32px));
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: none;
    flex-direction: column;
    max-height: min(480px, 70vh);
}
.chat-win.open { display: flex; }
.chat-head { background: var(--brand-navy); padding: 0.9rem 1.1rem; display: flex; align-items: center; gap: 0.7rem; border-bottom: 3px solid var(--brand-gold); }
.chat-av { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); display: flex; align-items: center; justify-content: center; color: #fff; }
.chat-head-name { font-family: var(--font-heading); font-size: var(--fs-sm); font-weight: 700; color: #fff; margin: 0; }
.chat-head-sub { font-size: 0.7rem; color: var(--text-on-brand-muted); margin: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; background: var(--surface-sunken); }
.bw { display: flex; gap: 8px; }
.bw.user { flex-direction: row-reverse; }
.bb { max-width: 85%; padding: 0.6rem 0.85rem; font-size: var(--fs-sm); line-height: 1.5; }
.bb.bot { background: var(--surface-card); color: var(--text); border: 1px solid var(--border); border-radius: 4px 12px 12px 12px; }
.bb.user { background: var(--brand-navy); color: #fff; border-radius: 12px 4px 12px 12px; }
.chat-row { padding: 0.7rem 0.9rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; background: var(--surface-card); }
.chat-inp { flex: 1; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0.45rem 0.7rem; font-size: var(--fs-sm); background: var(--surface-card); color: var(--text-strong); }
.chat-inp:focus { border-color: var(--brand-navy); outline: none; box-shadow: 0 0 0 3px rgba(0, 24, 94, 0.12); }
.chat-send { width: 36px; height: 36px; background: var(--brand-navy); border: 0; border-radius: var(--radius-sm); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-send:hover { background: var(--brand-navy-700); }
.tdots { display: flex; gap: 4px; padding: 4px 0; }
.tdots span { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-gold); animation: td 0.9s infinite; }
.tdots span:nth-child(2) { animation-delay: 0.15s; }
.tdots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes td { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* --------------------------------------------------------------------------
   29. COMMAND PALETTE (Cmd/Ctrl+K)
   -------------------------------------------------------------------------- */
.command-palette-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0, 10, 46, 0.45);
    display: none; align-items: flex-start; justify-content: center;
    padding: 10vh 1rem 0;
}
.command-palette-overlay.show { display: flex; }
.command-palette-box {
    width: 100%; max-width: 600px;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    color: var(--text);
}
.command-palette-input-wrap { display: flex; align-items: center; gap: 0.6rem; border-bottom: 1px solid var(--divider); padding: 0.85rem 1.1rem; color: var(--text-subtle); }
.command-palette-input { flex: 1; background: none; border: 0; color: var(--text-strong); font-size: 1.05rem; outline: none; }
.command-palette-input::placeholder { color: var(--text-subtle); }
.command-palette-results { max-height: 320px; overflow-y: auto; padding: 0.5rem; }
.command-palette-item { padding: 0.65rem 0.9rem; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 0.75rem; cursor: pointer; color: var(--text); text-decoration: none !important; }
.command-palette-item:hover, .command-palette-item.active { background: var(--brand-navy-50); color: var(--brand-ink); }

.countdown-band {
    background: var(--brand-gold-100);
    color: var(--brand-gold-700);
    border: 1px solid rgba(198, 157, 103, 0.4);
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: var(--fs-sm);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   30. LEGACY COMPONENT ALIASES — older page headers (.topnav / .topbar) render
   as the app bar until each page includes includes/app_bar.html
   -------------------------------------------------------------------------- */
.topnav, nav.topnav, div.topnav, .topbar {
    background: var(--surface-header) !important;
    border-bottom: 3px solid var(--brand-gold) !important;
    color: #fff;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 0 var(--safe-pad-x);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
}
.topnav .brand, .topbar .brand { font-family: var(--font-heading); font-weight: 700; color: #fff; font-size: 1rem; }
.topnav img, .topbar img { height: 34px; width: auto; }
.topnav .nav-links, .topnav .topnav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link-item, .topnav-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    height: 38px; padding: 0 0.8rem;
    border-radius: var(--radius-sm);
    color: var(--text-on-brand-muted);
    font-size: var(--fs-sm); font-weight: 600;
    text-decoration: none;
    background: none; border: 0;
}
.nav-link-item:hover, .topnav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

/* --------------------------------------------------------------------------
   31. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1279.98px) {
    .app-bar__divider, .app-bar__title { display: none; }
}
@media (max-width: 1199.98px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-bar__user span:not(.app-bar__avatar) { display: none; }
}
@media (max-width: 991.98px) {
    :root { --sidebar-width: 0px; --header-height: 58px; }
    .sidebar { width: 272px; transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; width: 100%; }
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* App bar: icon-only links, the menu holds the rest */
    .app-bar__link .app-bar__label { display: none; }
    .app-bar__link { padding: 0 0.65rem; }
    .app-bar__user span:not(.app-bar__avatar) { display: none; }
    .app-bar__sub { display: none; }
}
@media (max-width: 767.98px) {
    body { font-size: 0.9rem; }
    .page-head { align-items: flex-start; }
    .page-head__actions { width: 100%; }
    .app-main { padding-top: var(--sp-4); }
    .card-body, .panel { padding: 1rem; }
    .card-header { padding: 0.8rem 1rem; }
    .modal-footer { flex-direction: column-reverse; align-items: stretch; }
    .modal-footer .btn { width: 100%; }
    .form-row { grid-template-columns: 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
    .stat-tile, .stat-card, .stat-widget { padding: 0.9rem; gap: 0.75rem; }
    .stat-tile__icon, .stat-icon { width: 36px; height: 36px; font-size: 0.95rem; }
    .stat-tile__value, .stat-value { font-size: 1.3rem; }
    .event-modal-meta { grid-template-columns: 1fr; }
    .modal-btn-group { flex-direction: column; }
    .app-bar__divider, .app-bar__title { display: none; }
    .topnav .brand, .topbar .brand { display: none; }
    .nav-link-item:has(i) span, .topnav-link:has(i) span { display: none; }

    /* Opt-in stacked tables: add .table-stack and data-label on each cell */
    .table-stack thead { display: none; }
    .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { border-bottom: 1px solid var(--border); padding: 0.5rem 0; }
    .table-stack td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0.35rem 1rem; text-align: right; }
    .table-stack td::before { content: attr(data-label); font-weight: 600; color: var(--text-subtle); font-size: var(--fs-xs); text-transform: uppercase; text-align: left; }
}
@media (max-width: 479.98px) {
    .grid-4 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .content-wrapper { padding: 0.9rem; }
    .app-bar__inner { gap: var(--sp-2); }
    .app-bar .brand-logo { height: 28px; }
    .app-bar__link { padding: 0 0.5rem; }
    .app-bar--has-back .app-bar__brand { display: none; }
    .app-bar__back .app-bar__label { display: none; }
}

/* --------------------------------------------------------------------------
   32. REDUCED MOTION / PRINT
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
button, a.btn, .nav-link, .form-check-label { touch-action: manipulation; }
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body { padding-bottom: env(safe-area-inset-bottom); }
}
@media print {
    .app-bar, .snav, .navbar, .btn, .modal, .sidebar, .chat-fab, .site-footer, .site-ft, .no-print, #sp-toast-container { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    .card, .panel { box-shadow: none !important; border: 1px solid #ccc !important; }
    .main-content { margin-left: 0; }
}

/* --------------------------------------------------------------------------
   33. MOBILE BOTTOM NAVIGATION + OFFLINE BANNER (components/mobile_nav.html;
       was static/css/mobile.css, which only the home page loaded)
   -------------------------------------------------------------------------- */
.mobile-nav-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 62px;
    background: #17130F;
    border-top: 3px solid #B5532B;
    display: none;
    justify-content: space-around;
    align-items: stretch;
    z-index: 1040;
    padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    color: #D8CEBE;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    background: none;
    border: 0;
    cursor: pointer;
}
.mobile-nav-item i { font-size: 1.15rem; }
.mobile-nav-item:hover, .mobile-nav-item.active, .mobile-nav-item[aria-current="page"] { color: #F2A516; }
.mobile-nav-item--accent, .mobile-nav-item--accent i { color: #D9693A; }
.offline-banner {
    position: fixed; top: 0; left: 0; right: 0;
    background: var(--danger); color: #fff;
    text-align: center; font-size: var(--fs-sm); font-weight: 600;
    padding: 6px 12px; z-index: 2000;
    display: none; align-items: center; justify-content: center; gap: 8px;
}
@media (max-width: 767.98px) {
    body:has(.mobile-nav-bar) { padding-bottom: 72px; }
    /* The bottom bar carries the workspace links on phones; the app bar keeps the
       logo and tools, so the logo is never squeezed (UPG-63) */
    body:has(.mobile-nav-bar) .app-bar__link--ws { display: none; }
    .app-bar__brand { flex-shrink: 0; }
    .mobile-nav-bar { display: flex; }
    body:has(.mobile-nav-bar) .chat-fab { bottom: 80px; }
    body:has(.mobile-nav-bar) #sp-btt { bottom: 80px !important; }
    /* Touch targets: controls, not text links */
    .btn, .nav-link, .ftab, .seg__btn, .dropdown-item { min-height: 44px; }
    /* A finger needs about 44×44 px, and text stays 12 px or more (UPG-364) */
    .app-bar__link { min-width: 44px; height: 44px; justify-content: center; }
    .app-bar__brand, .app-bar__user { min-height: 44px; display: inline-flex; align-items: center; }
    .mobile-nav-item { font-size: 0.75rem; }
    .hsc-cat { min-height: 44px; font-size: 0.8125rem; }
    .pw-toggle { right: 0; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .login-card .form-check { display: flex; align-items: center; gap: 0.25rem; }
    .login-card .form-check-input { width: 1.4em; height: 1.4em; margin-top: 0; }
    .login-card .form-check-label { display: inline-flex; align-items: center; min-height: 44px; padding-left: 0.35rem; }
    .login-card form a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
}
/* A narrow phone fits the 44 px header buttons: the bottom menu does the
   finding, so the search button goes, and the logo keeps its 120 px min width */
@media (max-width: 479.98px) {
    body:has(.mobile-nav-bar) .app-bar__link[data-h-click="palette:open"] { display: none; }
    .app-bar__inner { gap: 4px; padding: 0 8px; }
    .app-bar__brand { padding: 4px 2px; }
    .app-bar .brand-logo { height: 22px; min-width: 120px; }
    .app-bar__nav { gap: 1px; }
    .app-bar__link { position: relative; padding: 0 4px; }
    .app-bar__link--cta { margin-left: 0; }
    .app-bar__user { margin-left: 1px; padding-left: 0; border-left: 0; min-width: 44px; justify-content: center; }
}

/* PWA install sheet (components/mobile_nav.html) */
.pwa-sheet-backdrop {
    display: none; position: fixed; inset: 0; z-index: 100000;
    background: rgba(0, 10, 46, 0.55);
    align-items: flex-end; justify-content: center;
}
.pwa-sheet {
    background: var(--surface-card);
    color: var(--text);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-top: 3px solid var(--brand-gold);
    padding: 24px 22px 32px;
    width: 100%; max-width: 500px;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform var(--t-slow);
}
.pwa-sheet__handle { width: 40px; height: 4px; background: var(--border-strong); border-radius: 2px; margin: 0 auto 18px; }
.pwa-sheet__head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pwa-sheet__head img { border-radius: 12px; border: 2px solid var(--brand-gold); }
.pwa-sheet__title { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--text-strong); }
.pwa-sheet__sub { margin: 0; color: var(--text-subtle); font-size: var(--fs-sm); }
.pwa-sheet__close {
    margin-left: auto; background: var(--surface-muted); border: 0; border-radius: 50%;
    width: 34px; height: 34px; color: var(--text-muted); font-size: 18px; cursor: pointer; flex-shrink: 0;
}
.pwa-sheet__list { background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.pwa-sheet__list div { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--text); }
.pwa-sheet__list i { color: var(--brand-gold-600); width: 16px; text-align: center; }
.pwa-step { display: flex; align-items: center; gap: 12px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.pwa-step__num { width: 26px; height: 26px; background: var(--brand-navy); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--fs-xs); flex-shrink: 0; }
.pwa-step p { margin: 0; font-size: var(--fs-sm); }
.pwa-step strong { color: var(--brand-ink); }
.pwa-step small { color: var(--text-subtle); }

/* --------------------------------------------------------------------------
   34. SHARE STRIP (includes/share_strip.html)
   -------------------------------------------------------------------------- */
.share-strip-wrap { margin-top: var(--sp-4); }
.share-strip-wrap__label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-subtle); font-weight: 700; margin-bottom: var(--sp-2); }
.share-strip-wrap__btns { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.shr-cp.copied { background: var(--success-soft); color: var(--success-text); border-color: rgba(22, 163, 74, 0.35); }

/* --------------------------------------------------------------------------
   35. TOURNAMENT FIXTURES (includes/tournament.html)
   -------------------------------------------------------------------------- */
.match-card { padding: 0.65rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-card); font-size: var(--fs-sm); }
.match-card--done { background: var(--surface-sunken); }
.match-result { margin-top: 4px; font-size: var(--fs-xs); font-weight: 700; color: #15803d; }  /* who won (UPG-456) */
.match-result .fa-trophy { color: #ca8a04; }
.match-card .text-muted { font-size: var(--fs-xs); }
.match-score { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-muted); color: var(--text-strong); border-radius: var(--radius-xs); padding: 1px 6px; }

/* --------------------------------------------------------------------------
   36. CHOICE FIELDS — radio / checkbox lists used by registration forms
   -------------------------------------------------------------------------- */
.choice-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.choice-item, .single-check {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    cursor: pointer;
    user-select: none;
    transition: border-color var(--t-fast), background var(--t-fast);
    font-weight: 400;
}
.choice-item:hover, .single-check:hover { border-color: var(--text-subtle); }
.choice-item input, .single-check input { width: 18px; height: 18px; accent-color: var(--brand-navy); flex-shrink: 0; cursor: pointer; margin: 0; }
.choice-item span, .single-check span { font-size: var(--fs-base); color: var(--text); }
.choice-item:has(input:checked), .single-check:has(input:checked) { border-color: var(--brand-navy); background: var(--brand-navy-50); }
.choice-item:has(input:checked) span { color: var(--text-strong); font-weight: 600; }
.choice-item:has(input:focus-visible), .single-check:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.field-error { color: var(--danger-text); font-size: var(--fs-sm); margin-top: 4px; font-weight: 500; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-heading { font-family: var(--font-heading); font-size: var(--fs-md); font-weight: 700; color: var(--text-strong); margin: var(--sp-6) 0 var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--divider); }
.field-paragraph { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: var(--sp-3); line-height: 1.55; }
.field-divider { border: 0; border-top: 1px solid var(--divider); margin: var(--sp-6) 0; opacity: 1; }

/* --------------------------------------------------------------------------
   37. STATUS PAGES (layouts/status.html)
   -------------------------------------------------------------------------- */
body.status-page { background: var(--surface-page); min-height: 100vh; }
.status-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px 64px; }
.status-card { width: 100%; max-width: 440px; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; text-align: center; }
.status-card__brand { background: var(--brand-navy); border-bottom: 3px solid var(--brand-gold); padding: 16px; display: flex; justify-content: center; }
.status-card__body { padding: 28px 28px 30px; }
.status-card__icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 1.6rem; background: var(--brand-navy-50); color: var(--brand-ink); }
.status-card--success .status-card__icon { background: var(--success-soft); color: var(--success); }
.status-card--warning .status-card__icon { background: var(--warning-soft); color: var(--warning); }
.status-card--danger .status-card__icon { background: var(--danger-soft); color: var(--danger); }
.status-card--info .status-card__icon { background: var(--info-soft); color: var(--info); }
.status-card h1 { font-size: 1.35rem; margin-bottom: 8px; }
.status-card p { color: var(--text-muted); font-size: var(--fs-base); }
.status-card .status-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.status-card .info-row { display: flex; justify-content: space-between; gap: 12px; background: var(--surface-sunken); border: 1px solid var(--divider); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; font-size: var(--fs-sm); text-align: left; }
.status-card .info-label { color: var(--text-subtle); font-weight: 600; }
.status-card .info-val { color: var(--text-strong); font-weight: 700; text-align: right; }
.status-card form { text-align: left; }

/* --------------------------------------------------------------------------
   38. PROSE — long-form documents (privacy notice, terms, API docs)
   -------------------------------------------------------------------------- */
.prose { max-width: 820px; line-height: 1.75; color: var(--text); }
.prose h2 { font-size: var(--fs-lg); margin: var(--sp-8) 0 var(--sp-3); color: var(--text-strong); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--fs-md); margin: var(--sp-6) 0 var(--sp-2); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.35rem; }
.prose a { color: var(--brand-navy-700); font-weight: 500; }
.prose table { width: 100%; border-collapse: collapse; margin: var(--sp-4) 0; font-size: var(--fs-sm); }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.55rem 0.75rem; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-sunken); color: var(--text-muted); font-weight: 600; }

/* --------------------------------------------------------------------------
   39. NOTIFICATION PANEL (app bar bell, static/js/notifications.js)
   -------------------------------------------------------------------------- */
.notif-wrap { position: relative; }
.notif-panel {
    position: absolute; right: 0; top: calc(100% + 8px);
    width: min(360px, calc(100vw - 24px));
    background: var(--surface-card); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); overflow: hidden;
    z-index: calc(var(--z-header) + 1);
}
.notif-panel__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--divider); background: var(--surface-sunken); font-size: var(--fs-sm); font-weight: 700; color: var(--text-strong); }
.notif-panel__head i { color: var(--brand-gold-600); }
.notif-panel__list { max-height: 360px; overflow-y: auto; }
.notif-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--divider); text-decoration: none; color: var(--text); }
.notif-item:hover { background: var(--hover-bg); color: var(--text-strong); }
.notif-item.is-unread { background: var(--brand-navy-50); box-shadow: inset 3px 0 0 var(--brand-gold); }
.notif-item__title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-strong); }
.notif-item.is-unread .notif-item__title { font-weight: 700; }
.notif-item__body { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 2px; }
.notif-empty { padding: 22px 14px; text-align: center; color: var(--text-subtle); font-size: var(--fs-sm); }
@media (max-width: 575.98px) { .notif-panel { position: fixed; right: 12px; left: 12px; top: calc(var(--header-height) + 6px); width: auto; } }

/* --------------------------------------------------------------------------
   40. TABLE CARD — a card that holds a data table
   -------------------------------------------------------------------------- */
.table-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); overflow: hidden; }
.table-card > .table-responsive, .table-card .table-responsive { border: 0; border-radius: 0; }
.table-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 0.9rem var(--card-pad); border-bottom: 1px solid var(--divider); }
.table-card__title { font-family: var(--font-heading); font-size: var(--fs-md); font-weight: 700; color: var(--text-strong); margin: 0; }

/* --------------------------------------------------------------------------
   41. SOFT BACKGROUND UTILITIES (icon wells on light cards)
   -------------------------------------------------------------------------- */
.bg-primary-light { background: var(--brand-navy-50) !important; color: var(--brand-ink) !important; }
.bg-success-light { background: var(--success-soft) !important; color: var(--success-text) !important; }
.bg-warning-light { background: var(--brand-gold-100) !important; color: var(--brand-gold-700) !important; }
.bg-secondary-light { background: var(--surface-muted) !important; color: var(--text-muted) !important; }
.bg-white-opacity-20 { background: rgba(255, 255, 255, 0.16) !important; }
.avatar-lg { width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar-lg .fa-2x { font-size: 1.4rem; }

/* Narrow single-column forms (UPG-63) */
.form-narrow { max-width: 480px; }

/* Keyboard focus is never lost (UPG-63): page styles that set `outline: none` on
   custom inputs load after this file, so the guarantee needs !important. Bootstrap
   form controls keep their own focus ring. */
:is(input, select, textarea, [contenteditable]):not(.form-control):not(.form-select):not(.form-check-input):not(.btn-check):focus-visible {
    outline: 2px solid var(--brand-gold-700) !important;
    outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   42. AVATARS / PROFILE PHOTOS (UPG-71) — includes/ui.html avatar(); photo,
       brand preset (static/img/avatars/) or initials
   -------------------------------------------------------------------------- */
.se-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.se-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.se-avatar--initials { background: var(--brand-gold); color: var(--brand-navy-900); font-family: var(--font-heading); font-weight: 700; }
.app-bar__avatar.se-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }

/* --------------------------------------------------------------------------
   43. PROFILE HERO (includes/ui.html profile_hero) — navy arena banner, the
       person's photo overlapping its lower edge
   -------------------------------------------------------------------------- */
.profile-hero { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-xs); margin-bottom: var(--grid-gap, 20px); }
.profile-hero__banner { display: flex; align-items: center; justify-content: center; height: 180px; position: relative; border-bottom: 4px solid #B5532B; background: #17130F; padding: 24px; }
.profile-hero__banner img { display: block; width: auto; height: 34px; min-width: 120px; max-width: 80%; object-fit: contain; box-shadow: none !important; }
/* UPG-297 (d): on the student dashboard the banner is a compact strip */
.profile-hero[data-banner="short"] .profile-hero__banner { height: 112px; padding: 16px; }
.profile-hero[data-banner="short"] .profile-hero__banner img { height: 28px; min-width: 120px; }
@media (max-width: 767.98px) { .profile-hero[data-banner="short"] .profile-hero__banner { height: 88px; } .profile-hero[data-banner="short"] .profile-hero__banner img { height: 24px; min-width: 120px; } }
.profile-hero__body { padding: 0 24px 22px; position: relative; }
.profile-hero__avatar-wrap { position: relative; width: 120px; height: 120px; margin-top: -60px; z-index: 1; }
.profile-hero__avatar { width: 120px; height: 120px; border: 4px solid var(--surface-card); box-shadow: var(--shadow-sm); font-size: 2.4rem; }
.profile-hero__photo-btn { position: absolute; right: 2px; bottom: 4px; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-navy); color: #fff; border: 2px solid var(--surface-card); display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; text-decoration: none; }
.profile-hero__photo-btn:hover { background: var(--brand-navy-900); color: #fff; }
.profile-hero__name { font-size: 1.35rem; margin: 12px 0 2px; }
.profile-hero__email { font-size: var(--fs-sm); color: var(--text-muted); margin: 0 0 12px; }
@media (max-width: 767.98px) {
    .profile-hero__body { padding: 0 16px 16px; }
    .profile-hero__avatar-wrap, .profile-hero__avatar { width: 92px; height: 92px; }
    .profile-hero__avatar-wrap { margin-top: -46px; }
    .profile-hero__avatar { font-size: 1.9rem; }
}

/* The live refresh shows and hides with the hidden attribute (UPG-267); buttons and
   flex rows set their own display, so say it once for the live regions. */
[data-live-action][hidden], [data-live-locked][hidden], [data-live-explanation][hidden],
[data-live-status][hidden], [data-live-when-known][hidden] { display: none !important; }

/* A team logo beside its name in fixtures, tables and the scoreboard (UPG-386) */
.team-logo { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; border-radius: 4px; }

/* What the points table's letters mean (UPG-425) */
.table-key__letters { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.table-key__letters > div { display: flex; gap: 4px; }
.table-key__letters dt { font-weight: 700; color: var(--bs-body-color, #222); }
.table-key__letters dd { margin: 0; }

/* SP-15: a points table fits a 390 px phone without scrolling sideways */
.points-table { font-variant-numeric: tabular-nums; }
.points-table thead th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.points-table td:not(:nth-child(2)), .points-table th:not(:nth-child(2)) { text-align: center; }
@media (max-width: 576px) {
  .points-table th, .points-table td { padding: .45rem .3rem; font-size: .85rem; width: auto !important; }
  .points-table td:nth-child(2) { overflow-wrap: anywhere; min-width: 7.5rem; }
  .points-table .team-logo { width: 20px; height: 20px; }
}
/* SP-15: the players' points tables, compact on a phone */
.stats-table { font-variant-numeric: tabular-nums; }
.stats-table thead th { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; white-space: normal; vertical-align: bottom; }
@media (max-width: 576px) {
  .stats-table th, .stats-table td { padding: .4rem .25rem; font-size: .82rem; }
  .stats-table td strong { overflow-wrap: anywhere; }
}
@media (max-width: 576px) { .stats-table--team th:nth-child(5), .stats-table--team td:nth-child(5) { display: none; } }

/* SP-57: "Scored on MittiToMat" on a free tournament's public pages */
.scored-on { margin: 1rem 0 0; font-size: 0.85rem; color: #6B6259; text-align: center; }
.scored-on a { color: #B5532B; font-weight: 700; }

/* SP-60: English, ಕನ್ನಡ, हिन्दी on the sports pages */
.lang-switch { display: flex; justify-content: flex-end; gap: 0.25rem; margin: 0 0 0.5rem; }
.lang-switch__btn { border: 1px solid #D9CFC1; background: #FFFDF8; color: #3B332B; border-radius: 999px;
  padding: 0.15rem 0.7rem; font-size: 0.85rem; min-height: 32px; }
.lang-switch__btn[aria-pressed="true"] { background: #B5532B; border-color: #B5532B; color: #fff; }

/* SP-68: a status card inside the classic layout (the app bar and footer around it) */
.status-wrap--classic { min-height: 0; padding: 24px 0 48px; }
