/* === BEYERS Dienstplan === Farben und Schriften wie die Website, aber als Arbeitswerkzeug */
@font-face{font-family:"Inter";font-weight:400;font-display:swap;src:url("assets/fonts/inter-400.woff2") format("woff2")}
@font-face{font-family:"Inter";font-weight:500;font-display:swap;src:url("assets/fonts/inter-500.woff2") format("woff2")}
@font-face{font-family:"Inter";font-weight:700;font-display:swap;src:url("assets/fonts/inter-700.woff2") format("woff2")}
@font-face{font-family:"Barlow Condensed";font-weight:700;font-display:swap;src:url("assets/fonts/barlow-cond-700.woff2") format("woff2")}
@font-face{font-family:"Barlow Condensed";font-weight:800;font-display:swap;src:url("assets/fonts/barlow-cond-800.woff2") format("woff2")}

:root {
  --brand: #00A1BB;
  --brand-deep: #007A8D;
  --brand-dark: #006273;
  --brand-ink: #063844;
  --ink: #15282E;
  --ink-soft: #46585E;
  --line: #DCE7EA;
  --bg: #F4F8F9;
  --card: #fff;
  --bg-soft: #F0FAFB;
  --bg-mute: #EAF4F6;
  --accent: #D81B60;
  --accent-dark: #AD1457;
  --open: #C62828;
  --open-bg: #FDECEC;
  --ok: #1B7A43;
  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 3px rgba(6,56,68,.08), 0 1px 2px rgba(6,56,68,.06);
  --ff: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ff-head: "Barlow Condensed", "Arial Narrow", var(--ff);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--ff); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.45; }
body.modal-open { overflow: hidden; }
h1, h2, h3 { font-family: var(--ff-head); font-weight: 800; letter-spacing: .01em; line-height: 1.1; margin: 0; color: var(--brand-ink); }
h1 { font-size: 2rem; margin-bottom: 14px; }
h2 { font-size: 1.45rem; margin-bottom: 10px; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 10px; }
a { color: var(--brand-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); font-size: .92rem; }
.warn { color: var(--open); }
.big { font-size: 1.15rem; font-weight: 700; }
.mt { margin-top: 12px; }
.nowrap { white-space: nowrap; }
.print-only { display: none; }

