/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }

/* ---- CSS proměnné (design tokeny) ---- */
:root {
    --cal-primary:     #3182ce;
    --cal-primary-dk:  #2b6cb0;
    --cal-primary-bg:  #ebf4ff;
    --cal-border:      #e2e8f0;
    --cal-bg:          #ffffff;
    --cal-bg-light:    #f8fafc;
    --cal-past-stripe: repeating-linear-gradient(45deg,#f8f8f8,#f8f8f8 9px,#f0f0f0 9px,#f0f0f0 18px);
    --cal-weekend:     #fdf8f8;
    --cal-weekend-num: #c53030;
    --cal-day-num:     #64748b;
    --cal-today-bg:    #3182ce;
    --cal-today-color: #fff;
    --badge-bg:        #fee2e2;
    --badge-color:     #991b1b;
    --badge-border:    #fecaca;
    --sidebar-color:   #2c3e50;
    --active-blue:     #3182ce;
    --bg-light:        #f4f7f6;
    --text-dark:       #333;
}

/* =============================================
   VEŘEJNÁ STRÁNKA — 100 VH, BEZ SCROLLBARU
   ============================================= */
body:not(.admin-body) {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg-light);
    color: #333;
    margin: 0;
    padding: 12px 16px;
    height: 100vh;
    overflow: hidden;
}

/* =============================================
   ADMIN — základní vzhled
   ============================================= */
body.admin-body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg-light);
    color: #333;
}

/* =============================================
   VEŘEJNÝ LAYOUT — dvousloupcový grid
   ============================================= */
.container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 1600px;
    /* Výška: 100vh minus padding nahoře a dole (2×12px) */
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
    margin: 0 auto;
    background: #fff;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    min-height: 0;
}

.left-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Pravý sloupec se formuláře scrolluje interně */
.right-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}
.right-col::-webkit-scrollbar { width: 5px; }
.right-col::-webkit-scrollbar-track { background: transparent; }
.right-col::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 4px; }

/* =============================================
   FORMULÁŘ
   ============================================= */
.form-group { margin-bottom: 9px; }
label {
    display: block; margin-bottom: 3px;
    font-weight: 700; font-size: 11px;
    text-transform: uppercase; color: #555;
    letter-spacing: .4px;
}
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
    width: 100%; padding: 7px 10px;
    border: 1px solid #cbd5e0; border-radius: 6px;
    font-size: 14px; font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--cal-primary);
    box-shadow: 0 0 0 3px rgba(49,130,206,.15);
}
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* =============================================
   VEŘEJNÝ KALENDÁŘ — hlavička + grid
   ============================================= */
/* Sjednocená hlavička obou kalendářů */
.admin-cal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    background: #fff;
    padding: 10px 16px;
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--cal-border);
    border-bottom: none;
}
.period-switcher {
    display: flex; align-items: center;
    background: var(--cal-bg-light);
    border: 1px solid #d1e3f8;
    border-radius: 50px; padding: 5px 14px; gap: 12px;
}
.cal-brand-label {
    font-size: 17px; font-weight: 900;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: #2c3e50; line-height: 1.2;
}
.period-switcher button {
    background: #fff; border-radius: 50%;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #d1e3f8; color: var(--cal-primary);
    font-size: 13px; cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.period-switcher button:hover {
    background: var(--cal-primary); color: #fff;
    border-color: var(--cal-primary); transform: scale(1.08);
}
.clickable-label {
    cursor: pointer; font-size: 15px; font-weight: 700;
    color: #2c3e50; min-width: 140px; text-align: center;
    padding: 5px 14px; border-radius: 20px;
    transition: all .2s ease; user-select: none;
}
.clickable-label:hover { background: var(--cal-primary-bg); color: var(--cal-primary); }
.header-titles { display: flex; flex-direction: column; align-items: center; gap: 0; }

/* Obal kalendáře — vyplní celou zbývající výšku levého sloupce */
.calendar {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    border: 1px solid var(--cal-border);
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    background: #fff;
}

/* Záhlaví dnů (Po–Ne) */
.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--cal-bg-light);
    border-bottom: 1px solid var(--cal-border);
    text-align: center; font-weight: 700; font-size: 12px;
    color: #718096; padding: 6px 0; letter-spacing: .4px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Mřížka dnů — vyplní volnou výšku rovnoměrně */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    flex-grow: 1;
    min-height: 0;
    background: var(--cal-border);
    gap: 1px;
    border-top: none;
}

