/* =======================================================
   Klimcars – styles.css (final, strict colors + reliable dark/light)
   - Dark/Light přes html[data-theme] i html[data-bs-theme]
   - 4K = zelená, 2K = fialová (vždy, všude)
   - Kalendář + Modal + Admin tabulka
   ======================================================= */

/* ---------- TÉMATICKÉ PROMĚNNÉ ---------- */
:root {
  /* Light */
  --kc-bg:        #f5f7fb;
  --kc-surface:   #ffffff;
  --kc-text:      #0f141a;
  --kc-muted:     #6b7280;
  --kc-border:    #dee2e6;

  --kc-free:      #0d6efd;   /* „X volných směn" */
  --kc-1k:        #e91e63;   /* 1K růžová */
  --kc-2k:        #6f42c1;   /* 2K fialová */
  --kc-3k:        #0d6efd;   /* 3K modrá */
  --kc-4k:        #198754;   /* 4K zelená */
  --kc-5k:        #fd7e14;   /* 5K oranžová */
  --kc-warning:   #ffe6a7;

  /* map pro BS */
  --bs-body-bg:       var(--kc-bg);
  --bs-body-color:    var(--kc-text);
  --bs-border-color:  var(--kc-border);
}

/* Dark může být nastavováno různě – pokrýváme obě varianty */
html[data-theme="dark"],
html[data-bs-theme="dark"] {
  --kc-bg:        #0e1116;
  --kc-surface:   #161b22;
  --kc-text:      #e6edf3;
  --kc-muted:     #9aa4b2;
  --kc-border:    #2d333b;

  --bs-body-bg:       var(--kc-bg);
  --bs-body-color:    var(--kc-text);
  --bs-border-color:  var(--kc-border);
}

/* ---------- GLOBÁLNÍ PŘEBITÍ ---------- */
html, body {
  background: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
}

