/* MyClub — mobile-first stylesheet. */

:root {
    /* Klubový design systém — brand červená, chrome bordó, papírové karty */
    --brand: #CC162C;       /* červená — brand / akce */
    --brand-dark: #A3101F;  /* tmavší červená pro hover */
    --bordo: #3A0E17;       /* tmavý chrome — sidebar / portál header */
    --bordo-2: #7A1F2B;     /* bordó akcent */
    --paper: #FAF8F6;       /* pozadí karet */
    --ink: #2A2320;         /* inkoust — text */
    --ok: #2E9E5B;          /* zelená stav */
    --warn: #E0922F;        /* jantarová stav */
    --bg: #F4F0EC;
    --surface: #ffffff;
    --text: #2A2320;
    --muted: #8A817B;
    --border: #E6DED8;
    --danger: #CC162C;
    --radius: 10px;
    --maxw: 900px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Archivo', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

/* Pomocné třídy — mono číslice a Material Symbols ikony */
.mono {
    font-family: 'JetBrains Mono', ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-variant-numeric: tabular-nums;
}
.ms {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    /* Inline v textu (popisky, nadpisy) — sedí na účaří a škáluje s písmem. */
    font-size: 1.15em;
    vertical-align: -0.18em;
}

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; }
h1:focus { outline: none; }

a { color: var(--brand-dark); }

/* Hlavička */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--brand);
    color: #fff;
    padding: 0.7rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-nav a { color: #fff; text-decoration: none; }
.auth-nav a:hover { text-decoration: underline; }
.auth-nav .user { font-size: 0.9rem; opacity: 0.9; }
.auth-nav form { margin: 0; }

/* Obsah */
main {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

/* Formuláře */
.auth-form {
    max-width: 420px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

form label {
    display: block;
    margin: 0.75rem 0 0.25rem;
    font-weight: 600;
    font-size: 0.95rem;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.6rem 0.7rem;
    font-size: 1rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(204, 22, 44, 0.15);
}

label > input[type="checkbox"] { width: auto; display: inline-block; margin-right: 0.4rem; }

button, .btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

button:hover { background: var(--brand-dark); }
button.danger { background: var(--danger); }
button.link {
    background: none;
    color: #fff;
    padding: 0;
    margin: 0;
    font-weight: 600;
    text-decoration: underline;
}
button.link:hover { background: none; }

/* Tabulky */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table th, .data-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: #F4F0EC;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
}

/* QuickGrid: záhlaví sortovatelných sloupců je <button> — jinak by zdědilo
   globální bílý text tlačítek a bylo na světlém th neviditelné. */
.data-table th button {
    margin: 0;
    padding: 0;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
}
.data-table th button:hover {
    background: none;
    color: var(--text);
    text-decoration: underline;
}

.data-table tr:last-child td { border-bottom: none; }

/* Sbalovací panel „Nový člen" nad gridem */
.toolbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.3rem 1rem;
    margin-bottom: 1rem;
}
.toolbar > summary {
    cursor: pointer;
    padding: 0.55rem 0;
    list-style: none;
    color: var(--brand-dark);
}
.toolbar > summary::-webkit-details-marker { display: none; }
.toolbar > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 0.5rem;
    color: var(--brand);
    transition: transform 0.15s ease;
}
.toolbar[open] > summary::before { transform: rotate(90deg); }
.toolbar[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 0.75rem; }

/* Sekce filtrů nad gridem — orámovaná, s popiskem „Filtry" */
.filters {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 0.5rem 1rem 1rem;
    margin: 0 0 0.75rem;
    min-width: 0;
}
.filters > legend {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    padding: 0 0.4rem;
}
.filter-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}
.filter-fields label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1 1 12rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}
.filter-fields input,
.filter-fields select { margin: 0; }

/* Veřejný kalendář (/kalendar) — full-width layout, Google embed přes šířku
   obrazovky; boční okraj = spodní okraj mainu (3rem, na mobilu 1rem). */
