/* Empátia beosztás – mobilra tervezett, nyugodt felület az Empátia színeivel. */

@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/SourceSerif4-Variable.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --hatter: #F8F4F2;
  --felulet: #FFFFFF;
  --felulet-2: #F3ECEA;
  --szoveg: #2E2627;
  --szoveg-2: #6F6264;
  --szoveg-3: #9A8C8E;
  --vonal: #E8DEDC;
  --rozsa: #C46A6F;
  --rozsa-sotet: #9E4D52;
  --rozsa-halvany: #F7E3E4;
  --rozsa-lagy: #FBF0F0;
  --zold: #2F7A57;
  --zold-halvany: #E3F2EA;
  --borostyan: #8A5E0F;
  --borostyan-halvany: #FBF1DC;
  --piros: #B23A40;
  --piros-halvany: #FBE6E7;
  --arnyek: 0 1px 2px rgb(46 38 39 / .05), 0 4px 16px rgb(46 38 39 / .06);
  --arnyek-magas: 0 -4px 24px rgb(46 38 39 / .12);
  --kerek: 16px;
  --kerek-kicsi: 10px;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
  --also-sav: calc(64px + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: var(--hatter); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--hatter);
  color: var(--szoveg);
  font: 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; font-family: var(--sans); font-weight: 650; }
p { margin: 0; }
a { color: var(--rozsa-sotet); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--rozsa); outline-offset: 2px; }

/* ---------- Váz ---------- */

.app { max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--also-sav) + 24px); }
.app.szeles { max-width: 1400px; }
.vendeg .app { padding-bottom: 32px; }

.fejresz { padding: 20px 0 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.felirat { font-size: .78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--rozsa); margin-bottom: 4px; }
.fejresz .jobbra { display: flex; gap: 8px; }

.also-menu {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  height: var(--also-sav); padding-bottom: env(safe-area-inset-bottom);
  background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--vonal);
}
.also-menu nav { display: flex; width: 100%; max-width: 640px; }
.also-menu a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--szoveg-3); font-size: .72rem; font-weight: 600;
}
.also-menu a svg { width: 24px; height: 24px; }
.also-menu a[aria-current="page"] { color: var(--rozsa-sotet); }

@media (min-width: 900px) {
  .also-menu { top: 0; bottom: auto; height: 60px; padding: 0; border-top: 0; border-bottom: 1px solid var(--vonal); }
  .also-menu nav { max-width: 1400px; padding: 0 24px; gap: 4px; justify-content: flex-start; }
  .also-menu nav::before { content: 'Empátia'; font: 600 1.15rem var(--serif); color: var(--rozsa-sotet); align-self: center; margin-right: 24px; }
  .also-menu a { flex: none; flex-direction: row; gap: 8px; padding: 0 14px; font-size: .92rem; }
  .also-menu a svg { width: 20px; height: 20px; }
  .also-menu a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--rozsa); }
  .admin .app { padding-top: 60px; padding-bottom: 48px; }
  .toast { bottom: 24px !important; }
}

/* ---------- Gombok ---------- */