/* =============================================
   SDÍLENÉ STYLY BUŇKY (veřejný kalendář)
   ============================================= */
.calendar-day {
    background: var(--cal-bg);
    padding: 4px 3px 3px;
    text-align: center;
    cursor: pointer;
    transition: background .15s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--cal-day-num);
    position: relative;
}
.calendar-day:hover { background: var(--cal-primary-bg); }
.calendar-day.empty { background: var(--cal-bg-light); cursor: default; }
.calendar-day.empty:hover { background: var(--cal-bg-light); }

/* Víkend (6. a 7. sloupec: so, ne) — jemný tint */
.calendar-day:nth-child(7n+6),
.calendar-day:nth-child(7n)   { background: var(--cal-weekend); }
.calendar-day:nth-child(7n+6):hover,
.calendar-day:nth-child(7n):hover { background: var(--cal-primary-bg); }
.calendar-day:nth-child(7n+6) { color: var(--cal-weekend-num); }
.calendar-day:nth-child(7n)   { color: var(--cal-weekend-num); }

.calendar-day.past {
    background: var(--cal-past-stripe) !important;
    color: #b0bec5 !important;
    cursor: not-allowed;
}
.calendar-day.past:hover { background: var(--cal-past-stripe) !important; }
.calendar-day.selected {
    background: var(--cal-primary) !important;
    color: #fff !important;
}
.calendar-day.selected:hover { background: var(--cal-primary-dk) !important; }

/* =============================================
   ŠTÍTEK OBSAZENO (veřejný kalendář)
   ============================================= */
.obsazeno-badge {
    background: var(--badge-bg);
    color: var(--badge-color);
    font-size: 9px;
    font-weight: 600;
    padding: 1px 3px;
    border-radius: 3px;
    border: 1px solid var(--badge-border);
    text-align: center;
    line-height: 1.1;
    cursor: not-allowed;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}
/* Zabrání štítku zvětšit buňku přes její maximální výšku v gridu */
.calendar-day > .obsazeno-badge:nth-child(n+4) { display: none; }

/* =============================================
   ČASY (time-slots)
   ============================================= */
.time-options-wrapper {
    height: 155px;
    background: #fcfcfc;
    border: 1px dashed #d1e3f8;
    border-radius: 6px;
    padding: 5px;
    position: relative;
}
.time-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
    height: 100%;
    overflow-y: auto;
    align-content: start;
    padding-right: 4px;
}
.time-options::-webkit-scrollbar { width: 5px; }
.time-options::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.time-options::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
.time-options input[type="radio"] { display: none; }
.time-options label {
    display: block; background: var(--cal-bg-light);
    padding: 6px 4px; text-align: center; border-radius: 5px;
    cursor: pointer; border: 1px solid var(--cal-border);
    font-size: 12px; line-height: 1.3; font-weight: 600; color: #333;
    transition: all .15s;
}
.time-options label:hover { border-color: var(--cal-primary); background: var(--cal-primary-bg); }
.time-options input[type="radio"]:checked + label {
    background: var(--cal-primary); color: #fff;
    border-color: var(--cal-primary-dk);
}
.time-options input[type="radio"]:disabled + label {
    background: #e0e0e0; color: #999; cursor: not-allowed; text-decoration: line-through;
}
#loader {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center;
    color: var(--cal-primary); font-weight: 700;
    border-radius: 4px;
}

/* =============================================
   TLAČÍTKA
   ============================================= */
