/* ============================================================
   AmyntasBC — Design System
   ============================================================ */

:root {
    --amyntas-primary: #1d4ed8;
    --amyntas-primary-600: #2563eb;
    --amyntas-primary-700: #1e40af;
    --amyntas-primary-soft: #e8efff;
    --amyntas-accent: #f97316;
    --amyntas-accent-soft: #fff1e6;
    --amyntas-success: #15803d;
    --amyntas-success-soft: #e7f6ec;
    --amyntas-danger: #dc2626;
    --amyntas-danger-soft: #fdecec;
    --amyntas-warning: #b45309;
    --amyntas-warning-soft: #fef4e6;

    --surface: #ffffff;
    --surface-2: #f7f8fb;
    --surface-3: #eef1f6;
    --border: #e4e8ef;
    --topbar-bg: rgba(255, 255, 255, 0.82);
    --text: #101828;
    --text-muted: #667085;
    --text-soft: #98a2b3;

    --sidebar-bg: linear-gradient(185deg, #0b1220 0%, #111c34 55%, #0d1730 100%);
    --sidebar-text: #cbd5e1;
    --sidebar-text-muted: #7c8aa3;
    --sidebar-active-bg: rgba(37, 99, 235, 0.18);
    --sidebar-active-text: #ffffff;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.07);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.09);
    --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.14);

    --sidebar-width: 268px;
    --topbar-height: 68px;
}

[data-theme="dark"] {
    --surface: #131a2a;
    --surface-2: #0b1220;
    --surface-3: #1c2536;
    --border: #27324a;
    --topbar-bg: rgba(15, 22, 38, 0.85);
    --text: #f1f5f9;
    --text-muted: #9aa8bd;
    --text-soft: #64748b;

    --amyntas-primary-soft: rgba(37, 99, 235, 0.20);
    --amyntas-accent-soft: rgba(249, 115, 22, 0.18);
    --amyntas-success-soft: rgba(34, 197, 94, 0.18);
    --amyntas-danger-soft: rgba(239, 68, 68, 0.18);
    --amyntas-warning-soft: rgba(245, 158, 11, 0.20);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5);
}

html, body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--surface-2);
    -webkit-font-smoothing: antialiased;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #c3cbd8 transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #c3cbd8; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #9aa6b8; background-clip: content-box; }

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

a { color: var(--amyntas-primary-600); text-decoration: none; }
a:hover { color: var(--amyntas-primary-700); }

/* ---------- App shell ---------- */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}
/* Anonymous/public view: no sidebar rendered -> single column */
.app-shell:not(:has(.sidebar)) { grid-template-columns: 1fr; }

.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 30;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 18px;
}

.sidebar__logo {
    width: 46px;
    height: 52px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    padding: 5px;
    flex: none;
}
.sidebar__logo img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}
.auth-hero__brand .sidebar__logo { width: 58px; height: 66px; border-radius: 14px; padding: 7px; }

.sidebar__title { font-size: 1.05rem; font-weight: 700; color: #fff; line-height: 1.1; }
.sidebar__subtitle { font-size: 0.72rem; color: var(--sidebar-text-muted); letter-spacing: 0.08em; text-transform: uppercase; }

.sidebar__scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px 20px;
}

