/* ==========================================================
   NESDENT Tým – vzhled
   Moderní, vzdušný, tyrkysový. Systémové písmo (SF Pro na iPhonu).
   ========================================================== */

:root {
  --bg: #F3F6F7;
  --surface: #FFFFFF;
  --surface-2: #EEF3F4;
  --ink: #10262E;
  --ink-2: #4A5F67;
  --ink-3: #8A9BA2;
  --line: #E3EAEC;
  --primary: #0B7F8A;
  --primary-dark: #075F68;
  --primary-soft: #E2F2F3;
  --danger: #C8423B;
  --danger-soft: #FBEBEA;
  --warn: #C9821F;
  --warn-soft: #FCF2E2;
  --ok: #2F8F5F;
  --ok-soft: #E5F4EC;

  --radius-l: 26px;
  --radius-m: 18px;
  --radius-s: 12px;
  --shadow-1: 0 1px 2px rgba(16, 38, 46, .04), 0 6px 20px rgba(16, 38, 46, .05);
  --shadow-2: 0 10px 30px rgba(16, 38, 46, .14);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 66px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.4;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
#app { max-width: 560px; margin: 0 auto; }
.view {
  padding: calc(var(--safe-top) + 18px) 20px calc(var(--tabbar-h) + var(--safe-bottom) + 28px);
  min-height: 100vh;
  animation: viewIn .35s var(--ease);
}
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 22px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }
.page-title { font-size: 34px; font-weight: 800; letter-spacing: -.025em; margin: 4px 0 0; line-height: 1.05; }
.page-sub { color: var(--ink-2); margin-top: 6px; font-size: 15px; }

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; flex: none; box-shadow: 0 6px 14px rgba(30, 60, 140, .28); }
.brand-mark img { width: 100%; height: 100%; display: block; }

/* Zub z loga NESDENT – barví se přes currentColor */
.tooth { display: inline-block; flex: none; width: 1em; height: 1em; background: currentColor;
  -webkit-mask: url("icons/tooth.png") center / contain no-repeat; mask: url("icons/tooth.png") center / contain no-repeat; }
.brand-name { font-weight: 800; letter-spacing: .16em; font-size: 15px; }
.brand-sub { font-size: 10.5px; letter-spacing: .16em; color: var(--ink-3); font-weight: 600; text-transform: uppercase; }

.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-1); color: var(--ink); transition: transform .15s; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(11,127,138,.32); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 12px; }
.section-title { font-size: 20px; font-weight: 750; letter-spacing: -.01em; margin: 0; }
.section-title .count { color: var(--ink-3); font-weight: 600; margin-left: 6px; }
.link-btn { color: var(--primary); font-weight: 650; font-size: 15px; }

/* ---------- Nadcházející (horizontální pás) ---------- */
.upcoming-strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 2px 20px 8px; scrollbar-width: none; }
.upcoming-strip::-webkit-scrollbar { display: none; }
.up-card { scroll-snap-align: start; flex: none; width: 170px; background: var(--surface); border-radius: var(--radius-m); padding: 14px 14px 13px; box-shadow: var(--shadow-1); text-align: left; position: relative; overflow: hidden; }
.up-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.up-when { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--c); text-transform: uppercase; }
.up-when.today { color: #fff; background: var(--c); padding: 2px 7px; border-radius: 6px; display: inline-block; }
.up-title { font-weight: 650; margin-top: 6px; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.up-sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Mimo tento týden ---------- */
.away { background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow-1); padding: 6px 16px; }
.away-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.away-row + .away-row { border-top: 1px solid var(--line); }
.away-name { font-weight: 600; font-size: 15px; }
.away-why { color: var(--ink-3); font-size: 13px; }
.away-empty { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 12px 0; font-size: 15px; }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--g1, var(--primary)); flex: none; letter-spacing: .02em; }

