/* ==========================================================================
   Team Oetti – Design System
   ========================================================================== */

:root {
    --color-primary: #0f2557;
    --color-primary-dark: #0a1a3d;
    --color-primary-light: #1c3f7a;
    --color-accent: #f5a623;
    --color-accent-dark: #d98c0f;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-warning: #f59e0b;
    --color-info: #0891b2;

    --color-bg: #f2f5fb;
    --color-surface: #ffffff;
    --color-surface-alt: #f7f9fd;
    --color-text: #151b2e;
    --color-text-muted: #64748b;
    --color-border: #e3e8f1;

    --radius-lg: 1.1rem;
    --radius: 0.8rem;
    --radius-sm: 0.5rem;

    --shadow-sm: 0 1px 2px rgba(15, 37, 87, 0.06);
    --shadow-md: 0 10px 25px -8px rgba(15, 37, 87, 0.16);
    --shadow-lg: 0 25px 50px -12px rgba(15, 37, 87, 0.25);

    --font-heading: 'Poppins', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;

    --nav-height: 64px;
    --bottom-nav-height: 64px;
}

[data-theme="dark"] {
    --color-bg: #0a0f1e;
    --color-surface: #121a2e;
    --color-surface-alt: #16203a;
    --color-text: #e8ecf7;
    --color-text-muted: #8b96b4;
    --color-border: #223052;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 25px -8px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   Base
   ========================================================================== */

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    transition: background-color .25s ease, color .25s ease;
    padding-bottom: 0;
}

body.has-bottom-nav {
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
}

body.js-loading { visibility: hidden; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

a { color: var(--color-primary-light); }
[data-theme="dark"] a { color: #7fa4ff; }

::selection { background: var(--color-accent); color: #1a1a1a; }

.text-muted, .small.text-muted { color: var(--color-text-muted) !important; }

.page-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted);
    margin-bottom: .9rem;
}

/* ==========================================================================
   Topbar
   ========================================================================== */

.oetti-topbar {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 0 1rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.oetti-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    white-space: nowrap;
}

.oetti-brand .brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--color-accent);
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.oetti-topbar-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
    color: #fff;
    border: none;
    text-decoration: none;
    transition: background .2s ease, transform .15s ease;
    flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255,255,255,.18); color: #fff; transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }

.user-chip {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.08);
    color: #fff;
    padding: .35rem .8rem .35rem .5rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
}
.user-chip .avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 800;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    margin: 0 -1rem 1.75rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hero img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,37,87,0) 0%, rgba(10,20,40,.55) 75%, rgba(8,14,30,.85) 100%);
}

.hero-content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 1.1rem 1.25rem;
    color: #fff;
    z-index: 2;
}

.hero-content .eyebrow {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--color-accent);
    font-weight: 700;
}

.hero-content h1 {
    color: #fff;
    font-size: 1.7rem;
    margin: .15rem 0 0;
}

@media (min-width: 768px) {
    .hero { margin: 0 0 2rem; border-radius: var(--radius-lg); }
    .hero img { height: 280px; }
    .hero-content { padding: 1.75rem 2rem; }
    .hero-content h1 { font-size: 2.3rem; }
}

/* ==========================================================================
   Tab navigation
   ========================================================================== */

.oetti-tabs {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: .25rem .1rem 1rem;
    margin-bottom: .75rem;
    -webkit-overflow-scrolling: touch;
}
.oetti-tabs::-webkit-scrollbar { display: none; }

.oetti-tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1.05rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .9rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    text-decoration: none;
    white-space: nowrap;
    transition: all .18s ease;
}
.oetti-tab:hover { color: var(--color-primary); border-color: var(--color-primary-light); }
.oetti-tab.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}
.oetti-tab .live-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #ff5a5a;
    animation: pulse-dot 1.4s infinite;
    flex-shrink: 0;
}
.oetti-tab .badge-count {
    background: rgba(255,255,255,.25);
    border-radius: 999px;
    font-size: .72rem;
    padding: .05rem .4rem;
}
.oetti-tab:not(.active) .badge-count {
    background: var(--color-primary);
    color: #fff;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .4; transform: scale(.75); }
}