/* Kontejner pro kalendář - pouze pro PC */
@media (min-width: 992px) {
  html, body {
    height: 100vh;
    overflow: hidden;
  }
  .container.py-3 {
    height: calc(100vh - 140px); /* Celková výška minus navbar a margin */
    overflow-y: auto;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
}

.navbar,
.alert,
.card,
.dropdown-menu,
.offcanvas,
.list-group-item,
.table,
.table thead th,
.table tbody td,
.modal-content {
  background: var(--kc-surface) !important;
  color: var(--kc-text) !important;
  border-color: var(--kc-border) !important;
}

.text-muted { color: var(--kc-muted) !important; }
a, .link-primary { color: var(--kc-free); }
a:hover { color: #0b5ed7; }

hr { border-color: var(--kc-border); }

/* ---------- KALENDÁŘ – HLAVIČKY DNŮ ---------- */
.calendar-weekdays {
  display: flex !important;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

/* Skrytí hlaviček na mobilu */
@media (max-width: 991px) {
  .calendar-weekdays {
    display: none !important;
  }
}

.weekday-header {
  text-align: center;
  font-weight: 600;
  color: var(--kc-muted);
  padding: 6px 12px;
  font-size: 0.85rem;
  background: var(--kc-bg);
  border: 1px solid var(--kc-border);
  border-radius: 8px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  /* Nedotykové - bez hover efektů a cursor */
  cursor: default;
  user-select: none;
}

/* Staré CSS pravidla pro calendar-grid odstraněna - nahrazena novými níže */

/* ---------- KALENDÁŘ – DLAŽDICE DNE ---------- */
.day-tile {
  background: var(--kc-surface);
  border: 1px solid var(--kc-border);
  border-radius: 12px;
  padding: 8px;
  height: 100px;
  cursor: pointer;
  transition: box-shadow .15s, transform .06s, background .15s;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Zajistit propagaci kliknutí přes child elementy */
.day-tile .day-header,
.day-tile .day-header-shift,
.day-tile .shift-time-centered,
.day-tile .shift-time,
.day-tile .shift-time-cancel,
.day-tile .day-number,
.day-tile .day-weekday,
.day-tile .badge {
  pointer-events: none;
}

/* Barvení celé buňky podle typu směny */
.day-tile.day-shift-1k {
  background: #e91e63 !important;
  color: #fff !important;
  border-color: #e91e63 !important;
}
.day-tile.day-shift-2k {
  background: #6f42c1 !important;
  color: #fff !important;
  border-color: #6f42c1 !important;
}
.day-tile.day-shift-3k {
  background: #0d6efd !important;
  color: #fff !important;
  border-color: #0d6efd !important;
}
.day-tile.day-shift-4k {
  background: #198754 !important;
  color: #fff !important;
  border-color: #198754 !important;
}
.day-tile.day-shift-5k {
  background: #fd7e14 !important;
  color: #fff !important;
  border-color: #fd7e14 !important;
}

/* Pending žádosti - saturované */
.day-tile.day-pending-saturated {
  background: #fff3cd !important;
  border: 2px solid #ffc107 !important;
  color: #856404 !important;
}

/* Pending žádosti - obsazené */
.day-tile.day-pending-occupied {
  background: #cfe2ff !important;
  border: 2px solid #0d6efd !important;
  color: #084298 !important;
}

/* Modrý badge "volných směn" musí být viditelný i na barevném pozadí */
.day-tile.day-shift-1k .badge-free-count,
.day-tile.day-shift-2k .badge-free-count,
.day-tile.day-shift-3k .badge-free-count,
.day-tile.day-shift-4k .badge-free-count,
.day-tile.day-shift-5k .badge-free-count {
  background: #fff !important;
  color: var(--kc-free) !important;
  border: 1px solid rgba(255,255,255,0.3);
}
.day-tile:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
.day-tile:active { transform: scale(0.99); }

.day-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-weight: 700;
}
.day-number { 
  opacity: .9; 
  color: var(--kc-text);
}

/* Dark mode - černý text pro číslovky dnů POUZE u navolených směn/žádostí */
html[data-theme="dark"] .day-tile.day-shift-1k .day-number,
html[data-theme="dark"] .day-tile.day-shift-2k .day-number,
html[data-theme="dark"] .day-tile.day-shift-3k .day-number,
html[data-theme="dark"] .day-tile.day-shift-4k .day-number,
html[data-theme="dark"] .day-tile.day-shift-5k .day-number,
html[data-theme="dark"] .day-tile.day-pending-saturated .day-number,
html[data-theme="dark"] .day-tile.day-pending-occupied .day-number,
html[data-theme="dark"] .day-tile.day-pending-transfer .day-number,
html[data-theme="dark"] .day-tile.day-pending-exchange .day-number,
html[data-bs-theme="dark"] .day-tile.day-shift-1k .day-number,
html[data-bs-theme="dark"] .day-tile.day-shift-2k .day-number,
html[data-bs-theme="dark"] .day-tile.day-shift-3k .day-number,
html[data-bs-theme="dark"] .day-tile.day-shift-4k .day-number,
html[data-bs-theme="dark"] .day-tile.day-shift-5k .day-number,
html[data-bs-theme="dark"] .day-tile.day-pending-saturated .day-number,
html[data-bs-theme="dark"] .day-tile.day-pending-occupied .day-number,
html[data-bs-theme="dark"] .day-tile.day-pending-transfer .day-number,
html[data-bs-theme="dark"] .day-tile.day-pending-exchange .day-number {
  color: #000000 !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}
.day-weekday {
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 4px;
  opacity: 0.7;
}

/* Zkratky dnů se zobrazují pouze na mobilu */
@media (min-width: 992px) {
  .day-weekday {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .day-weekday {
    display: inline !important;
  }
}
.day-subtle { color: var(--kc-muted); font-size: .95rem; }

/* Čas směny - velký, bílý, vycentrovaný */
.shift-time {
  color: #fff !important;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  margin-top: auto;
  padding-top: 8px;
}

/* Hlavička pro buňky s směnami - pouze číslo dne */
.day-header-shift {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  margin-bottom: 0;
}

/* Čas směny - střed-střed buňky, větší písmo */
.shift-time-centered {
  color: #fff !important;
  font-size: 1.375rem; /* 1.1rem * 1.25 = 25% větší */
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  margin-top: auto;
  margin-bottom: auto;
}

/* Zajistit viditelnost textu v barevných buňkách - nejvyšší priorita */
.day-tile.day-shift-1k .shift-time-centered {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}
.day-tile.day-shift-2k .shift-time-centered,
.day-tile.day-shift-3k .shift-time-centered,
.day-tile.day-shift-4k .shift-time-centered,
.day-tile.day-shift-5k .shift-time-centered {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}

/* Speciální styl pro volné směny - modrý badge uprostřed */
.day-tile:not(.day-shift-1k):not(.day-shift-2k):not(.day-shift-3k):not(.day-shift-4k):not(.day-shift-5k):not(.day-pending-saturated):not(.day-pending-occupied) .shift-time-centered {
  background: var(--kc-free) !important;
  color: #fff !important;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  width: fit-content;
  margin: auto;
  flex: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Styl pro text směny v pending žádostech */
.day-tile.day-pending-saturated .shift-time-centered,
.day-tile.day-pending-occupied .shift-time-centered {
  background: transparent !important;
  color: inherit !important;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0;
  border-radius: 0;
  width: fit-content;
  margin: auto;
  flex: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Čas směny u žádosti o zrušení - střed buňky */
.shift-time-cancel {
  color: var(--kc-text) !important;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  margin: auto 0 4px 0;
  padding: 0;
}

/* ---------- BADGE – VOLNÉ/MOJE/ŽÁDOST ---------- */
/* „X volných směn“ – menší modrá pilulka */
.badge-free-count {
  background: var(--kc-free) !important;
  color: #fff !important;
  font-size: .75rem;
  padding: .25rem .55rem;
  border-radius: 999px;
}

/* „Moje směna" podle typu směny */
.badge-my-shift-1k {
  background: var(--kc-1k) !important;
  color: #fff !important;
  font-size: .86rem;
  padding: .32rem .6rem;
  border-radius: 999px;
}
.badge-my-shift-2k {
  background: var(--kc-2k) !important;
  color: #fff !important;
  font-size: .86rem;
  padding: .32rem .6rem;
  border-radius: 999px;
}
.badge-my-shift-3k {
  background: var(--kc-3k) !important;
  color: #fff !important;
  font-size: .86rem;
  padding: .32rem .6rem;
  border-radius: 999px;
}
.badge-my-shift-4k {
  background: var(--kc-4k) !important;
  color: #fff !important;
  font-size: .86rem;
  padding: .32rem .6rem;
  border-radius: 999px;
}
.badge-my-shift-5k {
  background: var(--kc-5k) !important;
  color: #fff !important;
  font-size: .86rem;
  padding: .32rem .6rem;
  border-radius: 999px;
}
/* Fallback pro starší kód */
.badge-my-shift {
  background: var(--kc-2k) !important;
  color: #fff !important;
  font-size: .86rem;
  padding: .32rem .6rem;
  border-radius: 999px;
}

/* Žádost o zrušení */
.badge-req {
  background: var(--kc-warning) !important;
  color: #3c2e04 !important;
  font-weight: 600;
  border-radius: 10px;
  padding: .28rem .55rem;
}

/* Žádost o zrušení v kalendářních buňkách - vycentrovaná */
.day-tile .badge-req {
  margin: 0 auto;
  display: inline-block;
}

/* Badge pro pending saturované žádosti */
.badge-pending-saturated {
  background: #ffc107 !important;
  color: #000 !important;
  font-weight: 600;
  border-radius: 10px;
  padding: .28rem .55rem;
  margin: 0 auto;
  display: inline-block;
  font-size: 0.75rem;
}

/* Badge pro pending žádosti o obsazené směny */
.badge-pending-occupied {
  background: #0d6efd !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  padding: .28rem .55rem;
  margin: 0 auto;
  display: inline-block;
  font-size: 0.75rem;
}

/* ---------- PEVNÉ BARVY TYPŮ SMĚN (kdekoli v UI) ---------- */
/* 1K = růžová */
.bg-shift-1k,
.badge-1k,
.badge.badge-1k {
  background-color: var(--kc-1k) !important;
  color: #fff !important;
}
/* 2K = fialová */
.bg-shift-2k,
.badge-2k,
.badge.badge-2k {
  background-color: var(--kc-2k) !important;
  color: #fff !important;
}
/* 3K = modrá */
.bg-shift-3k,
.badge-3k,
.badge.badge-3k {
  background-color: var(--kc-3k) !important;
  color: #fff !important;
}
/* 4K = zelená */
.bg-shift-4k,
.badge-4k,
.badge.badge-4k {
  background-color: var(--kc-4k) !important;
  color: #fff !important;
}
/* 5K = oranžová */
.bg-shift-5k,
.badge-5k,
.badge.badge-5k {
  background-color: var(--kc-5k) !important;
  color: #fff !important;
}

/* (Pro jistotu) pokud někde zůstane jen .badge bez naší třídy,
   zkusíme napovědět podle „my“ tříd používaných ve starších šablonách */
.badge-my-shift-4k { background: var(--kc-4k) !important; color: #fff !important; }

/* ---------- MODAL DNE ---------- */
.modal-dialog.modal-day { max-width: 720px; }
@media (max-width: 991px) {
  .modal-dialog.modal-day {
    margin: 0; width: 100%; max-width: 100%;
    height: 100%; display: flex; align-items: flex-end;
  }
  .modal-content.modal-day {
    width: 100%; border-radius: 16px 16px 0 0;
    max-height: 85vh; overflow: hidden;
  }
  .modal-body.modal-day {
    overflow-y: auto; padding-bottom: env(safe-area-inset-bottom, 16px);
  }
}

.shift-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--kc-border);
}
.shift-row:last-child { border-bottom: 0; }
.shift-actions .btn { min-height: 40px; border-radius: 10px; padding: .55rem .9rem; }

/* Bootstrap „text-bg-*“ pilulky ať jsou čitelné i v dark */
.text-bg-secondary, .text-bg-light, .text-bg-dark { color: var(--kc-text) !important; }

/* ---------- ADMIN TABULKA ---------- */
.admin-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: 12px; border: 1px solid var(--kc-border);
  background: var(--kc-surface);
}
.admin-table {
  min-width: 900px; width: 100%;
  border-collapse: separate; border-spacing: 0;
}
.admin-table th, .admin-table td {
  white-space: nowrap;
  padding: .65rem .5rem;
  border-bottom: 1px solid var(--kc-border);
  border-right: 1px solid var(--kc-border);
}
.admin-table td:last-child, .admin-table th:last-child { border-right: 0; }
.admin-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--kc-surface);
}
.admin-table .col-name {
  position: sticky; left: 0; z-index: 3;
  background: var(--kc-surface); font-weight: 600;
}
.admin-table thead th.col-name {
  z-index: 4;
}

/* Badge v adminu hezky kulaté */
.admin-table .badge, .badge { border-radius: 999px; font-weight: 600; }

/* ---------- OVLÁDACÍ PRVKY ---------- */
.btn-outline-secondary {
  color: var(--kc-text); border-color: var(--kc-border);
}
.btn-outline-secondary:hover { background: rgba(0,0,0,.04); }

/* ---------- STABILIZACE DARK REŽIMU PRO VŠECHNY BLOKY ---------- */
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .alert,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .card,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .table,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .admin-table-wrap,
html[data-theme="dark"] .day-tile,
html[data-bs-theme="dark"] .navbar,
html[data-bs-theme="dark"] .alert,
html[data-bs-theme="dark"] .dropdown-menu,
html[data-bs-theme="dark"] .list-group-item,
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .offcanvas,
html[data-bs-theme="dark"] .table,
html[data-bs-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .admin-table-wrap,
html[data-bs-theme="dark"] .day-tile {
  background: var(--kc-surface) !important;
  color: var(--kc-text) !important;
  border-color: var(--kc-border) !important;
}

/* Dark mode - pending žádosti zachovávají barevné pozadí */
html[data-theme="dark"] .day-tile.day-pending-saturated,
html[data-bs-theme="dark"] .day-tile.day-pending-saturated {
  background: #665d03 !important;
  border: 2px solid #ffc107 !important;
  color: #fff3cd !important;
}

html[data-theme="dark"] .day-tile.day-pending-saturated .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-pending-saturated .shift-time-centered {
  color: #fff3cd !important;
}

html[data-theme="dark"] .day-tile.day-pending-occupied,
html[data-bs-theme="dark"] .day-tile.day-pending-occupied {
  background: #052c65 !important;
  border: 2px solid #0d6efd !important;
  color: #cfe2ff !important;
}

html[data-theme="dark"] .day-tile.day-pending-occupied .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-pending-occupied .shift-time-centered {
  color: #cfe2ff !important;
}

/* Dark mode - zajistit viditelnost textu směn v barevných buňkách */
html[data-theme="dark"] .day-tile.day-shift-1k .shift-time-centered,
html[data-theme="dark"] .day-tile.day-shift-2k .shift-time-centered,
html[data-theme="dark"] .day-tile.day-shift-3k .shift-time-centered,
html[data-theme="dark"] .day-tile.day-shift-4k .shift-time-centered,
html[data-theme="dark"] .day-tile.day-shift-5k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-1k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-2k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-3k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-4k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-5k .shift-time-centered {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

/* Silnější selektory pro přepsání inline stylů */
html[data-theme="dark"] .day-tile[style*="background: #6f42c1"] .shift-time-centered,
html[data-theme="dark"] .day-tile[style*="background: #198754"] .shift-time-centered,
html[data-bs-theme="dark"] .day-tile[style*="background: #6f42c1"] .shift-time-centered,
html[data-bs-theme="dark"] .day-tile[style*="background: #198754"] .shift-time-centered {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

/* Nejvyšší priorita - přepsání všech možných stylů */
html[data-theme="dark"] .day-tile.day-shift-1k .shift-time-centered,
html[data-theme="dark"] .day-tile.day-shift-2k .shift-time-centered,
html[data-theme="dark"] .day-tile.day-shift-3k .shift-time-centered,
html[data-theme="dark"] .day-tile.day-shift-4k .shift-time-centered,
html[data-theme="dark"] .day-tile.day-shift-5k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-1k .shift-time-centered {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}
html[data-bs-theme="dark"] .day-tile.day-shift-2k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-3k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-4k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-5k .shift-time-centered,
html[data-theme="dark"] .day-tile[style*="color: #fff"] .shift-time-centered,
html[data-bs-theme="dark"] .day-tile[style*="color: #fff"] .shift-time-centered {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}

/* Dark mode - jednoduché pravidlo pro text v barevných buňkách */
html[data-bs-theme="dark"] .shift-time-centered {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
  font-weight: 700 !important;
}

/* Dark mode - černý text pouze pro pending žádosti */
html[data-bs-theme="dark"] .day-tile.day-pending-saturated .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-pending-occupied .shift-time-centered {
  color: #000000 !important;
  font-weight: 800 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Dark mode - bílý text pro všechny směny */
html[data-bs-theme="dark"] .day-tile.day-shift-1k .shift-time-centered {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
  font-weight: 800 !important;
  opacity: 1 !important;
  visibility: visible !important;
}
html[data-bs-theme="dark"] .day-tile.day-shift-2k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-3k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-4k .shift-time-centered,
html[data-bs-theme="dark"] .day-tile.day-shift-5k .shift-time-centered {
  color: #ffffff !important;
  font-weight: 800 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Ztišení „Volný den" + drobné odsazení badge v dlaždicích */
.day-tile .day-subtle,
.day-tile .text-muted { color: var(--kc-muted) !important; }
.day-tile .badge { margin-top: .25rem; }

/* ---------- ADMIN KALENDÁŘ ---------- */
.admin-day-tile {
  cursor: pointer;
}

.admin-day-tile .day-header {
  border-bottom: none !important;
  background-color: transparent !important;
  margin-bottom: 2px;
  flex-shrink: 0;
  padding: 0;
}

.admin-day-tile .day-number {
  font-size: 0.75rem;
  line-height: 1;
}

.admin-day-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  margin-bottom: 0;
  width: 100%;
  flex: 1;
  justify-content: center;
}

.admin-stat {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1.3;
  flex-shrink: 0;
}

.admin-stat.occupied {
  color: var(--kc-text);
  background: rgba(255, 255, 255, 0.1);
}

.admin-stat.free {
  color: #fff;
  background: #dc3545;
  border-radius: 999px;
}

.admin-stat.free.free-zero {
  background: #198754;
}

.admin-stat.saturated {
  background: #ffc107;
  color: #000;
  font-weight: 600;
}

/* Tlačítko pro okamžité zrušení směny */
.instant-cancel-btn {
  animation: pulse-red 1s infinite;
  font-weight: 600;
  border: 2px solid #dc3545;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.instant-cancel-btn:hover {
  background-color: #b02a37;
  border-color: #a02834;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(220, 53, 69, 0.7);
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.8);
  }
  100% {
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
  }
}

/* Saturované směny - vizuální odlišení */
.shift-row .badge-shift.bg-shift-1k.saturated,
.shift-row .badge-shift.bg-shift-2k.saturated,
.shift-row .badge-shift.bg-shift-3k.saturated,
.shift-row .badge-shift.bg-shift-4k.saturated,
.shift-row .badge-shift.bg-shift-5k.saturated {
  border: 2px solid #ffc107;
  box-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
  position: relative;
}

.shift-row .badge-shift.saturated::after {
  content: "★";
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ffc107;
  color: #000;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

/* Tlačítko pro saturované směny */
.btn-warning.js-day-book {
  font-weight: 600;
  border: 2px solid #ffc107;
}


/* Saturované směny v kalendáři */
.day-tile .shift-time-centered.saturated-shift {
  color: #ffc107;
  font-weight: 600;
  text-shadow: 0 0 3px rgba(255, 193, 7, 0.5);
}

/* Větší žluté checkboxy pro saturované směny */
.saturated-checkbox {
  transform: scale(1.5);
  accent-color: #ffc107;
  border-color: #ffc107;
  margin-left: 200px;
}

.saturated-checkbox:checked {
  background-color: #ffc107;
  border-color: #ffc107;
}

/* Vyrovnání výšky pro hlavičku s hvězdičkou */
.form-label span {
  vertical-align: middle;
  line-height: 1;
}

/* Prázdné buňky pro dny předchozího měsíce */
.day-tile.empty-day {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  cursor: default;
  opacity: 0.3;
  pointer-events: none;
}

.day-tile.empty-day:hover {
  background-color: #f8f9fa;
  transform: none;
}

/* Skrytí prázdných buněk na mobilu */
@media (max-width: 991px) {
  .day-tile.empty-day {
    display: none !important;
  }
}

/* Oprava pro správné zobrazení PC vs mobil - žádné mezilehlé stavy */
.calendar-grid {
  display: grid;
  gap: 2px;
  margin-bottom: 1rem;
}

/* Desktop: 7 sloupců */
@media (min-width: 992px) {
  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
  }
  
  .calendar-weekdays {
    display: flex !important;
    justify-content: space-between;
    margin-bottom: 0.5rem;
  }
}

/* ---------- SATUROVANÉ SMĚNY V ADMIN TABULCE ---------- */
.badge.saturated {
  opacity: 0.7;
  border: 2px dashed #fff !important;
  position: relative;
}

.badge.saturated::after {
  content: "★";
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ffc107;
  color: #000;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* ---------- ROZBALOVACÍ SEZNAM ŽÁDOSTÍ O SATUROVANÉ SMĚNY ---------- */
.saturated-requests-toggle {
  transition: all 0.2s ease;
}

.saturated-requests-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.saturated-requests-list {
  background: rgba(0,0,0,0.05) !important;
  border: 1px solid var(--kc-border);
  border-radius: 6px;
  padding: 12px;
  margin-top: 8px;
  animation: slideDown 0.2s ease;
}

/* ---------- ROZBALOVACÍ SEZNAM ŽÁDOSTÍ O OBSAZENÉ SMĚNY ---------- */
.occupied-requests-toggle {
  transition: all 0.2s ease;
}

.occupied-requests-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.occupied-requests-list {
  background: rgba(0,0,0,0.05) !important;
  border: 1px solid var(--kc-border);
  border-radius: 6px;
  padding: 12px;
  margin-top: 8px;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.saturated-request-item {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: 6px 0;
}

.saturated-request-item:last-child {
  border-bottom: none;
}

.chevron-icon {
  transition: transform 0.2s ease;
}

.chevron-icon.rotated {
  transform: rotate(180deg);
}

/* Mobil: 2 sloupce */
@media (max-width: 991px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mobilní zobrazení pro admin kalendář */
  .admin-day-tile {
    padding: 8px;
  }

  .admin-day-tile .day-header {
    margin-bottom: 4px;
  }

  .admin-day-tile .day-number {
    font-size: 0.8rem;
  }

  .admin-day-stats {
    gap: 3px;
    margin-top: 0;
    flex: 1;
    justify-content: center;
  }

  .admin-stat {
    font-size: 0.7rem;
    padding: 4px 6px;
    line-height: 1.3;
  }
}

/* ---------- VÝMĚNA A PŘEVZETÍ SMĚN ---------- */
/* Tlačítka pro výměnu/převzetí směn v modalu */
.js-shift-transfer,
.js-shift-exchange {
  transition: all 0.2s ease;
}

.js-shift-transfer:hover {
  background-color: #0dcaf0 !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(13, 202, 240, 0.3);
}

.js-shift-exchange:hover {
  background-color: #0d6efd !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

/* Badge styly pro výměnu/převzetí směn */
.badge.bg-info {
  background-color: #0dcaf0 !important;
  color: #000 !important;
}

/* Courier selection modals */
.js-select-courier {
  cursor: pointer;
  transition: all 0.2s ease;
}

.js-select-courier:hover {
  background-color: #0d6efd !important;
  color: white !important;
}

/* Tlačítka pro schválení/zamítnutí výměny */
.js-approve-exchange {
  transition: all 0.2s ease;
}

.js-approve-exchange:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(25, 135, 84, 0.3);
}

.js-deny-exchange {
  transition: all 0.2s ease;
}

.js-deny-exchange:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* ---------- PENDING SMĚNY V KALENDÁŘI ---------- */
/* Směna čekající na převzetí (oranžová) */
.day-pending-transfer {
  background: #fd7e14 !important;
  border: 2px solid #fd7e14 !important;
  color: white !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.day-pending-transfer:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(253, 126, 20, 0.4);
}

.day-pending-transfer .day-number {
  color: white !important;
}

.day-pending-transfer .shift-time-centered {
  color: white !important;
  font-weight: bold;
}

/* Směna čekající na výměnu (cyan) */
.day-pending-exchange {
  background: #0dcaf0 !important;
  border: 2px solid #0dcaf0 !important;
  color: white !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.day-pending-exchange:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(13, 202, 240, 0.4);
}

.day-pending-exchange .day-number {
  color: white !important;
}

.day-pending-exchange .shift-time-centered {
  color: white !important;
  font-weight: bold;
}

/* Badge pro čeká na převzetí */
.badge-pending-transfer {
  background-color: #fd7e14 !important;
  color: white !important;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(253, 126, 20, 0.3);
}

/* Badge pro čeká na výměnu */
.badge-pending-exchange {
  background-color: #0dcaf0 !important;
  color: white !important;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(13, 202, 240, 0.3);
}

/* Nezveřejněné směny - pro adminy */
.shift-row .badge-shift.unpublished {
  opacity: 0.8;
  border: 2px solid #ffc107;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 193, 7, 0.1) 30%, rgba(255, 193, 7, 0.1) 70%, transparent 70%);
  position: relative;
}

.shift-row .badge-shift.unpublished::after {
  content: "🔒";
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ffc107;
  color: #000;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---------- MANUÁL - DARK MODE ---------- */
/* Manual section titles - responsive to theme */
.manual-section-title {
  color: #0d6efd;
  border-bottom: 2px solid #0d6efd;
  padding-bottom: 10px;
}

html[data-theme="dark"] .manual-section-title,
html[data-bs-theme="dark"] .manual-section-title {
  color: #58a6ff !important;
  border-bottom-color: #58a6ff !important;
}

/* Dark mode pro manual sekce */
html[data-theme="dark"] .manual-section,
html[data-bs-theme="dark"] .manual-section {
  background: #1c2128 !important;
  border: 1px solid var(--kc-border);
}

html[data-theme="dark"] .manual-section h5,
html[data-bs-theme="dark"] .manual-section h5 {
  color: var(--kc-text) !important;
}

/* Dark mode pro manual nadpisy a borders */
html[data-theme="dark"] .manual-content h4,
html[data-bs-theme="dark"] .manual-content h4 {
  color: #58a6ff !important;
  border-bottom-color: #58a6ff !important;
}

html[data-theme="dark"] .manual-content h3,
html[data-bs-theme="dark"] .manual-content h3 {
  color: #58a6ff !important;
}

/* Dark mode pro manual cards */
html[data-theme="dark"] .manual-section .card,
html[data-bs-theme="dark"] .manual-section .card {
  background: var(--kc-surface) !important;
  border-color: var(--kc-border) !important;
}

html[data-theme="dark"] .manual-section .card-title,
html[data-bs-theme="dark"] .manual-section .card-title {
  color: var(--kc-text) !important;
}

html[data-theme="dark"] .manual-section .card-text,
html[data-bs-theme="dark"] .manual-section .card-text {
  color: var(--kc-muted) !important;
}

/* Dark mode pro alert v manuálu */
html[data-theme="dark"] .manual-section .alert,
html[data-bs-theme="dark"] .manual-section .alert {
  background: rgba(88, 166, 255, 0.15) !important;
  border-color: #58a6ff !important;
  color: var(--kc-text) !important;
}

html[data-theme="dark"] .manual-section .alert-warning,
html[data-bs-theme="dark"] .manual-section .alert-warning {
  background: rgba(255, 193, 7, 0.15) !important;
  border-color: #ffc107 !important;
  color: #fff3cd !important;
}

html[data-theme="dark"] .manual-section .alert-info,
html[data-bs-theme="dark"] .manual-section .alert-info {
  background: rgba(13, 202, 240, 0.15) !important;
  border-color: #0dcaf0 !important;
  color: #cff4fc !important;
}

html[data-theme="dark"] .manual-content .alert-primary,
html[data-bs-theme="dark"] .manual-content .alert-primary {
  background: rgba(88, 166, 255, 0.15) !important;
  border-color: #58a6ff !important;
  color: var(--kc-text) !important;
}

/* Dark mode pro code elementy v manuálu */
html[data-theme="dark"] .manual-section code,
html[data-bs-theme="dark"] .manual-section code {
  background: var(--kc-bg) !important;
  color: #ff7b72 !important;
  border: 1px solid var(--kc-border);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Dark mode pro colored borders v manuálu */
html[data-theme="dark"] .manual-section .border-info,
html[data-bs-theme="dark"] .manual-section .border-info {
  border-color: #0dcaf0 !important;
}

html[data-theme="dark"] .manual-section .border-primary,
html[data-bs-theme="dark"] .manual-section .border-primary {
  border-color: #0d6efd !important;
}

html[data-theme="dark"] .manual-section .border-success,
html[data-bs-theme="dark"] .manual-section .border-success {
  border-color: #198754 !important;
}

/* Dark mode pro všechny manual prvky */
html[data-theme="dark"] .manual-content,
html[data-bs-theme="dark"] .manual-content {
  color: var(--kc-text) !important;
}

html[data-theme="dark"] .manual-content p,
html[data-theme="dark"] .manual-content li,
html[data-bs-theme="dark"] .manual-content p,
html[data-bs-theme="dark"] .manual-content li {
  color: var(--kc-text) !important;
}

html[data-theme="dark"] .manual-content strong,
html[data-bs-theme="dark"] .manual-content strong {
  color: var(--kc-text) !important;
  font-weight: 700;
}

/* Badge pro nezveřejněné směny v manuálu */
.badge-unpublished {
  background: #ffc107 !important;
  color: #000 !important;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.25rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Dark mode pro badge nezveřejněných směn */
html[data-theme="dark"] .badge-unpublished,
html[data-bs-theme="dark"] .badge-unpublished {
  background: #ffc107 !important;
  color: #000 !important;
}

/* ---------- TLAČÍTKO ZÁMKU MĚSÍCE ---------- */
.lock-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--kc-surface);
  border: 2px solid var(--kc-border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  margin-left: 12px;
}

.lock-button:hover {
  background: var(--kc-bg);
  border-color: var(--kc-free);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lock-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Dark mode pro tlačítko zámku */
html[data-theme="dark"] .lock-button,
html[data-bs-theme="dark"] .lock-button {
  background: var(--kc-surface);
  border-color: var(--kc-border);
  color: var(--kc-text);
}

html[data-theme="dark"] .lock-button:hover,
html[data-bs-theme="dark"] .lock-button:hover {
  background: var(--kc-bg);
  border-color: #58a6ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---------- IKONKY ZÁMKU V MANUÁLECH ---------- */
.lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--kc-surface);
  border: 2px solid var(--kc-border);
  border-radius: 6px;
  font-size: 1rem;
  margin: 0 6px;
  vertical-align: middle;
}

/* Dark mode pro ikonky zámku v manuálech */
html[data-theme="dark"] .lock-icon,
html[data-bs-theme="dark"] .lock-icon {
  background: var(--kc-surface);
  border-color: var(--kc-border);
  color: var(--kc-text);
}