.btn-submit {
    background: var(--cal-primary); color: #fff;
    padding: 11px; border: none; border-radius: 6px;
    width: 100%; font-size: 15px; cursor: pointer;
    margin-top: 8px; font-weight: 700;
    transition: background .2s;
}
.btn-submit:hover { background: var(--cal-primary-dk); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; font-size: 14px; font-weight: 600; border-radius: 8px; border: none; cursor: pointer; text-decoration: none; transition: all .2s ease; font-family: inherit; box-sizing: border-box; }
.btn:active, .btn-submit:active, .btn-icon:active { transform: scale(.95); }
.btn-main  { background: #3182ce; color: #fff; box-shadow: 0 4px 6px rgba(49,130,206,.2); }
.btn-main:hover  { background: #2b6cb0; color: #fff; }
.btn-success { background: #38a169; color: #fff; box-shadow: 0 4px 6px rgba(56,161,105,.2); }
.btn-success:hover { background: #2f855a; color: #fff; }
.btn-danger { background: #e53e3e; color: #fff; box-shadow: 0 4px 6px rgba(229,62,62,.2); }
.btn-danger:hover { background: #c53030; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 6px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: #fff; text-decoration: none; transition: all .2s ease; border: none; cursor: pointer; }
.btn-icon.edit  { background: #3182ce; }
.btn-icon.edit:hover  { background: #2b6cb0; }
.btn-icon.delete { background: #e53e3e; }
.btn-icon.delete:hover { background: #c53030; }

/* =============================================
   ADMIN — LAYOUT
   ============================================= */
.admin-body { display: flex; font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg-light); }
.sidebar { width: 240px; height: 100vh; background: var(--sidebar-color); color: white; position: fixed; display: flex; flex-direction: column; }
.sidebar-header { padding: 20px; text-align: center; border-bottom: 1px solid #3e4f5f; font-weight: bold; }
.sidebar-menu { list-style: none; padding: 0; margin: 0; flex-grow: 1; }
.sidebar-menu li a { display: flex; align-items: center; gap: 15px !important; padding: 15px 20px; color: #b8c7ce; text-decoration: none; transition: .3s; }
.sidebar-menu li a:hover,
.sidebar-menu li a.active { background: #1e282c; color: white; border-left: 4px solid var(--active-blue); }
.nav-icon { width: 28px; text-align: center; }
.main-wrapper { margin-left: 240px; width: calc(100% - 240px); }
.top-bar { background: var(--active-blue); color: white; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; }
.content-area { padding: 30px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }
.card { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 2px 5px rgba(0,0,0,.05); }
.card h3 { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 10px; font-size: 16px; color: var(--text-dark); }
.main-title { font-size: 24px; font-weight: bold; text-align: center; margin-bottom: 25px; margin-top: 0; }
.top-dashboard-row { display: grid; grid-template-columns: 280px 1fr 320px; gap: 20px; margin-bottom: 20px; align-items: start; }

/* =============================================
   ADMIN KALENDÁŘ — mřížka
   Sjednocená s veřejným (stejné barvy, border, hover)
   Fixní výška řádků = buňky se nezvětšují
   ============================================= */
#admin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: 105px;
    background: var(--cal-border);
    gap: 1px;
    border: 1px solid var(--cal-border);
    border-radius: 0 0 8px 8px;
    /* overflow: visible — aby se rozbalená buňka zobrazila nad sousedy */
    overflow: visible;
    position: relative;
}

.calendar-day-admin {
    background: var(--cal-bg);
    padding: 5px 6px 4px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: background .15s;
    overflow: hidden;
    height: 105px;
    position: relative;   /* základ pro absolutní rozbalení */
}
.calendar-day-admin:hover { background: var(--cal-primary-bg); }
.calendar-day-admin.empty { background: var(--cal-bg-light); cursor: default; }
.calendar-day-admin.empty:hover { background: var(--cal-bg-light); }

/* Rozbalená buňka — plave nad mřížkou */
.calendar-day-admin.expanded {
    overflow: visible;
    height: 105px;   /* výška v gridu se nemění */
    z-index: 50;
}
.calendar-day-admin.expanded .day-events-container {
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    background: #fff;
    border: 1px solid var(--cal-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 4px 5px 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,.13);
    overflow: visible;
    gap: 3px;
    z-index: 50;
}

/* Tlačítko „+N dalších" */
.more-badge {
    font-size: 11px; font-weight: 700;
    color: var(--cal-primary);
    background: var(--cal-primary-bg);
    border: 1px dashed var(--cal-primary);
    border-radius: 4px;
    padding: 2px 5px;
    cursor: pointer;
    text-align: center;
    line-height: 1.4;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    user-select: none;
}
.more-badge:hover { background: var(--cal-primary); color: #fff; }

/* Víkendové sloupce (6. a 7.) — So/Ne */
.calendar-day-admin:nth-child(7n+6),
.calendar-day-admin:nth-child(7n) { background: var(--cal-weekend); }
.calendar-day-admin:nth-child(7n+6):hover,
.calendar-day-admin:nth-child(7n):hover { background: var(--cal-primary-bg); }

.day-header { display: flex; justify-content: flex-end; margin-bottom: 4px; flex-shrink: 0; }
.day-num {
    font-weight: 700; font-size: 13px; color: var(--cal-day-num);
    line-height: 1; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
/* Víkendové číslo dne — červené */
.calendar-day-admin:nth-child(7n+6) .day-num,
.calendar-day-admin:nth-child(7n) .day-num { color: var(--cal-weekend-num); }

/* Dnešní datum — modré kolečko */
.calendar-day-admin.today .day-num {
    background: var(--cal-today-bg);
    color: var(--cal-today-color);
}

.day-events-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

/* Odznak události — sjednocený s veřejným badge */
.event-badge {
    background: var(--cal-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid var(--cal-primary-dk);
    cursor: pointer;
    transition: transform .1s, background .15s;
    flex-shrink: 0;
    line-height: 1.4;
}
.event-badge:hover { background: var(--cal-primary-dk); transform: scale(1.02); }
.event-badge.pending { background: #d69e2e; border-left-color: #b7791f; }
.event-badge.pending:hover { background: #b7791f; }
.event-badge.cancelled { background: #e53e3e; border-left-color: #c53030; }
.event-badge.cancelled:hover { background: #c53030; }

/* Záhlaví dnů v admin kalendáři */
.calendar-days-header-admin {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--cal-bg-light);
    border: 1px solid var(--cal-border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    text-align: center;
    font-weight: 700; font-size: 12px;
    color: #718096;
    padding: 7px 0;
    letter-spacing: .4px;
    text-transform: uppercase;
}

/* =============================================
   PŘEPÍNAČ POHLEDU (veřejný — zachování funkce)
   ============================================= */
.view-toggles { display: flex; gap: 5px; margin-bottom: 15px; justify-content: center; }
.view-toggles button { padding: 8px 15px; border: 1px solid var(--cal-primary); background: #fff; color: var(--cal-primary); cursor: pointer; border-radius: 4px; font-weight: bold; }
.view-toggles button.active { background: var(--cal-primary); color: #fff; }
.view-toggles button:hover:not(.active) { background: var(--cal-primary-bg); }

/* Roční pohled */
.calendar-grid.view-year { grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 10px; display: grid; grid-auto-rows: 1fr; background: #fff; }
.calendar-grid.view-year .calendar-day { border: 1px solid #eee; border-radius: 6px; padding: 25px 5px; justify-content: center; background: var(--cal-bg-light); }
.calendar-grid.view-year .calendar-day:hover { background: var(--cal-primary-bg); }

/* =============================================
   MODALY
   ============================================= */
.modal-overlay { display: none; position: fixed; z-index: 99999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.modal-window { background: #fff; margin: 40px auto; padding: 0; width: 95%; max-width: 600px; border-radius: 12px; position: relative; box-shadow: 0 15px 50px rgba(0,0,0,.3); overflow: hidden; }
.modal-window h3 { background: #f8f9fa; margin: 0; padding: 20px; font-size: 18px; border-bottom: 1px solid #eee; color: #333; }
.modal-window form { padding: 20px; }
.close-btn { position: absolute; right: 20px; top: 15px; font-size: 32px; cursor: pointer; color: #bbb; z-index: 10; }
#clientDetailModal .modal-window { max-width: 900px; }
.client-detail-wrapper { display: grid; grid-template-columns: 320px 1fr; height: 75vh; }
.client-info-side { background: #f8f9fa; padding: 25px; border-right: 1px solid #eee; overflow-y: auto; }
.client-appointments-side { background: #fff; padding: 25px; overflow-y: auto; }
.client-header-avatar { width: 50px; height: 50px; background: var(--cal-primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: bold; margin-bottom: 15px; }
.client-info-side h4 { color: var(--cal-primary); margin-bottom: 20px; border-bottom: 2px solid #f0f0f0; padding-bottom: 10px; }
.info-item { margin-bottom: 15px; font-size: 14px; }
.info-item label { display: block; color: #888; font-size: 12px; font-weight: bold; text-transform: uppercase; }
.info-item span { font-weight: 500; color: #333; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th { text-align: left; background: #f9f9f9; padding: 10px; border-bottom: 2px solid #eee; }
.mini-table td { padding: 10px; border-bottom: 1px solid #f0f0f0; }
.repeat-box { background: #f8fbff; border: 1px solid #d1e3f8; padding: 20px; border-radius: 8px; margin-top: 20px; }
.days-check { display: flex; gap: 12px; margin: 15px 0; flex-wrap: wrap; }
.days-check label { background: #fff; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; font-weight: normal; font-size: 14px; }
.month-group { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,.02); overflow: hidden; }
.month-header { background: #f4f7f6; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e0e0e0; }
.month-header h4 { margin: 0; font-size: 16px; color: #2c3e50; }
.month-footer { background: #fafafa; padding: 12px 20px; text-align: right; border-top: 1px solid #e0e0e0; color: #333; font-size: 15px; }
#resModal .modal-window { max-width: 850px; width: 95%; max-height: 85vh; overflow-y: auto; padding: 30px; }
#admin-slots-container { min-height: 60px; }
#resModal .form-group { margin-bottom: 10px; }
#resModal .repeat-box { margin-top: 10px; padding: 15px; }
.swal2-container { z-index: 100000 !important; }

/* =============================================
   ADMIN — NÁSTĚNKA WIDGETY
   ============================================= */
.scheduler-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.scheduler-table th, .scheduler-table td { border: 1px solid #eee; padding: 10px; text-align: center; font-size: 13px; }
.scheduler-table th { background: #f9f9f9; }
.status { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; }
.status.booked { background: #d9edf7; color: #31708f; }
.status.pending { background: #fcf8e3; color: #8a6d3b; }
.btn-admin { padding: 8px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }
.btn-edit { background: #337ab7; color: white; }
.btn-delete { background: #d9534f; color: white; }
.calendar-card { padding: 15px; }
.calendar-preview-card { padding: 10px; text-align: center; }
.calendar-preview-card h3 { background: var(--active-blue); color: white; margin: -10px -10px 10px -10px; padding: 10px; border-radius: 8px 8px 0 0; }
.cal-grid-mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 12px; }
.cal-day-mini { padding: 5px; background: #f9f9f9; border-radius: 2px; }
.cal-day-mini.today { background: var(--active-blue); color: white; font-weight: bold; }
.cal-day-mini.booked { background: #eee; text-decoration: line-through; color: #999; }
.stats-legend-card { display: flex; flex-direction: column; gap: 15px; }
.stats-group { border-bottom: 1px solid #eee; padding-bottom: 15px; }
.stats-item { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.stats-item strong { font-size: 16px; color: var(--text-dark); }
.legend-group h4 { margin: 0 0 10px 0; font-size: 14px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 5px; }
.dot { width: 12px; height: 12px; border-radius: 2px; }
.client-mgmt-card { display: flex; flex-direction: column; gap: 15px; max-height: 450px; overflow-y: auto; }
.client-search { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.client-list { display: flex; flex-direction: column; gap: 10px; }
.client-card-mini { border: 1px solid #eee; border-radius: 4px; padding: 10px; font-size: 13px; background: #fdfdfd; }
.client-card-mini strong { font-size: 14px; color: var(--active-blue); display: block; margin-bottom: 3px; }
.client-card-mini p { margin: 2px 0; color: #666; }
.client-actions { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.btn-mini { padding: 4px 8px; font-size: 11px; border-radius: 3px; border: none; cursor: pointer; text-decoration: none; }
.btn-mini.edit { background: #337ab7; color: white; }
.btn-mini.cancel { background: #d9534f; color: white; }
.btn-mini.new-res { background: #5cb85c; color: white; margin-left: auto; }
.trainer-cell { font-weight: bold; color: var(--text-dark); text-align: left !important; }
.booking-slot { font-size: 11px; text-align: left; }
.booking-slot strong { display: block; color: var(--text-dark); }

/* =============================================
   NOTIFIKAČNÍ ODZNAK (menu)
   ============================================= */
.icon-with-badge { position: relative; }
.badge-container { position: absolute; top: -8px; right: -12px; display: inline-flex; align-items: center; z-index: 10; }
.menu-badge { background: linear-gradient(135deg,#ff416c,#ff4b2b); color: white; font-size: 12px; font-weight: 900; padding: 2px 8px; border-radius: 12px; box-shadow: 0 2px 10px rgba(255,65,108,.4); display: inline-block; }
.menu-badge.pulse { animation: pulse-glow 2s infinite; }
.menu-badge.pop { animation: popIn .5s cubic-bezier(.175,.885,.32,1.275) forwards, pulse-glow 2s infinite .5s; }
@keyframes popIn { 0%{transform:scale(0)}50%{transform:scale(1.3)}100%{transform:scale(1)} }
@keyframes pulse-glow { 0%{box-shadow:0 0 0 0 rgba(255,65,108,.7)}70%{box-shadow:0 0 0 8px rgba(255,65,108,0)}100%{box-shadow:0 0 0 0 rgba(255,65,108,0)} }

/* =============================================
   ANIMACE
   ============================================= */
@keyframes slideDownFade { 0%{opacity:0;transform:translateY(-12px)}100%{opacity:1;transform:translateY(0)} }
.time-options label { animation: slideDownFade .6s cubic-bezier(.25,1,.5,1) forwards; }
.smooth-section { max-height:0;opacity:0;overflow:hidden;transition:max-height .8s cubic-bezier(.4,0,.2,1),opacity .8s cubic-bezier(.4,0,.2,1),margin .8s ease;margin-top:0; }
.smooth-section.visible { max-height:200px;opacity:1;margin-top:15px; }
#loader { transition: opacity .4s ease; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    /* Admin — mobilní nav */
    .desktop-only { display: none !important; }
    body.admin-body { display: block !important; padding: 0 !important; padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
    .main-wrapper { margin-left: 0 !important; width: 100% !important; }
    .content-area { padding: 10px !important; }
    .top-bar { padding: 15px !important; }
    .card { overflow-x: auto !important; width: 100% !important; padding: 15px !important; }
    .scheduler-table th, .scheduler-table td, .mini-table th, .mini-table td { font-size: 13px !important; padding: 8px 5px !important; }
    .sidebar { position: fixed !important; top: auto !important; bottom: 0 !important; left: 0 !important; width: 100% !important; height: calc(60px + env(safe-area-inset-bottom)) !important; background: rgba(255,255,255,.95) !important; backdrop-filter: blur(10px) !important; border-top: 1px solid #edf2f7 !important; box-shadow: 0 -4px 20px rgba(0,0,0,.06) !important; z-index: 99999 !important; padding-bottom: env(safe-area-inset-bottom) !important; display: flex !important; }
    .sidebar-menu { display: flex !important; flex-direction: row !important; width: 100% !important; justify-content: space-around !important; align-items: center !important; height: 60px !important; margin: 0 !important; padding: 0 !important; }
    .sidebar-menu li { flex: 1 !important; display: flex !important; justify-content: center !important; list-style: none !important; }
    .sidebar-menu a { display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 4px !important; color: #a0aec0 !important; text-decoration: none !important; width: 100% !important; padding: 8px 0 !important; border-left: none !important; background: transparent !important; }
    .sidebar-menu a.active { color: #3182ce !important; }
    .nav-icon { font-size: 22px !important; width: auto !important; }
    .menu-text { font-size: 10px !important; font-weight: 600 !important; }
    .badge-container { position: absolute !important; top: -6px !important; right: -14px !important; transform: scale(.8) !important; }
    .dash-content-grid, .two-cols, .stats-grid { display: flex !important; flex-direction: column !important; gap: 15px !important; }
    .admin-cal-header { flex-direction: column !important; gap: 12px !important; align-items: center !important; padding: 12px 10px !important; }
    .calendar-admin-container, .calendar-card { width: 100% !important; overflow-x: auto !important; padding: 10px !important; }
    #admin-calendar-grid, .calendar-days-header-admin { min-width: 700px !important; }
    .calendar-day-admin { height: 105px !important; }

    /* Veřejný — mobilní */
    body:not(.admin-body) { height: auto !important; overflow: auto !important; padding: 10px !important; }
    .container { display: flex !important; flex-direction: column !important; height: auto !important; max-height: none !important; width: 100% !important; margin: 0 !important; padding: 12px !important; gap: 16px !important; border-radius: 8px !important; }
    .left-col, .right-col { width: 100% !important; overflow: visible !important; }
    .right-col { overflow-y: visible !important; }
    .calendar { border-radius: 0 0 8px 8px !important; }
    .calendar-grid { grid-auto-rows: 72px !important; }
    .two-cols { display: flex !important; flex-direction: column !important; gap: 8px !important; }
    .calendar-day { padding: 6px 3px !important; font-size: 12px !important; }
    #submit-btn { padding: 15px !important; font-size: 16px !important; }
}