/* ---------- Karty zaměstnanců (styl peněženky) ---------- */
.wallet { position: relative; padding-bottom: 4px; }
.emp-card {
  --g1: #0E8C95; --g2: #0A5F6B;
  position: relative; display: block; width: 100%; height: 208px; border-radius: var(--radius-l);
  color: #fff; text-align: left; padding: 18px 20px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.22), transparent 55%),
    radial-gradient(80% 60% at 0% 100%, rgba(0,0,0,.18), transparent 60%),
    linear-gradient(140deg, var(--g1), var(--g2));
  box-shadow: 0 -1px 0 rgba(255,255,255,.25) inset, 0 12px 28px rgba(16,38,46,.16);
  transition: transform .25s var(--ease);
}
.wallet .emp-card + .emp-card { margin-top: -138px; }
.wallet .emp-card:active { transform: translateY(-4px); }
.emp-card .watermark { position: absolute; right: -18px; bottom: -26px; width: 180px; height: 180px; opacity: .12; }
.ec-top { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; gap: 12px; }
.ec-brand { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .2em; opacity: .9; }
.ec-brand .tooth { width: 15px; height: 15px; }
.ec-role { font-size: 12px; font-weight: 650; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ec-bottom { position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ec-name { font-size: 23px; font-weight: 750; letter-spacing: -.015em; line-height: 1.1; }
.ec-title { font-size: 13px; opacity: .8; margin-bottom: 3px; font-weight: 600; }
.ec-stat { text-align: right; flex: none; }
.ec-stat-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.ec-stat-value { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.ec-chip { position: absolute; left: 20px; top: 104px; width: 40px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,.18)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.ec-chip::after { content: ""; position: absolute; inset: 8px 0; border-top: 1px solid rgba(255,255,255,.35); border-bottom: 1px solid rgba(255,255,255,.35); }

.add-card { width: 100%; margin-top: 14px; height: 64px; border-radius: var(--radius-m); border: 1.5px dashed #C5D3D6; color: var(--primary); font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 8px; background: transparent; }

.empty { text-align: center; color: var(--ink-3); padding: 28px 10px; font-size: 15px; }

/* ---------- Detail karty ---------- */
.detail {
  position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 8px) 20px calc(var(--safe-bottom) + 40px);
}
.detail-inner { max-width: 560px; margin: 0 auto; }
.detail-bar { position: sticky; top: calc(-1 * var(--safe-top) - 8px); z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-top) + 8px) 0 10px; margin: calc(-1 * var(--safe-top) - 8px) -20px 0; padding-left: 20px; padding-right: 20px; background: rgba(243,246,247,.82); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); }
.detail-bar-title { font-weight: 700; opacity: 0; transition: opacity .2s; }
.detail.scrolled .detail-bar-title { opacity: 1; }
.detail .emp-card { margin-top: 6px; cursor: grab; }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: #CBD6D9; margin: 0 auto 2px; }
.detail-body { animation: bodyIn .45s var(--ease) both; animation-delay: .12s; }
@keyframes bodyIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.quick-item { display: block; text-align: left; background: var(--surface); border-radius: var(--radius-m); padding: 14px 15px 13px; box-shadow: var(--shadow-1); min-width: 0; }
.quick-item:active { transform: scale(.98); }
.quick-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }
.quick-value { font-size: 21px; font-weight: 750; margin-top: 3px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.seg { display: flex; gap: 6px; overflow-x: auto; margin: 22px -20px 16px; padding: 0 20px; scrollbar-width: none; position: sticky; top: calc(var(--safe-top) + 52px); z-index: 1; }
.seg::-webkit-scrollbar { display: none; }
.seg-btn { flex: none; padding: 9px 15px; border-radius: 999px; font-weight: 650; font-size: 14.5px; color: var(--ink-2); background: var(--surface); box-shadow: var(--shadow-1); transition: background .2s, color .2s; }
.seg-btn.is-active { background: var(--ink); color: #fff; }

.panel { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-1); padding: 20px; }
.panel + .panel, .panel + .list, .list + .panel { margin-top: 12px; }
.hero-panel { color: #fff; background: radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,.16), transparent 55%), linear-gradient(140deg, #0E8C95, #0A5F6B); box-shadow: 0 12px 26px rgba(11,127,138,.25); }
.hero-label { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.hero-value { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin-top: 8px; }
.hero-value small { font-size: 20px; font-weight: 650; margin-left: 6px; letter-spacing: 0; }
.hero-note { opacity: .82; font-size: 14px; margin-top: 4px; }
.bar { height: 7px; border-radius: 4px; background: rgba(255,255,255,.22); margin: 18px 0 16px; overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; background: #fff; }
.bar > i.planned { background: rgba(255,255,255,.5); }
.split { display: grid; grid-template-columns: 1fr 1fr; }
.split > div + div { border-left: 1px solid rgba(255,255,255,.22); padding-left: 16px; }
.split .v { font-size: 20px; font-weight: 750; }
.split .l { font-size: 13px; opacity: .8; }

.year-switch { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.year-switch .y { font-weight: 750; font-size: 18px; }
.year-switch button { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-1); display: grid; place-items: center; color: var(--primary); }
.year-switch svg { width: 18px; height: 18px; stroke-width: 2.2; }

.list { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-1); overflow: hidden; }
.list-head { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; padding: 16px 18px 4px; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; width: 100%; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
.row:active { background: var(--surface-2); }
.row-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--primary)) 13%, white); color: var(--c, var(--primary)); flex: none; }
.row-icon svg { width: 20px; height: 20px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 650; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--ink-3); font-size: 13.5px; margin-top: 1px; }
.row-end { text-align: right; flex: none; }
.row-value { font-weight: 700; font-size: 15.5px; }
.row-value-sub { color: var(--ink-3); font-size: 12.5px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--danger); background: var(--danger-soft); }
.pill.info { color: var(--primary); background: var(--primary-soft); }

.btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; height: 54px; border-radius: var(--radius-m); font-weight: 700; font-size: 16px; background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(11,127,138,.25); transition: transform .15s; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-1); }
.btn.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn + .btn { margin-top: 10px; }
.mt { margin-top: 12px; }

.hint { display: flex; gap: 12px; align-items: flex-start; background: var(--primary-soft); color: var(--primary-dark); border-radius: var(--radius-m); padding: 14px 16px; font-size: 14px; }
.hint svg { width: 20px; height: 20px; margin-top: 1px; }

.info-grid { display: grid; gap: 0; }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; }
.info-row + .info-row { border-top: 1px solid var(--line); }
.info-row .k { color: var(--ink-3); }
.info-row .v { font-weight: 600; text-align: right; }
.info-row a { color: var(--primary); text-decoration: none; }
.note-text { white-space: pre-wrap; color: var(--ink-2); }

/* ---------- Kalendář ---------- */
.toggle { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.toggle button { flex: 1; height: 38px; border-radius: 11px; font-weight: 650; color: var(--ink-2); font-size: 15px; }
.toggle button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px 16px; padding: 0 20px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-1); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip.is-off { opacity: .45; box-shadow: none; background: transparent; }

.month-group { margin-bottom: 18px; }
.month-label { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 4px 8px; }
.date-block { width: 46px; flex: none; text-align: center; border-radius: 13px; padding: 6px 0 5px; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); }
.date-block .d { font-size: 19px; font-weight: 800; line-height: 1; }
.date-block .w { font-size: 11px; font-weight: 700; text-transform: uppercase; margin-top: 3px; letter-spacing: .04em; }
.type-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }

.cal { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-1); padding: 14px 12px 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; }
.cal-head .m { font-weight: 750; font-size: 18px; text-transform: capitalize; }
.cal-head button { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--primary); background: var(--surface-2); }
.cal-head svg { width: 18px; height: 18px; stroke-width: 2.2; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 4px 0 6px; }
.cal-day { height: 50px; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 7px; gap: 4px; font-weight: 600; font-size: 15.5px; }
.cal-day.out { color: #C3CED1; }
.cal-day.weekend:not(.out) { color: var(--ink-3); }
.cal-day.today { color: var(--primary); font-weight: 800; }
.cal-day.sel { background: var(--ink); color: #fff; }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.day-title { font-weight: 750; font-size: 18px; margin: 22px 4px 10px; }
.day-title::first-letter { text-transform: uppercase; }

/* ---------- Nastavení ---------- */
.set-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; width: 100%; text-align: left; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row .row-title { font-weight: 600; }
.set-row.danger { color: var(--danger); }
.set-row.danger .row-icon { --c: var(--danger); }
.chev { color: #B9C6C9; width: 18px; height: 18px; }
.foot { text-align: center; color: var(--ink-3); font-size: 12.5px; margin-top: 26px; letter-spacing: .04em; }

/* ---------- Spodní lišta (připnutá ke spodu, přes celou šířku) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; gap: 0;
  padding: 7px max(8px, env(safe-area-inset-left)) calc(var(--safe-bottom) + 6px);
  background: rgba(255,255,255,.94); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; max-width: 140px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 0; color: var(--ink-3); font-size: 11.5px; font-weight: 650; }
.tab .ic { display: grid; place-items: center; width: 58px; height: 32px; border-radius: 16px; transition: background .2s, color .2s; }
.tab svg { width: 23px; height: 23px; }
.tab.is-active { color: var(--primary); }
.tab.is-active .ic { background: var(--primary-soft); }

/* ---------- Spodní panel (formuláře) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(10, 25, 30, .38); animation: fadeIn .25s ease both; }
.sheet-backdrop.closing { animation: fadeOut .22s ease both; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 560px; margin: 0 auto;
  max-height: calc(100vh - var(--safe-top) - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 20px calc(var(--safe-bottom) + 22px);
  animation: sheetUp .38s var(--ease) both; box-shadow: 0 -10px 40px rgba(0,0,0,.12);
}
.sheet.closing { animation: sheetDown .25s ease both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { from { transform: none; } to { transform: translateY(100%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 18px; }
.sheet-title { font-size: 22px; font-weight: 800; letter-spacing: -.015em; }
.sheet .icon-btn { width: 38px; height: 38px; box-shadow: none; background: var(--surface-2); }
.sheet .icon-btn svg { width: 18px; height: 18px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink-2); margin: 0 4px 6px; }
.field input, .field select, .field textarea {
  width: 100%; height: 52px; border-radius: 15px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 15px; font-size: 16.5px; outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.field textarea { height: 96px; padding: 13px 15px; resize: none; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A9BA2' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(11,127,138,.12); }
.field .help { font-size: 12.5px; color: var(--ink-3); margin: 6px 4px 0; }
.field-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.field-row .field { min-width: 0; }
.field input[type=date], .field input[type=time], .field input[type=month] { min-width: 0; display: block; }
.color-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.color-pick button { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(140deg, var(--g1), var(--g2)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); transition: transform .15s; }
.color-pick button.is-active { transform: scale(1.08); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.type-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.type-pick button { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 12px; font-size: 14.5px; font-weight: 600; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-2); }
.type-pick button i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.type-pick button.is-active { border-color: var(--c); color: var(--ink); background: color-mix(in srgb, var(--c) 9%, white); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 84px); z-index: 80; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-2); animation: toastIn .3s var(--ease); white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Zaměstnanci (seznam) ---------- */
.search { position: relative; margin-bottom: 14px; }
.search input { width: 100%; height: 50px; border-radius: 16px; border: 0; background: var(--surface); box-shadow: var(--shadow-1); padding: 0 16px 0 46px; font-size: 16.5px; outline: none; -webkit-appearance: none; }
.search input:focus { box-shadow: 0 0 0 3px rgba(11,127,138,.18), var(--shadow-1); }
.search svg { position: absolute; left: 15px; top: 14px; width: 21px; height: 21px; color: var(--ink-3); }
.mini-card { width: 50px; height: 34px; border-radius: 9px; flex: none; position: relative; overflow: hidden; color: #fff; display: grid; place-items: center; font-weight: 750; font-size: 13px; letter-spacing: .04em;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.25), transparent 55%), linear-gradient(140deg, var(--g1), var(--g2)); box-shadow: 0 4px 10px rgba(16,38,46,.15); }
.people-row { align-items: center; }
.people-row .pill { margin-top: 6px; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }

/* ---------- Pole s datem (iPhone si je jinak kreslí po svém) ---------- */
.date-wrap { position: relative; }
.date-wrap input { display: block; width: 100%; min-width: 0; height: 52px; line-height: 52px; text-align: left; padding: 0 44px 0 15px; }
.date-wrap input::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.2em; }
.date-wrap input::-webkit-datetime-edit { padding: 0; }
.date-wrap input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
.date-wrap svg { position: absolute; right: 14px; top: 15px; width: 21px; height: 21px; color: var(--ink-3); pointer-events: none; }
.date-wrap .ph { position: absolute; left: 16px; top: 0; line-height: 52px; color: #A3B2B7; font-size: 16.5px; pointer-events: none; display: none; }
.date-wrap.is-empty .ph { display: block; }
.date-wrap.is-empty input { color: transparent; }
.date-wrap.is-empty input:focus { color: inherit; }
.date-wrap.is-empty input:focus ~ .ph { display: none; }

/* ---------- Rozvrh ---------- */
.sched-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.sched-total { font-weight: 750; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd { text-align: center; border-radius: 12px; padding: 8px 0 7px; background: var(--surface-2); color: var(--ink-3); }
.wd span { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.wd b { display: block; font-size: 15px; margin-top: 2px; }
.wd.on { background: var(--primary-soft); color: var(--primary-dark); }
.sched-foot { margin-top: 14px; color: var(--ink-2); font-size: 14.5px; }
.sched-foot b { color: var(--ink); }

.sched-presets { display: flex; gap: 8px; margin-bottom: 10px; }
.sched-presets .chip { box-shadow: none; border: 1.5px solid var(--line); background: var(--surface); }
.sched-edit { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; }
.sched-row { display: flex; align-items: center; gap: 12px; padding: 7px 12px 7px 14px; }
.sched-row + .sched-row { border-top: 1px solid var(--line); }
.sched-day { flex: 1; font-weight: 650; color: var(--ink-3); }
.sched-row.on .sched-day { color: var(--ink); }
.sched-row input[type=text], .day-row input { width: 74px; height: 40px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--bg); text-align: right; padding: 0 10px; font-size: 16.5px; font-weight: 650; outline: none; -webkit-appearance: none; }
.sched-row input[type=text]:focus, .day-row input:focus { border-color: var(--primary); background: #fff; }
.sched-row input:disabled { opacity: .4; }
.sched-unit { color: var(--ink-3); font-size: 14px; width: 12px; }
.sched-sum { margin: 10px 4px 0; color: var(--ink-2); font-size: 14.5px; }
.sched-sum b { color: var(--ink); }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input, .field .switch input { position: absolute; opacity: 0; left: 0; top: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; z-index: 1; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 13px; background: #D5DEE1; transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(18px); }

/* ---------- Dovolená – rozpis po dnech ---------- */
.days-box { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 15px; margin-top: -2px; }
.days-total { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--primary-dark); }
.days-note { color: var(--ink-3); font-size: 13.5px; }
.days summary { margin-top: 10px; color: var(--primary); font-weight: 650; font-size: 15px; cursor: pointer; list-style: none; }
.days summary::-webkit-details-marker { display: none; }
.days summary::before { content: "›"; display: inline-block; margin-right: 6px; transition: transform .2s; }
.days[open] summary::before { transform: rotate(90deg); }
.days summary span { color: var(--ink-3); font-weight: 500; }
.day-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.day-row + .day-row { border-top: 1px solid var(--line); }
.day-row:first-of-type { margin-top: 8px; }
.day-name { flex: 1; font-weight: 600; }
.day-plan { color: var(--ink-3); font-size: 13px; }
.empty-days { display: flex; gap: 10px; color: var(--ink-2); font-size: 14.5px; }
.empty-days svg { width: 20px; height: 20px; color: var(--warn); }

/* ---------- Úprava typů ---------- */
.chip.chip-edit { color: var(--primary); background: transparent; box-shadow: none; border: 1.5px dashed #BFD0D3; }
.chip.chip-edit svg { width: 16px; height: 16px; }

/* ---------- Přihlášení / načítání ---------- */
body.logged-out #app, body.logged-out .tabbar { display: none; }
.login { min-height: 100vh; max-width: 420px; margin: 0 auto; padding: calc(var(--safe-top) + 64px) 24px calc(var(--safe-bottom) + 32px); display: flex; flex-direction: column; align-items: center; }
.login-logo { width: 92px; height: 92px; border-radius: 24px; overflow: hidden; box-shadow: 0 14px 34px rgba(30, 60, 140, .3); }
.login-logo img { width: 100%; height: 100%; display: block; }
.login-brand { font-weight: 800; letter-spacing: .2em; font-size: 20px; margin-top: 20px; }
.login-card { width: 100%; margin-top: 34px; background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-1); padding: 24px 20px 18px; }
.login-err { background: var(--danger-soft); color: var(--danger); border-radius: 12px; padding: 11px 14px; font-size: 14.5px; font-weight: 600; margin-bottom: 14px; }
.login-help { text-align: center; color: var(--ink-3); font-size: 13.5px; margin: 14px 0 0; }
.login-wait { display: flex; align-items: center; gap: 12px; margin-top: 44px; color: var(--ink-2); font-weight: 600; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn:disabled { opacity: .6; }

/* stav synchronizace v hlavičce */
.brand { position: relative; }
.sync-pill { margin-left: auto; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; color: var(--warn); background: var(--warn-soft); }
.sync-pill.bad::before { content: "●"; margin-right: 5px; font-size: 9px; vertical-align: 1px; }
