/* Kalendář: měsíc, den s hodinami a program dne. Barvy položek přes --c (druh úkolu nebo splatnost faktury). */
.cal-head { flex-wrap: wrap; gap: 10px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-label { min-width: 150px; text-align: center; font-size: 17px; font-weight: 650; }
.cal-label::first-letter { text-transform: uppercase; }
.cal-label.day { min-width: 250px; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }
.cal-center { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cal-side { display: flex; flex-direction: column; gap: var(--gap); position: sticky; top: 0; min-width: 0; }
.cal-note { margin: 0; padding: 0 4px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 2px 4px; font-size: 12px; color: var(--text2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 3px; }
.cal-legend i.ring { width: 13px; height: 13px; border-radius: 3px; background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.cal-legend b { font-weight: 650; }

/* Měsíc */
.calm { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.calm-wd { padding: 11px 12px; font-size: 12px; font-weight: 650; letter-spacing: .3px; color: var(--text2); border-bottom: 1px solid var(--border); }
.calm-wd.weekend { color: var(--muted); }
.calm-day { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 7px; cursor: pointer; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: background .12s; }
.calm-day:nth-child(7n) { border-right: 0; }
.calm-day:nth-last-child(-n+7) { border-bottom: 0; }
.calm-day.weekend { background: color-mix(in srgb, var(--subtle) 70%, var(--card)); }
.calm-day:hover { background: var(--hover); }
.calm-day.out { background: var(--subtle); }
.calm-day.out .calm-n { color: var(--muted); font-weight: 500; }
.calm-day.out .cev { opacity: .55; }
.calm-day.sel { background: color-mix(in srgb, var(--text) 7%, var(--card)); }
.calm-day.sel .calm-n { background: var(--sky); color: #fff; }
/* Splatnost: rámeček přes celý den. Hnědý zaplatit, zelený inkaso, oba najednou vnořené. */
.calm-day.pay { box-shadow: inset 0 0 0 1px var(--brown); }
.calm-day.collect { box-shadow: inset 0 0 0 1px var(--green); }
.calm-day.pay.collect { box-shadow: inset 0 0 0 1px var(--brown), inset 0 0 0 2px var(--green); }
.cald.pay { box-shadow: inset 0 0 0 2.5px var(--brown); }
.cald.collect { box-shadow: inset 0 0 0 2.5px var(--green); }
.cald.pay.collect { box-shadow: inset 0 0 0 2.5px var(--brown), inset 0 0 0 5px var(--green); }
.calm-due { padding: 0 3px; font-size: 12px; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calm-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.calm-n { width: 27px; height: 27px; padding: 0; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer; }
.calm-n:hover { background: var(--segment); }
.calm-day.today .calm-n, .calm-day.today.sel .calm-n { background: var(--red); color: #fff; }
.calm-add { width: 23px; height: 23px; padding: 0; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 7px; background: var(--segment); color: var(--text2); cursor: pointer; opacity: 0; transition: opacity .12s; }
.calm-day:hover .calm-add, .calm-add:focus-visible { opacity: 1; }
.calm-add:hover { color: var(--text); }
.cev { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 3px 7px; border-radius: 6px; font-size: 12px; line-height: 1.3; background: color-mix(in srgb, var(--c) 13%, var(--card)); box-shadow: inset 2.5px 0 0 var(--c); }
.cev span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }
.cev i { flex: none; font-style: normal; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--c); }
.cev.done { background: var(--subtle); box-shadow: none; }
.cev.done span { color: var(--muted); text-decoration: line-through; }
.cev.done i { color: var(--muted); }
.calm-more { align-self: flex-start; padding: 1px 4px; border: 0; background: transparent; color: var(--text2); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; border-radius: 5px; }
.calm-more:hover { color: var(--text); background: var(--segment); }

/* Program dne */
.cal-agenda { display: flex; flex-direction: column; gap: 8px; }
.cal-dayhead { display: flex; align-items: center; gap: 12px; }
.cal-bignum { flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: var(--segment); color: var(--text); font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-bignum.today { background: var(--red); color: #fff; }
.cal-daytext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cal-daytext b { font-size: 16px; font-weight: 650; }
.cal-daytext b::first-letter { text-transform: uppercase; }
.cal-daytext span { font-size: 12.5px; color: var(--text2); }
.cal-ico { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--card)); }
.cal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; text-align: left; }
.cal-main small { font-size: 12px; color: var(--text2); }
.cal-main b { font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.cal-main p { margin: 2px 0 0; font-size: 12.5px; color: var(--text2); }
.cal-main .refs { margin-top: 3px; }
.cal-task, .cal-inv { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: inherit; font: inherit; cursor: pointer; transition: background .12s, border-color .12s; }
.cal-task:hover, .cal-inv:hover { background: var(--hover); border-color: var(--border2); }
.cal-task.done { opacity: .62; }
.cal-task.done .cal-main b { text-decoration: line-through; }
.cal-inv { align-items: center; border-color: color-mix(in srgb, var(--c) 35%, var(--border)); background: color-mix(in srgb, var(--c) 7%, var(--card)); }
.cal-inv small { font-weight: 650; color: var(--c); }
.cal-amount { flex: none; font-size: 14px; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; }
.cal-openday { align-self: stretch; justify-content: center; margin-top: 2px; }

/* Den s hodinami */
.cald { padding: 16px; }
.cald-all { display: flex; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.cald-alllabel { flex: none; width: 52px; padding-top: 9px; font-size: 11.5px; font-weight: 600; color: var(--text2); text-align: right; }
.cald-allitems { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cald-body { position: relative; margin-top: 14px; border-top: 1px solid var(--border); }
.cald-slot { position: absolute; left: 0; right: 0; display: block; padding: 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.cald-slot:hover { background: color-mix(in srgb, var(--hover) 75%, transparent); }
.cald-hour { position: absolute; left: 0; top: 6px; width: 52px; text-align: right; font-size: 12px; font-weight: 500; color: var(--text2); font-variant-numeric: tabular-nums; }
.cald-plus { position: absolute; right: 10px; top: 6px; font-size: 12px; font-weight: 600; color: var(--text2); opacity: 0; }
.cald-slot:hover .cald-plus { opacity: 1; }
.cald-ev { position: absolute; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 7px 9px; border-radius: 10px; background: color-mix(in srgb, var(--c) 16%, var(--card)); box-shadow: inset 3px 0 0 var(--c), 0 1px 2px rgba(0,0,0,.05); cursor: pointer; overflow: hidden; z-index: 1; transition: background .12s; }
.cald-ev:hover { background: color-mix(in srgb, var(--c) 22%, var(--card)); }
.cald-ev.done { background: var(--subtle); box-shadow: inset 3px 0 0 var(--border2); }
.cald-ev.done b { color: var(--muted); text-decoration: line-through; }
.cald-evicon { flex: none; color: var(--c); display: flex; }
.cald-evmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cald-evmain small { font-size: 11.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cald-evmain b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cald-now { position: absolute; left: 58px; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.cald-now i { position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* Malý měsíc */
.cal-minihead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-minihead b { font-size: 14px; font-weight: 650; }
.cal-minihead b::first-letter { text-transform: uppercase; }
.cal-minigrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-miniwd { padding: 3px 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); }
.cal-miniday { position: relative; aspect-ratio: 1; padding: 0; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.cal-miniday:hover { background: var(--hover); }
.cal-miniday.out { color: var(--muted); }
.cal-miniday.today { color: var(--red); font-weight: 700; }
.cal-miniday.sel { background: var(--sky); color: #fff; font-weight: 700; }
.cal-miniday i { position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--brown); }
.cal-miniday.sel i { background: var(--card); }
.cal-miniday.pay { box-shadow: inset 0 0 0 2px var(--brown); }
.cal-miniday.collect { box-shadow: inset 0 0 0 2px var(--green); }
.cal-miniday.pay.collect { box-shadow: inset 0 0 0 2px var(--brown), inset 0 0 0 4px var(--green); }

@media (max-width: 1200px) { .cal-wrap { grid-template-columns: 1fr; } .cal-side { position: static; } }
@media (max-width: 760px) { .cald-ev .btn.done span { display: none; } .calm { grid-template-rows: auto !important; } }

/* Úkol s prioritou: v měsíci jen tenký modrý rámeček dne, ve dni modrý akcent a dvojitý zoom jako zakázka */
.calm-day.prio { position: relative; z-index: 1; outline: 1px solid var(--sky); outline-offset: -3px; animation: day-pulse 1.2s ease-in-out infinite alternate; }
/* Záře ven: stín kolem dne, pulzuje spolu s výplní */
.calm-day.prio::after { content: ""; position: absolute; inset: 3px; border-radius: 4px; pointer-events: none; animation: day-glow 1.2s ease-in-out infinite alternate; }
@keyframes day-pulse { from { background-color: var(--card); } to { background-color: color-mix(in srgb, var(--sky) 26%, var(--card)); } }
@keyframes day-glow { from { box-shadow: 0 0 0 0 transparent; } to { box-shadow: 0 0 16px 4px color-mix(in srgb, var(--sky) 55%, transparent); } }
@media (prefers-reduced-motion: reduce) { .calm-day.prio, .calm-day.prio::after { animation: none; } }
.calm-day.prio.pay.collect { outline-offset: -4px; }
.cal-task.prio { border: 2px solid var(--sky); box-shadow: 0 2px 10px color-mix(in srgb, var(--sky) 25%, transparent); animation: order-nudge 3.2s ease-in-out infinite; }
.cald-ev.prio { box-shadow: inset 3px 0 0 var(--c), inset 0 0 0 2px var(--sky), 0 2px 8px color-mix(in srgb, var(--sky) 25%, transparent); animation: order-nudge 3.2s ease-in-out infinite; }
.cal-task.prio:hover, .cald-ev.prio:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .cal-task.prio, .cald-ev.prio { animation: none; } }
