/* iflott – Einsatzplanung */
:root {
  --c-bg: #f4f6f9; --c-card: #fff; --c-text: #1f2a37; --c-muted: #6b7785; --c-line: #d9e0e8;
  --c-pri: #0069b4; --c-pri-d: #00528c; --c-ok: #1e7b34; --c-ok-bg: #e3f4e7; --c-err: #b42318; --c-err-bg: #fdecea;
  --c-warn: #9a6100; --c-warn-bg: #fff4d6; --c-mine: #ffe066; --radius: 6px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; background: var(--c-bg); color: var(--c-text); line-height: 1.4; }
a { color: var(--c-pri); }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .7rem; }
h3 { font-size: 1rem; }
code { background: #eef2f6; padding: 0 .3em; border-radius: 3px; }

header.top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.2rem; background: var(--c-pri-d); color: #fff; padding: .5rem 1rem; }
header.top .brand { font-weight: 600; }
header.top nav { display: flex; flex-wrap: wrap; gap: .2rem; flex: 1; }
header.top nav a { color: #dbe8f3; text-decoration: none; padding: .35rem .6rem; border-radius: var(--radius); }
header.top nav a:hover, header.top nav a.active { background: rgba(255, 255, 255, .15); color: #fff; }
header.top .me { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
header.top .me a { color: #fff; }
header.top .role { background: rgba(255, 255, 255, .18); padding: .05rem .45rem; border-radius: 10px; font-size: .8rem; }
button.link { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; }
main { padding: 1rem 1.2rem 2rem; max-width: 1600px; margin: 0 auto; }
footer { text-align: center; color: var(--c-muted); font-size: .8rem; padding: 1rem; }

.log-alarm { position: fixed; top: 6px; left: 6px; z-index: 1000; background: var(--c-err); color: #fff !important; font-weight: 700; padding: .45rem .8rem; border-radius: var(--radius); text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); animation: blink 1.5s infinite; }
@keyframes blink { 50% { opacity: .65; } }
body:has(.log-alarm) header.top { padding-left: 13rem; }

.card { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 420px; margin: 3rem auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1rem; align-items: start; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: .6rem; }
.pagehead h1, .pagehead h2 { margin: 0; margin-right: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.mt { margin-top: 1rem; }
.small { font-size: .85rem; }
.muted { color: var(--c-muted); }
.nowrap { white-space: nowrap; }
.hidden { display: none; }
.inline { display: inline; }

label { display: block; margin-bottom: .6rem; font-size: .9rem; color: #384656; }
label.check { display: flex; gap: .4rem; align-items: center; }
input, select, textarea { font: inherit; padding: .38rem .5rem; border: 1px solid #b9c4d0; border-radius: 4px; background: #fff; color: var(--c-text); max-width: 100%; }
label > input:not([type=checkbox]):not([type=color]), label > select, label > textarea { display: block; width: 100%; margin-top: .15rem; }
input:invalid:not(:placeholder-shown), input:focus:invalid { border-color: var(--c-err); }
input[type=color] { padding: 0; width: 2.4rem; height: 2rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 1rem; }
.formgrid .wide { grid-column: span 2; }
.row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; }
.row label { margin-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.calc { font-size: .9rem; color: #384656; margin-bottom: .6rem; }
.calc span { display: block; }
.calc output { display: block; margin-top: .15rem; padding: .38rem .5rem; background: #eef2f6; border-radius: 4px; color: #33475b; font-weight: 600; min-height: 2.1rem; }
.fieldhint { color: var(--c-err); font-size: .85rem; margin-top: .2rem; }

.btn { display: inline-block; font: inherit; font-size: .9rem; padding: .38rem .8rem; border: 1px solid #b9c4d0; border-radius: 4px; background: #fff; color: var(--c-text); cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: #eef2f6; }
.btn.primary { background: var(--c-pri); border-color: var(--c-pri); color: #fff; }
.btn.primary:hover { background: var(--c-pri-d); }
.btn.danger { color: var(--c-err); border-color: #e3b5b0; }
.btn.danger:hover { background: var(--c-err); color: #fff; }
.btn.warn { color: var(--c-warn); border-color: #e7cf95; }
.btn.small { font-size: .8rem; padding: .2rem .5rem; }
.danger-zone { border: 1px dashed #e3b5b0; background: #fff8f7; padding: .7rem; border-radius: var(--radius); margin-top: .6rem; }

.alert { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: .7rem; border: 1px solid transparent; }
.alert.ok { background: var(--c-ok-bg); border-color: #b5dfbf; color: #14532d; }
.alert.err { background: var(--c-err-bg); border-color: #f1b8b2; color: #7a1a12; }
.alert.warn { background: var(--c-warn-bg); border-color: #f0d68c; color: #6b4500; }
.alert.info { background: #e8f1fa; border-color: #bcd5ec; }
.hinweise .alert { margin: .4rem 0; padding: .4rem .7rem; font-size: .9rem; }
.badge { display: inline-block; font-size: .75rem; padding: .05rem .4rem; border-radius: 3px; font-weight: 700; }
.badge.red { background: var(--c-err); color: #fff; }
.ok, td.ok { color: var(--c-ok); font-weight: 600; }
.bad, td.bad, .unter { color: var(--c-err); font-weight: 600; }
.ueber { color: var(--c-warn); font-weight: 600; }
.warntext { color: var(--c-warn); }
.errtext { color: var(--c-err); }
.okbox, .badbox { display: inline-block; padding: .2rem .6rem; border-radius: 4px; font-weight: 700; margin: .3rem .3rem 0 0; }
.okbox { background: var(--c-ok); color: #fff; }
.badbox { background: var(--c-err); color: #fff; }
.bar { height: 8px; background: #e5eaf0; border-radius: 4px; overflow: hidden; }
.bar div { height: 100%; background: var(--c-pri); }

table.list { width: 100%; border-collapse: collapse; background: #fff; font-size: .9rem; }
table.list th, table.list td { border-bottom: 1px solid var(--c-line); padding: .35rem .45rem; text-align: left; vertical-align: top; }
table.list thead th { background: #e9eef4; position: sticky; top: 0; z-index: 1; font-weight: 600; }
table.list.compact td, table.list.compact th { padding: .25rem .4rem; }
table.list tr.inaktiv td { color: var(--c-muted); }
td.num, th.num { text-align: right; }
td.indent { padding-left: 1.4rem; }
tr.blockhead td { background: #dfe7f0; font-weight: 600; font-size: .85rem; }
tr.blockhead.warnhead td { background: var(--c-warn-bg); }
.feiertag { color: var(--c-err); }
table.plan td.auto { background: #f2f4f7; color: #55606d; }
table.plan td.modul { border-left: 6px solid var(--mf, #ccc); font-weight: 600; }
table.plan tr.ausgefallen td { color: #8a94a0; text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, .5); }
table.plan tr.ausgefallen td.actions-cell, table.plan tr.ausgefallen .badge, table.plan tr.ausgefallen .small { text-decoration: none; }
table.plan tr.hl td { background: #fff7cc !important; }
table.log td { font-size: .82rem; }

.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.plan-side { position: sticky; top: .6rem; max-height: calc(100vh - 1.2rem); overflow: auto; }
#formcard.editing { border-color: var(--c-pri); box-shadow: 0 0 0 2px rgba(0, 105, 180, .2); }
table.sum { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.sum th, table.sum td { padding: .2rem .35rem; border-bottom: 1px solid #edf0f3; }
table.sum th { text-align: right; color: var(--c-muted); font-weight: 500; }
table.sum tr.mod td { font-weight: 700; }
table.sum tr.me td:first-child { padding-left: 1rem; color: #55606d; }
table.sum tbody.totals td { font-weight: 700; border-top: 2px solid #c9d3de; background: #f6f8fa; }
table.sum .pre { color: var(--c-muted); text-decoration: line-through; font-weight: 400; }
table.sum .proj { border: 1px dashed var(--c-pri); padding: 0 .25rem; border-radius: 3px; color: var(--c-pri); }
.kontrolle { margin-top: .5rem; }

/* Wochenplan */
.weekinfo { color: #384656; }
table.week { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; font-size: .85rem; }
table.week th, table.week td { border: 1px solid #c9d3de; padding: .3rem .35rem; vertical-align: top; }
table.week thead th { background: #e9eef4; }
table.week th.stdcol { width: 92px; background: #f2f4f7; text-align: center; font-weight: 600; }
table.week tr.nach-pause > * { border-top: 3px double #8fa1b3; }
table.week td.leer { background: #fbfcfd; }
table.week td.slot { background: var(--mf, #eef); }
table.week td.slot.mine, table.printlist tr.mine td { outline: 3px solid #e0a800; outline-offset: -3px; background-image: linear-gradient(0deg, rgba(255, 224, 102, .45), rgba(255, 224, 102, .45)); }
table.week th.feiertag, table.week td.feiertag { background: #fdecea; color: var(--c-err); text-align: center; vertical-align: middle; font-weight: 600; }
.slot-head { font-weight: 700; }
.slot-thema { margin: .15rem 0; }
.slot-doz { font-style: italic; }
.slot-bem { font-size: .78rem; color: #4a5562; margin-top: .15rem; }
table.printlist td.modul { border-left: 6px solid var(--mf, #ccc); font-weight: 600; }
table.printlist tr.feiertag td { background: #fdecea; }
table.printlist tfoot th { text-align: right; background: #e9eef4; }
.print-head { display: none; }

@media (max-width: 1000px) {
  .plan-layout { grid-template-columns: 1fr; }
  .plan-side { position: static; max-height: none; }
  .formgrid .wide { grid-column: auto; }
}

/* Druck: A4 quer */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  html { font-size: 10.5pt; }
  body { background: #fff; }
  .no-print, header.top, footer, .log-alarm, .alert { display: none !important; }
  main { padding: 0; max-width: none; }
  .print-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #000; margin-bottom: 4mm; padding-bottom: 1.5mm; }
  .ph-title { font-size: 14pt; font-weight: 700; }
  .ph-sub { font-size: 11pt; }
  .ph-date { font-size: 8pt; }
  .weekinfo { margin: 0 0 3mm; font-size: 9pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.week { font-size: 8.5pt; }
  table.week td, table.week th { padding: 1mm; }
  table.list { font-size: 8.5pt; }
  table.list thead th { position: static; }
  tbody.day, table.week tr { break-inside: avoid; }
  .card { border: 0; padding: 0; }
}

/* Zwei-Faktor-Anmeldung */
.card.wide-ish { max-width: 560px; }
.badge.green { background: var(--c-ok); color: #fff; }
.badge.grey { background: #8a94a0; color: #fff; }
.badge.amber { background: #d08a00; color: #fff; }
.qr { width: 220px; height: 220px; margin: .6rem 0; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 4px; }
.qr svg { width: 100%; height: 100%; display: block; }
ol.steps li { margin-bottom: .6rem; }
code.secret { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
input.code { font-size: 1.4rem; letter-spacing: .25em; text-align: center; max-width: 14rem; font-family: ui-monospace, Consolas, monospace; }
ol.codes { columns: 2; font-size: 1.1rem; padding-left: 1.6rem; }
ol.codes code { background: #eef2f6; padding: .1rem .4rem; }
fieldset.radio { border: 1px solid var(--c-line); border-radius: var(--radius); padding: .3rem .8rem .1rem; margin: 0 0 .6rem; }
fieldset.radio legend { font-size: .9rem; color: #384656; padding: 0 .3rem; }

/* Marke iflott */
header.top .brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; }
header.top .brand img { border-radius: 7px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
header.top .brand small { font-weight: 400; font-size: .8rem; opacity: .8; border-left: 1px solid rgba(255, 255, 255, .35); padding-left: .55rem; }
.login-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.login-brand strong { display: block; font-size: 1.6rem; color: var(--c-pri); line-height: 1.1; }
.login-brand span { color: var(--c-muted); font-size: .9rem; }
.ph-title img { vertical-align: -4px; }