.nav-group { margin-bottom: 18px; }
.nav-group__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sidebar-text-muted);
    padding: 0 10px 8px;
    font-weight: 600;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background .15s ease, color .15s ease, transform .15s ease;
    cursor: pointer;
    margin-bottom: 2px;
}
.nav-link-item:hover { background: rgba(148, 163, 184, 0.12); color: #fff; text-decoration: none; }
.nav-link-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35); }
.nav-link-item.is-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.nav-link-item svg { width: 19px; height: 19px; flex: none; opacity: 1; }
.nav-group.group-overview .nav-link-item svg { color: #60a5fa; }
.nav-group.group-club .nav-link-item svg { color: #34d399; }
.nav-group.group-operations .nav-link-item svg { color: #38bdf8; }
.nav-group.group-finance .nav-link-item svg { color: #fbbf24; }
.nav-group.group-administration .nav-link-item svg { color: #c084fc; }
.nav-link-item:hover svg { filter: brightness(1.18); }
.nav-link-item.active svg { color: #ffffff; filter: none; }

.sidebar__footer { padding: 14px; border-top: 1px solid rgba(148, 163, 184, 0.12); }
.nav-version { margin-top: 10px; padding: 2px 14px; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sidebar-text-muted); opacity: 0.75; }

/* ---------- Main / topbar ---------- */
.main-area { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 26px;
    background: var(--topbar-bg);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar__search {
    flex: 1;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 0.88rem;
}
.topbar__search input { border: 0; background: transparent; outline: none; width: 100%; color: var(--text); }

.topbar__spacer { flex: 1; }

.icon-btn {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted);
    cursor: pointer; transition: all .15s ease;
}
.icon-btn:hover { color: var(--amyntas-primary-600); border-color: #c7d6f8; background: #f5f8ff; }

.lang-switch { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.lang-switch button {
    border: 0; background: transparent; padding: 6px 10px; border-radius: 8px;
    font-size: 0.78rem; font-weight: 700; color: var(--text-muted); cursor: pointer;
}
.lang-switch button.active { background: var(--amyntas-primary); color: #fff; }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.user-chip__avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--amyntas-primary-600), #7c3aed);
    color: #fff; font-weight: 700; font-size: 0.82rem;
}
.user-chip__name { font-size: 0.85rem; font-weight: 600; line-height: 1.1; }
.user-chip__role { font-size: 0.72rem; color: var(--text-muted); }

.content { padding: 28px; flex: 1; }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-header__title { font-size: 1.6rem; font-weight: 750; margin: 0; }
.page-header__subtitle { color: var(--text-muted); margin: 4px 0 0; font-size: 0.92rem; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Cards ---------- */
.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}
.app-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.app-card__title { font-size: 1.02rem; font-weight: 700; margin: 0; }
.app-card__subtitle { font-size: 0.82rem; color: var(--text-muted); margin: 2px 0 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }

.kpi-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-card__top { display: flex; align-items: center; justify-content: space-between; }
.kpi-card__label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.kpi-card__icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; }
.kpi-card__value { font-size: 2rem; font-weight: 750; margin: 12px 0 2px; letter-spacing: -0.03em; }
.kpi-card__trend { font-size: 0.82rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.trend-up { color: var(--amyntas-success); }
.trend-down { color: var(--amyntas-danger); }

.icon-primary { background: var(--amyntas-primary-soft); color: var(--amyntas-primary-600); }
.icon-accent { background: var(--amyntas-accent-soft); color: var(--amyntas-accent); }
.icon-success { background: var(--amyntas-success-soft); color: var(--amyntas-success); }
.icon-danger { background: var(--amyntas-danger-soft); color: var(--amyntas-danger); }
.icon-warning { background: var(--amyntas-warning-soft); color: var(--amyntas-warning); }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.badge-soft { padding: 4px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; }
.badge-soft.badge-primary { background: var(--amyntas-primary-soft); color: var(--amyntas-primary-700); }
.badge-soft.badge-success { background: var(--amyntas-success-soft); color: var(--amyntas-success); }
.badge-soft.badge-warning { background: var(--amyntas-warning-soft); color: var(--amyntas-warning); }
.badge-soft.badge-danger { background: var(--amyntas-danger-soft); color: var(--amyntas-danger); }

.team-pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.team-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn .app-icon { margin-right: 6px; vertical-align: -2px; }
.app-icon { flex: none; }
.btn-primary { background: var(--amyntas-primary-600); border-color: var(--amyntas-primary-600); }
.btn-primary:hover, .btn-primary:focus { background: var(--amyntas-primary-700); border-color: var(--amyntas-primary-700); }
.btn-accent { background: var(--amyntas-accent); border-color: var(--amyntas-accent); color: #fff; }
.btn-accent:hover { background: #ea6a0c; border-color: #ea6a0c; color: #fff; }
.btn-outline-secondary { border-color: var(--border); color: var(--text); }
.btn-outline-secondary:hover { background: var(--surface-3); border-color: var(--border); color: var(--text); }

/* ---------- Auth pages ---------- */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--surface-2);
}
.auth-hero {
    position: relative;
    background: var(--sidebar-bg);
    color: #fff;
    padding: 56px 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.auth-hero::after {
    content: "";
    position: absolute;
    width: 520px; height: 520px; border-radius: 50%;
    right: -180px; bottom: -180px;
    background: radial-gradient(circle at center, rgba(37,99,235,0.55), transparent 65%);
}
.auth-hero__brand { display: flex; align-items: center; gap: 14px; }
.auth-hero__title { font-size: 2.5rem; font-weight: 750; letter-spacing: -0.03em; max-width: 520px; line-height: 1.15; position: relative; z-index: 2; }
.auth-hero__text { color: #a9b6cc; max-width: 460px; font-size: 1.02rem; position: relative; z-index: 2; }
.auth-panel { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-mobile-brand { display: none; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-mobile-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        margin-bottom: 22px;
        text-align: center;
    }
    .auth-mobile-brand .sidebar__logo { width: 64px; height: 72px; border-radius: 14px; padding: 8px; }
    .auth-mobile-brand .sidebar__title { color: var(--text); font-size: 1.05rem; }
    .auth-mobile-brand .sidebar__subtitle { color: var(--text-muted); margin-top: -2px; }
}

.auth-title { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); font-size: 0.94rem; margin-bottom: 24px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: 0.8rem; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-footer { text-align: center; margin-top: 22px; font-size: 0.9rem; color: var(--text-muted); }

.manage-grid { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.manage-nav { display: flex; flex-direction: column; gap: 4px; }
.manage-nav a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--text); font-weight: 500; font-size: 0.9rem; }
.manage-nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.manage-nav a.active { background: var(--amyntas-primary-soft); color: var(--amyntas-primary-700); font-weight: 600; }
@media (max-width: 860px) { .manage-grid { grid-template-columns: 1fr; } }

.modal-overlay {
    position: fixed; inset: 0; z-index: 1050;
    background: rgba(16, 24, 40, 0.45);
    backdrop-filter: blur(2px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 60px 16px;
    overflow-y: auto;
}
.modal-card { width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); }

.topbar__dropdown { position: relative; }
.icon-btn { position: relative; }
.topbar__badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--amyntas-danger); color: #fff;
    font-size: 0.68rem; font-weight: 700; display: grid; place-items: center;
    box-shadow: 0 0 0 2px var(--surface);
}
.notif-panel {
    position: absolute; top: calc(100% + 10px); right: 0; width: 330px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); overflow: hidden; z-index: 40;
}
.notif-panel__header { padding: 14px 16px; font-weight: 700; border-bottom: 1px solid var(--border); }
.notif-panel__empty { padding: 22px 16px; color: var(--text-muted); font-size: 0.88rem; text-align: center; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.notif-item__dot.icon-primary { background: var(--amyntas-primary-600); }
.notif-item__dot.icon-warning { background: var(--amyntas-warning); }
.notif-item__dot.icon-danger { background: var(--amyntas-danger); }
.notif-item__dot.icon-success { background: var(--amyntas-success); }
.notif-item__title { font-weight: 600; font-size: 0.88rem; }
.notif-item__text { color: var(--text-muted); font-size: 0.8rem; }

/* ============================================================
   Responsive / mobile
   ============================================================ */
.nav-overlay { display: none; }
.bottom-nav { display: none; }

@media (max-width: 960px) {
    .app-shell.nav-open .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(4, 8, 18, 0.5);
        backdrop-filter: blur(2px);
        z-index: 25;
    }

    .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-scroll table { min-width: 560px; }

    .content { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
    .bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        z-index: 28;
        box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.06);
    }
    .bottom-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 6px 2px;
        border: 0;
        background: transparent;
        color: var(--text-muted);
        font-size: 0.68rem;
        font-weight: 600;
        border-radius: 10px;
        text-decoration: none;
        cursor: pointer;
    }
    .bottom-nav__item svg { width: 22px; height: 22px; }
    .bottom-nav__item.active { color: var(--amyntas-primary-600); background: var(--amyntas-primary-soft); }
}

@media (max-width: 720px) {
    .content { padding: 14px; }
    .page-header { gap: 12px; margin-bottom: 18px; }
    .page-header__title { font-size: 1.35rem; }
    .page-actions { width: 100%; flex-wrap: wrap; }
    .app-card { padding: 16px; border-radius: 14px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .kpi-card { padding: 16px; }
    .kpi-card__value { font-size: 1.6rem; }
    .notif-panel { width: min(92vw, 330px); right: -8px; }
    .topbar { gap: 8px; }
    .user-chip { padding: 4px; }
    .auth-title { font-size: 1.45rem; }
    .manage-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .lang-switch button { padding: 6px 9px; }
    .btn { padding-left: 12px; padding-right: 12px; }
}

/* Quick actions (role-aware) */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 12px;
}
.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.quick-action:hover {
    border-color: var(--amyntas-primary-600);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text);
    transform: translateY(-2px);
}
.quick-action .kpi-card__icon { width: 38px; height: 38px; flex: none; }

/* Friendly loading / state card */
.state-card {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}
.state-spinner {
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 50%;
    border: 2px solid var(--border);
    border-top-color: var(--amyntas-primary-600);
    animation: state-spin 0.7s linear infinite;
}
@keyframes state-spin {
    to { transform: rotate(360deg); }
}

/* Schedule (agenda) */
.schedule-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}
.schedule-row:first-of-type { border-top: 0; }
.schedule-row__time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 6px 8px;
    border-radius: 10px;
    background: var(--amyntas-primary-soft);
    color: var(--amyntas-primary-700);
    font-weight: 700;
    font-size: 0.85rem;
    flex: none;
}
.schedule-row__time small { font-weight: 500; font-size: 0.68rem; opacity: 0.8; }

