/* Wäschebot Web-UI — Design nach docs/referenz/ (tools.bathomesolutions.com):
   Navy-Sticky-Header, #f0f0f5-Hintergrund, weiße Karten mit weichem Schatten,
   farbige Standort-Header, Aktionsfarben, große Mengenzahlen, Print-Support. */

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

:root {
    --navy: #1C3A5E;
    --bg: #f0f0f5;
    --text: #222;
    --muted: #888;
    --border: #e3e3e8;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --ok: #2E7D32;
    --warn: #EF6C00;
    --crit: #C62828;
    --load: #5E35B1;
    --dirty: #B0413E;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    padding-bottom: 60px;
}

/* ---------- Topbar (Sticky-Header wie tools-Seiten) ---------- */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--navy); color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.topbar-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 16px;
}
.brand { font-size: 17px; font-weight: 700; color: white; text-decoration: none; white-space: nowrap; }
.topbar-user { font-size: 11px; opacity: 0.85; text-align: right; }
.topbar-user a { color: white; font-weight: 600; text-decoration: underline; }
.topnav {
    display: flex; gap: 4px; padding: 0 10px 8px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.topnav a {
    color: white; text-decoration: none; font-size: 13px; font-weight: 600;
    padding: 6px 11px; border-radius: 16px; white-space: nowrap;
    background: rgba(255,255,255,0.12);
}
.topnav a.active { background: white; color: var(--navy); }

/* ---------- Seiteninhalt ---------- */
/* Responsive Vollbreite (Björn 2026-07-10): breite Tabellen (Storno, Korrektur,
   Inventur-Review) nutzen den Screen statt in 900px gequetscht zu werden.
   1600px-Deckel hält Textzeilen auf Ultrawide lesbar; Mobile bleibt unverändert
   (Padding nur ab 1000px, Cards halten ohnehin 10px Randabstand). Abschneiden
   ist unmöglich: jede Tabelle steckt in .table-wrap (overflow-x: auto). */
.page { max-width: 1600px; margin: 0 auto; padding: 4px 0 20px; }
@media (min-width: 1000px) {
    .page { padding: 4px 24px 20px; }
}
.page-header { padding: 14px 16px 4px; }
.page-header h1 { font-size: 19px; color: var(--navy); }
.page-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

/* ---------- Karten ---------- */
.card, section.card {
    background: white; margin: 10px; border-radius: 10px;
    overflow: hidden; box-shadow: var(--card-shadow);
}
.card-header {
    padding: 12px 14px; display: flex; align-items: center;
    justify-content: space-between; gap: 10px; border-bottom: 1px solid #f0f0f0;
}
.card-header h2 { font-size: 15px; color: var(--navy); }
.card-title-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 12px 14px; }
.count-badge {
    font-size: 12px; background: rgba(0,0,0,0.15); color: white;
    padding: 3px 10px; border-radius: 12px; font-weight: 600;
}
.card-header .count-badge { background: #eef1f6; color: var(--navy); }

/* Farbige Standort-Header (Farb-Legende docs/referenz/farben.html) */
.standort-header {
    padding: 12px 14px; display: flex; align-items: center;
    justify-content: space-between; gap: 10px; color: white;
}
.standort-header h2, .standort-header .standort-name { font-size: 16px; font-weight: 700; color: white; }
.standort-header .standort-sub { font-size: 11px; opacity: 0.95; }
.standort-header .count-badge { background: rgba(0,0,0,0.18); color: white; }
.st-Udo     { background: #1976D2; }
.st-Kopp2   { background: #D32F2F; }
.st-Saar97  { background: #388E3C; }
.st-PM7     { background: #FBC02D; }
.st-GSS2B   { background: #F57C00; }
.st-Depot   { background: #5E35B1; }
.st-Default { background: var(--navy); }

/* ---------- Artikel-Zeilen mit großen Zahlen (packen.html-Look) ---------- */
.artikel-list { padding: 4px 0; }
.artikel-row { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid #f0f0f0; }
.artikel-row:last-child { border-bottom: none; }
.artikel-row.zero { opacity: 0.35; }
.artikel-row.zero.hidden { display: none; }
.artikel-name { flex: 1; font-size: 14px; }
.artikel-detail { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.artikel-zahl { font-size: 22px; font-weight: 800; min-width: 50px; text-align: right; }
.z-none { color: #BBB; }
.z-low  { color: var(--ok); }
.z-mid  { color: var(--warn); }
.z-high { color: var(--crit); }
.toggle-zero { text-align: center; padding: 12px; }
.toggle-zero button {
    background: white; border: 1px solid #ddd; padding: 8px 18px;
    border-radius: 20px; font-size: 13px; color: #555; cursor: pointer;
}

/* Aktionsblöcke (fahrplan.html-Look) */
.aktion-block { padding: 4px 0; }
.aktion-label {
    font-size: 12px; font-weight: 700; padding: 8px 14px 4px;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.a-load .aktion-label,   .a-load .artikel-zahl   { color: var(--load); }
.a-deliver .aktion-label, .a-deliver .artikel-zahl { color: var(--ok); }
.a-carry .aktion-label,  .a-carry .artikel-zahl  { color: var(--warn); }
.a-dirty .aktion-label,  .a-dirty .artikel-zahl  { color: var(--dirty); }
.end-card {
    background: var(--navy); color: white; margin: 10px; padding: 16px;
    border-radius: 10px; text-align: center; font-size: 14px; font-weight: 600;
}
.footer-hint { text-align: center; padding: 14px; color: var(--muted); font-size: 11px; }

/* ---------- Startseite ---------- */
.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0; }
.start-card {
    display: block; background: white; margin: 8px 10px; border-radius: 10px;
    box-shadow: var(--card-shadow); padding: 16px 14px; text-decoration: none; color: var(--text);
}
.start-card:active { transform: scale(0.99); }
.start-emoji { font-size: 26px; }
.start-titel { font-size: 15px; font-weight: 700; color: var(--navy); margin: 6px 0 3px; }
.start-text { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
    text-align: left; padding: 9px 14px; background: #f7f8fb; color: #555;
    font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.3px;
}
table.data td { padding: 9px 14px; border-bottom: 1px solid #f0f0f0; }
table.data tr:last-child td { border-bottom: none; }
td.menge, th.menge { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
td.menge.pos { color: var(--ok); }
td.menge.neg { color: var(--crit); }

/* ---------- Badges ---------- */
.badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    padding: 2px 9px; border-radius: 10px; white-space: nowrap;
}
.badge-ok      { background: #E8F5E9; color: var(--ok); }
.badge-warn    { background: #FFF3E0; color: var(--warn); }
.badge-pending { background: #FBE9E7; color: var(--dirty); }
.badge-info    { background: #E3F2FD; color: #1565C0; }
.badge-grey    { background: #ECEFF1; color: #607D8B; }

/* ---------- Status-Kacheln (Reports) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; }
.tile {
    background: white; margin: 8px 10px; border-radius: 10px; padding: 12px 14px;
    box-shadow: var(--card-shadow); border-left: 5px solid var(--navy);
}
.tile .tile-value { font-size: 24px; font-weight: 800; color: var(--navy); }
.tile .tile-label { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tile-ok   { border-left-color: var(--ok); }
.tile-warn { border-left-color: var(--warn); }
.tile-crit { border-left-color: var(--crit); }
.tile-info { border-left-color: #1976D2; }

/* ---------- Buttons ---------- */
button, .btn-ok, .btn-warn, .btn-ghost, .btn-primary, .btn-print { font-family: inherit; }
.btn-primary, .btn-ok, .btn-warn, .btn-print {
    display: inline-block; border: none; border-radius: 8px; cursor: pointer;
    font-size: 14px; font-weight: 600; padding: 10px 18px; text-decoration: none;
    color: white; text-align: center;
}
.btn-primary { background: var(--navy); }
.btn-ok      { background: var(--ok); }
.btn-warn    { background: var(--warn); }
.btn-print   { background: var(--navy); display: block; margin: 14px auto; }
.btn-ghost {
    display: inline-block; background: white; border: 1px solid #ddd; color: #555;
    border-radius: 20px; font-size: 13px; padding: 8px 16px; cursor: pointer; text-decoration: none;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Formulare ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--navy); }
.field-help { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.required { color: var(--crit); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], select, textarea {
    width: 100%; padding: 9px 10px; border: 1px solid #ccc; border-radius: 8px;
    font-size: 14px; font-family: inherit; background: white;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #1976D2; outline-offset: 1px; border-color: #1976D2; }
input.qty { width: 84px; text-align: right; }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: 13.5px; }
.checkbox-row input[type="checkbox"] { width: auto; margin-top: 2px; }
.checkbox-row .rolle-hint { font-size: 11px; color: var(--muted); display: block; }
.inline-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-filter select { width: auto; }

/* ---------- Sonstiges ---------- */
.hint-box {
    background: #FFF8E1; border: 1px solid #FFE082; border-radius: 8px;
    padding: 10px 12px; font-size: 12.5px; line-height: 1.5; margin-bottom: 12px;
}
.empty-state { color: var(--muted); font-size: 13.5px; padding: 6px 0; }
.ok-state { color: var(--ok); font-size: 14px; }
.ok-state.strong { font-weight: 700; }
.meta-line { font-size: 12.5px; color: #555; margin-bottom: 4px; }
.error-box { background: #FEE; color: #C33; padding: 12px 16px; margin: 12px; border-radius: 8px; font-size: 13px; }
.collapse summary { cursor: pointer; list-style: none; }
.collapse summary::-webkit-details-marker { display: none; }
.warn-list { margin: 4px 0 4px 18px; font-size: 13.5px; }
.warn-list li { margin-bottom: 5px; }

/* ---------- Login/Registrieren ---------- */
.auth-main { max-width: 400px; margin: 8vh auto 0; padding: 0 10px; }
.auth-main .card { margin: 10px 0; }
.auth-brand { text-align: center; font-size: 20px; font-weight: 800; color: var(--navy); padding: 14px; }

/* ---------- Druck ---------- */
@media print {
    body { background: white; padding: 0; }
    .topbar, .btn-print, .toggle-zero, .actions, .topnav, button { display: none !important; }
    .card, section.card, .tile, .start-card { box-shadow: none; border: 1px solid #ccc; margin: 6px 0; }
    .standort-header, .end-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .artikel-row.zero { display: none; }
    .page { max-width: none; }
}

/* ---------- Kompatibilität mit Bestands-Templates ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; }
.tile-blue  { border-left-color: #1976D2; }
.tile-green { border-left-color: var(--ok); }
.tile-amber { border-left-color: var(--warn); }
.tile-red   { border-left-color: var(--crit); }
.card-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.btn-sm { font-size: 12px; padding: 6px 12px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.warn-state { color: var(--warn); font-weight: 600; }
.error { background: #FEE; color: #C33; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
.success { background: #E8F5E9; color: var(--ok); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
/* ---------- Verständlichkeits-Hilfen (Schritt 5, rein additiv) ----------
   .hilfe  = ausklappbarer Erklärkasten unter dem Seitenkopf (Ebene 1+2)
   .tip    = Inline-Tooltip an Feld-Labels (Ebene 3), Hover + Tap/Fokus */
.hilfe { margin: 6px 16px 0; font-size: 12.5px; }
.hilfe summary {
    cursor: pointer; color: var(--navy); font-weight: 600;
    list-style: none; display: inline-block;
    padding: 4px 10px; border-radius: 14px; background: rgba(28,58,94,0.08);
}
.hilfe summary::-webkit-details-marker { display: none; }
.hilfe[open] summary { border-radius: 14px 14px 0 0; }
.hilfe-body {
    background: white; border: 1px solid var(--border); border-radius: 0 8px 8px 8px;
    padding: 10px 12px; line-height: 1.55; color: #444; max-width: 720px;
}
.hilfe-body p { margin: 0 0 7px; }
.hilfe-body p:last-child { margin-bottom: 0; }
.hilfe-body ul { margin: 0 0 7px 18px; }
.hilfe-body li { margin-bottom: 3px; }
.hilfe-body a { color: var(--navy); }
.landkarte-kette { line-height: 1.7; }
.tip {
    position: relative; display: inline-block; margin-left: 4px;
    color: var(--navy); cursor: help; font-weight: 600; font-size: 12px;
}
.tip .tip-text {
    display: none; position: absolute; left: 0; bottom: 140%;
    width: min(280px, 72vw); background: var(--navy); color: white;
    padding: 8px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 400;
    line-height: 1.45; z-index: 300; box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.tip:hover .tip-text, .tip:focus .tip-text, .tip:focus-within .tip-text { display: block; }
@media print { .hilfe, .tip { display: none !important; } }

.login-container { max-width: 400px; margin: 8vh auto 0; padding: 0 10px; }
.login-brand { text-align: center; font-size: 20px; font-weight: 800; color: var(--navy); padding: 14px; }
.auth-alt { text-align: center; font-size: 12.5px; padding: 10px; color: var(--muted); }
.auth-alt a { color: var(--navy); }
.icon { margin-right: 4px; }
