/* ============================================================
   FightReg — App Styles
   ============================================================ */

/* ── Font Size Levels ──────────────────────── */
html { font-size: 16px; }
html.fs-sm { --fs: 0.92; }
html.fs-md { --fs: 1.08; }
html.fs-lg { --fs: 1.28; }
html.fs-xl { --fs: 1.48; }
:root { --fs: 1.08; }

/* ── Spacing Tokens (scale with --fs) ─────── */
:root {
    --sp-2: calc(2px * var(--fs));
    --sp-4: calc(4px * var(--fs));
    --sp-6: calc(6px * var(--fs));
    --sp-8: calc(8px * var(--fs));
    --sp-10: calc(10px * var(--fs));
    --sp-12: calc(12px * var(--fs));
    --sp-14: calc(14px * var(--fs));
    --sp-16: calc(16px * var(--fs));
    --sp-20: calc(20px * var(--fs));
    --sp-24: calc(24px * var(--fs));
    --sp-32: calc(32px * var(--fs));
}
body { font-size: calc(14px * var(--fs)); line-height: calc(1.5 * var(--fs)); }
h1, .hero-title { font-size: calc(36px * var(--fs)) !important; }
h2, .page-title { font-size: calc(22px * var(--fs)) !important; }
h3, .cat-section-title { font-size: calc(15px * var(--fs)) !important; }
.stat-value { font-size: calc(32px * var(--fs)) !important; }
.stat-label { font-size: calc(11px * var(--fs)) !important; }
.btn { font-size: calc(13px * var(--fs)); padding: calc(9px * var(--fs)) calc(16px * var(--fs)); }
.btn-sm { font-size: calc(12px * var(--fs)); padding: calc(5px * var(--fs)) calc(11px * var(--fs)); }
.btn-lg { font-size: calc(15px * var(--fs)); }
.form-input, .form-select { font-size: calc(14px * var(--fs)); padding: calc(10px * var(--fs)) calc(13px * var(--fs)); }
.form-label { font-size: calc(10px * var(--fs)) !important; }
table { font-size: calc(13px * var(--fs)); }
th { font-size: calc(10px * var(--fs)) !important; }
td { font-size: calc(13px * var(--fs)); padding: calc(10px * var(--fs)) calc(14px * var(--fs)); }
.tab-btn { font-size: calc(13px * var(--fs)); padding: calc(8px * var(--fs)) calc(16px * var(--fs)); }
.badge { font-size: calc(11px * var(--fs)); }
.cat-chip { font-size: calc(12px * var(--fs)); padding: calc(6px * var(--fs)) calc(12px * var(--fs)); }
.card { font-size: calc(14px * var(--fs)); }
.participant-card * { font-size: inherit; }
.participant-card { font-size: calc(14px * var(--fs)); line-height: calc(1.5 * var(--fs)); }
.hero-text { font-size: calc(16px * var(--fs)) !important; }
.hero-date { font-size: calc(14px * var(--fs)) !important; }
.feature-title { font-size: calc(16px * var(--fs)) !important; }
.feature-desc { font-size: calc(13px * var(--fs)) !important; }
.navbar-brand { font-size: calc(16px * var(--fs)); }
.toast { font-size: calc(14px * var(--fs)); }