/* Scheduler uses a light surface; force readable dark text regardless of app theme */
.amyntas-scheduler { color: #1f2937; }

/* Scheduler appointment card (Notion-like) */
.sched-card {
    color: #1f2937;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    height: 100%;
    padding: 3px 6px;
    border-radius: 6px;
    border-left: 4px solid transparent;
    overflow: hidden;
    line-height: 1.15;
}
.sched-card__edit {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 2px;
    line-height: 1;
    border: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.75);
    color: #1f2937;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.12s ease;
}
.sched-card:hover .sched-card__edit { opacity: 1; }
.sched-card__time { font-size: 0.68rem; font-weight: 600; opacity: 0.85; }
.sched-card__title {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sched-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}
.sched-card__team {
    padding: 0 6px;
    max-width: 100%;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sched-card__tag {
    padding: 0 6px;
    max-width: 100%;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #7c2d12;
    background: #fed7aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sched-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.sched-legend__label { font-weight: 700; font-size: 0.8rem; margin-right: 4px; }
.sched-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; }
.sched-legend__swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- DevExpress scheduler ---------- */
.sched-card { cursor: pointer; }
.sched-card__status {
    padding: 0 6px;
    max-width: 100%;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #334155;
    background: rgba(15, 23, 42, 0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.amyntas-scheduler { min-height: 640px; }

/* ---------- Reports ---------- */
.report-bar {
    flex: 1;
    height: 8px;
    min-width: 60px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}
.report-bar__fill {
    height: 100%;
    border-radius: 999px;
    background: var(--amyntas-primary);
}

/* ---------- Responsive month calendar ---------- */
.cal__toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal__title { font-weight: 700; font-size: 1.05rem; text-transform: capitalize; }
.cal__spacer { flex: 1; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__dow {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: 2px;
}
.cal__cell {
    min-height: 96px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--surface);
    min-width: 0;
}
.cal__cell--muted { opacity: 0.45; }
.cal__cell--today { box-shadow: inset 0 0 0 2px var(--amyntas-primary); }
.cal__daynum { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.cal__events { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal__event {
    text-align: left;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 5px;
    padding: 2px 4px;
    font-size: 0.66rem;
    line-height: 1.15;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cal__event__time { font-weight: 700; opacity: 0.85; }
.cal__event__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal__event--cancelled .cal__event__title { text-decoration: line-through; opacity: 0.6; }

@media (max-width: 720px) {
    .cal { gap: 3px; }
    .cal__cell { min-height: 72px; padding: 3px; border-radius: 8px; }
    .cal__event { font-size: 0.6rem; padding: 1px 3px; }
    .cal__event__time { display: none; }
    .cal__dow { font-size: 0.62rem; }
    .cal__daynum { font-size: 0.66rem; }
}

/* ---------- Tabs (raised cards, not flat) ---------- */
.nav-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 0;
    padding: 0;
}
.nav-tabs .nav-link {
    border: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    background: var(--surface-3);
    color: var(--text-muted);
    font-weight: 600;
    padding: 9px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.nav-tabs .nav-link:hover { background: var(--surface-2); color: var(--text); border-color: #c7d6f8; }
.nav-tabs .nav-link.active {
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    border-color: var(--border);
    border-bottom-color: var(--surface);
    box-shadow: 0 -3px 10px rgba(16, 24, 40, 0.06);
}
.nav-tabs .nav-link.active svg { color: var(--amyntas-primary-600); }

/* ---------- Event details popup ---------- */
.event-pop {
    width: 100%;
    max-width: 420px;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.event-pop__banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    color: #fff;
}
.event-pop__team { font-weight: 750; font-size: 1.05rem; }
.event-pop__status { font-size: 0.78rem; opacity: 0.9; margin-top: 2px; }
.event-pop__close { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.event-pop__close:hover { color: #fff; background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.6); }
.event-pop__body { padding: 16px 18px; }
.event-pop__matchup { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 650; margin-bottom: 14px; }
.event-pop__vs { color: var(--text-muted); }
.event-pop__rows { display: flex; flex-direction: column; gap: 8px; }
.event-pop__row { display: flex; gap: 10px; font-size: 0.88rem; }
.event-pop__label { min-width: 92px; color: var(--text-muted); font-weight: 600; }
.event-pop__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
}
@media (max-width: 480px) {
    .event-pop__label { min-width: 78px; }
}

/* ---------- Public layout (no sidebar) ---------- */
.public-shell { display: flex; flex-direction: column; min-height: 100vh; background: var(--surface-2); }
.public-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--topbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.public-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.public-brand__logo { width: 36px; height: 36px; object-fit: contain; }
.public-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.public-brand__title { font-weight: 750; font-size: 0.98rem; }
.public-brand__sub { font-size: 0.75rem; color: var(--text-muted); }
.public-actions { display: flex; align-items: center; gap: 8px; }
.public-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 20px 0;
    background: var(--surface-2);
}
.public-tab {
    padding: 8px 16px;
    border-radius: 10px 10px 0 0;
    font-weight: 650;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}
.public-tab:hover { color: var(--text); }
.public-tab--active { color: var(--amyntas-primary-700); border-bottom-color: var(--amyntas-primary); }
.public-content { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 22px 20px 40px; }

/* ---------- Public results ---------- */
.result-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: 0; }
.result-row__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
    font-weight: 700;
    line-height: 1.1;
}
.result-row__date small { color: var(--text-muted); font-weight: 500; font-size: 0.7rem; }
.result-row__main { flex: 1; min-width: 0; }
.result-row__matchup { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.result-row__score { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.result-row__value { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.result-row__value--win { color: var(--amyntas-success); }
.result-row__value--loss { color: var(--amyntas-danger); }
.result-row__value--draw { color: var(--amyntas-warning); }
.result-row__sep { margin: 0 4px; color: var(--text-muted); }

/* ---------- Public hub (/mobile) ---------- */
.hub { max-width: 620px; margin: 0 auto; }
.hub__intro { margin: 6px 0 18px; }
.hub__title { font-weight: 800; font-size: 1.6rem; margin: 0; }
.hub__subtitle { color: var(--text-muted); margin: 4px 0 0; }
.hub-grid { display: grid; gap: 14px; }
.hub-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.hub-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12); color: var(--text); }
.hub-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    flex-shrink: 0;
}
.hub-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.hub-card__title { font-weight: 750; font-size: 1.05rem; }
.hub-card__desc { color: var(--text-muted); font-size: 0.82rem; }
.hub-card__chevron { color: var(--text-soft); font-size: 1.6rem; line-height: 1; }
.hub-card--games .hub-card__icon { background: var(--amyntas-primary-soft); color: var(--amyntas-primary-700); }
.hub-card--training .hub-card__icon { background: var(--amyntas-success-soft); color: var(--amyntas-success); }
.hub-card--results .hub-card__icon { background: var(--amyntas-warning-soft); color: var(--amyntas-warning); }
.public-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 20px;
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
}
@media (max-width: 720px) {
    .public-topbar { padding: 10px 14px; }
    .public-tabs { padding: 8px 12px 0; }
    .public-tab { padding: 8px 12px; font-size: 0.85rem; }
    .public-content { padding: 16px 12px 32px; }
    .public-brand__sub { display: none; }
}

/* ---------- Schedule (public page) — mobile ---------- */
@media (max-width: 720px) {
    .page-header { align-items: flex-start; }
    .page-actions { flex-wrap: wrap; }
    .nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .nav-tabs .nav-link { white-space: nowrap; }
    .schedule-row { flex-wrap: wrap; gap: 8px; }
    .schedule-row__time { min-width: 48px; }
    .sched-legend__label { width: 100%; }
    .amyntas-scheduler { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .modal-card { max-width: 100%; }
}

/* Mobile card list (instead of grid) */
.mobile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 4px;
    border-top: 1px solid var(--border);
    color: var(--text);
}
.mobile-row:first-child { border-top: 0; }
.mobile-row:hover { text-decoration: none; color: var(--text); }
.mobile-row__sub { color: var(--text-muted); font-size: 0.8rem; }
.mobile-row__right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.mobile-row__chevron { color: var(--text-soft); font-size: 1.4rem; line-height: 1; }

/* Mobile search box */
.mobile-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-muted);
}
.mobile-search input {
    border: 0;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--text);
    font-size: 0.95rem;
}
.mobile-search__clear {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 2px 4px;
}

/* Seamless mobile/desktop switching (no flash): both rendered, CSS decides instantly */
.only-mobile { display: none; }
@media (max-width: 820px) {
    .only-mobile { display: block; }
    .only-desktop { display: none !important; }
}

.form-control, .form-select { border-radius: 10px; border-color: var(--border); }.form-control:focus, .form-select:focus { border-color: var(--amyntas-primary-600); box-shadow: 0 0 0 4px rgba(37,99,235,0.12); }
.form-floating > .form-control { border-radius: 10px; }

/* ---------- Blazor error UI ---------- */
#blazor-error-ui {
    display: none;
    position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
    background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--amyntas-danger);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 14px 20px; z-index: 1080; gap: 14px; align-items: center;
}
.blazor-error-boundary { border-radius: var(--radius); }

.valid.modified:not([type=checkbox]) { outline: 1px solid var(--amyntas-success); }
.invalid { outline: 1px solid var(--amyntas-danger); }
.validation-message { color: var(--amyntas-danger); }

/* ---------- DevExpress tweaks ---------- */
.dxbl-grid { border-radius: var(--radius-lg); overflow: hidden; }

/* ---------- Responsive sidebar ---------- */
.sidebar-toggle { display: none; }
@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width);
        transform: translateX(-100%); transition: transform .25s ease;
    }
    .app-shell.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-toggle { display: grid; }
    .content { padding: 18px; }
    .topbar { padding: 0 16px; }
    .topbar__search { display: none; }
    .user-chip__meta { display: none; }
}