main.full-width {
    max-width: none;
    padding: 1.25rem 3rem 3rem;
}
@media (max-width: 700px) {
    main.full-width { padding: 1rem 1rem 3rem; }
}
.cal-embed {
    display: block;
    width: 100%;
    height: 72vh;
    min-height: 480px;
    border: 0;
    background: #fff;
}
.cal-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.cal-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--muted);
    padding-bottom: 0.55rem;
}
.cal-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    display: inline-block;
}
.cal-dot-home { background: #0b8043; } /* Google Basil (10) — doma */
.cal-dot-away { background: #3f51b5; } /* Google Blueberry (9) — venku */

/* Kalendář (/admin/kalendar) — denní tabulky se stejně širokými sloupci
   pod sebou (fixed layout + sdílený colgroup). */
.cal-table {
    table-layout: fixed;
    width: 100%;
}
.cal-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-table .c-time  { width: 8.5rem; }
.cal-table .c-kind  { width: 8.5rem; }
.cal-table .c-team  { width: 13rem; }
.cal-table .c-place { width: 17rem; }
/* c-title bez šířky = zbytek */

.hint {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0.25rem 0 0.75rem;
}

/* Orámovaná podsekce formuláře (např. Občanství a původ v kartě člena) */
.subfields {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 1rem 1rem;
    margin: 0.5rem 0 1rem;
    min-width: 0;
}
.subfields > legend {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    padding: 0 0.4rem;
}

/* Dvousloupcové skupiny polí (karta člena — taby, ať se formulář vejde na obrazovku) */
.field-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.25rem;
    align-items: start;
}
@media (max-width: 700px) {
    .field-cols { grid-template-columns: 1fr; }
}

/* Externí login (OAuth) */
.external-login { margin-top: 1.25rem; }
.external-login .sep {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.5rem 0;
}
.external-login form { display: flex; flex-direction: column; gap: 0.5rem; }
button.ext {
    margin-top: 0;
    color: #fff;
    width: 100%;
    text-align: center;
}
button.ext-google { background: #4285f4; }
button.ext-google:hover { background: #3367d6; }
button.ext-facebook { background: #1877f2; }
button.ext-facebook:hover { background: #145dbf; }

/* Admin nav */
.admin-nav ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.admin-nav a {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
}

/* Validace / chyby */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--ok); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: 0.9rem; }
.error { color: var(--danger); }
ul.error { padding-left: 1.2rem; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
    border-radius: 8px;
}
.blazor-error-boundary::after { content: "Došlo k chybě."; }

/* Blazor unhandled-error UI — skryté, dokud Blazor nenastaví display:block */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (min-width: 640px) {
    h1 { font-size: 1.9rem; }
}

/* ==========================================================================
   Členský portál (/portal/*) — bordó zóna, mobile-first, oddělená od zelené
   admin/login zóny. Header + karty + spodní tab bar (na desktopu horizontální).
   ========================================================================== */
:root {
    /* --bordo je sjednocené s design systémem (#3A0E17) v hlavním :root výše;
       tady jen doplňujeme tmavší odstín pro portálový chrome. */
    --bordo-dark: #2A0A10;
}

.portal { display: flex; flex-direction: column; min-height: 100vh; }

.portal-header {
    order: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--bordo);
    color: #fff;
    padding: 0.7rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.portal-brand { color: #fff; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.portal-subject { color: #fff; font-size: 0.95rem; font-weight: 600; }
.portal-logout { margin: 0; }
.portal-logout button.link { color: #fff; }

/* Přepínač subjektu (rodič s více dětmi) */
.portal-switcher { position: relative; }
.portal-switcher > summary {
    list-style: none; cursor: pointer; color: #fff; font-weight: 600;
    display: inline-flex; align-items: center; gap: 0.3rem;
}
.portal-switcher > summary::-webkit-details-marker { display: none; }
.portal-switcher > summary::after { content: "▾"; font-size: 0.8em; }
.portal-switcher[open] > summary::after { content: "▴"; }
.portal-switcher ul {
    position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + 0.4rem);
    min-width: 12rem; margin: 0; padding: 0.3rem; list-style: none;
    background: #fff; color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,0.18); z-index: 200;
}
.portal-switcher li a {
    display: block; padding: 0.5rem 0.7rem; border-radius: 8px;
    color: var(--text); text-decoration: none;
}
.portal-switcher li a:hover { background: var(--paper); }
.portal-switcher li a.active { font-weight: 700; color: var(--bordo); }

.portal-main {
    order: 2;
    max-width: var(--maxw);
    width: 100%;
    margin: 0 auto;
    padding: 1.1rem 1rem 5.5rem; /* spodní místo pro fixed tab bar na mobilu */
}

/* Karty */
.portal-card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin: 0 0 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.portal-card h1 { font-size: 1.4rem; margin: 0 0 0.75rem; }
.portal-card h2 { font-size: 1.05rem; margin: 0 0 0.6rem; }

/* Hero (hlavička profilu) */
.portal-hero { display: flex; gap: 1rem; align-items: center; }
.portal-avatar {
    flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%;
    overflow: hidden; background: var(--bordo); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.portal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.portal-avatar-initials { font-size: 1.5rem; font-weight: 700; }
.portal-hero-body { min-width: 0; }
.portal-hero-body h1 { font-size: 1.35rem; margin: 0 0 0.35rem; }
.portal-hero-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 0.5rem; }
.portal-year { color: var(--muted); font-size: 0.9rem; }
.portal-teams { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.portal-team-empty { color: var(--muted); font-size: 0.9rem; font-style: italic; }

/* Chip + stavová tečka */
.chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.15rem 0.6rem; border-radius: 999px;
    font-size: 0.8rem; font-weight: 600; background: #F4F0EC; color: var(--text);
}
.chip .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--muted); }
.chip-ok { background: #e6f4ea; color: #1c6b34; }
.chip-ok .dot { background: var(--ok); }
.chip-warn { background: #fdf0e3; color: #8a5300; }
.chip-warn .dot { background: var(--warn); }
.chip-muted { background: #eee; color: var(--muted); }
.chip-team { background: #f4e7e9; color: var(--bordo-2); }
.chip-team .dot { display: none; }

/* Definiční seznam kontaktu */
.portal-kv { display: grid; grid-template-columns: 7rem 1fr; gap: 0.4rem 0.75rem; margin: 0; }
.portal-kv dt { color: var(--muted); font-size: 0.9rem; }
.portal-kv dd { margin: 0; }

/* Statboxy */
.portal-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.portal-stat {
    display: flex; flex-direction: column; gap: 0.3rem;
    background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.8rem 0.9rem; text-decoration: none; color: var(--text);
}
a.portal-stat:hover { border-color: var(--bordo); }
.portal-stat-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.02em; }
.portal-stat-value { font-size: 1.15rem; font-weight: 700; }
.portal-stat-muted { color: var(--muted); font-weight: 600; font-size: 1rem; }

/* Seznamy (kalendář, doklady) */
.portal-list { list-style: none; margin: 0; padding: 0; }
.portal-list-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0; border-bottom: 1px solid var(--border);
}
.portal-list-row:last-child { border-bottom: none; }
.portal-date {
    flex: 0 0 auto; min-width: 4.5rem; font-variant-numeric: tabular-nums;
    font-weight: 700; color: var(--bordo);
}
.portal-list-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.portal-list-sub { color: var(--muted); font-size: 0.85rem; }
.portal-empty { color: var(--muted); padding: 0.5rem 0; }

/* Spodní tab bar (mobile-first: fixed dole) */
.portal-tabbar {
    order: 1;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    display: flex; background: #fff; border-top: 1px solid var(--border);
    box-shadow: 0 -1px 4px rgba(0,0,0,0.06);
}
.portal-tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 0.5rem 0 0.6rem; font-size: 0.72rem; color: var(--muted); text-decoration: none;
}
.portal-tabbar a .ico { font-size: 1.2rem; line-height: 1; }
.portal-tabbar a .ms { font-size: 1.4rem; }
.portal-tabbar a:hover { color: var(--brand); }
.portal-tabbar a[aria-current="page"] { color: var(--brand); font-weight: 700; }

@media (min-width: 640px) {
    /* Desktop: tab bar jako horizontální navigace pod headerem (ne fixed dole). */
    .portal-header { order: 0; }
    .portal-tabbar {
        order: 1; position: static; justify-content: center; gap: 0.5rem;
        border-top: none; border-bottom: 1px solid var(--border); box-shadow: none;
    }
    .portal-tabbar a {
        flex: 0 0 auto; flex-direction: row; gap: 0.4rem;
        padding: 0.7rem 1rem; font-size: 0.95rem;
        border-bottom: 3px solid transparent;
    }
    .portal-tabbar a[aria-current="page"] { border-bottom-color: var(--brand); }
    .portal-main { order: 2; padding-bottom: 3rem; }
    .portal-stats { grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   Admin split shell (/admin/*) — bordó sidebar 82px + topbar + tělo (Fáze 3b).
   Desktop-first; na mobilu se sidebar překlopí na horizontální lištu nahoře.
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }

.shell-sidebar {
    flex: 0 0 82px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    background: var(--bordo);
    padding: 0.7rem 0.4rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.shell-logo {
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 12px;
    background: var(--brand); color: #fff;
    font-weight: 800; font-size: 1rem; letter-spacing: 0.02em;
    text-decoration: none; margin-bottom: 0.6rem; overflow: hidden;
}
.shell-logo img { width: 100%; height: 100%; object-fit: cover; }

.shell-nav { display: flex; flex-direction: column; gap: 0.25rem; width: 100%; }
.shell-nav a {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 0.55rem 0.2rem;
    border-radius: 10px;
    color: #CBB8BC;
    text-decoration: none;
}
.shell-nav a .ms { font-size: 1.35rem; vertical-align: baseline; }
.shell-nav-label { font-size: 8px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.shell-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.shell-nav a[aria-current="page"] { color: #fff; background: var(--brand); }
.shell-nav-count {
    position: absolute; top: 4px; right: 8px;
    min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--warn); color: #2A2320;
    border-radius: 999px; font-size: 0.65rem; font-weight: 800;
}

.shell-sidebar-foot { margin-top: auto; }
.shell-sidebar-foot form { margin: 0; }
.shell-sidebar-foot button {
    margin: 0; padding: 0.5rem; background: none; border: none;
    color: #CBB8BC; cursor: pointer; border-radius: 10px;
}
.shell-sidebar-foot button:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.shell-sidebar-foot .ms { font-size: 1.3rem; }

.shell-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.shell-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    height: 62px; padding: 0 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 90;
}
.shell-topbar-title { display: flex; align-items: baseline; gap: 0.75rem; min-width: 0; }
.shell-section { font-weight: 800; font-size: 1.1rem; }
.shell-breadcrumb { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-user { color: var(--muted); font-size: 0.9rem; }

/* Tělo — širší než veřejný main (gridy potřebují prostor). */
.shell-body {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    padding: 1.25rem 1.25rem 3rem;
}

/* Dashboard statboxy (AdminHome) */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.9rem; }
.dash-stat {
    display: flex; flex-direction: column; gap: 0.4rem;
    background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.1rem; text-decoration: none; color: var(--text);
}
.dash-stat:hover { border-color: var(--brand); }
.dash-stat-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; }
.dash-stat-value { font-size: 1.7rem; font-weight: 700; }
.dash-attn { color: var(--brand); }

@media (max-width: 700px) {
    /* Mobil: sidebar jako horizontální lišta nahoře, labely skryté. */
    .shell { flex-direction: column; }
    .shell-sidebar {
        flex: 0 0 auto; flex-direction: row; height: auto; width: 100%;
        padding: 0.4rem 0.6rem; overflow-x: auto; overflow-y: hidden;
        position: sticky; top: 0; z-index: 100;
    }
    .shell-logo { width: 40px; height: 40px; margin: 0 0.4rem 0 0; flex: 0 0 auto; }
    .shell-nav { flex-direction: row; width: auto; }
    .shell-nav a { padding: 0.45rem 0.55rem; }
    .shell-nav-label { display: none; }
    .shell-sidebar-foot { margin: 0 0 0 auto; }
    .shell-topbar { height: auto; padding: 0.6rem 1rem; }
}

/* ==========================================================================
   Členský grid 4.9 — 6 sloupců, výběr řádku, column filtry, master-detail
   panel 540px (spec D/E/F). Ostrov MemberGrid + MemberDetailPanel.
   ========================================================================== */
.member-split { display: flex; align-items: flex-start; gap: 0; }
.member-grid { flex: 1 1 auto; min-width: 0; }

/* Avatar (sdílená komponenta) */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    overflow: hidden; flex: 0 0 auto; font-weight: 800;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Chip týmu (spec G) */
.team-chip {
    display: inline-block; padding: 0.1rem 0.5rem; margin: 0 0.25rem 0.15rem 0;
    background: #F1E0E3; color: #45111B;
    border-radius: 5px; font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}

/* Řádek gridu: jméno + reg. č.; stretched button = klik kamkoli v řádku
   (::after se kotví na tr — position:relative na td by pokrylo jen buňku). */
.member-table tbody tr { position: relative; }
.member-table .row-open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    margin: 0; padding: 0; background: none; border: none;
    color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.member-table .row-open:hover { background: none; }
.member-table .row-open::after { content: ""; position: absolute; inset: 0; }
.member-name { font-weight: 700; font-size: 0.9rem; }
.member-regno { font-size: 0.72rem; color: var(--muted); }
.member-type-coach { color: var(--brand); font-weight: 700; }

/* Stavy řádků (spec D.2) — stav nese button, řádek se stylí přes :has() */
.member-table tbody tr:has(.row-open.selected) td { background: #FBEEF0; }
.member-table tbody tr:has(.row-open.selected) td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.member-table tbody tr:has(.row-open.dim) td { color: var(--muted); }
.member-table tbody tr:hover td { background: #FCFAF9; }
.member-table tbody tr:has(.row-open.selected):hover td { background: #FBEEF0; }

/* Kalendář (③) — zrušené události ztlumené a škrtnuté */
.cal-cancelled td, .portal-cancelled { color: var(--muted); text-decoration: line-through; }

/* Kalendář — podtitulek v h1 (rozsah + aktivní filtry, hodí se i pro tisk) */
.cal-title-hint { font-size: 0.9rem; font-weight: 400; margin-left: 0.5rem; }

/* Tisk kalendáře (vývěska): skryje shell + filtry, tabulky nedělit přes stránku */
@media print {
    .no-print, .shell-sidebar, .shell-topbar { display: none !important; }
    .shell-body { padding: 0 !important; max-width: none !important; }
    h2 { break-after: avoid; }
    .cal-table { break-inside: avoid; }
    body { background: #fff; }
}

/* Hromadný výběr — checkbox musí nad stretched button (.row-open::after) */
.member-table .col-select { width: 2.2rem; }
.member-table .row-check,
.member-table thead .row-check { position: relative; z-index: 1; width: 1rem; height: 1rem; margin: 0; }
.bulk-bar {
    display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
    padding: 0.5rem 0.75rem; margin: 0 0 0.75rem;
    background: #FBEEF0; border: 1px solid var(--border); border-radius: 8px;
}
.bulk-bar label { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; }
.bulk-bar select { width: auto; }
.bulk-count { font-weight: 700; }

/* Column filter v hlavičce (typ/stav) */
.col-filter { display: inline-flex; align-items: center; gap: 0.25rem; }
.col-filter .ms { font-size: 1rem; color: var(--muted); }
.col-filter.active .ms { color: var(--brand); }
.col-filter select {
    width: auto; padding: 0.15rem 0.3rem; font-size: 0.78rem;
    border: 1px solid var(--border); border-radius: 6px; color: var(--muted);
    text-transform: none; letter-spacing: normal; background: #fff;
}
.col-filter.active select { color: var(--text); border-color: var(--brand); }

/* Paginator — aktivní stránka červeně */
.member-grid nav[role="navigation"] button[aria-current="page"],
.member-grid .paginator .current {
    color: var(--brand); font-weight: 800;
}

/* Master-detail panel (spec E) */
.mdp {
    flex: 0 0 540px; max-width: 540px; min-height: 320px;
    margin-left: 1rem; padding: 1.1rem 1.2rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: -8px 0 24px rgba(40, 15, 20, 0.04);
    position: sticky; top: calc(62px + 1rem);
}
.mdp-head { display: flex; gap: 0.9rem; align-items: flex-start; }
.mdp-head-body { flex: 1; min-width: 0; }
.mdp-name { font-size: 1.5rem; font-weight: 900; margin: 0 0 0.4rem; }
.mdp-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.mdp-head-actions { display: flex; align-items: center; gap: 0.4rem; }
.mdp-edit { margin: 0; padding: 0.4rem 0.8rem; font-size: 0.85rem; text-decoration: none; }
.mdp-close {
    margin: 0; padding: 0.3rem; background: none; border: none;
    color: var(--muted); cursor: pointer;
}
.mdp-close:hover { background: none; color: var(--text); }

/* Taby karty člena (MemberEdit — static SSR, přepínání přes ?tab=) */
.edit-tabs { display: flex; gap: 0.2rem; margin: 1rem 0 1.1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.edit-tabs a {
    padding: 0.5rem 0.8rem; text-decoration: none;
    border-bottom: 3px solid transparent;
    color: var(--muted); font-weight: 600; font-size: 0.9rem;
}
.edit-tabs a:hover { color: var(--text); }
.edit-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 800; }

.mdp-tabs { display: flex; gap: 0.2rem; margin: 1rem 0 0.9rem; border-bottom: 1px solid var(--border); }
.mdp-tabs button {
    margin: 0; padding: 0.5rem 0.8rem; background: none; border: none;
    border-bottom: 3px solid transparent; border-radius: 0;
    color: var(--muted); font-weight: 600; font-size: 0.9rem; cursor: pointer;
}
.mdp-tabs button:hover { background: none; color: var(--text); }
.mdp-tabs button[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 800; }

.mdp-kv { display: grid; grid-template-columns: 9rem 1fr; gap: 0.45rem 0.75rem; margin: 0 0 1rem; }
.mdp-kv dt { color: var(--muted); font-size: 0.85rem; }
.mdp-kv dd { margin: 0; font-size: 0.9rem; }

.mdp-sub { font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 1rem 0 0.5rem; }

.mdp-guardian {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.55rem 0; border-bottom: 1px solid var(--border);
}
.mdp-guardian:last-of-type { border-bottom: none; }
.mdp-guardian-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mdp-guardian-body strong { font-size: 0.9rem; }
.mdp-guardian-sub { color: var(--muted); font-size: 0.8rem; }
.mdp-pending { border: 1px dashed var(--brand); border-radius: var(--radius); padding: 0.55rem 0.7rem; margin-top: 0.5rem; }
.mdp-pending > .ms { color: var(--warn); }

.mdp-rights { display: inline-flex; gap: 0.35rem; }
.mdp-rights .ms { font-size: 1.05rem; color: #D8D2CC; }
.mdp-rights .ms.on { color: var(--ok); }

.chip-primary { background: #F4E6E8; color: var(--bordo-2); }

.mdp-statbox {
    display: flex; flex-direction: column; gap: 0.15rem;
    background: var(--bordo); color: #fff;
    border-radius: var(--radius); padding: 0.9rem 1rem; margin: 0 0 0.75rem;
}
.mdp-statbox-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; }
.mdp-statbox-value { font-size: 1.6rem; font-weight: 800; }
.mdp-statbox-sub { font-size: 0.8rem; opacity: 0.8; }
.mdp-ministats { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 0.75rem; }
.mdp-list { list-style: none; margin: 0; padding: 0; }
.mdp-list li {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.45rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem;
}
.mdp-list li:last-child { border-bottom: none; }
.mdp-list li .chip { margin-left: auto; }

/* Užší okna: panel jako overlay přes grid */
@media (max-width: 1100px) {
    .mdp {
        position: fixed; top: 0; right: 0; bottom: 0; margin: 0;
        border-radius: 0; overflow-y: auto; z-index: 150;
        box-shadow: -12px 0 32px rgba(40, 15, 20, 0.18);
    }
}
@media (max-width: 700px) {
    .mdp { left: 0; max-width: none; flex-basis: auto; }
}