/* mobile bottom nav */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: none;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -8px 24px rgba(15,37,87,.08);
    padding: .4rem .25rem calc(.4rem + env(safe-area-inset-bottom));
    z-index: 1030;
}
.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    padding: .35rem 0;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: .68rem;
    font-weight: 600;
    position: relative;
}
.bottom-nav-item i { font-size: 1.05rem; }
.bottom-nav-item.active { color: var(--color-primary); }
[data-theme="dark"] .bottom-nav-item.active { color: #7fa4ff; }
.bottom-nav-item .live-dot {
    position: absolute;
    top: 0; right: 22%;
    width: 7px; height: 7px; border-radius: 50%;
    background: #ff5a5a;
    animation: pulse-dot 1.4s infinite;
}

@media (max-width: 767.98px) {
    .bottom-nav { display: block; }
}

/* admin scrollable tabs already covered by .oetti-tabs */

/* ==========================================================================
   Cards / surfaces
   ========================================================================== */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.surface-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem;
}

.card-header {
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

.bg-light { background: var(--color-surface-alt) !important; color: var(--color-text); }

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--color-text-muted);
}
.empty-state i { font-size: 2.2rem; color: var(--color-border); margin-bottom: .75rem; display: block; }

/* Widgets */
.widget-row { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .widget-row { grid-template-columns: repeat(3, 1fr); } }

.widget-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: .9rem;
}
.widget-card .widget-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}
.widget-icon.gold { background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark)); }
.widget-icon.navy { background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary)); }
.widget-icon.green { background: linear-gradient(135deg, #22c55e, var(--color-success)); }

.widget-card .widget-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); font-weight: 700; }
.widget-card .widget-value { font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.widget-card .widget-sub { font-size: .78rem; color: var(--color-text-muted); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn { border-radius: var(--radius-sm); font-weight: 600; }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--color-primary-light); border-color: var(--color-primary-light); }
.btn-success { background: var(--color-success); border-color: var(--color-success); }
.btn-info { background: var(--color-info); border-color: var(--color-info); color: #fff; }
.btn-info:hover { color: #fff; filter: brightness(1.08); }
.btn-outline-secondary, .btn-outline-primary, .btn-outline-danger { border-radius: var(--radius-sm); }

.btn-warning, .btn-accent {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-primary-dark);
}
.btn-warning:hover, .btn-accent:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); color: var(--color-primary-dark); }

/* ==========================================================================
   Pill badges (role / status)
   ========================================================================== */