/* --- Knöpfe --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 2px solid transparent; font-weight: 700; text-decoration: none; background: none; white-space: nowrap; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn-block { display: flex; width: 100%; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-primary { background: var(--brand-deep); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { border-color: var(--brand-deep); color: var(--brand-dark); background: #fff; }
.btn-outline:hover { background: var(--bg-soft); }
.btn-ghost { border-color: var(--line); color: var(--brand-ink); background: #fff; }
.btn-ghost:hover { border-color: var(--brand); }
.btn-danger { color: var(--open); border-color: #f1c4c4; background: #fff; }
.btn-danger:hover { background: var(--open-bg); }
.btn-icon { width: 44px; min-width: 44px; padding: 0; border-color: var(--line); background: #fff; font-size: 1.2rem; }
.btn:disabled { opacity: .6; cursor: default; }
.link-btn { background: none; border: 0; padding: 8px 4px; color: var(--ink-soft); text-decoration: underline; font-size: .9rem; }
.link-btn:hover { color: var(--brand-ink); }

/* --- Anmeldung --- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(160deg, var(--brand-deep), var(--brand-ink) 120%); }
.login-box { width: 100%; max-width: 400px; background: #fff; border-radius: 22px; padding: 30px 24px; text-align: center; box-shadow: 0 18px 50px rgba(6,56,68,.3); }
.login-logo { width: 200px; height: auto; margin-bottom: 14px; }
.login-box h1 { font-size: 2.4rem; margin: 0; }
.login-sub { color: var(--brand-dark); font-weight: 700; margin-bottom: 22px; }
.login-form { text-align: left; }
.login-form label, .field label, .field-row label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 5px; color: var(--brand-ink); }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 46px; padding: 8px 12px; border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,161,187,.18); }
.login-form input { margin-bottom: 12px; }
.login-msg { margin: 12px 0 0; font-size: .92rem; min-height: 1.2em; }
.login-msg.ok { color: var(--ok); font-weight: 500; }
.login-msg.error { color: var(--open); font-weight: 500; }
.login-demo .btn { margin-bottom: 8px; }
.demo-note { font-size: .92rem; color: var(--ink-soft); }
.login-hint { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-soft); }

/* --- Rahmen --- */
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 18px; }
.topbar-logo { height: 36px; width: auto; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.badge { font-size: .82rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--bg-mute); color: var(--brand-dark); white-space: nowrap; }
.badge-admin { background: #fde4ef; color: var(--accent-dark); }
.nav { display: flex; gap: 4px; }
.nav-btn { position: relative; border: 0; background: none; padding: 10px 16px; border-radius: 999px; font-weight: 700; color: var(--ink-soft); }
.nav-btn:hover { background: var(--bg-soft); }
.nav-btn.active { background: var(--bg-mute); color: var(--brand-dark); }
.dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 6px; border-radius: 999px;
  background: var(--open); color: #fff; font-size: .75rem; }
.demo-banner { background: #FFF4D6; color: #6b4e00; text-align: center; font-size: .88rem; padding: 6px 12px; }
.demo-banner .link-btn { padding: 0 4px; color: inherit; }

main { max-width: 1240px; margin: 0 auto; padding: 22px 16px 60px; }
.view { display: none; }
.view.active { display: block; }
#view-home, #view-team, #view-more { max-width: 760px; margin: 0 auto; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.view-head h1 { margin: 0; }
.hello { font-size: 2.2rem; }

/* --- Karten und Zeilen --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-open { border: 2px solid var(--open); background: linear-gradient(#fff, #fff) padding-box; }
.card-open h2 { color: var(--open); }
.card-alert { border: 2px solid var(--accent); }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--open);
  color: #fff; font-family: var(--ff); font-size: .85rem; vertical-align: 3px; }
.card-alert .count { background: var(--accent); }
.h2-sub { font-family: var(--ff); font-weight: 500; font-size: .9rem; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.row:first-of-type { border-top: 0; }
h2 + .row, p + .row { border-top: 1px solid var(--line); }
.row-main { flex: 1; min-width: 0; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.check { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; font-size: .95rem !important; }
.check input { width: 22px; height: 22px; accent-color: var(--brand-deep); }
#week-open { max-width: 760px; }
.wa-people { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-people .chip { text-decoration: none; padding: 8px 12px; }
.row-btn { background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 4px; border-radius: 0; }
.row-btn:first-child { border-top: 0; }
.row-btn:hover { background: var(--bg-soft); }
.chev { color: var(--ink-soft); font-size: 1.4rem; }
.quote { margin: 6px 0; padding: 8px 12px; background: var(--bg-soft); border-left: 3px solid var(--brand); border-radius: 4px; font-style: italic; }
.notice { background: #FFF4D6; border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px; font-size: .95rem; }
.notice input { margin-top: 8px; font-size: .85rem; }
ul.plain { margin: 0; padding-left: 20px; }
ul.plain li { margin-bottom: 8px; }
.stack { display: grid; gap: 8px; margin-top: 14px; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; min-width: 34px; border-radius: 50%; font-weight: 700; font-size: .78rem; background: var(--c, var(--bg-mute)); color: var(--t, var(--ink)); }
.avatar-open { background: var(--open); color: #fff; }

/* --- Schicht-Marken --- */
.chip { display: inline-block; border: 0; border-radius: 7px; padding: 4px 8px; font-size: .84rem; font-weight: 700; line-height: 1.25; background: var(--c, var(--bg-mute)); color: var(--t, var(--ink));
  font-variant-numeric: tabular-nums; text-align: left; }
.chip-open { background: var(--open); color: #fff; }
.chip-cancelled { background: #eef1f2; color: var(--ink-soft); font-weight: 500; }
.chip-mine { box-shadow: 0 0 0 2px var(--brand-ink); }
.chip-wait { background: #FFF4D6; color: #6b4e00; }
.chip-ok { background: #E3F4EA; color: var(--ok); }
/* Am Theken-PC meldet sich niemand aus Versehen ab */
body.is-kiosk:not(.is-demo) #btn-logout { display: none; }
body.is-kiosk .chip:not(.chip-open), body.is-kiosk .bar:not(.bar-open) { cursor: default; }
.print-only-block { display: none !important; }
.legend { margin-top: 14px; font-size: .85rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.legend .chip { font-size: .78rem; }
.legend .chip-cancelled { margin-left: 10px; }

/* --- Woche: Werkzeugleiste --- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar-nav { display: flex; align-items: center; gap: 10px; }
.toolbar-nav h2 { margin: 0; min-width: 250px; text-align: center; font-size: 1.5rem; }
.toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 999px; background: #fff; overflow: hidden; }
.seg-btn { border: 0; background: none; padding: 0 14px; min-height: 36px; font-weight: 700; font-size: .9rem; color: var(--ink-soft); }
.seg-btn.active { background: var(--brand-deep); color: #fff; }
.seg-block { display: flex; border-radius: var(--r-sm); }
.seg-block .seg-btn { flex: 1; min-height: 44px; }
body:not(.is-admin) .admin-only { display: none !important; }

/* --- Woche: Tabelle --- */
.week-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; box-shadow: var(--shadow); }
.week-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 860px; }
.week-table th { background: var(--brand-deep); color: #fff; padding: 8px 4px; font-size: .9rem; font-weight: 700; }
.week-table th span { display: block; font-weight: 400; font-size: .78rem; opacity: .9; }
.week-table th.today { background: var(--accent); }
.week-table th.weekend { background: var(--brand-ink); }
.week-table td { border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 5px; vertical-align: top; position: relative; height: 46px; }
.week-table td .chip { display: block; width: 100%; margin-bottom: 3px; text-align: center; padding: 5px 2px; }
.week-table td.today { background: #fff5f9; }
.week-table td.weekend { background: #f7fafb; }
.week-table .col-name { width: 150px; text-align: left; padding-left: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 0; vertical-align: middle; }
.week-table .col-name .avatar { margin-right: 8px; width: 28px; height: 28px; min-width: 28px; font-size: .7rem; }
.week-table .col-sum { width: 84px; text-align: center; font-weight: 700; vertical-align: middle; font-variant-numeric: tabular-nums; }
.week-table .target { color: var(--ink-soft); font-weight: 400; font-size: .85rem; }
.row-open td { background: var(--open-bg) !important; }
.row-open .col-name { color: var(--open); }
.row-me .col-name { background: var(--bg-mute); }
.row-total td { background: var(--bg-mute); font-weight: 700; text-align: center; font-size: .88rem; }
.row-total .col-name { text-align: left; }
.cell-add { display: block; width: 100%; height: 26px; border: 1px dashed transparent; border-radius: 6px; background: none; color: transparent; font-weight: 700; }
td:hover .cell-add, .cell-add:focus-visible { border-color: var(--brand); color: var(--brand-dark); }

.away { display: block; font-size: .74rem; color: var(--ink-soft); text-align: center; padding: 2px 0; }
.week-table td.is-away { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(70,88,94,.10) 6px 8px); }

/* --- Woche: Tagesliste (Handy) und Balken --- */
.week-days { display: none; }
.day { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.day-today { border: 2px solid var(--accent); }
.day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.day-head h3 span { font-family: var(--ff); font-weight: 500; font-size: .9rem; color: var(--ink-soft); margin-left: 4px; }
.day-chips { display: flex; flex-direction: column; gap: 6px; }
.day-chips .chip { padding: 10px 12px; font-size: .95rem; }
.btn-add { width: 38px; min-width: 38px; min-height: 38px; color: var(--brand-dark); }
.bars { position: relative; }
.bar-row { position: relative; height: 34px; margin-bottom: 4px; background: repeating-linear-gradient(90deg, transparent 0 calc(100%/7 - 1px), var(--line) 0 calc(100%/7)); }
.bar { position: absolute; top: 2px; bottom: 2px; border: 0; border-radius: 7px; padding: 0 8px; font-size: .8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; background: var(--c, var(--bg-mute)); color: var(--t, var(--ink)); }
.bar-open { background: var(--open); color: #fff; }
.bar-axis { position: relative; height: 18px; font-size: .72rem; color: var(--ink-soft); }
.bar-axis span { position: absolute; transform: translateX(-50%); }
.bar-axis span:first-child { transform: none; }
.bar-axis span:last-child { transform: translateX(-100%); }
body.mode-bars .week-table-wrap, body.mode-bars .week-days { display: none; }

/* --- Dialog --- */
.modal-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(6,56,68,.55); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 500px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: 0 18px 50px rgba(6,56,68,.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 10px 20px; }
.modal-head h3 { font-size: 1.5rem; }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.modal-foot .btn-danger { margin-right: auto; }
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; margin-bottom: 14px; }
.field-row > div { flex: 1; }
.field-row > .grow { flex: 3; }
.field .field-row { margin: 10px 0 0; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset { border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; padding: 7px 4px; font-weight: 700; font-size: .84rem; }
.preset span { display: block; font-weight: 400; font-size: .78rem; color: var(--ink-soft); }
.preset:hover { border-color: var(--brand); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch.active { box-shadow: 0 0 0 3px var(--brand-ink); }
.swatches input[type=color] { width: 44px; height: 38px; padding: 2px; border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); background: var(--brand-ink); color: #fff;
  padding: 12px 18px; border-radius: 12px; font-weight: 500; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast-error { background: var(--open); }

/* --- Handy --- */
@media (max-width: 760px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.is-kiosk { padding-bottom: 0; }
  .topbar-inner { padding: 8px 12px; gap: 10px; }
  .topbar-logo { height: 30px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .nav-btn { flex: 1; padding: 12px 4px; }
  body.is-kiosk .nav { display: none; }
  main { padding: 16px 12px 40px; }
  h1, .hello { font-size: 1.8rem; }
  .toolbar { gap: 10px; }
  .toolbar-nav { width: 100%; justify-content: space-between; }
  .toolbar-nav h2 { min-width: 0; font-size: 1.25rem; }
  .toolbar-actions { width: 100%; }
  #week-print { display: none; }
  .week-table-wrap { display: none; }
  .week-days { display: block; }
  .row-req { flex-direction: column; align-items: stretch; }
  .modal-overlay { padding: 0; place-items: end center; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .modal-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
  .modal-foot .btn-danger { flex: 0 0 auto; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); width: max-content; }
}

/* --- Druck: eine Woche, A4 quer, bunt --- */
@page { size: A4 landscape; margin: 9mm; }
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { background: #fff; padding: 0; font-size: 10pt; }
  .topbar, .demo-banner, .toolbar, .modal-overlay, .toast, .cell-add, .week-days, .week-bars, .login,
  #view-home, #view-team, #view-more, #week-open { display: none !important; }
  main { max-width: none; padding: 0; }
  #view-week { display: block !important; }
  .print-only { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4mm; font-family: var(--ff-head); font-size: 18pt; color: var(--brand-ink); }
  .print-only span { font-size: 15pt; }
  .week-table-wrap { display: block !important; border: 0; box-shadow: none; overflow: visible; border-radius: 0; }
  .week-table { min-width: 0; border: 1px solid #9fb1b6; }
  .week-table td, .week-table th { border: 1px solid #9fb1b6; }
  .week-table td { height: 9mm; padding: 1.2mm; }
  .week-table td .chip { font-size: 9pt; padding: 1mm; margin-bottom: .8mm; }
  .week-table .col-name { width: 34mm; }
  .week-table .col-name .avatar { width: 6mm; height: 6mm; min-width: 6mm; font-size: 6.5pt; }
  .week-table .col-sum { width: 20mm; }
  .print-only-block { display: flex !important; }
  /* Tinte sparen: Farbe nur als Streifen links, Flächen bleiben weiß */
  .week-table th, .week-table th.today, .week-table th.weekend { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .week-table td, .week-table td.today, .week-table td.weekend, .row-open td, .row-total td { background: #fff !important; }
  .week-table td .chip { background: #fff; color: #000; border: 1px solid #9fb1b6; border-left: 3.5mm solid var(--c, #9fb1b6); text-align: left; padding-left: 1.5mm; }
  .week-table td .chip-open { border: 1.5px solid var(--open); border-left: 3.5mm solid var(--open); color: var(--open); }
  .week-table td .chip-open::after { content: " offen"; }
  .week-table td .chip-cancelled { border-left-color: #cfd8da; color: #667; }
  .legend .chip-open { background: #fff; color: var(--open); border: 1.5px solid var(--open); }
  .chip-mine { box-shadow: none; }
  .row-me .col-name { background: none; }
  tr { break-inside: avoid; }
  .row-empty { display: none; }
  .away { display: none; }
  .week-table td.is-away { background-image: none; }
  .print-only small { font-family: var(--ff); font-size: 8pt; font-weight: 400; color: var(--ink-soft); margin-left: 4mm; }
  .legend { margin-top: 3mm; font-size: 8pt; }
}
