:root {
    --dd-blue: #005caa;
    --dd-blue-dark: #004a89;
    --line: #dde3ea;
    --muted: #5f6b77;
    --stripe: #f5f7fa;
    --error: #990000;
    --ok: #1a7f37;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: #1d2329;
    background: #fff;
}

a { color: var(--dd-blue); }
h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
code { font-size: .9em; background: var(--stripe); padding: .1rem .3rem; border-radius: .2rem; }
.hint { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.error { color: var(--error); font-weight: 600; }
.count { color: var(--muted); font-weight: normal; }

/* Kopfzeile (wie backend.css/admin.css) */
.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1.5rem;
    padding: .5rem 1rem;
    background: var(--dd-blue);
    color: rgba(255, 255, 255, .85);
}
.topbar .brand img { display: block; max-width: 100%; height: auto; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin-left: auto; }
.topbar nav a, .linkbtn {
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    font: inherit;
    background: none;
    border: 0;
    padding: .25rem 0;
    cursor: pointer;
}
.topbar nav a:hover, .linkbtn:hover, .topbar nav a.active { color: #fff; }
.topbar nav a.active { border-bottom: 2px solid #fff; }
.topbar form { margin: 0; }

main { padding: 1.25rem 1rem 2rem; max-width: 72rem; margin: 0 auto; }

/* Unternavigation der Verwaltung */
.subnav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: 0 0 .6rem; margin: -.25rem 0 1.25rem; border-bottom: 1px solid var(--line); }
.subnav a { text-decoration: none; color: var(--muted); padding: .2rem 0; }
.subnav a:hover { color: var(--dd-blue); }
.subnav a.active { color: var(--dd-blue); font-weight: 700; border-bottom: 2px solid var(--dd-blue); }

/* Übersicht */
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.panel { border: 1px solid var(--line); border-radius: .5rem; padding: 1rem 1.25rem; }
.panel h2 { margin-top: 0; }
.panel.wide { grid-column: 1 / -1; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: .45rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.plain li:last-child { border-bottom: 0; }

/* Monatsansicht */
.month-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 1rem; }
.month-nav strong { font-size: 1.1rem; }
.chips { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.chips li { display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: baseline; }
.chips .where { color: var(--muted); font-size: .9rem; }
.chips li.deleted a, .chips li.deleted .where { text-decoration: line-through; color: var(--muted); }
.results tr.weekend { background: #eef1f4 !important; }
.results tr.today th { color: var(--dd-blue); }
.issues { color: #8a5300; font-size: .9rem; }
.recorded { display: grid; gap: .1rem; font-variant-numeric: tabular-nums; }
.recorded .hint { font-size: .9rem; }
.total { font-size: 1.05rem; margin: 1rem 0; }
.total a { margin-left: .75rem; }
.total > span { margin-left: .35rem; }
.details dl { display: grid; grid-template-columns: 11rem 1fr; gap: .3rem .75rem; margin: 0 0 1rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }

.card {
    border: 1px solid var(--line);
    border-radius: .5rem;
    padding: 1.25rem 1.5rem;
}
.narrow { max-width: 36rem; margin: 0 auto; }

/* Formulare */
input[type=text], input[type=search], input[type=password], input:not([type]) {
    font: inherit;
    padding: .55rem .7rem;
    border: 1px solid #b9c3cd;
    border-radius: .3rem;
    min-width: 0;
}
input:focus { outline: 2px solid var(--dd-blue); outline-offset: 0; border-color: var(--dd-blue); }

.btn {
    display: inline-block;
    font: inherit;
    padding: .5rem 1rem;
    border: 1px solid var(--dd-blue);
    border-radius: .3rem;
    background: var(--dd-blue);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--dd-blue-dark); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-light { background: #fff; color: var(--dd-blue); }
.btn-light:hover { background: #eef4fa; }
.btn-danger { background: var(--error); border-color: var(--error); }
.btn-danger:hover { background: #7a0000; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1rem; }
.filter input[type=search] { flex: 1 1 16rem; }
.check { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; }

.form { display: grid; gap: 1rem; max-width: 30rem; }
.field { display: grid; gap: .3rem; }
.field label { font-weight: 600; }
.field input, .field select { width: 100%; }
select { font: inherit; padding: .5rem .6rem; border: 1px solid #b9c3cd; border-radius: .3rem; background: #fff; }
.checks { display: grid; gap: .4rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
small.hint { font-size: .85rem; }

fieldset.field { border: 1px solid var(--line); border-radius: .4rem; padding: .75rem 1rem 1rem; margin: 0; }
fieldset.field legend { font-weight: 700; padding: 0 .3rem; }
textarea { font: inherit; padding: .5rem .7rem; border: 1px solid #b9c3cd; border-radius: .3rem; width: 100%; font-family: ui-monospace, Consolas, monospace; }
.helper { margin: .25rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.btn-small { padding: .25rem .6rem; font-size: .9rem; }
.status-sent { color: var(--ok); }
.status-failed { color: var(--error); }
.status-pending { color: #8a5300; }

.meta { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); max-width: 30rem; }
.meta.wide { max-width: none; }
.meta h2 { margin-top: 0; }
.meta dl { display: grid; grid-template-columns: 8rem 1fr; gap: .3rem .75rem; margin: 0 0 1rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }

.badge { display: inline-block; padding: .05rem .45rem; border-radius: .6rem; font-size: .85rem; }
.badge-muted { background: #e6e9ed; color: var(--muted); }
.badge-warn { background: #fff4e0; color: #8a5300; }
.badge-info { background: #e3eefa; color: var(--dd-blue-dark); }
.badge-danger { background: #fbe4e4; color: var(--error); }
.alert ul { margin: .25rem 0 0; padding-left: 1.2rem; }
.alert-warn { background: #fff4e0; color: #5c3900; border-left: .35rem solid #c77700; }
.alert-ok a, .alert-error a { color: #fff; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
.results { width: 100%; border-collapse: collapse; }
.results th, .results td {
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.results thead th { border-bottom: 2px solid var(--line); white-space: nowrap; }
.results tbody tr:nth-child(odd) { background: var(--stripe); }
.results tbody tr:hover { background: #e8f0f8; }
.results tbody th { font-weight: 600; white-space: nowrap; }
.results tr.inactive { color: var(--muted); }
.results tr.current th { color: var(--dd-blue); }
.week-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.6rem, 1fr)); gap: .5rem; border: 0; padding: 0; margin: 0; }
.week-fields legend { font-weight: 600; padding: 0; margin-bottom: .4rem; }
.templates { display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.templates a { white-space: nowrap; }
.diff-minus { color: #b00020; }
.filter .year { width: 6.5rem; }
.inline-form { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); align-items: end; max-width: 40rem; }
.day-note { font-weight: normal; font-size: .85rem; color: var(--dd-blue-dark); white-space: normal; }
.results tr.holiday { background: #f3eefa !important; }
.day-actions a { display: block; white-space: nowrap; }

.issues .request { color: var(--dd-blue-dark); }
.export-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 1rem; }

/* Monatsliste zum Drucken (A4, E56) */
main.print-page { max-width: 190mm; padding: 1rem; font-size: 12px; }
.print-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.sheet { break-after: page; page-break-after: always; margin-bottom: 2rem; }
.sheet:last-of-type { break-after: auto; page-break-after: auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 2px solid #000; padding-bottom: .4rem; margin-bottom: .5rem; }
.sheet-head h1 { font-size: 1.25rem; margin: 0 0 .2rem; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { border-bottom: 1px solid #c8c8c8; padding: 2px 4px; text-align: left; vertical-align: top; }
.sheet thead th { border-bottom: 1.5px solid #000; white-space: nowrap; }
.sheet tbody th { font-weight: 600; white-space: nowrap; }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet tr.weekend th, .sheet tr.weekend td { color: #6b6b6b; background: #f4f4f4; }
.sheet .sums p { margin: .35rem 0; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3rem; }
.signatures div { border-top: 1px solid #000; padding-top: .2rem; font-size: .9em; }
.printed { color: #6b6b6b; font-size: .85em; margin-top: 1rem; }
@media print {
    @page { size: A4; margin: 12mm; }
    .print-actions { display: none; }
    main.print-page { max-width: none; padding: 0; }
    body { font-size: 9.5pt; }
    .sheet { margin-bottom: 0; }
}
.diff-plus { color: #1b7a3a; }

/* Schmale Bildschirme: jede Zeile als Karte */
@media (max-width: 760px) {
    .results thead { display: none; }
    .results, .results tbody, .results tr, .results th, .results td { display: block; width: 100%; }
    .results tr { border: 1px solid var(--line); border-radius: .4rem; margin-bottom: .75rem; padding: .25rem 0; }
    .results tbody th, .results td { border: 0; padding: .2rem .75rem; display: grid; grid-template-columns: 8.5rem 1fr; gap: .5rem; }
    .results tbody th::before, .results td::before { content: attr(data-label); color: var(--muted); font-weight: normal; }
    .results td:empty { display: none; }
}

/* Stempelstation (Handy zuerst) */
.station { max-width: 32rem; margin: 0 auto; }
.clock { text-align: center; margin: .5rem 0 1.25rem; }
.clock-time { font-size: 3.25rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clock-date { color: var(--muted); }

.alert { display: grid; gap: .2rem; padding: .75rem 1rem; border-radius: .5rem; margin: 0 0 1rem; }
.alert-ok { background: var(--ok); color: #fff; }
.alert-error { background: var(--error); color: #fff; }

.status { display: grid; gap: .3rem; padding: .75rem 1rem; border-radius: .5rem; margin-bottom: 1rem; border-left: .35rem solid; }
.status-out { background: var(--stripe); border-color: #9aa5b1; }
.status-in { background: #e7f4ec; border-color: var(--ok); }
.status-openfromearlierday { background: #fff4e0; border-color: #c77700; }

.stamp-form { display: grid; gap: .75rem; }
.stamp-btn {
    font: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1.1rem 1rem;
    border: 0;
    border-radius: .75rem;
    color: #fff;
    background: var(--dd-blue);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
    touch-action: manipulation;
}
.stamp-btn:hover { background: var(--dd-blue-dark); }
.stamp-btn.stamp-gehen { background: #4a5663; }
.stamp-btn.stamp-gehen:hover { background: #36404a; }
.stamp-btn.stamp-gehen2 { background: #fff; color: #36404a; border: 2px solid #4a5663; font-size: 1.15rem; padding: .8rem 1rem; box-shadow: none; }
.stamp-btn.stamp-gehen2:hover { background: #eef1f4; }
.stamp-btn.stamp-pausebeginn, .stamp-btn.stamp-pauseende { background: #b26b00; }
.stamp-btn.stamp-pausebeginn:hover, .stamp-btn.stamp-pauseende:hover { background: #8a5300; }
.leave-hint { font-size: .85rem; margin: .5rem 0 0; }
.stamp-btn:disabled { opacity: .55; cursor: progress; }
.stamp-btn:focus-visible { outline: 3px solid #f0a500; outline-offset: 2px; }
.geo-progress { text-align: center; color: var(--muted); margin: .75rem 0 0; font-variant-numeric: tabular-nums; }
.where-now { color: var(--muted); margin: 0 0 .75rem; text-align: center; }
.where-now strong { color: #1d2329; }

.geo-denied { background: #fff4e0; border-left: .35rem solid #c77700; border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1rem; }
.geo-denied p { margin: 0 0 .5rem; }
.help { margin: 0 0 1rem; }
.help summary { cursor: pointer; color: var(--dd-blue); font-weight: 600; padding: .25rem 0; }
.help dl { margin: .5rem 0 0; }
.help dt { font-weight: 700; margin-top: .6rem; }
.help dd { margin: .15rem 0 0; }

ul.today { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
ul.today li { display: grid; grid-template-columns: 3.5rem 5rem 1fr; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.today-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.today-where { color: var(--muted); overflow-wrap: anywhere; }
.today-where a { margin-left: .35rem; }

/* Login (wie LoginFrm.css: Hintergrundbild, blaues Formular) */
.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10vh 1rem;
    background: #6b7b8c url("Bkg-DDZE.jpg") no-repeat center center fixed;
    background-size: cover;
}
.login-frm {
    width: 100%;
    max-width: 34rem;
    padding: 2.5rem 3rem;
    background: var(--dd-blue);
    box-shadow: 0 5px 8px 0 rgba(0, 0, 0, .2), 0 9px 26px 0 rgba(0, 0, 0, .19);
}
.login-frm h1 { text-align: center; font-weight: bold; color: #fff; margin-bottom: 1.75rem; }
.login-frm form { display: grid; gap: 1rem; }
.login-frm input { width: 100%; border: 0; font-size: 16px; } /* 16px: iOS zoomt sonst beim Antippen */
.btn-submit {
    justify-self: start;
    width: 50%;
    padding: .55rem;
    border: 0;
    border-radius: 1rem;
    font: inherit;
    font-weight: 600;
    color: #0062cc;
    background: #fff;
    cursor: pointer;
}
.btn-submit:hover { background: #eef4fa; }
.login-error { margin: 0; color: #fff; background: var(--error); padding: .4rem .7rem; font-weight: 600; }

@media (max-width: 500px) {
    .login-page { padding-top: 4vh; }
    .login-frm { padding: 1.5rem; }
    .btn-submit { width: 100%; }
    .topbar .brand img { width: 180px; }
}