.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .65rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.4;
}
.pill-badge.role-torwart { background: rgba(8, 145, 178, .15); color: #0e7490; }
.pill-badge.role-schuetze { background: var(--color-surface-alt); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.pill-badge.status-active { background: rgba(22, 163, 74, .15); color: #15803d; }
.pill-badge.status-inactive { background: var(--color-surface-alt); color: var(--color-text-muted); border: 1px solid var(--color-border); }
[data-theme="dark"] .pill-badge.role-torwart { background: rgba(8, 145, 178, .22); color: #67e8f9; }
[data-theme="dark"] .pill-badge.status-active { background: rgba(22, 163, 74, .22); color: #86efac; }

/* ==========================================================================
   Status banner (e.g. active round indicator)
   ========================================================================== */

.status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(8, 145, 178, .12), rgba(15, 37, 87, .05));
    border: 1px solid rgba(8, 145, 178, .25);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.status-banner h5 { margin: 0; color: var(--color-text); }
[data-theme="dark"] .status-banner { background: linear-gradient(135deg, rgba(8, 145, 178, .18), rgba(15, 37, 87, .2)); border-color: rgba(8, 145, 178, .35); }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-control, .form-select {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 .2rem rgba(28, 63, 122, .15);
    background: var(--color-surface);
    color: var(--color-text);
}
[data-theme="dark"] .form-control::placeholder { color: #5c6889; }
.form-label { font-weight: 600; font-size: .85rem; color: var(--color-text-muted); }

.form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }

.ss-main {
    background: var(--color-surface) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-sm) !important;
    min-height: 42px;
}
.ss-content { background: var(--color-surface) !important; border-color: var(--color-border) !important; color: var(--color-text); }
.ss-main .ss-values .ss-value { background: var(--color-primary) !important; border-radius: 999px !important; }

/* ==========================================================================
   Tables
   ========================================================================== */

.table { color: var(--color-text); }
.table > :not(caption) > * > * { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: var(--color-surface-alt); }
.table thead th {
    border-bottom: 2px solid var(--color-border);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--color-text-muted);
    font-weight: 700;
}
.table-responsive { border-radius: var(--radius); }

/* ==========================================================================
   Accordion
   ========================================================================== */

.accordion-item { background: var(--color-surface); border-color: var(--color-border); }
.accordion-button {
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
}
.accordion-button:not(.collapsed) {
    background: var(--color-surface-alt);
    color: var(--color-primary);
    box-shadow: none;
}
.accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(28,63,122,.15); }
.accordion-button::after { filter: none; }
[data-theme="dark"] .accordion-button::after { filter: invert(1) brightness(1.6); }
.accordion-button.bg-success-subtle { background-color: rgba(22,163,74,.12) !important; }
.accordion-button.bg-danger-subtle { background-color: rgba(220,38,38,.12) !important; }
.accordion-body { background: var(--color-surface); }

/* ==========================================================================
   List groups
   ========================================================================== */

.list-group-item {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.list-group-item.table-secondary { background: var(--color-surface-alt) !important; }

/* ==========================================================================
   Live / stat icons
   ========================================================================== */

.blinking-live { animation: pulse-dot 1.5s linear infinite; color: #ff5a5a; font-weight: bold; }

.stat-icon { font-size: 1.3rem; margin: 0 2px; }
.legend-item { margin-right: 1.5rem; white-space: nowrap; }
.player-stat-icons { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; }
.player-name { font-weight: 600; }

.live-score-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--color-primary);
    color: #fff;
    padding: .3rem .9rem;
    border-radius: 999px;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* ==========================================================================
   Alerts / flash toasts
   ========================================================================== */

.alert { border-radius: var(--radius-sm); border: 1px solid transparent; }
.alert h1, .alert h2, .alert h3, .alert h4, .alert h5, .alert h6 { color: inherit; font-family: var(--font-heading); }
.alert .btn-close { filter: none; }
[data-theme="dark"] .alert .btn-close { filter: invert(1) brightness(1.8); }

.alert-info { background: rgba(8, 145, 178, .12); color: #0e7490; border-color: rgba(8, 145, 178, .25); }
.alert-success { background: rgba(22, 163, 74, .12); color: #15803d; border-color: rgba(22, 163, 74, .25); }
.alert-warning { background: rgba(245, 158, 11, .15); color: #92400e; border-color: rgba(245, 158, 11, .3); }
.alert-danger { background: rgba(220, 38, 38, .12); color: #b91c1c; border-color: rgba(220, 38, 38, .25); }

[data-theme="dark"] .alert-info { background: rgba(8, 145, 178, .18); color: #7dd3fc; border-color: rgba(8, 145, 178, .35); }
[data-theme="dark"] .alert-success { background: rgba(22, 163, 74, .18); color: #86efac; border-color: rgba(22, 163, 74, .35); }
[data-theme="dark"] .alert-warning { background: rgba(245, 158, 11, .2); color: #fcd34d; border-color: rgba(245, 158, 11, .35); }
[data-theme="dark"] .alert-danger { background: rgba(220, 38, 38, .18); color: #fca5a5; border-color: rgba(220, 38, 38, .35); }

.flash-stack {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    right: 12px;
    left: 12px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}
.flash-stack .alert {
    pointer-events: auto;
    box-shadow: var(--shadow-md);
    max-width: 420px;
    margin: 0 0 0 auto;
    animation: toast-in .25s ease;
}
@media (max-width: 480px) { .flash-stack .alert { max-width: 100%; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-content { background: var(--color-surface); color: var(--color-text); border-radius: var(--radius); border: 1px solid var(--color-border); }
.modal-header, .modal-footer { border-color: var(--color-border); }
.btn-close { filter: none; }
[data-theme="dark"] .btn-close { filter: invert(1) brightness(1.8); }

.dropdown-menu {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
}
.dropdown-item { color: var(--color-text); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--color-surface-alt); color: var(--color-text); }
.dropdown-divider { border-color: var(--color-border); }
.form-check-label { color: var(--color-text); font-weight: 500; }

/* ==========================================================================
   Auth pages
   ========================================================================== */

.auth-wrapper {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 15% 15%, rgba(245,166,35,.12), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(28,63,122,.18), transparent 45%);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem 1.75rem;
}
.auth-card .brand-badge-lg {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: var(--color-primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-sm);
}
.auth-card h2 { text-align: center; font-size: 1.4rem; margin-bottom: .25rem; }
.auth-card .auth-sub { text-align: center; color: var(--color-text-muted); font-size: .88rem; margin-bottom: 1.5rem; }

/* ==========================================================================
   Footer
   ========================================================================== */

.oetti-footer {
    text-align: center;
    padding: 1.5rem 1rem 2rem;
    color: var(--color-text-muted);
    font-size: .82rem;
}

/* ==========================================================================
   Filter form
   ========================================================================== */

.filter-form .btn { border-radius: var(--radius-sm); }

/* ==========================================================================
   Chart container
   ========================================================================== */

.chart-container { width: 100%; max-width: 900px; margin: auto; }

/* ==========================================================================
   Instagram embed
   ========================================================================== */

.insta-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.insta-card-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .9rem 1.1rem;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    color: #fff;
}
.insta-card-header i { font-size: 1.2rem; }
.insta-card-header .handle { font-weight: 700; font-size: .92rem; }
.insta-card-header .visit-link { margin-left: auto; color: #fff; opacity: .9; font-size: .8rem; text-decoration: none; }
.insta-card-header .visit-link:hover { opacity: 1; text-decoration: underline; }
.insta-frame-wrap { background: #fff; padding: .5rem; flex: 1; }
.insta-frame { border: 0; border-radius: var(--radius-sm); display: block; width: 100%; }

/* ==========================================================================
   Admin sidebar shell
   ========================================================================== */

.admin-shell { display: flex; align-items: flex-start; }

.admin-sidebar {
    width: 250px;
    flex-shrink: 0;
    padding: 1.25rem .9rem 2rem;
    border-right: 1px solid var(--color-border);
    min-height: calc(100vh - var(--nav-height));
    display: none;
}
@media (min-width: 992px) { .admin-sidebar { display: block; } }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .85rem;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: .88rem;
    text-decoration: none;
    margin-bottom: .2rem;
    transition: background .15s ease, color .15s ease;
}
.sidebar-link i { width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-link:hover { background: var(--color-surface-alt); color: var(--color-text); }
.sidebar-link.active { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }

.sidebar-group-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--color-text-muted);
    font-weight: 700;
    margin: 1.25rem .85rem .5rem;
}
.sidebar-divider { border-top: 1px solid var(--color-border); margin: 1rem .85rem; }

.admin-content { flex: 1; min-width: 0; padding: 1.25rem 1rem 3rem; }
@media (min-width: 992px) { .admin-content { padding: 1.75rem 2rem 3.5rem; } }

.offcanvas { background: var(--color-surface); color: var(--color-text); }
.offcanvas-header { border-bottom: 1px solid var(--color-border); }
.offcanvas .sidebar-link { font-size: .95rem; }

/* ==========================================================================
   Segmented control
   ========================================================================== */

.segmented {
    display: inline-flex;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: .25rem;
    gap: .15rem;
    flex-wrap: wrap;
}
.segmented-item {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: .82rem;
    padding: .45rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.segmented-item:hover { color: var(--color-text); }
.segmented-item.active { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }

/* ==========================================================================
   Leaderboard
   ========================================================================== */

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .7rem .5rem;
    border-bottom: 1px solid var(--color-border);
}
.leaderboard-row:last-child { border-bottom: none; }

.rank-badge {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: .8rem;
    flex-shrink: 0;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}
.rank-badge.rank-1 { background: linear-gradient(135deg, #ffd76a, #f5a623); color: #6b3d00; border-color: transparent; }
.rank-badge.rank-2 { background: linear-gradient(135deg, #e2e8f0, #b9c2d1); color: #37414f; border-color: transparent; }
.rank-badge.rank-3 { background: linear-gradient(135deg, #e6b98a, #c9834a); color: #4a2a0d; border-color: transparent; }

.leaderboard-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-info .lb-name { font-weight: 700; font-size: .92rem; }
.leaderboard-info .lb-meta { font-size: .74rem; color: var(--color-text-muted); }

.leaderboard-stat { text-align: right; flex-shrink: 0; min-width: 64px; }
.leaderboard-stat .lb-value { font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; }
.leaderboard-stat .lb-label { font-size: .68rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .03em; }

/* ==========================================================================
   Mini progress bar
   ========================================================================== */

.mini-bar-wrap { display: flex; align-items: center; gap: .5rem; min-width: 110px; }
.mini-bar-track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    overflow: hidden;
}
.mini-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary)); }
.mini-bar-fill.fill-accent { background: linear-gradient(90deg, var(--color-accent), var(--color-accent-dark)); }
.mini-bar-value { font-size: .78rem; font-weight: 700; min-width: 42px; text-align: right; }

/* ==========================================================================
   Stat summary tiles
   ========================================================================== */

.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
@media (min-width: 576px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stat-tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    text-align: center;
}
.stat-tile .st-value { font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem; color: var(--color-primary); }
[data-theme="dark"] .stat-tile .st-value { color: #7fa4ff; }
.stat-tile .st-label { font-size: .72rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .15rem; }

/* ==========================================================================
   Utility
   ========================================================================== */

.fade-in { animation: fade-in .3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) {
    h1 { font-size: 1.6rem; }
    .filter-form .btn { width: 100%; }
    .btn-lg { font-size: 1rem; padding: .75rem 1rem; }
}
