/* Docházka – vzhled podle veterina-zak.cz (Open Sans, tmavě modrá / modrá / zlatá) */
:root {
  --navy: #201b57;
  --navy-2: #2d2775;
  --blue: #008ad1;
  --blue-2: #38b2f1;
  --blue-bg: #e6f3fc;
  --gold: #cca356;
  --gold-bg: #f5eddd;
  --cream: #faf5ef;
  --line: #e7e1d6;
  --muted: #6b6890;
  --ok: #2e8b57;
  --ok-bg: #e5f4ea;
  --err: #b80b0e;
  --err-bg: #fdeaea;
  --warn: #9a6a00;
  --warn-bg: #fff4d6;
  --radius: 12px;
  --page: 1000px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--navy);
  font-family: 'Open Sans', Arial, sans-serif; font-size: 16px; line-height: 1.45;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--blue); }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; font-weight: 300; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---- hlavička ---- */
.topbar { background: #fff; border-bottom: 3px solid var(--gold); }
.topbar-in { max-width: var(--page); margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand img { height: 34px; max-width: 62vw; }
.brand span { font-weight: 300; font-size: 1.2rem; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }
.who { font-size: .875rem; color: var(--muted); }
.nav { background: var(--navy); }
.nav-in { max-width: var(--page); margin: 0 auto; padding: 0 8px; display: flex; overflow-x: auto; scrollbar-width: none; }
.nav a { color: #fff; text-decoration: none; padding: 12px 14px; white-space: nowrap; font-size: .95rem; border-bottom: 3px solid transparent; }
.nav a:hover { background: var(--navy-2); }
.nav a.on { border-bottom-color: var(--gold); font-weight: 600; }
@media (max-width: 560px) { .brand span { display: none; } .who { width: 100%; text-align: right; margin-top: -4px; } }

.main { width: 100%; max-width: var(--page); margin: 0 auto; padding: 20px 16px 40px; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px; display: flex; justify-content: center; align-items: center; gap: 6px; }

/* ---- karty ---- */
.card { background: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: 0 6px 18px -10px rgba(32, 27, 87, .25); }
.card h2 { margin-bottom: .5em; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.status { text-align: center; padding: 26px 18px; }
.status .big { font-size: 2.6rem; font-weight: 300; margin: 6px 0; }
.status.in { background: var(--blue-bg); }
.status.out { background: #fff; }
.status .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.status.in .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(46, 139, 87, .2); }

.stats { display: grid; gap: 10px; grid-auto-flow: column; grid-auto-columns: 1fr; margin-bottom: 6px; }
.stats .card { padding: 14px 8px; }
.stat { text-align: center; }
.stat .v { font-size: 1.8rem; font-weight: 300; color: var(--blue); }
.stat .l { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---- tlačítka ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 2px solid var(--blue); background: var(--blue); color: #fff;
  border-radius: 2em; padding: 9px 20px; font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--navy); border-color: var(--navy); }
.btn-gold { background: #fff; color: var(--gold); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: var(--gold-bg); color: var(--navy); border-color: var(--gold); }
.btn-danger { background: #fff; color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn-sm { padding: 5px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
form.inline { display: inline; }

/* ---- formuláře ---- */
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--navy); background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 138, 209, .15); }
textarea { min-height: 110px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.otp { font-size: 1.8rem; letter-spacing: .4em; text-align: center; font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: 18px; height: 18px; }

/* ---- hlášky ---- */
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: .95rem; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-info { background: var(--blue-bg); color: var(--navy); }

/* ---- štítky ---- */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 1em; background: var(--gold-bg); color: var(--navy); vertical-align: middle; white-space: nowrap; }
.src-nfc { background: #e3e0ff; color: var(--navy); }
.src-qr { background: var(--blue-bg); color: #005f91; }
.src-form { background: var(--gold-bg); color: #7a5a1c; }
.src-admin { background: #ece9f5; color: var(--navy); }
.src-auto { background: var(--warn-bg); color: var(--warn); }
.badge-paid { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--err-bg); color: var(--err); }
.badge-edit { background: #f1f1f1; color: #555; }
.badge-off { background: #eee; color: #777; }

/* ---- tabulky ---- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 2px solid var(--line); }
td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.deleted td { color: #999; text-decoration: line-through; }
tr.total td { font-weight: 700; border-bottom: none; }
tr.we td:first-child { color: var(--gold); }

/* seznam záznamů (mobil) */
.recs { list-style: none; margin: 0; padding: 0; }
.recs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.recs li:last-child { border-bottom: none; }
.recs .t { font-size: 1.1rem; font-weight: 600; }
.recs .d { font-size: .85rem; color: var(--muted); }
.recs .m { font-weight: 600; color: var(--blue); white-space: nowrap; }
.recs a.rec { flex: 1; color: inherit; text-decoration: none; min-width: 0; }

/* skupiny podle dnů */
.day-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin: 18px -18px 0; padding: 9px 18px; background: var(--blue-bg); color: var(--navy); text-decoration: none;
  border-top: 1px solid #cfe6f7; border-bottom: 1px solid #cfe6f7;
}
.day-head:first-of-type { margin-top: 4px; }
.day-head.off { background: var(--gold-bg); border-color: #eadcc0; }
.day-head .dh-date { font-size: 1rem; }
.day-head .dh-date strong { font-weight: 700; }
.day-head .dh-sum { font-weight: 700; color: var(--blue); white-space: nowrap; }
.day-head + .recs li { padding-left: 4px; }

/* tabulka záznamů v měsíci */
.rec-table { font-size: .95rem; }
.rec-table tbody tr { cursor: pointer; }
.rec-table tbody tr:hover td { background: var(--cream); }
.rec-table td { border-bottom: none; padding: 7px 6px; }
.rec-table tr.day-first td { border-top: 1px solid var(--line); }
.rec-table tbody tr:first-child td { border-top: none; }
.rec-table td a { color: inherit; text-decoration: none; font-weight: 600; }
.rec-table td.off { color: #9b7630; }
.rec-table .dur { font-weight: 700; color: var(--blue); }
.rec-table .dur.open { color: var(--ok); }
.rec-table .mark { font-size: .7rem; color: var(--muted); margin-left: 3px; }
.rec-table .mark.warn { color: #fff; background: var(--err); border-radius: 50%; display: inline-block; width: 15px; height: 15px; text-align: center; line-height: 15px; font-weight: 700; }

/* ---- kalendář ---- */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.month-nav h2 { margin: 0; font-weight: 300; font-size: 1.4rem; text-align: center; }
.month-nav .btn { padding: 4px 16px; font-size: 1.3rem; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, .85fr); gap: 4px; }
.cal-head .wk { color: var(--blue); }
.cal-week { border-radius: 8px; background: var(--blue-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3px 2px; min-width: 0; }
.cal-week .wl { font-size: .62rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.cal-week .wv { font-size: .85rem; font-weight: 700; color: var(--blue); white-space: nowrap; }
@media (max-width: 420px) { .cal-week .wl { display: none; } .cal-week .wv { font-size: .7rem; } }
.cal-head div { text-align: center; font-size: .75rem; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal-head .we { color: var(--gold); }
.cal-cell {
  position: relative; min-height: 58px; border-radius: 8px; background: #fff; border: 1.5px solid var(--line);
  padding: 4px 5px; text-decoration: none; color: var(--navy); display: flex; flex-direction: column; overflow: hidden;
}
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.we { background: var(--gold-bg); }
.cal-cell.hol { background: #f3e2c2; }
.cal-cell.today { border-color: var(--blue); }
.cal-cell.sel { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.cal-cell .dn { font-size: .85rem; font-weight: 600; }
.cal-cell.we .dn, .cal-cell.hol .dn { color: #9b7630; }
.cal-cell .hn { font-size: .6rem; line-height: 1.1; color: #9b7630; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cal-cell .rngs { margin-top: auto; display: flex; flex-direction: column; gap: 1px; }
.cal-cell .rng { font-size: .72rem; line-height: 1.15; color: var(--navy); }
.cal-cell .hrs { white-space: nowrap; font-size: .8rem; font-weight: 700; color: var(--blue); }
.cal-cell .hrs.open { color: var(--ok); }
.cal-cell .fl { position: absolute; top: 3px; right: 4px; background: var(--err); color: #fff; border-radius: 50%; width: 16px; height: 16px; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cal-cell:hover:not(.empty) { border-color: var(--gold); }
.cal-cell.other { opacity: .45; background: #f4f2f0; filter: grayscale(1); }
.cal-cell.other .dn { font-weight: 400; }
.cal-cell.other:hover { opacity: .75; }
@media (max-width: 420px) { .cal-cell .mo { display: none; } .cal-cell { min-height: 64px; padding: 3px; } .cal-cell .hn { display: none; } .cal-cell .rng { font-size: .62rem; } .cal-cell .hrs { font-size: .7rem; } }
@media (min-width: 900px) { .cal-cell { min-height: 82px; } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--line); }

/* ---- skenování ---- */
.scan { text-align: center; padding: 34px 18px; }
.scan .icon { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 2.6rem; color: #fff; }
.scan.in .icon { background: var(--ok); }
.scan.out .icon { background: var(--blue); }
.scan.ignored .icon, .scan.locked .icon { background: var(--gold); }
.scan .time { font-size: 3.2rem; font-weight: 300; line-height: 1; margin: 6px 0 10px; }

/* ---- přihlášení ---- */
.login { max-width: 420px; margin: 4vh auto 0; }
.login .card { padding: 26px 22px; }
.login h1 { text-align: center; }

/* ---- admin ---- */
.people { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.person { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; text-decoration: none; color: var(--navy); display: block; }
.person:hover { border-color: var(--gold); }
.person.in { border-color: var(--ok); background: #f4fbf6; }
.person .n { font-weight: 600; }
.qr-box { display: inline-block; background: #fff; padding: 12px; border-radius: 10px; border: 1.5px solid var(--line); }
code.url { display: block; word-break: break-all; background: var(--cream); padding: 8px 10px; border-radius: 8px; font-size: .85rem; }
