/* Subject list full height scroll in flex parent */
#cardSubjects { display:flex; flex-direction:column; box-sizing:border-box; }
#subjectList { min-height:0; flex:1 1 auto; height:auto; overflow:auto; }
/* Allow subjects card to have explicit height set by JS without inner collapse */
#cardSubjects { position:relative; overflow:hidden; }

/* (cards-row removed; using JS height sync again) */

/* Mřížka – 1 hodina = 64px (print kompaktněji) */
.hour-row { height: 64px; }
@media print { .hour-row { height: 42px; } }
.event-card { position: absolute; left: .25rem; right: .25rem; }
@media print { .event-card { break-inside: avoid; } }
/* Tisk barev */
@media print { body { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.scrollbar-thin { scrollbar-width: thin; }
/* Clickable stat cards */
.stat-card { cursor:default; }
.stat-card[data-stat] { cursor:pointer; position:relative; }
.stat-card[data-stat]:hover { background-color:#f1f5f9; }
body.dark .stat-card[data-stat]:hover { background-color:#24324a !important; }
/* Global filters redesign */
.group-label { font-size:11px; text-transform:uppercase; letter-spacing:.05em; font-weight:600; color:#64748b; margin-bottom:0.25rem; }
body.dark .group-label { color:#94a3b8; }
.pill-label { display:inline-flex; }
.pill { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; font-size:12px; line-height:1; border-radius:9999px; border:1px solid rgba(100,116,139,0.4); cursor:pointer; user-select:none; position:relative; transition:.15s background-color,.15s color,.15s border-color,.15s box-shadow,.15s font-weight; font-weight:500; }
body.dark .pill { border-color:rgba(148,163,184,0.35); }
.pill-label input:checked + .pill { box-shadow:0 0 0 2px rgba(51,65,85,0.25) inset, 0 0 0 1px rgba(51,65,85,0.7); border-color:rgba(51,65,85,0.8); font-weight:600; }
body.dark .pill-label input:checked + .pill { box-shadow:0 0 0 2px rgba(255,255,255,0.12) inset,0 0 0 1px rgba(255,255,255,0.25); border-color:rgba(148,163,184,0.9); font-weight:600; }
.pill:hover { border-color:rgba(51,65,85,0.6); }
body.dark .pill:hover { border-color:rgba(148,163,184,0.8); }
.time-input { border:1px solid #cbd5e1; background:#fff; padding:.25rem .5rem; border-radius:.375rem; font-size:14px; line-height:1.2; }
body.dark .time-input { background:#334155; border-color:#475569; color:#f1f5f9; }
.time-input:focus { outline:2px solid rgba(71,85,105,.4); outline-offset:0; }
body.dark .time-input:focus { outline:2px solid rgba(148,163,184,.4); }
.text-input { width:100%; border:1px solid #cbd5e1; background:#fff; padding:.5rem .625rem; border-radius:.5rem; font-size:14px; }
body.dark .text-input { background:#334155; border-color:#475569; color:#f1f5f9; }
.text-input:focus { outline:2px solid rgba(71,85,105,.4); outline-offset:0; }
body.dark .text-input:focus { outline:2px solid rgba(148,163,184,.4); }
.field-label { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.05em; font-weight:600; color:#64748b; margin-bottom:0.25rem; }
body.dark .field-label { color:#94a3b8; }

/* Time input icon visibility in dark mode */
body.dark input[type=time] { color-scheme: dark; }
body.dark input[type=time]::-webkit-calendar-picker-indicator { filter: invert(1) brightness(1.4); opacity:.9; }
body.dark input[type=time]::-webkit-clear-button,
body.dark input[type=time]::-webkit-inner-spin-button { filter: invert(1) brightness(1.4); }
/* Firefox fallback: force light icon via overall invert if needed (scoped using a class to avoid affecting others) */
/* If Firefox icon still dark, uncomment next line: */
/* body.dark input[type=time] { filter: brightness(1.05); } */

/* Pills for dynamically generated days & kinds */
#gfDays label, #gfKinds label { display:inline-flex; align-items:center; }
#gfDays label input, #gfKinds label input { display:none; }
#gfDays label span.pill, #gfKinds label span.pill { display:inline-flex; align-items:center; padding:4px 10px; font-size:12px; line-height:1; border-radius:9999px; border:1px solid rgba(100,116,139,0.35); background:rgba(241,245,249,0.7); cursor:pointer; user-select:none; transition:.15s; }
body.dark #gfDays label span.pill, body.dark #gfKinds label span.pill { background:rgba(30,41,59,0.6); border-color:rgba(148,163,184,0.35); color:#cbd5e1; }
#gfDays label input:checked + span.pill, #gfKinds label input:checked + span.pill { background:#e2e8f0; border-color:#475569; font-weight:600; box-shadow:0 0 0 1px #475569; }
body.dark #gfDays label input:checked + span.pill, body.dark #gfKinds label input:checked + span.pill { background:#334155; border-color:#94a3b8; font-weight:600; box-shadow:0 0 0 1px #94a3b8; }
#gfDays label span.pill, #gfKinds label span.pill { font-weight:500; }

/* Stronger differentiation: status pills get solid color when selected, subtle outline when not */
.pill[data-color=green] { background:#f0fdf4; color:#14532d; border-color:#6ee7b71f; }
.pill-label input:checked + .pill[data-color=green] { background:#16a34a; color:#fff; border-color:#15803d; }
.pill[data-color=yellow] { background:#fefce8; color:#713f12; border-color:#facc151f; }
/* Checked = true yellow (not amber/orange) */
.pill-label input:checked + .pill[data-color=yellow] { background:#eab308; color:#fff; border-color:#a16207; }
/* Orange – add explicit styles so checked state is darker */
.pill[data-color=orange] { background:#fed7aa; color:#7c2d12; border-color:rgba(253,186,116,0.12); }
.pill-label input:checked + .pill[data-color=orange] { background:#fb923c; color:#fff; border-color:#f97316; }
.pill[data-color=red] { background:#fff1f2; color:#881337; border-color:#fb71851f; }
.pill-label input:checked + .pill[data-color=red] { background:#be123c; color:#fff; border-color:#9f1239; }
.pill[data-color=gray] { background:#f1f5f9; color:#334155; border-color:#94a3b81f; }
.pill-label input:checked + .pill[data-color=gray] { background:#64748b; color:#fff; border-color:#475569; }
body.dark .pill[data-color=green] { background:#14532d; color:#d1fae5; border-color:#16a34a66; }
body.dark .pill-label input:checked + .pill[data-color=green] { background:#16a34a; color:#fff; }
body.dark .pill[data-color=yellow] { background:#713f12; color:#fef9c3; border-color:#d9770680; }
/* Dark mode: keep yellow vivid and readable */
body.dark .pill-label input:checked + .pill[data-color=yellow] { background:#eab308; color:#0f172a; }
/* Dark mode orange */
/* Dark mode: use orange-800 at ~60% as background, light orange text and orange-700 border */
body.dark .pill[data-color=orange] { background:rgba(154,52,18,0.6); color:#fff7ed; border-color:rgba(194,65,12,0.5); }
body.dark .pill-label input:checked + .pill[data-color=orange] { background:#fb923c; color:#fff; border-color:#f97316; }
body.dark .pill[data-color=red] { background:#881337; color:#fecdd3; border-color:#be123c80; }
body.dark .pill-label input:checked + .pill[data-color=red] { background:#be123c; color:#fff; }
body.dark .pill[data-color=gray] { background:#334155; color:#cbd5e1; border-color:#64748b80; }
body.dark .pill-label input:checked + .pill[data-color=gray] { background:#64748b; color:#fff; }

/* Checkmark indicator */
.pill-label input:checked + .pill::before, #gfDays label input:checked + span.pill::before, #gfKinds label input:checked + span.pill::before { content:'\2713'; font-size:10px; margin-right:4px; opacity:.9; }
body.dark .pill-label input:checked + .pill::before, body.dark #gfDays label input:checked + span.pill::before, body.dark #gfKinds label input:checked + span.pill::before { opacity:.95; }

/* Distinct fill for selected days & kinds */
#gfDays label input:checked + span.pill, #gfKinds label input:checked + span.pill { background:#1e293b; color:#fff; border-color:#1e293b; }
body.dark #gfDays label input:checked + span.pill, body.dark #gfKinds label input:checked + span.pill { background:#475569; border-color:#64748b; color:#fff; }

/* Dark mode overrides (using body.dark class) */
body.dark { background-color: #0f172a; color: #e2e8f0; }
body.dark .bg-white { background-color: #1e293b !important; }
body.dark .bg-slate-50 { background-color: #1e293b !important; }
body.dark .text-slate-800 { color: #e2e8f0 !important; }
body.dark .text-slate-600 { color: #cbd5e1 !important; }
body.dark .text-slate-500 { color: #94a3b8 !important; }
body.dark .border { border-color: #334155 !important; }
body.dark .bg-slate-900 { background-color: #0f172a !important; }
/* Dark mode event tiles – odstraněn "metalický" inset efekt, čistší plochý vzhled */
body.dark .event-card { background-color:#1e2533 !important; box-shadow:0 0 0 1px #334155, 0 1px 2px rgba(0,0,0,.65); }
body.dark input, body.dark select { background-color: #0f172a; color:#e2e8f0; }
body.dark table thead { background-color:#1e293b; }
body.dark #toast { background-color:#1e293b; color:#e2e8f0; }
body.dark .hide-btn { background-color: rgba(30,41,59,0.85) !important; color:#e2e8f0; border-color:#475569; }

/* State badge/background neutralization for dark mode (soft translucent tints) */
/* Enhanced state badge backgrounds (higher contrast) */
body.dark { --badge-alpha:.38; --badge-radius:.5rem; --badge-shadow:0 0 0 1px rgba(255,255,255,0.04),0 1px 2px rgba(0,0,0,.55); }
body.dark .bg-green-100 { background-color: rgba(5,150,105,var(--badge-alpha)) !important; }
body.dark .bg-yellow-100 { background-color: rgba(217,119,6,var(--badge-alpha)) !important; }
body.dark .bg-rose-100 { background-color: rgba(225,29,72,var(--badge-alpha)) !important; }
body.dark .bg-slate-100 { background-color: rgba(100,116,139,var(--badge-alpha)) !important; }
body.dark .bg-slate-200 { background-color: rgba(148,163,184,0.55) !important; }

/* Speciální úprava pro stejné utility použité na kartách v dark módu – lehce vyšší kontrast než badge */
/* Event tiles state colors (opaque – no see-through) */
body.dark .event-card.bg-green-100 { background-color:#065f46 !important; }
body.dark .event-card.bg-yellow-100 { background-color:#92400e !important; }
body.dark .event-card.bg-rose-100 { background-color:#9f1239 !important; }
body.dark .event-card.bg-slate-100 { background-color:#334155 !important; }
body.dark .event-card.bg-slate-200 { background-color:#475569 !important; }

/* Adjust text colors inside those badges for readability */
body.dark .text-green-800 { color:#34d399 !important; }
body.dark .text-yellow-800 { color:#facc15 !important; }
body.dark .text-rose-800 { color:#fb7185 !important; }
body.dark .text-slate-800 { color:#e2e8f0 !important; }

/* Border tweaks for badges */
body.dark .border-green-200 { border-color:#047857 !important; }
body.dark .border-yellow-200 { border-color:#b45309 !important; }
body.dark .border-rose-200 { border-color:#be123c !important; }
body.dark .border-slate-200 { border-color:#64748b !important; }

/* Unified badge styling */
body.dark .bg-green-100,
body.dark .bg-yellow-100,
body.dark .bg-rose-100,
body.dark .bg-slate-100,
body.dark .bg-slate-200 { border-width:1px; border-style:solid; border-color:rgba(255,255,255,0.08); border-radius:var(--badge-radius); box-shadow:var(--badge-shadow); font-weight:600; letter-spacing:.25px; }
body.dark .bg-green-100:hover { background-color:#047857 !important; }
body.dark .bg-yellow-100:hover { background-color:#b45309 !important; }
body.dark .bg-rose-100:hover { background-color:#be123c !important; }
body.dark .bg-slate-100:hover { background-color:#475569 !important; }
body.dark .bg-slate-200:hover { background-color:#64748b !important; }

/* Hodinové labely (časové značky) – v dark módu byly světlé na světlém textu -> ztmavení pro čitelnost */
body.dark #gridContainer .bg-white\/80 { background-color: rgba(30,41,59,0.90) !important; color:#e2e8f0 !important; border:1px solid #334155; box-shadow:0 0 0 1px #1e293b; }

/* Buttons / interactive backgrounds hover (keep minimal changes) */
body.dark button.border, body.dark .border button { background-color:#0f172a; }
body.dark button.border:hover { background-color:#1e293b; }

/* Inputs placeholder color */
body.dark input::placeholder, body.dark textarea::placeholder { color:#64748b; }

/* Scrollbar (Firefox thin already); for WebKit approximate */
body.dark ::-webkit-scrollbar { width:10px; height:10px; }
body.dark ::-webkit-scrollbar-track { background:#0f172a; }
body.dark ::-webkit-scrollbar-thumb { background:#334155; border:2px solid #0f172a; border-radius:8px; }
body.dark ::-webkit-scrollbar-thumb:hover { background:#475569; }

/* Code blocks (event detail key) */
body.dark code { color:#f1f5f9; background:#0f172a; }
