/* IW Plan Haus Service – Farben kommen aus theme.css (in der App unter Einstellungen → Erscheinungsbild änderbar) */
:root {
  --pri: #5E1F4A; --accent: #F5C842; --ink: #1D1D1B;
  --bg: #f6f6f4; --card: #fff; --muted: #6b6b6b; --line: #e6e4df; --soft: #f3edf1;
  --ok: #1f7a3a; --warn: #9a5b00; --bad: #b3261e; --pri-ink: #fff;
  --r: 16px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 2px 8px rgba(20, 20, 20, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { padding-bottom: 40px; -webkit-tap-highlight-color: transparent; }
body.chef { padding-bottom: 20px; }
a { color: var(--pri); }
:focus-visible { outline: 3px solid var(--pri); outline-offset: 2px; }

/* Linien-Symbole */
.i { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.i { margin-right: .35em; }
.btn .i, .seg .i, .ico .i, nav .i, .hbtn .i, .state .i, h2 .i, .entry .i, .badge .i, .thumb .i, .aico .i, td > .i:only-child { margin-right: 0; }
.i.sm { width: 1em; height: 1em; vertical-align: -0.15em; }
.i.ok { color: var(--ok); } .i.warn { color: var(--warn); } .i.bad { color: var(--bad); }

/* Kopfzeile: weiß, Logo links, feine gelbe Linie */
header.top { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); color: var(--ink);
  padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); min-height: 60px;
  display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--accent); }