.gomb {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--felulet-2); color: var(--szoveg); font-weight: 600; cursor: pointer;
  text-decoration: none; transition: transform .1s ease, background .15s ease;
}
.gomb:active { transform: scale(.98); }
.gomb.fo { background: var(--rozsa-sotet); color: #fff; }
.gomb.fo:hover { background: #8A4247; }
.gomb.halk { background: transparent; color: var(--rozsa-sotet); padding: 0 12px; }
.gomb.veszely { background: var(--piros-halvany); color: var(--piros); }
.gomb.kicsi { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.gomb.teljes { width: 100%; }
.gomb svg { width: 18px; height: 18px; }
.gomb:disabled { opacity: .45; cursor: default; transform: none; }
.ikongomb {
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--felulet); flex: none;
  box-shadow: var(--arnyek); display: inline-grid; place-items: center; cursor: pointer; color: var(--szoveg);
}
.ikongomb svg { width: 20px; height: 20px; }
.ikongomb:disabled { opacity: .35; cursor: default; }

button svg, a svg { width: 20px; height: 20px; flex: none; }

/* ---------- Kártyák, listák ---------- */

.kartya { background: var(--felulet); border-radius: var(--kerek); box-shadow: var(--arnyek); padding: 16px; }
.kartya.lapos { padding: 0; overflow: hidden; }
.terkoz > * + * { margin-top: 12px; }
.csoport-cim { font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--szoveg-3); margin: 24px 4px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.csoport-cim:first-child { margin-top: 8px; }

.lista { list-style: none; margin: 0; padding: 0; background: var(--felulet); border-radius: var(--kerek); box-shadow: var(--arnyek); overflow: hidden; }
.lista > li + li { border-top: 1px solid var(--vonal); }
.lista-elem {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px;
  color: inherit; text-decoration: none; background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
button.lista-elem:active, a.lista-elem:active { background: var(--rozsa-lagy); }
.lista-elem .tobb { flex: 1; min-width: 0; }
.lista-elem .fo-sor { display: block; font-weight: 600; }
.lista-elem .al-sor { display: block; color: var(--szoveg-2); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-elem .nyil { color: var(--szoveg-3); font-size: 1.4rem; line-height: 1; }
.ures-allapot { padding: 32px 16px; text-align: center; color: var(--szoveg-2); }

.avatar {
  width: 40px; height: 40px; border-radius: 999px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem;
  background: var(--rozsa-halvany); color: var(--rozsa-sotet);
}
.avatar.kicsi { width: 30px; height: 30px; font-size: .78rem; }
.avatar.ures { background: var(--piros-halvany); color: var(--piros); }

.cimke { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--felulet-2); color: var(--szoveg-2); white-space: nowrap; }
.cimke.ok { background: var(--zold-halvany); color: var(--zold); }
.cimke.var { background: var(--borostyan-halvany); color: var(--borostyan); }
.cimke.uj { background: var(--rozsa-halvany); color: var(--rozsa-sotet); }
.cimke.hiba { background: var(--piros-halvany); color: var(--piros); }

.halvany { color: var(--szoveg-2); }
.kicsi { font-size: .875rem; }
.sor { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sor .nyujt { flex: 1; min-width: 0; }
.kod { font: 600 .95rem ui-monospace, 'SF Mono', Menlo, monospace; background: var(--felulet-2); padding: 4px 10px; border-radius: 8px; }

/* ---------- Űrlap ---------- */

.mezo { display: block; margin-top: 16px; }
.mezo > span { display: block; font-size: .85rem; font-weight: 600; color: var(--szoveg-2); margin: 0 4px 6px; }
.mezo small { display: block; color: var(--szoveg-3); margin: 6px 4px 0; font-size: .8rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--vonal); border-radius: var(--kerek-kicsi);
  background: var(--felulet); font-size: 16px; appearance: none; -webkit-appearance: none;
}
textarea { min-height: 88px; resize: vertical; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--szoveg-2) 50%), linear-gradient(135deg, var(--szoveg-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rozsa); box-shadow: 0 0 0 3px var(--rozsa-halvany); }

/* Kapcsoló-zseton (napszak, dolgozó) */
.zseton {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer; user-select: none;
  border: 1.5px solid var(--vonal); background: var(--felulet); color: var(--szoveg-2); font-weight: 600; font-size: .95rem;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.zseton input { position: absolute; opacity: 0; pointer-events: none; }
.zseton:has(input:checked) { background: var(--rozsa-sotet); border-color: var(--rozsa-sotet); color: #fff; }
.zseton:has(input:focus-visible) { outline: 3px solid var(--rozsa); outline-offset: 2px; }
.zsetonok { display: flex; flex-wrap: wrap; gap: 8px; }
.zsetonok.harom { display: grid; grid-template-columns: repeat(3, 1fr); flex: 1; }

/* Kapcsoló */
.kapcsolo { position: relative; width: 52px; height: 32px; flex: none; display: inline-block; }
.kapcsolo input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.kapcsolo span { position: absolute; inset: 0; border-radius: 999px; background: var(--vonal); transition: background .15s; }
.kapcsolo span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .15s; }
.kapcsolo input:checked + span { background: var(--zold); }
.kapcsolo input:checked + span::after { transform: translateX(20px); }
.kapcsolo input:focus-visible + span { outline: 3px solid var(--rozsa); outline-offset: 2px; }

/* Üzenetek */
.uzenet { padding: 12px 16px; border-radius: var(--kerek-kicsi); font-weight: 500; margin-top: 12px; }
.uzenet.ok { background: var(--zold-halvany); color: var(--zold); }
.uzenet.hiba { background: var(--piros-halvany); color: var(--piros); }
.uzenet:empty { display: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--also-sav) + 16px); transform: translateX(-50%) translateY(20px);
  background: var(--szoveg); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  opacity: 0; transition: opacity .2s, transform .2s; z-index: 50; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); text-align: center;
}
.toast.lathato { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.hiba { background: var(--piros); }
.vendeg .toast { bottom: 96px; }

/* Ragadós alsó gombsor */
.ragado-also {
  position: sticky; bottom: calc(var(--also-sav) + 12px); margin-top: 20px; z-index: 5;
  padding: 6px; border-radius: 999px; background: rgb(255 255 255 / .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--arnyek);
}
.vendeg .ragado-also { bottom: 16px; }
@media (min-width: 900px) { .admin .ragado-also { bottom: 16px; } }

/* Lapozó */
.lapozo { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.lapozo .cim { flex: 1; text-align: center; }
.lapozo .cim strong { display: block; font-size: 1.05rem; }
.lapozo .cim span { font-size: .85rem; color: var(--szoveg-2); }

.szegmens { display: flex; padding: 4px; background: var(--felulet-2); border-radius: 999px; }
.szegmens button { flex: 1; min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; color: var(--szoveg-2); cursor: pointer; }
.szegmens button[aria-pressed="true"] { background: var(--felulet); color: var(--szoveg); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }

/* ---------- Ráérés: napkártyák ---------- */

.napok { display: grid; gap: 8px; }
.napkartya { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; }
.napkartya .nap { width: 48px; flex: none; }
.napkartya .nap strong { display: block; font-size: 1rem; }
.napkartya .nap span { font-size: .8rem; color: var(--szoveg-3); }
.napkartya.hetvege .nap strong { color: var(--rozsa-sotet); }
.napkartya .zseton { padding: 0 4px; font-size: .88rem; }
.het-blokk + .het-blokk { margin-top: 28px; }
.het-fej { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px 10px; }
.het-fej h2 { font-size: 1.1rem; }
.gyors { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 4px; scrollbar-width: none; }
.gyors::-webkit-scrollbar { display: none; }
.gyors .gomb { flex: none; }

/* ---------- Belépés ---------- */

.belepes { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; }
.logo { font: 600 2.2rem/1 var(--serif); color: var(--rozsa-sotet); text-align: center; }
.logo-al { text-align: center; color: var(--szoveg-2); margin-top: 8px; }
.nevracs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 28px; }
.nevgomb {
  display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 64px; border: 0; border-radius: var(--kerek);
  background: var(--felulet); box-shadow: var(--arnyek); cursor: pointer; text-align: left; font-weight: 600; font-size: 1rem;
}
.nevgomb:active { transform: scale(.98); }

/* ---------- Beosztás: napi nézet ---------- */

.napsav { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.napsav button {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0; border: 0; border-radius: 14px;
  background: var(--felulet); box-shadow: var(--arnyek); cursor: pointer; color: var(--szoveg-3); font-weight: 650; font-size: .72rem; position: relative;
}
.napsav button strong { font-size: 1.1rem; color: var(--szoveg); }
.napsav button[aria-pressed="true"] { background: var(--rozsa-sotet); color: rgb(255 255 255 / .8); }
.napsav button[aria-pressed="true"] strong { color: #fff; }
.napsav .pont { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 999px; background: var(--piros); }
.napsav button[aria-pressed="true"] .pont { background: #fff; }

.latogatas { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 62px; width: 100%; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.latogatas:active { background: var(--rozsa-lagy); }
.latogatas .hely { min-width: 56px; }
.latogatas .hely strong { display: block; font-size: 1.05rem; }
.latogatas .hely span { font-size: .8rem; color: var(--szoveg-3); }
.latogatas .ki { flex: 1; display: flex; align-items: center; gap: 10px; justify-content: flex-end; font-weight: 600; min-width: 0; text-align: right; }
.latogatas .ki.ures { color: var(--piros); }
.latogatas .kezi-jel { width: 6px; height: 6px; border-radius: 999px; background: var(--rozsa); flex: none; }

.figy-kartya summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 28px; }
.figy-kartya summary::-webkit-details-marker { display: none; }
.figy-kartya summary::after { content: '›'; margin-left: auto; font-size: 1.4rem; color: var(--szoveg-3); transition: transform .15s; }
.figy-kartya[open] summary::after { transform: rotate(90deg); }
.figy-lista { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.figy-lista li { padding: 10px 12px; border-radius: var(--kerek-kicsi); background: var(--borostyan-halvany); color: #5E4310; font-size: .92rem; }
.figy-lista li.betoltetlen, .figy-lista li.utkozes, .figy-lista li.raeres_valtozott { background: var(--piros-halvany); color: var(--piros); }
.figy-lista li.uj_helyszin, .figy-lista li.emlekezteto { background: var(--rozsa-lagy); color: var(--rozsa-sotet); }

.muveletek { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.muveletek .gomb:not(.fo) { padding: 0 8px; font-size: .9rem; gap: 6px; }
.muveletek .gomb.fo { grid-column: 1 / -1; }
@media (min-width: 900px) { .muveletek { display: flex; } .muveletek .gomb.fo { order: -1; } }

/* ---------- Papíros tábla ---------- */

.racs-doboz { overflow: auto; max-height: calc(100dvh - 200px); background: var(--felulet); border-radius: var(--kerek); box-shadow: var(--arnyek); }
.racs { border-collapse: separate; border-spacing: 0; font: 12.5px/1.2 var(--sans); }
.racs th, .racs td { border-right: 1px solid #F0E8E6; border-bottom: 1px solid #F0E8E6; padding: 0; min-width: 34px; height: 30px; text-align: center; background: var(--felulet); }
.racs thead th { position: sticky; z-index: 2; background: #FCF8F7; font-weight: 650; }
.racs thead tr:first-child th { top: 0; height: 32px; padding: 0 6px; }
.racs thead tr:nth-child(2) th { top: 32px; height: 64px; padding: 6px 0; vertical-align: bottom; font-weight: 600; color: var(--szoveg-2); }
/* Csak a szöveg fordul el, a cella nem – különben a bal oldali csoportszegély jobbra kerülne. */
.racs .fuggoleges { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.racs .nap, .racs .napszak { position: sticky; z-index: 1; background: #FCF8F7; }
.racs .nap { left: 0; min-width: 34px; font-weight: 700; }
.racs .napszak { left: 34px; min-width: 54px; color: var(--szoveg-3); font-weight: 500; }
.racs thead .nap, .racs thead .napszak { z-index: 3; }
.racs .csoport-eleje { border-left: 2px solid #D9CBC9; }
.racs .nap-vege td, .racs .nap-vege th { border-bottom: 2px solid #D9CBC9; }
.racs td button { width: 100%; height: 100%; min-height: 30px; border: 0; padding: 0 3px; background: transparent; font: inherit; cursor: pointer; color: var(--szoveg); }
.racs td button:hover { background: var(--rozsa-lagy); }
.racs td.tele button { background: var(--rozsa-halvany); font-weight: 650; color: var(--rozsa-sotet); }
.racs td.kezi button { box-shadow: inset 0 0 0 2px var(--rozsa); }
.racs .uj-fej { color: var(--rozsa-sotet); font-weight: 750; }
.racs tfoot th, .racs tfoot td { background: var(--felulet-2); font-weight: 700; }
.racs textarea { min-height: 40px; border: 0; background: transparent; padding: 4px 8px; }

/* ---------- Alsó lap (sheet) ---------- */

dialog.lap {
  width: 100%; max-width: 560px; max-height: 90dvh; margin: auto auto 0; padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  border: 0; border-radius: 24px 24px 0 0; background: var(--hatter); color: var(--szoveg); box-shadow: var(--arnyek-magas); overflow: auto;
}
dialog.lap::backdrop { background: rgb(46 38 39 / .35); }
dialog.lap .fogo { width: 40px; height: 5px; border-radius: 999px; background: var(--vonal); margin: 4px auto 16px; }
dialog.lap[open] { animation: felcsuszik .22s ease-out; }
dialog.lap h2 { margin-bottom: 4px; font-size: 1.5rem; }
@keyframes felcsuszik { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) { dialog.lap { margin: auto; border-radius: 24px; padding-bottom: 20px; } }

.valasztas { display: grid; gap: 8px; margin-top: 12px; }
.valasztas button {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 56px; border: 1.5px solid transparent; border-radius: var(--kerek-kicsi);
  background: var(--felulet); box-shadow: var(--arnyek); cursor: pointer; text-align: left; font-weight: 600;
}
.valasztas button[aria-pressed="true"] { border-color: var(--rozsa-sotet); }
.valasztas button .pipa { margin-left: auto; color: var(--rozsa-sotet); font-weight: 800; }

/* ---------- Nyomtatás ---------- */

.csak-nyomtat { display: none; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body, html { background: #fff; }
  .also-menu, .nem-nyomtat, .toast { display: none !important; }
  .csak-nyomtat { display: block !important; font: 600 14px var(--sans); margin-bottom: 6px; }
  .app, .admin .app { max-width: none; padding: 0; }
  .racs-doboz { display: block !important; overflow: visible; max-height: none; box-shadow: none; }
  .racs { font-size: 9px; }
  .racs th, .racs td { min-width: 0; height: 18px; }
  .racs td button { min-height: 0; background: transparent !important; box-shadow: none !important; color: #000 !important; }
  .racs thead th, .racs .nap, .racs .napszak { position: static; }
}

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