/* Rückruf-Dashboard – Gestaltung wie die Medicalthree-Zeiterfassung (gleiche Farben, Schrift, Karten, Knöpfe).
   Farbwerte 1:1 aus zeiterfassung/src/index.css. Die Zeiterfassung läuft nur hell, daher auch hier. */

/* Inter (SIL Open Font License, siehe /fonts/Inter-OFL.txt), lokal ausgeliefert – keine Verbindung zu Google */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2-variations'), url(/fonts/inter-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --rr-css: 2; /* Versionsmarke: app.js lädt neu, wenn beim Deploy noch ein altes Stylesheet kommt */
  color-scheme: light;
  /* Grundfarben der Zeiterfassung (HSL-Bausteine) */
  --h-background: 210 20% 98%;
  --h-foreground: 252 32% 20%;
  --h-primary: 252 32% 39%;
  --h-secondary: 296 41% 40%;
  --h-muted: 252 15% 93%;
  --h-muted-foreground: 252 20% 45%;
  --h-accent-foreground: 296 41% 30%;
  --h-destructive: 0 72% 51%;
  --h-success: 142 76% 36%;
  --h-warning: 38 92% 50%;
  --h-border: 252 15% 88%;

  --background: hsl(var(--h-background));
  --foreground: hsl(var(--h-foreground));
  --primary: hsl(var(--h-primary));
  --secondary: hsl(var(--h-secondary));
  --muted-bg: hsl(var(--h-muted));
  --border: hsl(var(--h-border));
  --radius: 0.75rem;
  --radius-md: calc(var(--radius) - 2px);
  --radius-xl: calc(var(--radius) + 4px);
  --gradient-primary: linear-gradient(135deg, hsl(252, 32%, 39%) 0%, hsl(296, 41%, 40%) 100%);
  --gradient-hero: linear-gradient(180deg, hsl(252, 25%, 97%) 0%, hsl(210, 20%, 98%) 100%);
  --shadow-sm: 0 1px 2px 0 hsl(252 32% 20% / 0.05);
  --shadow-md: 0 4px 6px -1px hsl(252 32% 20% / 0.07), 0 2px 4px -2px hsl(252 32% 20% / 0.05);
  --shadow-lg: 0 10px 15px -3px hsl(252 32% 20% / 0.08), 0 4px 6px -4px hsl(252 32% 20% / 0.05);
  --ring: 0 0 0 2px #fff, 0 0 0 4px hsl(var(--h-primary));

  /* Namen, die das Skript und ältere Regeln verwenden */
  --bg: var(--background);
  --card: #fff;
  --text: var(--foreground);
  --muted: hsl(var(--h-muted-foreground));
  --line: var(--border);
  --accent: var(--primary);
  /* Flächen, Punkte und Icons in den Originaltönen der Zeiterfassung; Schrift in dunkleren Tönen derselben Farbe (Kontrast ≥ 4,5:1) */
  --ok: hsl(var(--h-success));
  --ok-text: hsl(142 76% 26%);
  --ok-bg: hsl(var(--h-success) / 0.1);
  --warn: hsl(30 90% 32%);
  --warn-bg: hsl(var(--h-warning) / 0.14);
  --bad: hsl(var(--h-destructive));
  --bad-text: hsl(0 72% 42%);
  --bad-bg: hsl(var(--h-destructive) / 0.1);
  --info: var(--primary);
  --info-bg: hsl(var(--h-primary) / 0.1);
  --orange: hsl(var(--h-warning));
  --orange-text: hsl(30 90% 38%);
  --orange-bg: hsl(var(--h-warning) / 0.14);
  --web: var(--secondary);
  --web-bg: hsl(var(--h-secondary) / 0.1);
}

* { box-sizing: border-box; }
html { background: var(--background); }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.5; font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 0; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.muted { color: var(--muted); margin: 2px 0 0; }
.small { font-size: 13px; }
a { color: var(--primary); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
/* Wie outline-none in Tailwind: unsichtbare Outline, die der Windows-Kontrastmodus einfärbt, plus Ring */
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }

/* ---------- Icons (Lucide, wie in der Zeiterfassung) ---------- */
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 20px; height: 20px; }