header.top .brand img { height: 38px; display: block; }
header.top .title { font-weight: 650; flex: 1; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.hbtn { background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; min-width: 44px; height: 44px; font-size: 20px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.hbtn:hover { background: var(--bg); }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.net::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.net.off { background: var(--ink); color: #fff; }
.net.off::before { background: var(--bad); }

main { max-width: 760px; margin: 0 auto; padding: 18px 16px; }
main.wide { max-width: 1150px; }
h1 { font-size: 24px; margin: 4px 0 14px; letter-spacing: -.015em; font-weight: 700; }
h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 26px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
h2 .i { color: var(--pri); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.err, .err { color: var(--bad); }
.muted { color: var(--muted); font-size: 15px; }
.center { text-align: center; }
.pre { white-space: pre-wrap; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.dim { opacity: .5; }
.scroll { overflow-x: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--pri); background: var(--pri); color: var(--pri-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  transition: filter .15s, background .15s; }
.btn:hover { filter: brightness(1.08); }
.btn.sec { background: #fff; color: var(--pri); border-color: var(--line); }
.btn.sec:hover { background: var(--soft); filter: none; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.small { min-height: 40px; padding: 4px 14px; font-size: 15px; border-radius: 10px; }
.btn.mini { min-height: 30px; padding: 0 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.btn.huge { min-height: 88px; font-size: 22px; flex: 1; border-radius: 16px; gap: 12px; }
.btn.huge .i { width: 28px; height: 28px; }

.stampcard { border-top: 4px solid var(--accent); }
.state { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; margin: 2px 0 14px; }
.state .i { width: 26px; height: 26px; }
.state.in { color: var(--ok); } .state.pause { color: var(--warn); }

/* Kacheln: Symbol in getöntem Feld, Text darunter */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 108px; padding: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); font: inherit; font-weight: 600; font-size: 16px; line-height: 1.3; color: var(--ink);
  text-decoration: none; text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: #d3cfc6; box-shadow: 0 2px 4px rgba(20,20,20,.05), 0 6px 16px rgba(20,20,20,.06); }
.tile .ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--soft); color: var(--pri); }
.tile .ico .i { width: 24px; height: 24px; }
.tile.call { background: var(--pri); color: #fff; border-color: var(--pri); }
.tile.call .ico { background: rgba(255,255,255,.14); color: #fff; }
.tile.sel { border-color: var(--pri); background: var(--soft); box-shadow: 0 0 0 2px var(--pri); }
.tile.left { min-height: 76px; }
.tile.left > span:first-child { display: flex; align-items: center; gap: 8px; }
.count { position: absolute; top: 14px; right: 14px; background: var(--bad); color: #fff; border-radius: 99px; min-width: 24px; padding: 0 7px; font-size: 13px; line-height: 24px; text-align: center; font-weight: 700; }
.count:empty { display: none; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice.one { grid-template-columns: 1fr; }
.choice.three { grid-template-columns: 1fr 1fr 1fr; }
.choice .tile { min-height: 76px; gap: 8px; }
.choice .tile .ico { width: 38px; height: 38px; }

.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; font: inherit; font-weight: 600; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--pri); box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { min-height: 42px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; }
.chip.on { border-color: var(--pri); background: var(--pri); color: #fff; font-weight: 600; }

label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: 15px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; padding: 8px 14px; }
legend { font-weight: 600; font-size: 15px; padding: 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #d8d5ce; border-radius: 12px; background: #fff; color: var(--ink); min-height: 50px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(94, 31, 74, .15); }
input[type=color] { padding: 2px; width: 80px; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; vertical-align: middle; accent-color: var(--pri); flex: none; box-shadow: none; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 8px 0; }
textarea { min-height: 110px; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 12px; z-index: 50; max-width: 92vw; font-size: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.banner { display: block; background: #fffaf0; border: 1px solid #f0dfaa; border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px; margin-bottom: 12px; color: var(--ink); text-decoration: none; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 44px; height: 44px; border-radius: 12px; font-size: 22px; border: 1px solid var(--line); background: #fff; color: var(--pri); font-weight: 600; cursor: pointer; }
.qty .n { min-width: 32px; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.aico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--soft); color: var(--pri); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li.unread { font-weight: 700; }
.msg { white-space: pre-wrap; margin: 6px 0; font-size: 17px; }
.rb { margin-top: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: #efede8; color: #3a3a3a; white-space: nowrap; }
.badge.neu, .badge.offen { background: #fdecea; color: var(--bad); }
.badge.gesehen { background: #fdf3dc; color: #7a4d00; }
.badge.erledigt, .badge.genehmigt, .badge.gemeldet { background: #e3f3e7; color: var(--ok); }
.badge.abgelehnt { background: #efede8; color: #555; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; }
.thumb { position: relative; }
.thumb button { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.entry { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; margin: 0 12px 4px 0; }
.wastebox { max-height: 280px; overflow: auto; }
.logoprev { height: 50px; background: #fff; padding: 4px; border-radius: 8px; border: 1px solid var(--line); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* Chef-Menü: weiße Leiste mit Symbolen, aktive Seite unterstrichen */
nav.tabs { position: sticky; top: 60px; z-index: 4; background: #fff; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 8px; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 12px 8px; font-size: 12.5px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
nav.tabs a .ico { display: block; line-height: 0; }
nav.tabs a .ico .i { width: 22px; height: 22px; }
nav.tabs a:hover { color: var(--ink); }
nav.tabs a.on { color: var(--pri); font-weight: 650; border-bottom-color: var(--pri); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.grid2 > section > h2:first-child { margin-top: 4px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; z-index: 60; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }

/* Kalender */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 12px 0; }
.cal .wd { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cd { background: #fff; border: 1px solid var(--line); border-radius: 10px; min-height: 64px; padding: 4px; font-size: 12px; overflow: hidden; }
.cd.empty { background: transparent; border: 0; }
.cd.we { background: #f1f0ec; }
.cd.today { border: 2px solid var(--pri); }
.cd .dn { font-weight: 700; display: block; }
.ev { display: flex; align-items: center; gap: 2px; background: var(--c); color: #fff; border-radius: 5px; padding: 0 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.offen { background: #fff; color: var(--c); border: 1px dashed var(--c); }
.ev.krank { background: #777; }

/* Anmeldung */
html:has(body.loginpage), body.loginpage { background: linear-gradient(var(--accent) 0 300px, var(--bg) 300px); min-height: 100vh; }
.login { max-width: 420px; margin: 0 auto; padding: max(30px, env(safe-area-inset-top)) 16px 30px; }
.logobox { text-align: center; margin: 10px 0 28px; }
.logobox img { width: 260px; max-width: 75%; }
.login .card { border: 0; box-shadow: 0 10px 40px rgba(0,0,0,.12); padding: 24px; }
.login h1 { color: var(--ink); }

@media (max-width: 380px) { .choice.three { grid-template-columns: 1fr; } .btn.huge { font-size: 20px; } }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