/* ── Accent Colors (Primary) ──────────────── */
:root, [data-accent="red"]     { --primary: #e63946; --primary-hover: #d62839; --primary-rgb: 230,57,70;  --sb-bg: #1a1a2e; --sb-border: rgba(255,255,255,.08); }
[data-accent="blue"]           { --primary: #2563eb; --primary-hover: #1d4ed8; --primary-rgb: 37,99,235;  --sb-bg: #131a2e; --sb-border: rgba(255,255,255,.08); }
[data-accent="teal"]           { --primary: #0d9488; --primary-hover: #0f766e; --primary-rgb: 13,148,136; --sb-bg: #0f1f1e; --sb-border: rgba(255,255,255,.08); }
[data-accent="violet"]         { --primary: #7c3aed; --primary-hover: #6d28d9; --primary-rgb: 124,58,237; --sb-bg: #1a152e; --sb-border: rgba(255,255,255,.08); }
[data-accent="orange"]         { --primary: #ea580c; --primary-hover: #c2410c; --primary-rgb: 234,88,12;  --sb-bg: #1e1710; --sb-border: rgba(255,255,255,.08); }
[data-accent="emerald"]        { --primary: #059669; --primary-hover: #047857; --primary-rgb: 5,150,105;  --sb-bg: #0e1e18; --sb-border: rgba(255,255,255,.08); }
[data-accent="rose"]           { --primary: #e11d48; --primary-hover: #be123c; --primary-rgb: 225,29,72;  --sb-bg: #1e1320; --sb-border: rgba(255,255,255,.08); }
[data-accent="amber"]          { --primary: #d97706; --primary-hover: #b45309; --primary-rgb: 217,119,6;  --sb-bg: #1e1a0e; --sb-border: rgba(255,255,255,.08); }
[data-accent="slate"]          { --primary: #475569; --primary-hover: #334155; --primary-rgb: 71,85,105;  --sb-bg: #161a20; --sb-border: rgba(255,255,255,.08); }
[data-accent="cyan"]           { --primary: #0891b2; --primary-hover: #0e7490; --primary-rgb: 8,145,178;  --sb-bg: #0e1a20; --sb-border: rgba(255,255,255,.08); }

/* ── Dark Theme (Default) ──────────────────── */
:root,
[data-theme="dark"] {
    --bg: #0a0a19;
    --bg-card: #13132a;
    --bg-card-hover: #1a1a35;
    --bg-input: #1c1c38;
    --bg-select: #1c1c38;
    --bg-navbar: #0c0c1e;
    --bg-switch: #1e1e38;
    --border: #2e2e52;
    --border-focus: var(--primary);
    --border-hover: #3a3a62;
    --text: #f1faee;
    --text-muted: #888;
    --text-label: #a8dadc;
    --text-switch: #666;
    --primary-bg: rgba(var(--primary-rgb), 0.15);
    --success: #2d6a4f;
    --success-bg: rgba(45,106,79,0.15);
    --warning: #e9c46a;
    --warning-bg: rgba(233,196,106,0.15);
    --danger: #c1121f;
    --danger-rgb: 193,18,31;
    --blue: #457b9d;
    --blue-bg: rgba(69,123,157,0.15);
    --pink: #e63998;
    --success-rgb: 45,106,79;
    --warning-rgb: 233,196,106;
    --blue-rgb: 69,123,157;
    --hero-bg-from: #0a0a19;
    --hero-bg-to: #1a1a2e;
    --hero-dot: rgba(255,255,255,0.03);
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --bg-tint: #101028;
    --bg-tint-hover: #0e0e22;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --font: 'DM Sans', system-ui, -apple-system, sans-serif;
    --transition: all 0.2s ease;
}

/* ── Light Theme ───────────────────────────── */
[data-theme="light"] {
    --bg: #f5f5f7;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f8fa;
    --bg-input: #ffffff;
    --bg-select: #ffffff;
    --bg-navbar: rgba(255,255,255,0.95);
    --bg-switch: rgba(0,0,0,0.06);
    --border: rgba(0,0,0,0.1);
    --border-focus: var(--primary);
    --border-hover: rgba(0,0,0,0.15);
    --text: #1d1d1f;
    --text-muted: #6e6e73;
    --text-label: #444;
    --text-switch: rgba(0,0,0,0.4);
    --primary-bg: rgba(var(--primary-rgb), 0.08);
    --success: #2d6a4f;
    --success-bg: rgba(45,106,79,0.08);
    --warning: #b8860b;
    --warning-bg: rgba(184,134,11,0.08);
    --danger: #c1121f;
    --danger-rgb: 193,18,31;
    --blue: #457b9d;
    --blue-bg: rgba(69,123,157,0.08);
    --pink: #e63998;
    --success-rgb: 45,106,79;
    --warning-rgb: 184,134,11;
    --blue-rgb: 69,123,157;
    --hero-bg-from: #f5f5f7;
    --hero-bg-to: #e8e8ee;
    --hero-dot: rgba(0,0,0,0.03);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --bg-tint: rgba(0,0,0,0.02);
    --bg-tint-hover: rgba(0,0,0,0.03);
}
[data-theme="light"] .card { box-shadow: var(--shadow); }
[data-theme="light"] .card-compact { box-shadow: var(--shadow); }
[data-theme="light"] .stat-card { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
[data-theme="light"] .navbar { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
[data-theme="light"] .badge { border: 1px solid rgba(0,0,0,0.05); }
[data-theme="light"] .form-select option { background: #fff; color: #1d1d1f; }
[data-theme="light"] .form-input:disabled { background: #f0f0f2; color: #6e6e73; }
[data-theme="light"] .modal { box-shadow: 0 12px 40px rgba(0,0,0,0.15); }
[data-theme="light"] .toast { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }
[data-theme="light"] .filter-chip:hover:not(.active) { background: rgba(0,0,0,.05); }
[data-theme="light"] .search-wrap input { background: #fff; }
[data-theme="light"] .table-wrap { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
[data-theme="light"] .btn-ghost { background: #fff; border-color: var(--border); }
[data-theme="light"] .btn-ghost:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .btn-icon { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
[data-theme="light"] .btn-outline { border-color: rgba(0,0,0,0.15); }
[data-theme="light"] .btn-outline:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .toolbar-group { background: rgba(0,0,0,0.05); }
[data-theme="light"] .alert { border: 1px solid rgba(0,0,0,0.06); }
[data-theme="light"] .section-h3 { color: #1d1d1f; }
[data-theme="light"] .cat-chip-available { background: #fff; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .arena-cat-row:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .arena-cat-row:hover .arena-drag-handle { background: rgba(var(--primary-rgb), 0.06); }
[data-theme="light"] .card-arena-cat-row:nth-child(even):not(.is-mine) { background: rgba(0,0,0,0.015); }
[data-theme="light"] .notif-panel { box-shadow: 0 8px 32px rgba(0,0,0,0.12); background: #fff; }
[data-theme="light"] .ring-participant { background: rgba(0,0,0,0.02); }

/* ── Auto Theme (follows OS) ───────────────── */
@media (prefers-color-scheme: light) {
    [data-theme="auto"] {
        --bg: #f5f5f7;
        --bg-card: #ffffff;
        --bg-card-hover: #f8f8fa;
        --bg-input: #ffffff;
        --bg-select: #ffffff;
        --bg-navbar: rgba(255,255,255,0.95);
        --bg-switch: rgba(0,0,0,0.06);
        --border: rgba(0,0,0,0.1);
        --border-focus: var(--primary);
        --border-hover: rgba(0,0,0,0.15);
        --text: #1d1d1f;
        --text-muted: #6e6e73;
        --text-label: #444;
        --text-switch: rgba(0,0,0,0.4);
        --primary-bg: rgba(var(--primary-rgb), 0.08);
        --success-bg: rgba(45,106,79,0.08);
        --warning: #b8860b;
        --warning-bg: rgba(184,134,11,0.08);
        --blue-bg: rgba(69,123,157,0.08);
        --hero-bg-from: #f5f5f7;
        --hero-bg-to: #e8e8ee;
        --hero-dot: rgba(0,0,0,0.03);
        --shadow: 0 2px 12px rgba(0,0,0,0.08);
        --bg-tint: rgba(0,0,0,0.02);
        --bg-tint-hover: rgba(0,0,0,0.03);
    }
    [data-theme="auto"] .card { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
    [data-theme="auto"] .card-compact { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
    [data-theme="auto"] .stat-card { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
    [data-theme="auto"] .navbar { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
    [data-theme="auto"] .badge { border: 1px solid rgba(0,0,0,0.05); }
    [data-theme="auto"] .form-select option { background: #fff; color: #1d1d1f; }
    [data-theme="auto"] .form-input:disabled { background: #f0f0f2; color: #6e6e73; }
    [data-theme="auto"] .modal { box-shadow: 0 12px 40px rgba(0,0,0,0.15); }
    [data-theme="auto"] .toast { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }
    [data-theme="auto"] .filter-chip:hover:not(.active) { background: rgba(0,0,0,.05); }
    [data-theme="auto"] .search-wrap input { background: #fff; }
    [data-theme="auto"] .table-wrap { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
    [data-theme="auto"] .btn-ghost { background: #fff; border-color: var(--border); }
[data-theme="auto"] .btn-ghost:hover { background: rgba(0,0,0,0.04); }
    [data-theme="auto"] .btn-icon { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
    [data-theme="auto"] .btn-outline { border-color: rgba(0,0,0,0.15); }
    [data-theme="auto"] .btn-outline:hover { background: rgba(0,0,0,0.03); }
    [data-theme="auto"] .toolbar-group { background: rgba(0,0,0,0.05); }
    [data-theme="auto"] .alert { border: 1px solid rgba(0,0,0,0.06); }
    [data-theme="auto"] .section-h3 { color: #1d1d1f; }
    [data-theme="auto"] .cat-chip-available { background: #fff; border-color: rgba(0,0,0,0.12); }
    [data-theme="auto"] .arena-cat-row:hover { background: rgba(0,0,0,0.03); }
    [data-theme="auto"] .notif-panel { box-shadow: 0 8px 32px rgba(0,0,0,0.12); background: #fff; }
    [data-theme="auto"] .ring-participant { background: rgba(0,0,0,0.02); }
}

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

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Loader ────────────────────────────────── */
.loader {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100vh; gap: var(--sp-16); color: var(--text-muted);
}
.loader-spinner {
    width: 36px; height: 36px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Navbar ────────────────────────────────── */
.navbar {
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border);
    padding: 0 var(--sp-20);
    position: sticky; top: 0; z-index: 100;
    overflow: visible;
}
.navbar-inner {
    max-width: 1000px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px;
}
.navbar-brand {
    display: flex; align-items: center; gap: var(--sp-8);
    cursor: pointer; font-weight: 800; font-size: calc(16px * var(--fs));
    color: var(--text); text-decoration: none;
}
.navbar-nav { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }

/* ── Buttons ───────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: var(--sp-6);
    padding: var(--sp-8) var(--sp-16); border-radius: 8px;
    font-size: calc(13px * var(--fs)); font-weight: 600;
    font-family: var(--font);
    cursor: pointer; border: none;
    transition: var(--transition);
    text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #d62839; }
.btn-secondary { background: var(--bg-card); color: var(--text-label); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-card-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: var(--bg-card); color: var(--text-label); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--bg-card-hover); border-color: var(--border-hover); }
.btn-sm { padding: var(--sp-4) var(--sp-10); font-size: calc(12px * var(--fs)); }
.btn-lg { padding: var(--sp-12) var(--sp-24); font-size: calc(15px * var(--fs)); }

/* ── Cards ─────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-20);
    margin-bottom: var(--sp-16);
    transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-compact { padding: var(--sp-14); }

/* Card Grid (2-column layout for settings) */
.card-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-16);
    margin-bottom: var(--sp-16);
}
.card-grid > .card { margin-bottom: 0; }
.card-grid > .card-full { grid-column: 1 / -1; }
@media (max-width: 768px) { .card-grid { grid-template-columns: 1fr; } }

/* ── Forms ─────────────────────────────────── */
.form-group { margin-bottom: var(--sp-14); }
.form-label {
    display: block; font-size: calc(11px * var(--fs)); color: var(--text-label);
    margin-bottom: var(--sp-4); font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
}
.form-label .required { color: var(--primary); font-weight: 700; font-size: calc(14px * var(--fs)); }
.form-input, .form-select {
    width: 100%; padding: var(--sp-10) var(--sp-12); border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text); font-size: calc(14px * var(--fs));
    font-family: var(--font);
    outline: none; transition: var(--transition);
}
.form-select {
    background: var(--bg-select);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--sp-12) center;
    padding-right: var(--sp-32);
    cursor: pointer;
}
.form-select option { background: var(--bg-select); color: var(--text); }
.form-input:focus, .form-select:focus { border-color: var(--border-focus); }

/* Validation states */
.form-input.is-invalid, .form-select.is-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(var(--danger-rgb), 0.15);
}
.form-input.is-invalid:focus, .form-select.is-invalid:focus {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(var(--danger-rgb), 0.2);
}
.form-error {
    display: block; font-size: calc(11px * var(--fs)); color: var(--danger);
    margin-top: var(--sp-4); line-height: 1.3; font-weight: 500;
}
.form-hint {
    display: block; font-size: calc(11px * var(--fs)); color: var(--text-muted);
    margin-top: var(--sp-4); line-height: 1.3;
}
.form-label .required { color: var(--danger); font-weight: 700; margin-left: 2px; }

/* Textarea improvements */
textarea.form-input {
    min-height: 80px; resize: vertical; line-height: 1.5;
    font-family: var(--font);
}
textarea.form-input.auto-resize { resize: none; overflow: hidden; }

/* Disabled state */
.form-input:disabled, .form-select:disabled {
    opacity: 0.55; cursor: not-allowed;
}

.form-row { display: flex; gap: var(--sp-10); }
.form-row > * { flex: 1; }
.form-divider {
    border: none; border-top: 1px solid var(--border);
    margin: var(--sp-16) 0;
}

/* ── Search Input ─────────────────────────── */
.search-wrap {
    position: relative; display: inline-flex; align-items: center;
    min-width: 220px; max-width: 320px;
}
.search-wrap input {
    width: 100%; padding: var(--sp-6) var(--sp-32) var(--sp-6) var(--sp-12);
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg-input); font-size: calc(13px * var(--fs));
    color: var(--text); font-family: var(--font);
    outline: none; transition: var(--transition);
}
.search-wrap input:focus { border-color: var(--border-focus); }
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap .search-clear {
    position: absolute; right: var(--sp-6); background: none; border: none;
    cursor: pointer; color: var(--text-muted); padding: var(--sp-2);
    display: flex; align-items: center; transition: color .15s;
}
.search-wrap .search-clear:hover { color: var(--text); }

/* ── Stats ─────────────────────────────────── */
.stats-grid {
    display: flex; gap: var(--sp-10); flex-wrap: wrap;
    margin-bottom: var(--sp-12);
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: var(--sp-10) var(--sp-14);
    flex: 1 1 120px; min-width: 100px;
}
.stat-label {
    font-size: calc(10px * var(--fs)); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: var(--sp-2);
}
.stat-value { font-size: calc(20px * var(--fs)); font-weight: 700; color: var(--text); }
.stat-icon { margin-top: var(--sp-2); font-size: calc(16px * var(--fs)); }

/* Stats inline (single row, even more compact) */
.stats-inline {
    display: flex; gap: var(--sp-16); flex-wrap: wrap; align-items: center;
    padding: var(--sp-6) 0; margin-bottom: var(--sp-8);
}
.stats-inline .stat-item {
    display: flex; align-items: baseline; gap: var(--sp-6);
    font-size: calc(13px * var(--fs));
}
.stats-inline .stat-item-value { font-weight: 700; font-size: calc(16px * var(--fs)); }
.stats-inline .stat-item-label { color: var(--text-muted); font-size: calc(11px * var(--fs)); text-transform: uppercase; letter-spacing: .5px; }

/* ── Page Toolbar (unified) ───────────────── */
.page-toolbar {
    display: flex; align-items: center; gap: var(--sp-10);
    margin-bottom: var(--sp-14); flex-wrap: wrap;
    min-height: 36px;
}
.page-toolbar-left {
    display: flex; align-items: center; gap: var(--sp-10);
    flex-shrink: 0;
}
.page-toolbar-center {
    display: flex; align-items: center; gap: var(--sp-8);
    flex-wrap: wrap; flex: 1; min-width: 0;
}
.page-toolbar-right {
    display: flex; align-items: center; gap: var(--sp-8);
    margin-left: auto; flex-shrink: 0;
}

/* ── Page Description ─────────────────────── */
.page-desc {
    font-size: calc(12px * var(--fs)); color: var(--text-muted);
    margin-bottom: var(--sp-14); line-height: 1.5;
}

/* ── Filter Chips (replacing badge-as-button) */
.filter-group {
    display: flex; gap: 3px;
    background: var(--bg-switch);
    border-radius: 7px; padding: 2px;
}
.filter-chip {
    padding: var(--sp-4) var(--sp-12); border-radius: 5px; border: none;
    cursor: pointer; font-size: calc(12px * var(--fs)); font-weight: 600;
    font-family: var(--font);
    background: transparent; color: var(--text-muted);
    transition: var(--transition); white-space: nowrap;
    display: inline-flex; align-items: center; gap: var(--sp-4);
}
.filter-chip:hover:not(.active) { color: var(--text); background: rgba(255,255,255,.05); }
.filter-chip.active { background: var(--primary); color: #fff; }

/* ── Badge ─────────────────────────────────── */
.badge {
    display: inline-block; padding: var(--sp-2) var(--sp-8); border-radius: 16px;
    font-size: calc(10px * var(--fs)); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: rgba(var(--danger-rgb),0.15); color: var(--danger); }

/* Cropper.js Circle Overlay */
.cropper-view-box,
.cropper-face { border-radius: 50%; }
.cropper-view-box { outline: 2px solid var(--primary); outline-offset: -2px; }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-pink { background: rgba(230,57,152,0.15); color: var(--pink); }

/* ── Tables ────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--fs)); }
thead tr { background: var(--bg-tint); }
th {
    padding: var(--sp-10) var(--sp-14); text-align: left;
    color: var(--text-label); font-size: calc(10px * var(--fs));
    text-transform: uppercase; letter-spacing: 1px;
    font-weight: 700; border-bottom: 1px solid var(--border);
}
td { padding: var(--sp-10) var(--sp-14); border-bottom: 1px solid var(--bg-tint); color: var(--text); }
tr:hover td { background: var(--bg-tint-hover); }
.text-muted { color: var(--text-muted); }
.text-bold { font-weight: 700; }

/* ── Tabs ──────────────────────────────────── */
.tabs {
    display: flex; gap: 2px;
    background: var(--bg-switch);
    border-radius: var(--radius); padding: 3px;
    margin-bottom: var(--sp-20); flex-wrap: wrap;
}
.tab-btn {
    padding: var(--sp-8) var(--sp-16); border-radius: 8px; border: none;
    cursor: pointer; font-size: calc(13px * var(--fs)); font-weight: 600;
    font-family: var(--font);
    background: transparent; color: var(--text-muted);
    transition: var(--transition); white-space: nowrap;
}
.tab-btn.active { background: var(--primary); color: #fff; }
.tab-btn:hover:not(.active) { color: var(--text); }

/* ── Modal ─────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: var(--sp-16);
    animation: fadeIn 0.15s ease;
}
.modal {
    background: var(--bg-card); border-radius: var(--radius-lg);
    padding: var(--sp-24); max-width: 500px; width: 100%;
    max-height: 85vh; overflow: auto;
    border: 1px solid var(--border-hover);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.2s ease;
}
.modal-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: var(--sp-16);
}
.modal-title { font-size: calc(17px * var(--fs)); font-weight: 700; color: var(--text); }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: calc(18px * var(--fs)); padding: var(--sp-4);
}

/* ── Toast ─────────────────────────────────── */
.toast {
    position: fixed; bottom: var(--sp-20); right: var(--sp-20);
    background: var(--success); color: #fff;
    padding: var(--sp-10) var(--sp-16); border-radius: var(--radius);
    font-size: calc(13px * var(--fs)); font-weight: 600; z-index: 9999;
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

/* ── Lang Switch ───────────────────────────── */
/* ── Toolbar Switches (Lang, Theme, Font) ──── */
.toolbar-group {
    display: flex; gap: 3px;
    background: var(--bg-switch);
    border-radius: 7px; padding: 2px;
}
.toolbar-group .tb {
    padding: var(--sp-2) var(--sp-8); border-radius: 5px; border: none;
    cursor: pointer; font-size: calc(12px * var(--fs)); font-weight: 700;
    font-family: var(--font);
    background: transparent; color: var(--text-switch);
    transition: var(--transition);
    line-height: 1.4;
}
.toolbar-group .tb.active { background: var(--primary); color: #fff; }
.toolbar-group .tb:hover:not(.active) { color: var(--text); }
.accent-dots { display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.accent-dot {
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
    transition: transform 0.15s, border-color 0.15s; position: relative; flex-shrink: 0;
}
.accent-dot:hover { transform: scale(1.15); }
.accent-dot.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg); }
.accent-dot .accent-check { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 800; opacity: 0; }
.accent-dot.active .accent-check { opacity: 1; }
.mail-preset-row { display: flex; gap: var(--sp-6); flex-wrap: wrap; margin-bottom: var(--sp-14); padding-bottom: var(--sp-14); border-bottom: 1px solid var(--border); }
.mail-preset {
    display: flex; align-items: center; gap: var(--sp-6); padding: var(--sp-4) var(--sp-10);
    border-radius: 20px; border: 1px solid var(--border); cursor: pointer;
    background: var(--bg-tint); transition: var(--transition); font-size: calc(11px * var(--fs));
}
.mail-preset:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.mail-preset.active { border-color: var(--primary); background: var(--primary-bg); font-weight: 600; }
.mail-preset .mp-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.navbar-toolbar { display: flex; align-items: center; gap: var(--sp-6); margin-left: var(--sp-6); }

/* Nav Buttons (bigger, clearer) */
.nav-btn {
    display: flex; align-items: center; gap: var(--sp-6);
    padding: var(--sp-8) var(--sp-14); border-radius: 8px; border: none;
    cursor: pointer; font-size: calc(14px * var(--fs)); font-weight: 600;
    font-family: var(--font);
    background: transparent; color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap;
}
.nav-btn:hover { background: var(--bg-tint); color: var(--text); }
.nav-btn-active { background: var(--primary); color: #fff !important; }
.nav-btn-active:hover { background: var(--primary); }
.nav-icon { font-size: calc(16px * var(--fs)); }

/* Submenu dropdown */
.nav-submenu-wrap { position: relative; z-index: 1001; }
.nav-submenu {
    position: absolute; right: 0; top: calc(100% + 6px);
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; padding: 14px 16px; min-width: 220px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    z-index: 9999;
}
.nav-sub-section { font-size: calc(11px * var(--fs)); font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin: 8px 0 4px; letter-spacing: 0.5px; }
.nav-sub-section:first-child { margin-top: 0; }
.nav-sub-row { display: flex; justify-content: center; margin-bottom: 4px; }
.nav-sub-btn {
    display: block; width: 100%; padding: 8px 10px; border: none; border-radius: 6px;
    cursor: pointer; font-size: calc(13px * var(--fs)); font-family: var(--font); font-weight: 500;
    background: transparent; color: var(--text); text-align: left;
    transition: var(--transition);
}
.nav-sub-btn:hover { background: var(--bg-tint); }

/* keep legacy class working */
.lang-switch { display: flex; gap: 3px; background: var(--bg-switch); border-radius: 7px; padding: 2px; }
.lang-btn {
    padding: 3px 9px; border-radius: 5px; border: none;
    cursor: pointer; font-size: calc(12px * var(--fs)); font-weight: 700;
    font-family: var(--font);
    background: transparent; color: var(--text-switch);
    transition: var(--transition);
}
.lang-btn.active { background: var(--primary); color: #fff; }

/* ── Layout ────────────────────────────────── */
.container { max-width: 100%; margin: 0 auto; padding: var(--sp-16) var(--sp-24); }
.container-sm { max-width: 500px; }
.container-md { max-width: 700px; }
.container-narrow { max-width: 1000px; }

.page-header { margin-bottom: var(--sp-12); }
.page-title { font-size: calc(20px * var(--fs)); font-weight: 700; margin: 0; }
.page-subtitle { color: var(--text-muted); font-size: calc(12px * var(--fs)); margin-top: var(--sp-2); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-10 { gap: var(--sp-10); }
.gap-8  { gap: var(--sp-8); }
.gap-12 { gap: var(--sp-12); }
.gap-14 { gap: var(--sp-14); }
.gap-16 { gap: var(--sp-16); }
.mt-8 { margin-top: var(--sp-8); }
.mt-12 { margin-top: var(--sp-12); }
.mt-16 { margin-top: var(--sp-16); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-10 { margin-bottom: var(--sp-10); }
.mb-12 { margin-bottom: var(--sp-12); }
.mb-14 { margin-bottom: var(--sp-14); }
.mb-20 { margin-bottom: var(--sp-20); }
.mb-24 { margin-bottom: var(--sp-24); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }

/* ── Hero Section ──────────────────────────── */
.hero {
    text-align: center; padding: var(--sp-32) var(--sp-20) var(--sp-32);
    background: linear-gradient(180deg, var(--primary-bg) 0%, transparent 100%);
    position: relative; overflow: hidden;
}
.hero-pattern {
    position: absolute; inset: 0; opacity: 0.5;
    background-image: repeating-linear-gradient(45deg, var(--hero-dot) 0px, var(--hero-dot) 1px, transparent 1px, transparent 20px);
}
.hero-badge {
    display: inline-block; padding: var(--sp-4) var(--sp-14); border-radius: 16px;
    background: rgba(var(--primary-rgb),0.18); color: var(--primary);
    font-size: calc(12px * var(--fs)); font-weight: 700; margin-bottom: var(--sp-16); letter-spacing: 1px;
}
.hero-title {
    font-size: clamp(28px, 5vw, 48px); font-weight: 800;
    margin: 0 0 var(--sp-14); line-height: 1.15;
}
.hero-text { font-size: calc(16px * var(--fs)); color: var(--text-label); max-width: 520px; margin: 0 auto var(--sp-10); line-height: 1.6; }
.hero-date { font-size: calc(14px * var(--fs)); color: var(--primary); font-weight: 600; margin-bottom: var(--sp-24); }
.hero-actions { display: flex; gap: var(--sp-10); justify-content: center; flex-wrap: wrap; }

/* ── Feature Cards ─────────────────────────── */
.features { display: flex; gap: var(--sp-16); flex-wrap: wrap; max-width: 850px; margin: 0 auto; padding: var(--sp-32) var(--sp-20); }
.feature-card {
    flex: 1 1 240px; padding: var(--sp-24); border-radius: var(--radius-lg);
    background: var(--bg-card); border: 1px solid var(--border);
    transition: var(--transition);
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.feature-icon { font-size: calc(28px * var(--fs)); margin-bottom: var(--sp-12); }
.feature-title { font-size: calc(16px * var(--fs)); font-weight: 700; margin-bottom: var(--sp-6); }
.feature-desc { font-size: calc(13px * var(--fs)); color: var(--text-muted); line-height: 1.5; }

/* ── Participant Card ──────────────────────── */
.participant-card { padding: var(--sp-16); }
.p-name { font-weight: 700; font-size: calc(15px * var(--fs)); }
.p-detail { font-size: calc(12px * var(--fs)); color: var(--text-muted); margin-left: var(--sp-8); }
.p-meta { font-size: calc(11px * var(--fs)); color: var(--text-muted); margin-top: var(--sp-4); }
.p-section-label {
    font-size: calc(10px * var(--fs)); text-transform: uppercase;
    letter-spacing: 1px; font-weight: 700; margin-bottom: var(--sp-4);
}
.p-section-label-booked { color: var(--text-label); }
.p-section-label-eligible { color: var(--text-muted); }
.p-no-cats { font-size: calc(12px * var(--fs)); color: var(--text-muted); }
.section-h3 { font-size: calc(15px * var(--fs)); margin-bottom: 14px; color: var(--text-label); }

/* ── Category List ─────────────────────────── */
.cat-section-title {
    font-size: calc(15px * var(--fs)); color: var(--text-label);
    margin-bottom: var(--sp-10); padding-bottom: var(--sp-6);
    border-bottom: 1px solid var(--border);
}
.cat-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-6); }
.cat-meta { color: var(--text-muted); font-size: calc(12px * var(--fs)); margin-left: var(--sp-8); }
.cat-chips { display: flex; gap: var(--sp-6); flex-wrap: wrap; margin-top: var(--sp-10); }
.cat-chip {
    padding: var(--sp-6) var(--sp-12); border-radius: 8px;
    font-size: calc(12px * var(--fs)); font-weight: 600;
    border: none; cursor: pointer; transition: var(--transition);
}
.cat-chip-available { background: var(--bg-card-hover); color: var(--text); border: 1px solid var(--border); }
.cat-chip-available:hover { background: var(--blue-bg); border-color: var(--blue); }
.cat-chip-booked { background: var(--success); color: #fff; }
.cat-chip-disabled {
    background: transparent; color: var(--text-muted);
    cursor: not-allowed; opacity: 0.3;
    text-decoration: line-through;
    border: 1px dashed var(--border);
    pointer-events: none;
}

/* ── Ring Card ─────────────────────────────── */
.ring-grid { display: flex; gap: var(--sp-16); flex-wrap: wrap; }
.ring-card { flex: 1 1 280px; min-width: 260px; }
.ring-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-14); }
.ring-title { font-size: calc(16px * var(--fs)); font-weight: 700; }
.ring-section-label {
    font-size: calc(11px * var(--fs)); color: var(--text-label);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: var(--sp-6);
}
.ring-participant {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--sp-4) var(--sp-8); border-radius: var(--radius-sm); margin-bottom: 3px;
    background: var(--bg-tint-hover); font-size: calc(12px * var(--fs));
}
.ring-actions { display: flex; gap: var(--sp-6); margin-top: var(--sp-12); }

/* ── Alert ─────────────────────────────────── */
.alert {
    padding: var(--sp-10) var(--sp-14); border-radius: 8px;
    font-size: calc(12px * var(--fs)); margin-bottom: var(--sp-14);
}
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-error { background: rgba(var(--danger-rgb),0.15); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }

/* ── Progress Bar ──────────────────────────── */
.progress-bar {
    width: 80px; height: 6px; border-radius: 3px;
    background: var(--bg-switch); overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 3px;
    background: var(--primary); transition: width 0.3s ease;
}

/* ── Animations ────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Footer ────────────────────────────────── */
.app-footer {
    margin-top: var(--sp-32);
    padding: var(--sp-24) var(--sp-20);
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-inner {
    max-width: 1000px; margin: 0 auto;
}
.footer-links {
    display: flex; gap: var(--sp-8); justify-content: center; align-items: center;
    margin-bottom: var(--sp-8); flex-wrap: wrap;
}
.footer-link {
    font-size: calc(12px * var(--fs)); color: var(--text-muted);
    cursor: pointer; text-decoration: none; transition: var(--transition);
}
.footer-link:hover { color: var(--primary); text-decoration: underline; }
.footer-sep { color: var(--border); font-size: calc(10px * var(--fs)); }
.footer-copy { font-size: calc(11px * var(--fs)); color: var(--text-muted); opacity: 0.6; }

/* ── Sidebar Layout ────────────────────────── */
.fr-layout { display: flex; min-height: 100vh; }

/* Sidebar — always dark, theme-independent */
.fr-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 240px;
    background: var(--sb-bg, #1a1a2e); border-right: 1px solid var(--sb-border, rgba(255,255,255,.08));
    z-index: 1000; display: flex; flex-direction: column;
    transition: width .2s ease, transform .2s ease;
    overflow: hidden; color: #e0e0e0;
}
.fr-sidebar.collapsed { width: 52px; }
.fr-sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.fr-sidebar-scroll::-webkit-scrollbar { width: 4px; }
.fr-sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.fr-sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.fr-sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }
.fr-sidebar-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 6px; }
.fr-main { flex: 1; margin-left: 240px; transition: margin-left .2s ease; min-width: 0; }
.fr-main.sb-collapsed { margin-left: 52px; }
.fr-main .container { max-width: 100%; margin-left: 0; margin-right: 0; padding-left: 24px; padding-right: 24px; }

/* Top header bar — respects page theme */
.fr-topbar {
    display: flex; align-items: center; padding: 8px 20px;
    border-bottom: 1px solid var(--border); background: var(--card-bg);
    min-height: 48px; gap: 12px; position: sticky; top: 0; z-index: 100;
}
.fr-topbar-title { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-topbar-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Sidebar header */
.fr-sb-header {
    display: flex; align-items: center; padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08); min-height: 48px; gap: 6px;
}
.fr-sb-brand {
    display: flex; align-items: center; gap: 6px;
    font-weight: 700; font-size: 14px; cursor: pointer;
    white-space: nowrap; overflow: hidden; color: #fff;
}
.fr-sb-brand img { height: 22px; width: auto; object-fit: contain; flex-shrink: 0; }
.collapsed .fr-sb-brand .s-label { display: none; }
.collapsed .fr-sb-brand img { display: none; }

/* Sidebar toggle button */
.fr-sb-toggle {
    margin-left: auto; width: 26px; height: 26px; border: none;
    background: transparent; color: rgba(255,255,255,.6); cursor: pointer;
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0; transition: background .15s;
}
.fr-sb-toggle:hover { background: rgba(255,255,255,.1); }
.collapsed .fr-sb-toggle {
    margin-left: 0; background: var(--primary, #e63946); color: #fff;
    width: 32px; height: 32px; border-radius: 8px; font-size: 15px;
}

/* Competition pill */
.fr-sb-comp {
    padding: 5px 12px; margin: 4px 6px; background: rgba(255,255,255,.06);
    border-radius: 6px; font-size: 11px; font-weight: 600; color: #ddd;
    white-space: normal; word-break: break-word; line-height: 1.35;
    cursor: pointer; transition: background .15s;
}
.fr-sb-comp:hover { background: rgba(255,255,255,.12); }
/* Touch-safe: prevent :hover sticky on touch devices */
@media (hover: hover) {
    .fr-sb-group-title:hover { background: rgba(255,255,255,.06); }
    .fr-sb-item:hover { background: rgba(255,255,255,.08); color: #fff; }
    .fr-sb-single:hover { background: rgba(255,255,255,.08); color: #fff; }
    .fr-sb-bottom-item:hover { background: rgba(255,255,255,.08); color: #fff; }
    .fr-sb-lang-item:hover { background: rgba(255,255,255,.08); color: #fff; }
    .arena-cat-row:hover { background: var(--bg-tint); }
    .arena-pool-chip:hover { background: var(--bg); transform: translateY(-1px); }
}
@media (hover: none) {
    .fr-sb-group-title:hover,
    .fr-sb-item:hover,
    .fr-sb-single:hover,
    .fr-sb-bottom-item:hover,
    .fr-sb-lang-item:hover { background: transparent; }
    .fr-sb-item:active, .fr-sb-single:active, .fr-sb-bottom-item:active { background: rgba(255,255,255,.12); }
}
.collapsed .fr-sb-comp { display: none; }

/* Nav group */
.fr-sb-group { margin: 1px 0; }
.fr-sb-group-title {
    display: flex; align-items: center; padding: 7px 12px;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: rgba(255,255,255,.55); cursor: pointer;
    user-select: none; transition: background .15s; gap: 6px; white-space: nowrap;
}
.fr-sb-group-title:hover { background: rgba(255,255,255,.06); }
.fr-sb-group-title .gr-icon { width: 18px; text-align: center; font-size: 12px; flex-shrink: 0; }
.fr-sb-group-title .gr-arrow { margin-left: auto; font-size: 8px; transition: transform .15s; flex-shrink: 0; }
.fr-sb-group-title .gr-arrow.open { transform: rotate(90deg); }
.collapsed .fr-sb-group-title .gr-label,
.collapsed .fr-sb-group-title .gr-arrow { display: none; }

/* Nav item (sub-item in group) */
.fr-sb-item {
    display: flex; align-items: center; padding: 6px 12px 6px 34px;
    font-size: 12px; color: rgba(255,255,255,.85); cursor: pointer;
    transition: background .15s, color .15s; gap: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fr-sb-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.fr-sb-item.active { background: var(--primary, #e63946); color: #fff; font-weight: 600; }
.fr-sb-item .item-icon { width: 16px; text-align: center; font-size: 11px; flex-shrink: 0; }
.collapsed .fr-sb-item { padding: 6px 0; justify-content: center; }
.collapsed .fr-sb-item .item-label { display: none; }

/* Single nav item (top-level) */
.fr-sb-single {
    display: flex; align-items: center; padding: 7px 12px;
    font-size: 12px; color: rgba(255,255,255,.85); cursor: pointer;
    transition: background .15s; gap: 6px; white-space: nowrap; font-weight: 500;
    position: relative;
}
.fr-sb-single:hover { background: rgba(255,255,255,.08); color: #fff; }
.fr-sb-single.active { background: var(--primary, #e63946); color: #fff; font-weight: 600; }
.fr-sb-single .s-icon { width: 18px; text-align: center; font-size: 13px; flex-shrink: 0; }
.collapsed .fr-sb-single .s-label { display: none; }

/* Bottom items (profile, password, logout) */
.fr-sb-bottom-item {
    display: flex; align-items: center; padding: 6px 12px;
    font-size: 11px; color: rgba(255,255,255,.6); cursor: pointer;
    gap: 6px; white-space: nowrap; transition: background .15s, color .15s;
}
.fr-sb-bottom-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.fr-sb-bottom-item.logout { color: var(--danger); }
.fr-sb-bottom-item.logout:hover { color: #ff5a6a; }
.collapsed .fr-sb-bottom-item .bi-label { display: none; }

/* Theme/font/lang toolbar in sidebar bottom */
.fr-sb-toolbar {
    display: none; gap: 6px; padding: 6px 10px; flex-wrap: wrap;
    align-items: center; border-bottom: 1px solid rgba(255,255,255,.06); margin-bottom: 4px;
}
@media (max-width: 768px) { .fr-sb-toolbar { display: flex; } }

/* .tb buttons inside dark sidebar */
.fr-sidebar .tb { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.15); }
.fr-sidebar .tb:hover,
.fr-sidebar .tb.active { color: #fff; background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.2); }
/* Force dark bg for toolbar groups inside sidebar (theme-independent) */
.fr-sidebar .toolbar-group { background: rgba(255,255,255,.08); }
.fr-sidebar .toolbar-group .tb { color: rgba(255,255,255,.7); }
.fr-sidebar .toolbar-group .tb.active { background: var(--primary); color: #fff; }
.fr-sidebar .toolbar-group .tb:hover:not(.active) { color: #fff; }

/* Language dropdown in sidebar — opens upward */
.fr-sb-lang-drop {
    position: absolute; bottom: 100%; left: 0; z-index: 1100;
    background: var(--sb-bg, #1a1a2e); border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px; box-shadow: 0 -4px 20px rgba(0,0,0,.4);
    min-width: 170px; max-height: 260px; overflow-y: auto; padding: 4px 0; margin-bottom: 4px;
}
.fr-sb-lang-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 14px;
    cursor: pointer; font-size: 12px; color: rgba(255,255,255,.85); transition: background .15s;
}
.fr-sb-lang-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.fr-sb-lang-item.active { background: rgba(255,255,255,.1); color: #fff; }

/* Mobile hamburger & backdrop */
.fr-mobile-hamburger {
    display: none; position: fixed; top: 8px; left: 8px; z-index: 1001;
    width: 38px; height: 38px; border-radius: 10px; border: none;
    background: var(--primary, #e63946); color: #fff; font-size: 18px;
    cursor: pointer; align-items: center; justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.fr-sb-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.55); z-index: 999; backdrop-filter: blur(2px);
}

/* Tooltip for collapsed sidebar icons */
.fr-sb-single,
.fr-sb-group-title,
.fr-sb-comp-item { position: relative; }
.collapsed .fr-sb-single[data-tip]:hover::after,
.collapsed .fr-sb-group-title[data-tip]:hover::after,
.collapsed .fr-sb-comp-item[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: 52px;
    background: var(--sb-bg, #1a1a2e); color: #fff; padding: 4px 10px;
    border-radius: 6px; font-size: 11px; font-weight: 600;
    white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.3);
    border: 1px solid rgba(255,255,255,.1); z-index: 1100; pointer-events: none;
}

/* Competition items in sidebar (admin overview) */
.fr-sb-comp-item { padding-left: 28px !important; }
.fr-sb-comp-item .item-icon { width: 12px !important; display: flex; align-items: center; justify-content: center; }
.fr-sb-comp-item .item-label {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px;
}

/* Tabler Icons inside sidebar */
.fr-sidebar .ti { line-height: 1; vertical-align: middle; }

/* Competition items in sidebar */
.fr-sb-comp-item { border-left: 3px solid transparent; transition: border-color .15s, background .15s; }
.fr-sb-comp-item:hover { border-left-color: currentColor; }
.fr-sb-item .ti,
.fr-sb-single .ti { font-size: 14px; }
.fr-sb-group-title .ti { font-size: 13px; }
.fr-sb-bottom-item .ti { font-size: 14px; }
.fr-topbar .ti { vertical-align: middle; }

/* Sidebar font-size scaling */
.fs-sm .fr-sidebar { font-size: 11px; }
.fs-sm .fr-sb-item { font-size: 11px; padding: 5px 12px 5px 34px; }
.fs-sm .fr-sb-single { font-size: 11px; padding: 6px 12px; }
.fs-sm .fr-sb-group-title { font-size: 9px; }
.fs-sm .fr-sb-bottom-item { font-size: 10px; }
.fs-sm .fr-sb-brand { font-size: 13px; }
.fs-lg .fr-sidebar { font-size: 14px; }
.fs-lg .fr-sb-item { font-size: 14px; padding: 8px 12px 8px 34px; }
.fs-lg .fr-sb-single { font-size: 14px; padding: 9px 12px; }
.fs-lg .fr-sb-group-title { font-size: 11px; }
.fs-lg .fr-sb-bottom-item { font-size: 13px; }
.fs-lg .fr-sb-brand { font-size: 16px; }

/* ── Animations ────────────────────────────── */
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.shake { animation: shake .3s ease; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
    /* Sidebar mobile — smooth overlay */
    .fr-sidebar {
        transform: translateX(-100%); width: 270px !important;
        box-shadow: 4px 0 24px rgba(0,0,0,.5);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
    }
    .fr-sidebar.mobile-open { transform: translateX(0); }
    .fr-main { margin-left: 0 !important; }
    .fr-mobile-hamburger { display: flex; }
    .fr-sb-backdrop.visible { display: block; animation: fadeIn .2s ease; }
    .fr-topbar-tools { display: none !important; }
    .fr-topbar { padding: 8px 12px 8px 52px; }

    /* Touch targets min 44x44 */
    .fr-sb-item { min-height: 44px; display: flex; align-items: center; }
    .fr-sb-single { min-height: 44px; }
    .fr-sb-group-title { min-height: 40px; }
    .fr-sb-bottom-item { min-height: 44px; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .filter-chip { min-height: 36px; }

    /* Filter chips horizontal scroll */
    .filter-group {
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none; flex-wrap: nowrap;
    }
    .filter-group::-webkit-scrollbar { display: none; }

    /* Table scroll indicator */
    .table-wrap { position: relative; }
    .table-wrap::after {
        content: ''; position: absolute; top: 0; right: 0;
        width: 24px; height: 100%; pointer-events: none;
        background: linear-gradient(to right, transparent, rgba(var(--primary-rgb),.08));
        opacity: 0; transition: opacity .2s;
    }
    .table-wrap.has-scroll::after { opacity: 1; }

    /* Navbar mobile */
    .navbar-inner { flex-wrap: wrap; height: auto; padding: 8px 0; gap: 6px; }
    .navbar-nav { width: 100%; justify-content: center; gap: 2px; }
    .navbar-toolbar { width: 100%; justify-content: center; margin-left: 0; }
    .nav-btn { padding: 6px 10px; font-size: calc(12px * var(--fs)); }
    .nav-label { display: none; }
    .nav-icon { font-size: calc(18px * var(--fs)); }

    /* Tabs/filter-groups: horizontal scroll */
    .tabs {
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none; flex-wrap: nowrap;
    }
    .tabs::-webkit-scrollbar { display: none; }

    /* Page toolbar sections don't truncate filter-groups */
    .page-toolbar-left { flex-shrink: 1; min-width: 0; overflow-x: auto; }

    /* Card-compact pricing/rules: stack vertically */
    .card-compact.flex { flex-direction: column; align-items: stretch !important; gap: var(--sp-8); }

    /* Arena category rows: prevent overflow */
    .arena-cat-row { font-size: calc(12px * var(--fs)); }
    .arena-cat-name { max-width: 40vw; }
    .arena-cat-info { min-width: 0; }
    .arena-pool-chip { font-size: calc(11px * var(--fs)); }
}
@media (min-width: 769px) {
    .fr-mobile-hamburger { display: none !important; }
    .fr-sb-backdrop { display: none !important; }
}
@media (max-width: 640px) {
    .btn { padding: var(--sp-6) var(--sp-12); font-size: calc(12px * var(--fs)); }
    .stats-grid { flex-direction: column; }
    .form-row { flex-direction: column; }
    .ring-grid { flex-direction: column; }
    .hero { padding: var(--sp-32) var(--sp-16) var(--sp-32); }
    .container { padding: var(--sp-12) var(--sp-14); }
    .toolbar-group .tb { padding: var(--sp-2) var(--sp-6); font-size: calc(11px * var(--fs)); }
    .page-toolbar { gap: var(--sp-8); }
    .page-toolbar-left,
    .page-toolbar-center,
    .page-toolbar-right { width: 100%; }
    .page-toolbar-right { margin-left: 0; flex-wrap: wrap; }
    .search-wrap { min-width: 100%; max-width: 100%; }
    .filter-chip { padding: var(--sp-2) var(--sp-8); font-size: calc(11px * var(--fs)); }

    /* Pricing rule cards: fully stacked */
    .card-compact { padding: var(--sp-10) var(--sp-12) !important; }
    .card-compact .flex.gap-6 { flex-wrap: wrap; }

    /* Arena: single column, no sticky pool */
    .arena-grid { grid-template-columns: 1fr !important; }
    .arena-col-pool { position: static !important; }
    .arena-cat-name { max-width: 55vw; }
    .arena-card-header { padding: var(--sp-10) var(--sp-12); }

    /* Modal: full width on small screens */
    .modal { max-width: calc(100vw - 32px) !important; padding: var(--sp-16) !important; }

    /* page-header breadcrumb wrap */
    .page-header { flex-wrap: wrap; gap: var(--sp-6); }
}

/* ═══════════════════════════════════════════════
   Arena Management (Sprint 15)
   ═══════════════════════════════════════════════ */
.arena-page .page-title { margin-bottom: 0; }
.arena-grid { display: grid; grid-template-columns: 1fr 320px; gap: var(--sp-16); align-items: start; }
.arena-col-pool { position: sticky; top: var(--sp-16); }
.arena-card { margin-bottom: var(--sp-12); }
.arena-card-header { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-14) var(--sp-16); border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: var(--sp-8); }
.arena-card-title { font-weight: 600; font-size: calc(15px * var(--fs)); }
.arena-thumb { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; }
.arena-thumb-placeholder { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--bg-tint); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.arena-drop-zone { min-height: 48px; padding: var(--sp-8); position: relative; }
.arena-drop-empty { display: flex; align-items: center; justify-content: center; gap: var(--sp-8); padding: var(--sp-16); color: var(--text-muted); font-size: calc(12px * var(--fs)); border: 2px dashed var(--border); border-radius: 8px; }
.arena-cat-row { display: flex; align-items: center; gap: var(--sp-8); padding: var(--sp-8) var(--sp-12); border-radius: var(--radius-sm); cursor: grab; transition: background .15s; font-size: calc(13px * var(--fs)); min-width: 0; overflow: hidden; }
.arena-cat-row:hover { background: var(--bg-tint); }
.arena-cat-row.dragging { opacity: 0.4; }

/* Drag handle — more visible */
.arena-drag-handle {
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 28px; flex-shrink: 0; cursor: grab;
    color: var(--text-muted); opacity: 0.5; border-radius: 4px;
    transition: opacity .15s, background .15s;
}
.arena-cat-row:hover .arena-drag-handle { opacity: 1; background: rgba(var(--primary-rgb), 0.08); color: var(--primary); }
.arena-drag-handle:active { cursor: grabbing; opacity: 1; }

/* Card arena section */
.card-arena-area { background: var(--bg-tint); border-radius: var(--radius); padding: var(--sp-12); margin-bottom: var(--sp-8); }
.card-arena-area.is-mine { border-left: 3px solid var(--primary); }
.card-arena-cat-row {
    display: flex; align-items: center; gap: var(--sp-6) var(--sp-10);
    padding: var(--sp-6) var(--sp-8); font-size: calc(12px * var(--fs));
    border-radius: 4px; flex-wrap: wrap; transition: background .15s;
}
.card-arena-cat-row.is-mine { font-weight: 700; color: var(--primary); background: rgba(var(--primary-rgb), 0.06); }
.card-arena-cat-row:nth-child(even):not(.is-mine) { background: rgba(255,255,255,0.04); }
.cat-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.arena-cat-info { flex: 1; min-width: 0; display: flex; align-items: center; }
.arena-cat-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arena-cat-mc { color: var(--text-muted); font-size: calc(11px * var(--fs)); white-space: nowrap; }
.arena-cat-sep { color: var(--text-muted); margin: 0 var(--sp-4); font-size: calc(10px * var(--fs)); }
.arena-cat-count { color: var(--text-muted); font-size: calc(10px * var(--fs)); margin-left: auto; white-space: nowrap; padding-left: var(--sp-8); }
.arena-cat-meta { color: var(--text-muted); font-size: calc(10px * var(--fs)); white-space: nowrap; padding: 0 var(--sp-4); }
.arena-cat-actions { display: flex; gap: var(--sp-4); flex-shrink: 0; }
.arena-sl-link { color: var(--primary) !important; opacity: .6; }
.arena-sl-link:hover { opacity: 1; }
.arena-grid-readonly { grid-template-columns: 1fr; }
.arena-readonly .arena-cat-row { cursor: default; }
.drop-indicator { height: 3px; background: var(--primary); border-radius: 2px; margin: 2px var(--sp-8); }
.drag-over { background: rgba(var(--primary-rgb, 59,130,246), 0.08); border-radius: 8px; }

/* Pool */
.arena-pool-card { max-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.arena-pool-header { padding: var(--sp-12) var(--sp-16); font-weight: 600; font-size: calc(13px * var(--fs)); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--sp-8); }
.arena-pool-body { flex: 1; overflow-y: auto; padding: var(--sp-8); display: flex; flex-wrap: wrap; gap: var(--sp-6); align-content: flex-start; }
.arena-pool-chip { display: inline-flex; align-items: center; padding: var(--sp-6) var(--sp-10); background: var(--bg-tint); border-radius: var(--radius-sm); font-size: calc(12px * var(--fs)); cursor: grab; transition: background .15s, transform .1s; }
.arena-pool-chip:hover { background: var(--bg); transform: translateY(-1px); }
.arena-pool-chip.dragging { opacity: 0.4; }

/* Notifications */
.notif-bell-wrap { position: relative; }
.notif-bell-btn { position: relative; padding: var(--sp-4) var(--sp-8) !important; }
.notif-badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; line-height: 1; }
.notif-panel { position: absolute; top: 100%; right: 0; width: 320px; max-height: 400px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.18); z-index: 1000; overflow: hidden; display: flex; flex-direction: column; }
.notif-panel-header { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-12) var(--sp-16); border-bottom: 1px solid var(--border); font-size: calc(13px * var(--fs)); }
.notif-empty { padding: var(--sp-24); text-align: center; color: var(--text-muted); font-size: calc(12px * var(--fs)); }
.notif-item { padding: var(--sp-10) var(--sp-16); border-bottom: 1px solid var(--border); font-size: calc(12px * var(--fs)); }
.notif-item.unread { background: rgba(var(--primary-rgb, 59,130,246), 0.06); }
.notif-title { font-weight: 600; margin-bottom: var(--sp-2); }
.notif-body { color: var(--text-muted); }
.notif-time { font-size: calc(10px * var(--fs)); color: var(--text-muted); margin-top: var(--sp-4); }

/* Button helpers */
.btn-icon { padding: var(--sp-6) var(--sp-8); min-width: 32px; min-height: 32px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.btn-ghost svg, .btn-icon svg { width: 18px; height: 18px; }
.btn-danger-ghost { color: var(--danger); border: 1px solid var(--danger); background: transparent; }
.btn-danger-ghost:hover { background: rgba(var(--danger-rgb), 0.1); }
.btn-xs { padding: var(--sp-2) var(--sp-8); font-size: calc(11px * var(--fs)); min-width: auto; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-label); }
.btn-outline:hover { background: var(--bg-tint); border-color: var(--border-hover); color: var(--text); }

@media(max-width:768px){
    .arena-grid { grid-template-columns: 1fr; }
    .arena-col-pool { position: static; }
    .notif-panel { width: calc(100vw - 32px); right: -60px; }
}

/* ── Settings Bar + Mobile FAB ── */
.settings-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
    background: var(--bg-card); border-top: 1px solid var(--border);
    padding: 8px 16px; display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap; justify-content: center;
    box-shadow: 0 -2px 12px rgba(0,0,0,.1);
}
.settings-fab {
    display: none; position: fixed; bottom: 20px; right: 20px; z-index: 500;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    align-items: center; justify-content: center; cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.settings-fab:active { transform: scale(0.92); }
@media(max-width:480px){
    .settings-bar { display: none !important; }
    .settings-fab { display: flex; }
}

/* ── TN-Card Arena Toolbar ── */
.card-arena-toolbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--bg); padding: 8px 0 10px;
    margin-bottom: 4px;
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}
.card-arena-toolbar.is-stuck {
    border-bottom-color: var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── TN-Card Mobile ── */
@media(max-width:480px){
    .card-page-header { padding: 16px !important; }
    .card-page-header .card-avatar img,
    .card-page-header .card-avatar > div:first-child {
        width: 64px !important; height: 64px !important;
        font-size: calc(24px * var(--fs)) !important;
    }
    .card-page-header h1 { font-size: calc(20px * var(--fs)) !important; }

    .card-booking-row > div { padding: 8px 10px !important; flex-wrap: wrap; gap: 6px; }
    .card-booking-label {
        flex-basis: 100% !important; white-space: normal !important;
        font-size: calc(13px * var(--fs)) !important;
    }
    .card-booking-label span { white-space: normal !important; }
    .card-booking-meta { margin-left: 0 !important; }

    .card-settings-row {
        flex-wrap: wrap !important; gap: 8px !important;
    }
    .card-settings-row > div:first-child { flex-basis: 100%; }

    .card-arena-area { padding: var(--sp-8); }
    .card-arena-cat-row { font-size: calc(11px * var(--fs)); gap: var(--sp-4) var(--sp-6); padding: var(--sp-6); }
    .card-arena-cat-name {
        white-space: normal !important; overflow: visible !important;
        flex-basis: calc(100% - 40px); /* leave room for status dot + badge */
    }
    .card-arena-cat-meta {
        flex-basis: 100%; margin-left: 0 !important;
        padding-left: 14px; /* align with text after status dot */
        font-size: calc(10px * var(--fs));
    }
}

/* fr-shake: Pflichtfeld-Validierungsanimation */
@keyframes fr-shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(3px); }
}


/* Arena touch D&D */
.drag-over-touch {
    background: rgba(var(--primary-rgb), 0.08) !important;
    border: 2px dashed var(--primary) !important;
}

/* Fightorder touch D&D */
.fo-drag-over {
    outline: 2px solid var(--primary) !important;
    background: rgba(var(--primary-rgb), 0.08) !important;
}

/* ── Sortable table headers ── */
th[onclick], th[data-sort] { cursor:pointer; user-select:none; }
th[onclick]:hover, th[data-sort]:hover { background:rgba(var(--primary-rgb),.06); }