/* ---------- Kopfzeile ---------- */
.appbar { position: sticky; top: 0; z-index: 40; background: hsl(var(--h-background) / 0.95); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border-bottom: 1px solid hsl(var(--h-border) / 0.6); }
.appbar-in { max-width: 1480px; margin: 0 auto; padding: 0 16px; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--foreground); min-width: 0; }
.brand img { height: 40px; width: auto; display: block; }
.brand-sep { width: 1px; height: 24px; background: var(--border); }
.brand-app { font-weight: 600; font-size: 15px; white-space: nowrap; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border-radius: 999px; background: hsl(var(--h-muted) / 0.6); color: var(--foreground); font-size: 13px; font-weight: 500; }
.user-chip .avatar { width: 26px; height: 26px; border-radius: 50%; background: hsl(var(--h-primary) / 0.12); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.user-chip .avatar .ic { width: 14px; height: 14px; }
.user-chip:has(#me:empty) { display: none; }

/* ---------- Seite ---------- */
.page { max-width: 1480px; margin: 0 auto; padding: 24px 16px 48px; }
.page-head { margin-bottom: 20px; }
.page-head .eyebrow { color: var(--muted); margin: 0; }
#sync { margin-top: 4px; font-size: 13px; }
#sync.error { font-size: 13px; }

/* ---------- Knöpfe (wie Button der Zeiterfassung) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 12px;
  border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--background); color: var(--foreground);
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, opacity .15s, box-shadow .15s;
}
.btn:hover { background: hsl(210 40% 98%); color: hsl(var(--h-accent-foreground)); border-color: hsl(var(--h-primary) / 0.35); }
.btn.primary { background: var(--gradient-primary); border-color: transparent; color: #fff; box-shadow: 0 10px 15px -3px hsl(var(--h-primary) / 0.25), 0 4px 6px -4px hsl(var(--h-primary) / 0.25); }
.btn.primary:hover { opacity: .9; color: #fff; }
.btn.primary:focus-visible { box-shadow: var(--ring), 0 10px 15px -3px hsl(var(--h-primary) / 0.25), 0 4px 6px -4px hsl(var(--h-primary) / 0.25); }
/* ghost: rahmenlos wie das Nutzer-Icon in der Kopfzeile der Zeiterfassung */
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: hsl(var(--h-muted) / 0.6); color: hsl(var(--h-accent-foreground)); border-color: transparent; }
.btn.danger { border-color: transparent; background: transparent; color: var(--bad-text); }
.btn.danger:hover { background: var(--bad-bg); color: var(--bad-text); border-color: transparent; }
.btn .ic { width: 16px; height: 16px; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; font-weight: 500; padding: 0; text-decoration: none; }
.link:hover { text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; pointer-events: none; }

/* ---------- Eingaben ---------- */
select, input, textarea {
  font: inherit; font-size: 14px; color: var(--foreground); background: var(--background);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 7px 10px; min-height: 36px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { line-height: 1.45; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b5f99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
select:focus-visible, input:focus-visible, textarea:focus-visible { box-shadow: var(--ring); border-color: var(--border); }
input[type="date"] { min-height: 32px; }

/* ---------- Ansicht umschalten (Tabs der Zeiterfassung) ---------- */
.views { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; background: var(--muted-bg); border-radius: var(--radius-md); }
.view-btn { font: inherit; font-size: 14px; font-weight: 500; height: 36px; padding: 0 14px; border: 0; border-radius: calc(var(--radius) - 4px);
  background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background-color .15s, color .15s, box-shadow .15s; }
.view-btn:hover { color: var(--foreground); }
.view-btn[aria-selected="true"] { background: #fff; color: var(--foreground); box-shadow: var(--shadow-sm); }
.view-btn[aria-selected="true"] .ic { color: var(--primary); }
.view-btn:focus-visible, .view-btn[aria-selected="true"]:focus-visible { box-shadow: var(--ring), var(--shadow-sm); }
.view-count:empty { display: none; }
.view-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; text-align: center; background: var(--bad-bg); color: var(--bad-text); }
.view-btn[aria-selected="true"] .view-count { background: var(--bad); color: #fff; }

/* ---------- Filter ---------- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.filters label { display: flex; flex-direction: column; font-size: 13px; font-weight: 500; color: var(--muted); gap: 6px; }
.filters select { min-width: 150px; height: 40px; background-color: #fff; }
.filters .btn { height: 40px; background: #fff; }
.filters [hidden] { display: none; }

/* ---------- Karten (glass-card der Zeiterfassung) ---------- */
.card { background: hsl(0 0% 100% / 0.8); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border: 1px solid hsl(var(--h-border) / 0.5);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 20px; margin-bottom: 20px; min-width: 0; animation: fade-in .3s ease-out both; }
.card > h2 { margin-bottom: 4px; }
.card > .muted.small { margin-bottom: 12px; max-width: 110ch; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid2 > .card { margin-bottom: 20px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Kennzahlen (Stat-Karten der Zeiterfassung) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
/* Die Kacheln werden bei jedem Abruf neu gezeichnet; eingeblendet wird nur der Behälter, einmal beim Laden */
.kpi { background: hsl(0 0% 100% / 0.8); border: 1px solid hsl(var(--h-border) / 0.5); border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  padding: 18px 18px 16px; min-width: 0; }
#kpis { animation: fade-in .3s ease-out both; }
.kpi-ic { width: 44px; height: 44px; border-radius: var(--radius-xl); display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
  background: hsl(var(--h-primary) / 0.1); color: var(--primary); }
.kpi-ic .ic { width: 20px; height: 20px; }
.kpi .v { font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--foreground); }
.kpi .l { color: var(--muted); font-size: 14px; margin-top: 2px; }
.kpi .sub { color: var(--primary); font-size: 12px; margin-top: 4px; }
.kpi.ok .kpi-ic { background: var(--ok-bg); color: var(--ok); }
.kpi.warn .kpi-ic { background: var(--orange-bg); color: var(--orange-text); }
.kpi.warn .v { color: var(--orange-text); }
.kpi.bad .kpi-ic { background: var(--bad-bg); color: var(--bad); }
.kpi.bad .v { color: var(--bad-text); }
/* Übersicht: acht Kennzahlen in zwei gleich vollen Reihen */
#kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { #kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Kennzahlen innerhalb einer Karte */
.kpis-inner { margin: 12px 0 0; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpis-inner .kpi { background: hsl(var(--h-muted) / 0.35); border-color: transparent; box-shadow: none; border-radius: var(--radius); padding: 14px; animation: none; }
.kpis-inner .kpi-ic { width: 36px; height: 36px; border-radius: var(--radius); margin-bottom: 10px; }
.kpis-inner .kpi-ic .ic { width: 18px; height: 18px; }
.kpis-inner .kpi .v { font-size: 20px; }
.kpis-inner .kpi .l { font-size: 13px; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; border: 1px solid hsl(var(--h-border) / 0.7); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid hsl(var(--h-border) / 0.7); white-space: nowrap; }
thead th { color: var(--muted); font-weight: 500; font-size: 13px; background: hsl(var(--h-muted) / 0.45); height: 44px; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { transition: background-color .12s; }
tbody tr:hover { background: hsl(var(--h-muted) / 0.5); }

/* ---------- Pillen (Badges der Zeiterfassung) ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; vertical-align: 1px; }
.p-offen { background: var(--bad-bg); color: var(--bad-text); }
.p-versucht { background: var(--warn-bg); color: var(--warn); }
.p-ok { background: var(--ok-bg); color: var(--ok-text); }
.p-info { background: var(--info-bg); color: var(--info); }
.p-grey { background: hsl(var(--h-muted)); color: var(--muted); }
.p-web { background: var(--web-bg); color: var(--web); }
.p-notfall { background: var(--bad); color: #fff; }

/* ---------- Dialoge ---------- */
dialog { border: 1px solid hsl(var(--h-border) / 0.6); border-radius: var(--radius-xl); background: #fff; color: var(--foreground);
  width: min(760px, 94vw); max-height: 88vh; padding: 24px; box-shadow: var(--shadow-lg), 0 24px 48px -12px hsl(252 32% 20% / 0.18); }
dialog[open] { animation: scale-in .2s ease-out; }
dialog::backdrop { background: hsl(252 32% 12% / 0.45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
dialog h2 { font-size: 18px; margin-bottom: 6px; padding-right: 36px; }
dialog h3 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; }
dialog .close { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border-radius: var(--radius-md); background: none; border: 0;
  color: var(--foreground); opacity: .7; transition: opacity .15s, background-color .15s; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
dialog .close:hover { background: hsl(var(--h-muted) / 0.7); opacity: 1; }
.transcript { white-space: pre-wrap; background: hsl(var(--h-muted) / 0.35); border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px; max-height: 320px; overflow: auto; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.status-choice { display: grid; gap: 6px; margin: 8px 0 12px; }
.status-choice label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-choice input[type="radio"] { min-height: 0; accent-color: hsl(var(--h-primary)); width: 16px; height: 16px; }
#case-form textarea { width: 100%; margin-bottom: 12px; }
.verlauf { list-style: none; padding: 0; margin: 6px 0 0; }
.verlauf li { padding: 8px 0; border-bottom: 1px solid hsl(var(--h-border) / 0.7); }
.verlauf li:last-child { border-bottom: 0; }
.verlauf .notiz { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.pw-form { display: flex; gap: 6px; }
.pw-form input { width: 170px; }
#users { width: min(1000px, 96vw); }
.error { color: var(--bad-text); margin: 0; }
.ok-text { color: var(--ok-text); }

/* ---------- Anmeldung (wie Zeiterfassung) ---------- */
body.login { min-height: 100vh; background: var(--gradient-hero); display: grid; place-items: center; padding: 24px; }
.login-box { width: min(448px, 100%); background: hsl(0 0% 100% / 0.8); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border: 1px solid hsl(var(--h-border) / 0.5); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 32px; display: flex; flex-direction: column; gap: 20px;
  animation: fade-in .3s ease-out both; }
.login-head { text-align: center; }
.login-head img { height: 48px; width: auto; display: block; margin: 0 auto 20px; }
.login-head h1 { font-size: 18px; font-weight: 600; }
.login-head p { color: var(--muted); margin: 6px 0 0; }
.login-box .field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; }
.login-box .in { position: relative; }
.login-box .in .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.login-box .in input { width: 100%; height: 48px; padding-left: 44px; font-size: 15px; font-weight: 400; }
.login-box .btn.primary { width: 100%; height: 44px; font-size: 15px; }
.login-box .error { color: var(--bad-text); background: var(--bad-bg); border: 1px solid hsl(var(--h-destructive) / 0.2); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; }
.login-box p.small { margin: 0; text-align: center; color: var(--muted); }

/* ---------- Rückruf-Tempo und Ampel ---------- */
.tempo .kpis { margin: 12px 0 14px; }
.tempo .kpi { background: hsl(var(--h-muted) / 0.35); border-color: transparent; box-shadow: none; border-radius: var(--radius); animation: none; }
.tempo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tempo-head h2 { margin: 0; }
.tempo-head p { max-width: 90ch; }
.amp { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: 0; flex: none; }
.amp-gruen { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.amp-orange { background: var(--orange); box-shadow: 0 0 0 3px var(--orange-bg); }
.amp-rot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.amp-cell { white-space: nowrap; }
.amp-cell .small { margin-left: 4px; }
.amp-t-rot .small { color: var(--bad-text); font-weight: 600; }
.amp-t-orange .small { color: var(--orange-text); font-weight: 600; }
tr.row-rot td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.row-orange td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
tr.row-notfall td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.ampel-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: hsl(var(--h-muted)); gap: 2px; }
.ampel-bar:empty { display: none; }
.seg-gruen { background: var(--ok); }
.seg-orange { background: var(--orange); }
.seg-rot { background: var(--bad); }
.seg-wartet { background: repeating-linear-gradient(45deg, var(--muted) 0 4px, transparent 4px 8px); opacity: .5; }
#ampel-bar-text { margin-top: 8px; }
.bad-text { color: var(--bad-text); font-weight: 600; }

/* ---------- Liste: Anliegen, Status, Notiz ---------- */
#cases td { vertical-align: top; }
#cases td.amp-cell { padding-top: 14px; }
td.anliegen { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
td.anliegen:focus-visible { box-shadow: inset 0 0 0 2px var(--primary); outline-offset: -2px; }
.anl-text { color: var(--foreground); }
.st-cell { min-width: 200px; white-space: normal; }
.st-sel { width: 100%; max-width: 230px; font-size: 13px; font-weight: 600; min-height: 34px; border-width: 1px; cursor: pointer; }
.st-sel.p-offen { background-color: var(--bad-bg); color: var(--bad-text); border-color: hsl(var(--h-destructive) / 0.3); }
.st-sel.p-versucht { background-color: var(--warn-bg); color: var(--warn); border-color: hsl(var(--h-warning) / 0.45); }
.st-sel.p-ok { background-color: var(--ok-bg); color: var(--ok-text); border-color: hsl(var(--h-success) / 0.3); }
.st-sel.p-info { background-color: var(--info-bg); color: var(--info); border-color: hsl(var(--h-primary) / 0.3); }
.st-sel.p-grey { background-color: hsl(var(--h-muted)); color: var(--muted); }
.st-sel option { background: #fff; color: var(--foreground); font-weight: 400; }
.st-cell .sub { margin-top: 4px; white-space: normal; max-width: 240px; }
.st-cell .sub.error { margin-top: 4px; }
.wv-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wv-row input { padding: 3px 8px; }
.wv-row .btn { height: 30px; padding: 0 10px; font-size: 13px; }
.note-cell { min-width: 210px; }
.note-row { display: flex; gap: 6px; }
.note-in { width: 100%; min-width: 160px; min-height: 34px; padding: 6px 10px; font-size: 13px; }
.note-save { height: 34px; width: 34px; padding: 0; flex: none; }

/* ---------- Hover-Text ---------- */
.tip { position: fixed; z-index: 50; background: #fff; color: var(--foreground); border: 1px solid hsl(var(--h-border) / 0.7); border-radius: var(--radius);
  padding: 10px 12px; box-shadow: var(--shadow-lg); font-size: 13.5px; line-height: 1.45; pointer-events: none; }
.tip p { margin: 4px 0 0; }
.tip-h { font-weight: 600; }

/* ---------- Ampel-Einstellung ---------- */
#ampel-dlg { width: min(460px, 94vw); }
.ampel-form { display: grid; gap: 12px; margin-top: 14px; }
.ampel-form label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.ampel-form input { width: 90px; }
.ampel-form .btn { justify-self: start; }

/* ---------- Bewegung ---------- */
/* Nur Bewegung, keine Transparenz: Bleibt eine Animation hängen (Hintergrund-Tab, Drucken), ist der Inhalt trotzdem sichtbar */
@keyframes fade-in { from { transform: translateY(8px); } to { transform: none; } }
@keyframes scale-in { from { transform: scale(.97); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 720px) {
  .brand-sep, .brand-app { display: none; }
  .brand img { height: 34px; }
  .appbar-in { padding: 8px 16px; }
  .page { padding-top: 16px; }
  h1 { font-size: 22px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-ic { width: 38px; height: 38px; margin-bottom: 10px; }
  .kpi .v { font-size: 20px; }
  .filters label { flex: 1 1 140px; min-width: 0; }
  .filters select { width: 100%; min-width: 0; }
  .card { padding: 16px; }
  /* Kopfzeile: nur Icons, Beschriftung bleibt für Screenreader */
  .appbar-in { flex-wrap: nowrap; }
  .actions { flex-wrap: nowrap; gap: 4px; }
  .actions .btn { width: 36px; padding: 0; }
  .actions .lbl, .user-chip #me { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .user-chip { padding: 0 5px; }
  .brand { flex: 1 1 auto; }
  .brand img { height: auto; max-height: 34px; max-width: 100%; min-width: 0; }
}
@media (max-width: 380px) { .user-chip { display: none; } }
/* iOS vergrößert die Seite bei Feldern unter 16px – wie die Zeiterfassung (text-base md:text-sm) */
@media (max-width: 767px) {
  select, input, textarea, .login-box .in input, .st-sel, .note-in { font-size: 16px; }
}
