/* =========================================================
   EMB Zeiterfassung — Designsprache von emb-neutraubling.de
   - Dunkles Slate-Navy Background mit dezentem Emerald-Schein
   - Akzent: Emerald 500/600/700 (Verlauf 135deg)
   - Cards mit feiner Border + sanftem Shadow
   ========================================================= */

:root {
  /* EMB Brand — Dark (Standard) */
  --bg:           #0a1120;
  --bg-2:         #0d1829;
  --card:         #0f172abf;        /* slate-900 75% — wie EMB-Cards */
  --card-solid:   #0f172a;
  --card-hover:   #112236;
  --border:       #1e293b;
  --border-2:     #334155;
  --text:         #f8fafc;
  --text-soft:    #cbd5e1;
  --muted:        #94a3b8;
  --muted-2:      #64748b;
  --sidebar-bg:   linear-gradient(180deg, #0c1729 0%, #0a1120 100%);
  --topbar-bg:    rgba(10,17,32,0.85);
  --shadow-card:  0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.25);
  --logo-light-display: none;       /* dunkles BG -> verwende logo-dark.png */
  --logo-dark-display:  block;

  --primary:        #10b981;
  --primary-2:      #059669;
  --primary-3:      #047857;
  --primary-4:      #065f46;
  --primary-hover:  #34d399;
  --primary-glow:   rgba(16,185,129,0.30);
  --primary-soft:   rgba(16,185,129,0.12);

  --danger:       #ef4444;
  --danger-soft:  rgba(239,68,68,0.12);
  --warning:      #f59e0b;
  --info:         #3b82f6;
  --info-soft:    rgba(59,130,246,0.18);
  --purple:       #a78bfa;
  --purple-soft:  rgba(167,139,250,0.18);
  --amber:        #fbbf24;
  --amber-soft:   rgba(251,191,36,0.18);

  --input-bg: #06111f;
  --radius:    12px;
  --radius-lg: 16px;

  --sidebar-w: 260px;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --grad-emerald: linear-gradient(135deg, var(--primary) 0%, var(--primary-3) 60%, var(--primary-4) 100%);
  --btn-primary-color: #042418;     /* Text auf grünem Hauptbutton */
}

/* ========== LIGHT THEME ========== */
html.light {
  --bg:           #f5f7fa;
  --bg-2:         #ffffff;
  --card:         #ffffffe6;
  --card-solid:   #ffffff;
  --card-hover:   #f0f3f7;
  --border:       #e2e8f0;
  --border-2:     #cbd5e1;
  --text:         #0f172a;
  --text-soft:    #1e293b;
  --muted:        #64748b;
  --muted-2:      #94a3b8;
  --sidebar-bg:   linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%);
  --topbar-bg:    rgba(245,247,250,0.88);
  --input-bg:     #ffffff;
  --primary-soft: rgba(4,120,87,0.10);
  --primary-glow: rgba(4,120,87,0.18);
  --primary:        #047857;
  --primary-2:      #065f46;
  --primary-hover:  #059669;
  --shadow-card:    0 1px 0 rgba(0,0,0,0.02) inset, 0 6px 18px rgba(15,23,42,0.06);
  --danger-soft:    rgba(239,68,68,0.08);
  --info-soft:      rgba(59,130,246,0.10);
  --purple-soft:    rgba(167,139,250,0.10);
  --amber-soft:     rgba(217,119,6,0.10);
  --logo-light-display: block;       /* helles BG -> verwende logo-light.png */
  --logo-dark-display:  none;
  --btn-primary-color:  #ffffff;     /* Text auf dunklerem Light-Mode Verlauf */
}
html.light body {
  background:
    radial-gradient(1200px 600px at 100% -200px, rgba(16,185,129,0.10), transparent 60%),
    radial-gradient(900px  500px at 0%   100%, rgba(16,185,129,0.06), transparent 60%),
    var(--bg);
}
html.light .stat-value.neg { color: #b91c1c; }
html.light .stat-value.pos { color: var(--primary-2); }
html.light .badge-bad { color: #b91c1c; background: rgba(239,68,68,0.10); }
html.light .badge-pending { color: #b45309; background: rgba(217,119,6,0.10); }
html.light .btn-secondary { color: var(--text); background: var(--card-hover); }
html.light tbody tr:hover { background: rgba(15,23,42,0.03); }
html.light .nav-item.active { color: var(--primary-2); }
html.light .entry-date .hours { color: var(--primary-2); border-color: rgba(4,120,87,0.25); }
html.light .totals strong { color: var(--primary-2); }
html.light .month-pill.active { color: var(--primary-2); border-color: var(--primary); }
html.light .topbar { background: var(--topbar-bg); border-bottom-color: var(--border); }
html.light .modal { background: rgba(15,23,42,0.40); }
html.light input, html.light select, html.light textarea { background: var(--input-bg); color: var(--text); border-color: var(--border); }
html.light .info-box { background: rgba(59,130,246,0.08); color: #1d4ed8; border-color: rgba(59,130,246,0.20); }
html.light .info-box strong { color: #0f172a; }
html.light .info-box-amber { background: rgba(217,119,6,0.10); color: #92400e; border-color: rgba(217,119,6,0.30); }
html.light .info-box-amber strong { color: #78350f; }
html.light .cal-cell { background: rgba(255,255,255,0.6); border-color: var(--border); color: var(--text-soft); }
html.light .cal-cell.cell-weekend { background: rgba(15,23,42,0.025); color: var(--muted); }
html.light .cal-cell.cell-work { background: rgba(4,120,87,0.10); border-color: rgba(4,120,87,0.30); color: var(--primary-2); }
html.light .cal-cell.cell-urlaub      { background: rgba(217,119,6,0.10); color: #92400e; border-color: rgba(217,119,6,0.30); }
html.light .cal-cell.cell-krank       { background: rgba(239,68,68,0.10); color: #b91c1c; border-color: rgba(239,68,68,0.30); }
html.light .cal-cell.cell-dienstreise { background: rgba(59,130,246,0.10); color: #1d4ed8; border-color: rgba(59,130,246,0.30); }
html.light .cal-cell.cell-schulung    { background: rgba(167,139,250,0.12); color: #6d28d9; border-color: rgba(167,139,250,0.30); }
html.light .cal-cell.cell-holiday     { background: repeating-linear-gradient(45deg, rgba(167,139,250,0.10) 0 6px, rgba(167,139,250,0.04) 6px 12px); color: #6d28d9; border-color: rgba(167,139,250,0.30); }
html.light .tag-urlaub      { color: #92400e; background: rgba(217,119,6,0.10); border-color: rgba(217,119,6,0.30); }
html.light .tag-krank       { color: #b91c1c; background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.30); }
html.light .tag-dienstreise { color: #1d4ed8; background: rgba(59,130,246,0.10); border-color: rgba(59,130,246,0.30); }
html.light .tag-schulung    { color: #6d28d9; background: rgba(167,139,250,0.10); border-color: rgba(167,139,250,0.30); }
html.light .tag-assigned    { color: var(--primary-2); background: var(--primary-soft); border-color: rgba(4,120,87,0.30); }
html.light .tag-holiday     { color: #6d28d9; background: rgba(167,139,250,0.10); border-color: rgba(167,139,250,0.30); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: dark; }
html.light { color-scheme: light; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
body {
  background: var(--bg);
  min-height: 100vh; min-height: 100dvh;
  position: relative;
}

/* Globaler atmosphärischer Hintergrund (auch in der App sichtbar) */
body::before {
  content: '';
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 85% 15%, rgba(16,185,129,0.14), transparent 55%),
    radial-gradient(800px 500px at 15% 85%, rgba(16,185,129,0.09), transparent 60%),
    radial-gradient(600px 400px at 60% 50%, rgba(52,211,153,0.06), transparent 60%);
  animation: body-aurora 32s ease-in-out infinite alternate;
}
html.light body::before {
  background:
    radial-gradient(900px 600px at 85% 15%, rgba(4,120,87,0.08), transparent 55%),
    radial-gradient(800px 500px at 15% 85%, rgba(4,120,87,0.06), transparent 60%),
    radial-gradient(600px 400px at 60% 50%, rgba(16,185,129,0.04), transparent 60%);
}
@keyframes body-aurora {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-50px, 40px) scale(1.05); }
  100% { transform: translate(40px, -30px) scale(1.02); }
}

/* Feines Grid-Pattern global (Tiefen-Layer) */
body::after {
  content: '';
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16,185,129,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 90%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 90%);
}
html.light body::after {
  background-image:
    linear-gradient(rgba(4,120,87,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(4,120,87,0.05) 1px, transparent 1px);
}

/* App-Inhalt liegt über dem Background */
body > * { position: relative; z-index: 1; }
.app-shell { isolation: isolate; }

/* ====== Globaler App-Background mit Live-Animationen ====== */
#appBg {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.app-circuit {
  width: 100%; height: 100%;
  opacity: 0.55;
}
html.light .app-circuit { opacity: 0.4; }
.app-circuit .trace path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1;
  stroke-opacity: 0.10;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html.light .app-circuit .trace path { stroke: var(--primary-2); stroke-opacity: 0.14; }
.app-circuit .flow path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24 2000;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 5px var(--primary-glow)) drop-shadow(0 0 10px var(--primary-glow));
  animation: circuit-pulse linear infinite;
}
html.light .app-circuit .flow path {
  stroke: var(--primary-hover);
  filter: drop-shadow(0 0 4px rgba(4,120,87,0.30)) drop-shadow(0 0 8px rgba(4,120,87,0.18));
}
.app-circuit .nodes circle {
  fill: var(--primary);
  filter: drop-shadow(0 0 4px var(--primary-glow));
  animation: node-pulse 3s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.app-circuit .nodes circle:nth-child(2n) { animation-delay: 0.5s; animation-duration: 4s; }
.app-circuit .nodes circle:nth-child(3n) { animation-delay: 1.2s; animation-duration: 5s; }

.app-sparks { position: absolute; inset: 0; pointer-events: none; }
.app-sparks span {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--primary-hover);
  box-shadow: 0 0 4px var(--primary-hover), 0 0 10px var(--primary-glow);
  opacity: 0;
  animation: spark-drift linear infinite;
}
html.light .app-sparks span {
  background: var(--primary-2);
  box-shadow: 0 0 4px var(--primary-2), 0 0 8px rgba(4,120,87,0.30);
}

/* Login-Page versteckt den App-BG (hat eigene, intensivere Effekte) */
.login-wrap ~ #appBg, body:has(#loginView:not(.hidden)) #appBg { display: none; }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .app-circuit .flow path, .app-circuit .nodes circle, .app-sparks span { animation: none; }
  .app-sparks { display: none; }
}

/* ========== LOGIN — Industrial / Elektrotechnik-Look ========== */
.login-wrap {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px 16px;
  padding-top:    calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 75% -100px, rgba(16,185,129,0.18), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(16,185,129,0.10), transparent 60%),
    var(--bg);
}
html.light .login-wrap {
  background:
    radial-gradient(900px 500px at 75% -100px, rgba(4,120,87,0.10), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(4,120,87,0.06), transparent 60%),
    var(--bg);
}

/* Feines Grid als Basis (subtiler Tiefen-Layer) */
.login-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(16,185,129,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 85%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 85%);
}
html.light .login-wrap::before {
  background-image:
    linear-gradient(rgba(4,120,87,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(4,120,87,0.08) 1px, transparent 1px);
}

/* Akzent-Streifen oben und unten am Wrapper */
.login-wrap::after {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary) 30%, var(--primary) 70%, transparent);
  opacity: 0.45;
}

.login-card {
  position: relative;
  width: 100%; max-width: 440px;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 30px 28px;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.30),
    0 0 0 1px rgba(16,185,129,0.10),
    inset 0 1px 0 rgba(255,255,255,0.04);
  z-index: 1;
}
html.light .login-card {
  box-shadow:
    0 12px 36px rgba(15,23,42,0.10),
    0 0 0 1px rgba(4,120,87,0.10),
    inset 0 1px 0 rgba(255,255,255,1);
}

/* Glow-Linie oben in der Card */
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 28px; right: 28px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.85;
}

/* Eckige Akzent-Marker an den Card-Ecken (Industrial) */
.login-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 19px;
  background:
    linear-gradient(135deg, var(--primary), transparent 30%) top left/16px 16px no-repeat,
    linear-gradient(225deg, var(--primary), transparent 30%) top right/16px 16px no-repeat,
    linear-gradient(45deg,  var(--primary), transparent 30%) bottom left/16px 16px no-repeat,
    linear-gradient(315deg, var(--primary), transparent 30%) bottom right/16px 16px no-repeat;
  opacity: 0.55;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  padding: 1px;
}

/* =========================================================
   PREMIUM-HINTERGRUND: Aurora + Schaltkreis + Funken
   ========================================================= */

/* ---- Aurora-Orbs (langsam treibende, weiche Lichtkreise) ---- */
.aurora {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  filter: blur(60px);
  opacity: 0.85;
}
.aurora-orb {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
}
html.light .aurora-orb { mix-blend-mode: multiply; opacity: 0.4; }
.aurora-1 {
  width: 60vw; height: 60vw;
  top: -20vw; left: -10vw;
  background: radial-gradient(circle, rgba(16,185,129,0.55), transparent 60%);
  animation: aurora-drift-1 24s ease-in-out infinite;
}
.aurora-2 {
  width: 55vw; height: 55vw;
  bottom: -20vw; right: -15vw;
  background: radial-gradient(circle, rgba(4,120,87,0.45), transparent 60%);
  animation: aurora-drift-2 32s ease-in-out infinite;
}
.aurora-3 {
  width: 40vw; height: 40vw;
  top: 30%; left: 50%;
  background: radial-gradient(circle, rgba(52,211,153,0.30), transparent 60%);
  animation: aurora-drift-3 28s ease-in-out infinite;
}
@keyframes aurora-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(20vw, 10vh) scale(1.15); }
  66%      { transform: translate(-10vw, 20vh) scale(0.9); }
}
@keyframes aurora-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-25vw, -15vh) scale(1.2); }
}
@keyframes aurora-drift-3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  25%      { transform: translate(-30%, -60%) scale(1.1); }
  50%      { transform: translate(-70%, -40%) scale(0.85); }
  75%      { transform: translate(-40%, -55%) scale(1.05); }
}

/* ---- Schaltkreis-SVG mit Lauflicht ---- */
.circuit {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}
html.light .circuit { opacity: 0.45; }
.circuit-trace path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-opacity: 0.18;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html.light .circuit-trace path { stroke: var(--primary-2); stroke-opacity: 0.22; }
.circuit-flow path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24 2000;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px var(--primary-glow)) drop-shadow(0 0 12px var(--primary-glow));
  animation: circuit-pulse linear infinite;
}
html.light .circuit-flow path {
  stroke: var(--primary-hover);
  filter: drop-shadow(0 0 6px rgba(4,120,87,0.35)) drop-shadow(0 0 12px rgba(4,120,87,0.20));
}
@keyframes circuit-pulse {
  0%   { stroke-dashoffset: 0;     }
  100% { stroke-dashoffset: -2024; }
}
.circuit-nodes circle {
  fill: var(--primary);
  filter: drop-shadow(0 0 4px var(--primary-glow));
  animation: node-pulse 3s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.circuit-nodes circle:nth-child(2n)   { animation-delay: 0.5s; }
.circuit-nodes circle:nth-child(3n)   { animation-delay: 1.2s; animation-duration: 4s; }
.circuit-nodes circle:nth-child(5n)   { animation-delay: 2s;   animation-duration: 5s; }
@keyframes node-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.4); }
}

/* ---- Treibende Funken/Partikel ---- */
.sparks {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.sparks span {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--primary-hover);
  box-shadow: 0 0 6px var(--primary-hover), 0 0 12px var(--primary-glow);
  opacity: 0;
  animation: spark-drift 12s linear infinite;
}
html.light .sparks span {
  background: var(--primary-2);
  box-shadow: 0 0 6px var(--primary-2), 0 0 12px rgba(4,120,87,0.35);
}
.sparks span:nth-child(1)  { left:  8%; animation-duration: 11s; animation-delay: 0s; }
.sparks span:nth-child(2)  { left: 22%; animation-duration: 14s; animation-delay: 2s; }
.sparks span:nth-child(3)  { left: 35%; animation-duration:  9s; animation-delay: 1s; }
.sparks span:nth-child(4)  { left: 48%; animation-duration: 15s; animation-delay: 4s; }
.sparks span:nth-child(5)  { left: 60%; animation-duration: 12s; animation-delay: 6s; }
.sparks span:nth-child(6)  { left: 72%; animation-duration: 13s; animation-delay: 3s; }
.sparks span:nth-child(7)  { left: 80%; animation-duration: 10s; animation-delay: 8s; }
.sparks span:nth-child(8)  { left: 88%; animation-duration: 16s; animation-delay: 5s; }
.sparks span:nth-child(9)  { left: 15%; animation-duration: 13s; animation-delay: 7s; width: 2px; height: 2px; }
.sparks span:nth-child(10) { left: 65%; animation-duration: 11s; animation-delay: 9s; width: 2px; height: 2px; }
@keyframes spark-drift {
  0%   { top: 110%; opacity: 0; transform: translateX(0); }
  10%  { opacity: 1; }
  50%  { transform: translateX(20px); }
  90%  { opacity: 1; }
  100% { top: -10%; opacity: 0; transform: translateX(-15px); }
}

/* ---- Card-Akzente animieren ---- */
@keyframes top-pulse {
  0%, 100% { opacity: 0.55; transform: scaleX(0.9); }
  50%      { opacity: 1;    transform: scaleX(1); }
}
.login-card::before { animation: top-pulse 3.5s ease-in-out infinite; transform-origin: center; }

/* ---- Reduzierte Animation ---- */
@media (prefers-reduced-motion: reduce) {
  .aurora-orb, .circuit-flow path, .circuit-nodes circle,
  .sparks span, .login-card::before { animation: none; }
  .sparks { display: none; }
}

.login-tag {
  text-align: center;
  font-size: 11px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 18px;
}
html.light .login-tag { color: var(--primary-2); }

.login-card .logo-wrap-large {
  height: 64px;
  display: flex; justify-content: center;
  margin: 0 0 8px;
}

.login-sub {
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.3px;
  margin: 0 0 28px;
  color: var(--muted);
}

.login-foot {
  margin: 22px 0 0;
  text-align: center;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.login-version {
  position: relative;
  margin-top: 22px;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.5px;
  z-index: 1;
}

/* Admin-Login: andere Akzentfarbe (etwas wärmer/orange) zur Unterscheidung */
.login-card-admin .login-tag {
  color: var(--warning);
}
.login-card-admin::before {
  background: linear-gradient(90deg, transparent, var(--warning), transparent);
}

/* ========== APP-SHELL (Sidebar als Drawer + Main) ========== */
.app-shell {
  display: block;
  min-height: 100dvh;
}

/* ========== SIDEBAR (Elektro-Design) ========== */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100dvh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding-top:    var(--safe-top);
  padding-bottom: var(--safe-bottom);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  box-shadow: 12px 0 40px rgba(0,0,0,0.45);
}
body.sidebar-open .sidebar { transform: translateX(0); }

/* Animierter Strom-Streifen entlang der rechten Sidebar-Kante */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, transparent 0%, var(--primary) 30%, var(--primary-hover) 50%, var(--primary) 70%, transparent 100%);
  filter: drop-shadow(0 0 6px var(--primary-glow));
  background-size: 100% 200%;
  animation: sidebar-edge-flow 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sidebar-edge-flow {
  0%, 100% { background-position: 0% 0%;   opacity: 0.55; }
  50%      { background-position: 0% 100%; opacity: 1; }
}

/* Subtiles Schaltkreis-Pattern als Hintergrund-Layer der Sidebar */
.sidebar::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16,185,129,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.7;
}
html.light .sidebar::before {
  background-image:
    linear-gradient(rgba(4,120,87,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(4,120,87,0.06) 1px, transparent 1px);
}
.sidebar-header {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16,185,129,0.05), transparent);
}
html.light .sidebar-header { background: linear-gradient(180deg, rgba(4,120,87,0.05), transparent); }
.sidebar-header::after {
  content: '';
  position: absolute; left: 14px; right: 14px; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.6;
}
.sidebar-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; min-height: 36px; padding: 0;
  background: transparent; border: 1px solid var(--border-2); border-radius: 10px;
  color: var(--muted); font-size: 22px; line-height: 1;
  margin: 0; box-shadow: none;
}
.sidebar-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px;
  width: 100%; min-height: 44px;
  padding: 10px 14px; margin: 0;
  background: transparent; color: var(--text-soft);
  border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; font-weight: 500; text-align: left;
  cursor: pointer; box-shadow: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s, padding-left 0.18s;
  position: relative;
  overflow: hidden;
}
.nav-item > span:not(.nav-icon):not(.nav-badge) {
  flex: 1; text-align: left;
  position: relative; z-index: 1;
}
.nav-item .nav-icon { position: relative; z-index: 1; }
.nav-item:active { transform: none; }
.nav-item:hover {
  background: rgba(16,185,129,0.06);
  color: var(--text);
  padding-left: 18px;
}
html.light .nav-item:hover { background: rgba(4,120,87,0.06); }
/* Hover-Glow scan effect */
.nav-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(16,185,129,0.10), transparent);
  transform: translateX(-110%);
  transition: transform 0.45s ease;
}
.nav-item:hover::after { transform: translateX(110%); }

.nav-item.active {
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  color: var(--primary-hover);
  border-color: rgba(16,185,129,0.25);
  font-weight: 600;
  padding-left: 20px;
  box-shadow: inset 0 0 12px rgba(16,185,129,0.08);
}
html.light .nav-item.active { color: var(--primary-2); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--primary-hover), var(--primary), var(--primary-3));
  box-shadow: 0 0 8px var(--primary-glow), 0 0 16px var(--primary-glow);
  animation: nav-active-pulse 2.5s ease-in-out infinite;
}
@keyframes nav-active-pulse {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; box-shadow: 0 0 12px var(--primary-glow), 0 0 24px var(--primary-glow); }
}
.nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 999px; padding: 2px 8px;
  font-size: 11px; font-weight: 700;
}
.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--border); }
.user-block { display: flex; align-items: center; gap: 12px; }
.user-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-emerald); color: #042418;
  font-weight: 800; font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.user-name { font-size: 14px; font-weight: 600; line-height: 1.2; }

.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 40; backdrop-filter: blur(2px);
}
@media (max-width: 760px) {
  body.sidebar-open .sidebar-backdrop { display: block; }
  /* Sidebar-Eintraege auf Touch-Geraeten groeszer und besser zu treffen */
  .sidebar-nav { padding: 14px 12px; gap: 4px; }
  .nav-item {
    min-height: 56px;
    padding: 14px 16px;
    font-size: 17px;
    gap: 16px;
    border-radius: 12px;
  }
  .nav-icon { font-size: 22px; width: 28px; }
  .nav-badge { font-size: 13px; padding: 3px 10px; }
  /* Footer (Theme-Toggle + User-Block) deutlich groesser fuer Touch */
  .theme-toggle {
    font-size: 17px;
    min-height: 56px;
    padding: 12px 16px;
    border-radius: 12px;
  }
  .theme-toggle-icon { font-size: 22px; }
  .user-avatar { width: 48px; height: 48px; font-size: 17px; border-radius: 12px; }
  .user-name { font-size: 17px; }
  .sidebar-footer { padding: 14px 16px; }
  .sidebar-footer .link-muted { font-size: 15px; }
}

/* ========== MAIN ========== */
.main {
  min-width: 0; padding: 0 0 32px;
  margin-left: 0;
  transition: margin-left 0.22s ease;
}
@media (min-width: 761px) {
  body.sidebar-open .main { margin-left: var(--sidebar-w); }
}
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  padding-top: calc(14px + var(--safe-top));
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-spacer { flex: 1; }
.hamburger {
  display: inline-flex;
  width: 40px; height: 40px; min-height: 40px;
  padding: 0; margin: 0;
  background: transparent; color: var(--text);
  border: 1px solid var(--border-2); border-radius: 10px;
  flex-direction: column; gap: 4px; align-items: center; justify-content: center;
  box-shadow: none;
  transition: background 0.15s, transform 0.22s ease;
}
.hamburger:active { background: var(--card-hover); }
.hamburger span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.22s, opacity 0.22s; }
/* Hamburger -> X wenn Sidebar offen (Desktop) */
@media (min-width: 761px) {
  body.sidebar-open .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.sidebar-open .hamburger span:nth-child(2) { opacity: 0; }
  body.sidebar-open .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

.view { padding: 24px 28px; max-width: 1600px; margin: 0 auto; }
/* Volle Breite für Kalender (brauchen Platz) */
.view[data-view="firmkal"],
.view[data-view="kalender"] { max-width: none; margin: 0; padding: 16px 20px; }
.view[data-view="firmkal"] .card,
.view[data-view="kalender"] .card { padding: 14px 16px; }

/* Mitarbeiter-Kalender (Monatsansicht): groessere Zellen, mehr Schrift,
   nutzt die volle Viewport-Hoehe. Nur auf Tablet/Desktop — auf Phones
   greift die separate Mobile-Regel weiter unten. */
@media (min-width: 761px) {
  .view[data-view="kalender"] .cal-grid:not(.cal-grid-small) { gap: 8px; }
  .view[data-view="kalender"] .cal-grid:not(.cal-grid-small) .cal-wd {
    font-size: 14px; padding: 8px 0; letter-spacing: 0.8px;
  }
  .view[data-view="kalender"] .cal-grid:not(.cal-grid-small) .cal-cell {
    min-height: 130px;
    padding: 10px 12px 12px;
    font-size: 15px;
    border-radius: 12px;
  }
  .view[data-view="kalender"] .cal-grid:not(.cal-grid-small) .cell-day {
    font-size: 20px;
  }
  .view[data-view="kalender"] .cal-grid:not(.cal-grid-small) .cell-label {
    font-size: 14px;
    -webkit-line-clamp: 4;
    margin-top: 4px;
  }
  .view[data-view="kalender"] .cal-grid:not(.cal-grid-small) .cell-hours {
    font-size: 14px;
  }
  .view[data-view="kalender"] .legend { font-size: 14px; gap: 16px; padding: 14px 0; }
  .view[data-view="kalender"] .legend .dot { width: 12px; height: 12px; }
  .view[data-view="kalender"] #calYearTitle { font-size: 24px; }
  .view[data-view="kalender"] .month-pill { font-size: 14px; padding: 8px 14px; min-height: 36px; }
  .view[data-view="kalender"] .cal-header .btn-sm { font-size: 22px; min-width: 42px; padding: 8px 12px; }
}
/* Form-orientierte Views — schmaler und mittig */
.view[data-view="stempel"],
.view[data-view="fehlzeit"],
.view[data-view="antraege"],
.view[data-view="historie"],
.view[data-view="krankeintrag"],
.view[data-view="zuteilung"],
.view[data-view="settings"],
/* Tabellen-orientierte Views — volle Breite nutzen */
.view[data-view="entries"],
.view[data-view="employees"],
.view[data-view="customers"],
.view[data-view="projects"] { max-width: none; }

/* ========== BRAND ========== */
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--grad-emerald);
  box-shadow: 0 4px 14px var(--primary-glow);
  flex-shrink: 0;
  position: relative;
}
.brand-mark::after {
  content: "E"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #042418; font-weight: 900; font-size: 14px;
}
.brand-text { letter-spacing: 0.2px; }
.brand-sub { color: var(--primary); font-weight: 700; margin-left: 6px; }
.brand.brand-large { font-size: 22px; margin-bottom: 4px; }
.brand.brand-large .brand-mark { width: 38px; height: 38px; }
.brand.brand-large .brand-mark::after { font-size: 18px; }

/* ========== CARDS / TYPO ========== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.25);
}
h1 { font-size: 22px; margin: 0 0 14px; font-weight: 700; }
h2 { font-size: 17px; margin: 0 0 14px; font-weight: 700; color: var(--text); letter-spacing: 0.2px; }
h3 { font-size: 15px; margin: 14px 0 8px; font-weight: 700; color: var(--text-soft); }
h4 { font-size: 13px; margin: 16px 0 8px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

label {
  display: block; font-size: 13px; font-weight: 500; color: var(--muted);
  margin: 20px 0 8px; letter-spacing: 0.2px;
}
label:first-child { margin-top: 0; }
/* Standard-Hinweistext unterhalb eines Inputs — bewusst Luft nach oben + unten */
.field-hint {
  margin: 6px 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; cursor: pointer; }
.checkbox-row input { width: auto; }

/* Layout-Helpers: gleichmaessige Spalten in Formularen.
   Auf Mobile (siehe @media unten) klappen alle auf 1 Spalte um. */
.row   { display: grid; grid-template-columns: 1fr 1fr;     gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Generischer Invalid-Marker fuer einzelne Inputs/Selects (z.B. Stempeluhr Pflichtfelder) */
.input-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.30);
  animation: shake-x 0.32s ease-out;
}
@keyframes shake-x {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* Inline-Field-Errors: rote Umrandung + kleiner Text unter dem Feld */
.field-error {
  font-size: 12px; color: #fca5a5; margin-top: 4px;
  min-height: 14px; line-height: 1.2;
}
.has-error > select,
.has-error > input,
.has-error .datepicker input,
.has-error .we-chip {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239,68,68,0.35);
}
html.light .field-error { color: #b91c1c; }

/* Mitarbeiter-Liste — deutlich groessere Lesbarkeit (Card "Mitarbeiter") */
.card-emp-list h2 { font-size: 28px; margin-bottom: 22px; }
.card-emp-list table { font-size: 18px; }
.card-emp-list table th {
  font-size: 14px;
  letter-spacing: 0.8px;
  padding: 16px 12px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.card-emp-list table td {
  padding: 22px 12px;
  vertical-align: middle;
  font-size: 17px;
}
.card-emp-list table td strong { font-size: 19px; font-weight: 700; }
.card-emp-list table td .muted { font-size: 14px; }
.card-emp-list table .badge { font-size: 14px; padding: 6px 14px; font-weight: 700; }
.card-emp-list table .list-actions button {
  font-size: 14px; padding: 8px 14px; min-height: 36px;
}
.card-emp-list table .list-actions { gap: 8px; }

/* Klappbare Cards (alle Admin-Reiter ausser Dashboard) */
.card.is-collapsible > h2,
.card.is-collapsible > .cal-header > h2 {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card.is-collapsible > h2::after,
.card.is-collapsible > .cal-header > h2::after {
  content: '▾';
  font-size: 0.75em;
  opacity: 0.55;
  display: inline-block;
  transition: transform 0.18s ease;
  margin-left: 4px;
}
.card.is-collapsible.collapsed > h2::after,
.card.is-collapsible.collapsed > .cal-header > h2::after {
  transform: rotate(-90deg);
}
/* Inhalt nach dem h2 / cal-header verstecken wenn collapsed */
.card.is-collapsible.collapsed > h2 ~ *,
.card.is-collapsible.collapsed > .cal-header ~ * { display: none; }
/* Header bei collapsed Card kompakter (kein Margin nach unten) */
.card.is-collapsible.collapsed { padding-bottom: 14px; }
.card.is-collapsible.collapsed > h2,
.card.is-collapsible.collapsed > .cal-header > h2 { margin: 0; }

/* Auto-Stop-Banner: 19:00-Auto-Stops, die der Admin bestaetigen soll */
.auto-stop-banner {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 14px 24px 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(239,68,68,0.18), rgba(239,68,68,0.06));
  border: 1px solid rgba(239,68,68,0.45);
  border-radius: var(--radius-lg);
  color: #fca5a5;
}
html.light .auto-stop-banner { background: rgba(239,68,68,0.10); color: #b91c1c; border-color: rgba(239,68,68,0.30); }
.auto-stop-icon { font-size: 24px; line-height: 1; }
.auto-stop-body { flex: 1; min-width: 0; }
.auto-stop-body strong { font-size: 15px; color: var(--text); }
html.light .auto-stop-body strong { color: #0f172a; }
.auto-stop-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; margin-top: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
}
html.light .auto-stop-row { background: rgba(15,23,42,0.02); }

/* ========== GEBURTSTAGS-BANNER (Dashboard) ========== */
.birthday-banner {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 14px 24px 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(167,139,250,0.10));
  border: 1px solid rgba(251,191,36,0.45);
  border-radius: var(--radius-lg);
  color: #fcd34d;
}
html.light .birthday-banner {
  background: linear-gradient(135deg, rgba(251,191,36,0.14), rgba(167,139,250,0.08));
  color: #92400e; border-color: rgba(251,191,36,0.40);
}
.birthday-icon { font-size: 24px; line-height: 1; }
.birthday-body { flex: 1; min-width: 0; }
.birthday-body strong { font-size: 15px; color: var(--text); }
html.light .birthday-body strong { color: #0f172a; }
.birthday-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; margin-top: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
html.light .birthday-row { background: rgba(15,23,42,0.02); }
.birthday-row .name { color: var(--text); font-weight: 600; }
html.light .birthday-row .name { color: #0f172a; }
.birthday-when-today  { color: #ef4444; font-weight: 700; }
.birthday-when-soon   { color: #f59e0b; font-weight: 600; }
.birthday-when-later  { color: var(--muted); }

/* ========== PROJEKTLEITUNG: TABELLEN -> KARTEN AUF MOBILE ==========
   Auf Desktops normales Tabellen-Layout. Auf Handys (≤640px) wird jede
   Zeile zu einer Karte: Spaltenkoepfe verschwinden, jedes <td> bekommt
   sein Label vor den Wert (data-label-Attribut). */
.pm-table { width: 100%; }
.pm-action-cell { white-space: nowrap; }
@media (max-width: 640px) {
  .pm-table thead { display: none; }
  .pm-table, .pm-table tbody, .pm-table tr, .pm-table td {
    display: block;
    width: 100%;
  }
  .pm-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
  }
  html.light .pm-table tr { background: rgba(15,23,42,0.025); }
  .pm-table td {
    padding: 4px 0;
    border: none;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
    align-items: baseline;
    font-size: 13px;
    overflow: hidden;
  }
  .pm-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  /* Action-Zelle (Buttons) ohne Label, volle Breite, oberhalb klarer Trenner */
  .pm-table td.pm-action-cell {
    grid-template-columns: 1fr;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
  }
  .pm-table td.pm-action-cell::before { content: none; }
  .pm-table td.pm-action-cell button { width: 100%; }
  /* "max-width: 220px" auf Notiz/Begruendung killen, Text darf umbrechen */
  .pm-table td[style*="max-width"] { max-width: none !important; }
}

/* ========== STUNDEN-AENDERUNGS-BANNER (Dashboard) ========== */
.change-req-banner {
  display: flex; gap: 14px; align-items: center;
  margin: 14px 24px 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(59,130,246,0.06));
  border: 1px solid rgba(59,130,246,0.45);
  border-radius: var(--radius-lg);
  color: #93c5fd;
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  width: calc(100% - 48px); font: inherit;
}
.change-req-banner:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,0.18); }
html.light .change-req-banner {
  background: rgba(59,130,246,0.10); color: #1d4ed8; border-color: rgba(59,130,246,0.30);
}
.change-req-icon { font-size: 24px; line-height: 1; }
.change-req-body { flex: 1; min-width: 0; }
.change-req-body strong { font-size: 15px; color: var(--text); }
html.light .change-req-body strong { color: #0f172a; }

/* ========== SWITCH (an/aus) ========== */
.switch { cursor: pointer; }
.switch input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 48px; height: 26px;
  background: var(--card-hover);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  position: relative; cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
  margin: 0; padding: 0;
}
.switch input[type="checkbox"]::before {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: var(--text-soft); border-radius: 50%;
  transition: transform 0.18s, background 0.18s;
}
.switch input[type="checkbox"]:checked {
  background: var(--primary-soft); border-color: var(--primary);
}
.switch input[type="checkbox"]:checked::before {
  transform: translateX(22px);
  background: var(--primary);
}

/* ========== LOGS-TABELLE ========== */
.logs-table { width: 100%; font-size: 13px; }
.logs-table th, .logs-table td { padding: 8px 10px; vertical-align: top; }
.logs-table tbody tr:hover { background: rgba(255,255,255,0.025); }
html.light .logs-table tbody tr:hover { background: rgba(15,23,42,0.025); }
.log-actor {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
}
.log-actor-admin { background: rgba(251,191,36,0.18); color: #fcd34d; border-color: rgba(251,191,36,0.40); }
.log-actor-emp   { background: rgba(16,185,129,0.18); color: var(--primary-hover); border-color: rgba(16,185,129,0.40); }
.log-actor-pub   { background: rgba(148,163,184,0.18); color: var(--muted); border-color: rgba(148,163,184,0.40); }
.log-actor-sys   { background: rgba(167,139,250,0.18); color: #c4b5fd; border-color: rgba(167,139,250,0.40); }
html.light .log-actor-admin { color: #92400e; background: rgba(217,119,6,0.10); border-color: rgba(217,119,6,0.30); }
html.light .log-actor-emp   { color: var(--primary-2); background: rgba(4,120,87,0.10); border-color: rgba(4,120,87,0.30); }
.log-method {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
}
.log-method-get    { color: #93c5fd; border-color: rgba(59,130,246,0.40); background: rgba(59,130,246,0.12); }
.log-method-post   { color: var(--primary-hover); border-color: rgba(16,185,129,0.40); background: rgba(16,185,129,0.12); }
.log-method-put    { color: #fcd34d; border-color: rgba(251,191,36,0.40); background: rgba(251,191,36,0.12); }
.log-method-delete { color: #fca5a5; border-color: rgba(239,68,68,0.40); background: rgba(239,68,68,0.12); }
.log-method-event  { color: #c4b5fd; border-color: rgba(167,139,250,0.40); background: rgba(167,139,250,0.12); }
@media (max-width: 760px) {
  .logs-table { font-size: 12px; }
  .logs-table th, .logs-table td { padding: 6px 6px; }
}

/* Fehlende Stempel-Tage (Erinnerung auf Mitarbeiter-Übersicht) */
.missing-stamps-card {
  border-color: rgba(251,191,36,0.40);
  background: linear-gradient(135deg, rgba(251,191,36,0.08), rgba(251,191,36,0.02));
}
html.light .missing-stamps-card { background: rgba(217,119,6,0.06); border-color: rgba(217,119,6,0.30); }
.missing-stamps-card h2 { color: #fcd34d; }
html.light .missing-stamps-card h2 { color: #92400e; }
.missing-stamp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin-bottom: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.missing-stamp-row:hover { transform: translateX(2px); }
.missing-stamp-row.urgency-soft   { border-left-color: rgba(251,191,36,0.55); }
.missing-stamp-row.urgency-orange { border-left-color: #f97316; background: rgba(249,115,22,0.10); }
.missing-stamp-row.urgency-red    { border-left-color: #ef4444; background: rgba(239,68,68,0.12); }
html.light .missing-stamp-row { background: rgba(15,23,42,0.02); }
html.light .missing-stamp-row.urgency-orange { background: rgba(249,115,22,0.08); }
html.light .missing-stamp-row.urgency-red    { background: rgba(239,68,68,0.08); }

/* Upload-Liste (Mitarbeiter "Fotos nachladen") */
.upload-list { display: flex; flex-direction: column; gap: 10px; }
.upload-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
html.light .upload-item { background: rgba(15,23,42,0.02); }
.upload-thumb {
  display: block; width: 64px; height: 64px; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--border); background: #000;
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-info { min-width: 0; }
.upload-info strong { display: block; }

/* Datepicker: "future"-Zelle leicht abgeblendet, damit klar ist warum sie nicht gewaehlt werden kann */
.dp-cell.future.disabled,
.dp-cell.too-old.disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.dp-cell.too-old.disabled { color: #fca5a5; }

/* ===== Stempeluhr (Live-Punch) ===== */
.punch-card { text-align: left; }
.punch-card h2 { margin-bottom: 12px; }
.btn-punch {
  width: 100%; padding: 18px 24px; font-size: 18px; font-weight: 700;
  border-radius: 12px; cursor: pointer; border: none;
}
.btn-punch-start {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #042418;
  box-shadow: 0 8px 24px var(--primary-glow);
}
.btn-punch-start:hover { transform: translateY(-1px); }
.btn-punch-stop {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 6px 18px rgba(239,68,68,0.30);
}
.punch-running {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 14px;
  background: rgba(16,185,129,0.10);
  border: 1px solid rgba(16,185,129,0.35);
  border-radius: 10px;
  font-size: 14px;
}
.punch-running-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.20);
  animation: punch-pulse 1.6s infinite;
}
@keyframes punch-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(16,185,129,0.40); }
  70%  { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0   rgba(16,185,129,0); }
}
.punch-elapsed {
  margin-left: auto; font-family: monospace; font-size: 22px; font-weight: 700;
  letter-spacing: 0.6px; color: var(--primary-hover);
}
html.light .punch-running { background: rgba(4,120,87,0.08); }

/* Deadline-Tags (Projektliste + Dashboard) */
.deadline-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 6px;
  border: 1px solid transparent;
}
.deadline-ok      { background: rgba(148,163,184,0.15); color: var(--muted-2); border-color: var(--border); }
.deadline-urgent  { background: rgba(251,191,36,0.18); color: #fcd34d; border-color: rgba(251,191,36,0.40); }
.deadline-overdue { background: rgba(239,68,68,0.18);  color: #fca5a5; border-color: rgba(239,68,68,0.40); }
html.light .deadline-ok      { color: #475569; background: rgba(148,163,184,0.20); }
html.light .deadline-urgent  { color: #92400e; background: rgba(217,119,6,0.10); border-color: rgba(217,119,6,0.30); }
html.light .deadline-overdue { color: #b91c1c; background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.30); }

/* ========== ADMIN DASHBOARD ========== */
/* Volle Viewport-Hoehe, ein einziger Bildschirm — keine Page-Scrolls.
   Inhalte scrollen intern wenn sie zu lang werden.
   ID-Selektor #adminDashboard gewinnt gegen die spaetere employee-Dashboard-Regel
   (.view[data-view="dashboard"] { max-width: 880px; ... }). */
#adminDashboard {
  max-width: none !important; margin: 0 !important;
  height: calc(100dvh - 92px);
  padding: 16px 24px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  /* Today + absent kompakt oben, Strip + Projects bekommen den groeszeren Anteil */
  grid-template-rows: auto minmax(0, 0.4fr) minmax(0, 1.7fr);
  grid-template-areas:
    "stats   stats"
    "today   absent"
    "strip   projects";
  gap: 14px;
  min-height: 0;
  text-align: left;
}
/* Card-Texte wieder linksbuendig (employee-Dashboard zentriert sie per Default) */
#adminDashboard .card,
#adminDashboard .card h2 { text-align: left; }
.dashboard-stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.dashboard-stats .stat-card { padding: 14px 18px; margin: 0; }
/* Klickbare KPI-Karte (Button-Variante) */
.stat-card.stat-card-link {
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  display: block;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.stat-card.stat-card-link:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(16,185,129,0.15);
}
.dashboard-stats .stat-label { font-size: 10px; }
.dashboard-stats .stat-value { font-size: 26px; margin: 6px 0 4px; }
.dashboard-stats .stat-sub { font-size: 11px; }

.dash-card-today    { grid-area: today;    }
.dash-card-absent   { grid-area: absent;   }
.dash-card-strip    { grid-area: strip;    }
.dash-card-projects { grid-area: projects; }

.dash-card-today,
.dash-card-absent,
.dash-card-strip,
.dash-card-projects {
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  padding: 14px 18px;
  overflow: hidden;
}
.dash-card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 10px;
}
.dash-card-head h2 { margin: 0; font-size: 18px; }
.dash-card-body { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
.dash-card-body::-webkit-scrollbar { width: 8px; }
.dash-card-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* Aktive Projekte — kompakte vertikale Liste statt Grid (passt in schmale Spalte) */
.dash-projects {
  display: flex; flex-direction: column; gap: 8px;
}
.dash-proj-card {
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.dash-proj-card-main { min-width: 0; flex: 1; }
.dash-proj-card-main strong { display: block; font-size: 14px; }
.dash-proj-card-main .muted { font-size: 11px; }
/* Aktive-Projekte-Card: gruppiert nach Kunde, eine Card pro Kunde mit Projekt-Liste */
.dash-proj-card-grouped {
  display: block; flex-direction: initial;
  padding: 12px 14px;
}
.dash-proj-card-customer {
  font-size: 13px; font-weight: 700; letter-spacing: 0.2px;
  color: var(--text);
  padding-bottom: 8px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.dash-proj-list { list-style: none; padding: 0; margin: 0; }
.dash-proj-list-item {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.dash-proj-list-item:last-child { border-bottom: none; padding-bottom: 0; }
.dash-proj-list-main strong { display: inline; font-size: 13px; }
.dash-proj-card-meta { flex-shrink: 0; text-align: right; font-size: 11px; }
html.light .dash-proj-card { background: rgba(15,23,42,0.02); }

@media (max-width: 1100px) {
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  #adminDashboard {
    height: auto !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto auto auto !important;
    grid-template-areas: "stats" "today" "absent" "projects" "strip" !important;
  }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  /* Default-Min-Hoehe fuer alle Cards */
  .dash-card-today, .dash-card-strip { min-height: 240px; max-height: 50vh; }
  /* abwesend kleiner: nur so viel wie der Inhalt braucht (oft empty state) */
  .dash-card-absent { min-height: 0; max-height: 40vh; }
  /* projects groesser: mehr Platz fuer alle Kunden-Gruppen */
  .dash-card-projects { min-height: 320px; max-height: 70vh; }
}

/* 7-Tage-Strip im Dashboard — sauberer Card-Look mit gerundeten Chips */
.dash-strip-scroll { overflow-x: auto; height: 100%; padding: 4px; }
table.dash-strip {
  border-collapse: separate;
  border-spacing: 8px 8px;
  width: 100%; min-width: 720px;
  table-layout: fixed;
}
table.dash-strip th, table.dash-strip td {
  border: none; padding: 0; vertical-align: middle;
}

/* Header (Wochentag + Datum) als Pill */
table.dash-strip thead th {
  font-weight: 700; text-align: center; font-size: 12px;
  color: var(--muted); letter-spacing: 0.4px;
  padding: 14px 0;
  border-radius: 12px;
}
table.dash-strip thead th.is-today {
  background: linear-gradient(135deg, rgba(16,185,129,0.20), rgba(16,185,129,0.06));
  color: var(--primary-hover);
}
table.dash-strip thead th.is-weekend { color: var(--muted-2); opacity: 0.75; }
table.dash-strip thead th.is-holiday {
  background: repeating-linear-gradient(45deg, rgba(167,139,250,0.16) 0 6px, rgba(167,139,250,0.05) 6px 12px);
  color: #c4b5fd;
}

/* Mitarbeiter-Spalte: clean, ohne Background */
table.dash-strip th.ds-name, table.dash-strip td.ds-name {
  text-align: left; width: 170px; min-width: 150px;
  font-size: 14px; padding: 10px 14px 10px 6px;
  color: var(--text);
}
.ds-wd  { font-size: 11px; opacity: 0.75; line-height: 1; text-transform: uppercase; }
.ds-num { font-size: 16px; font-weight: 700; line-height: 1.4; margin-top: 4px; }

/* Body-Zellen: weiche, gerundete Chips */
.ds-cell {
  font-size: 12px; line-height: 1.2; height: 64px;
  padding: 8px 10px !important;
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
html.light .ds-cell { background: rgba(15,23,42,0.025); border-color: rgba(15,23,42,0.04); }

/* Today-Spalte: zarter grüner Wash */
.ds-cell.col-today {
  background: rgba(16,185,129,0.06);
  border-color: rgba(16,185,129,0.18);
}
html.light .ds-cell.col-today {
  background: rgba(4,120,87,0.06);
  border-color: rgba(4,120,87,0.20);
}

/* Wochenend-Spalte: zarte Strichelung */
.ds-cell.col-weekend {
  background: transparent;
  border-style: dashed;
  border-color: rgba(255,255,255,0.06);
  opacity: 0.85;
}
html.light .ds-cell.col-weekend { border-color: rgba(15,23,42,0.06); }

/* Hover (klickbare Zelle) */
.ds-cell-clickable { cursor: pointer; }
.ds-cell-clickable:hover {
  background: rgba(16,185,129,0.10);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16,185,129,0.15);
}
html.light .ds-cell-clickable:hover {
  background: rgba(4,120,87,0.08);
  box-shadow: 0 4px 12px rgba(4,120,87,0.10);
}

.ds-cell .ds-label {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word; font-weight: 600;
}

/* Belegte Zellen: kraeftige farbige Chips */
.ds-cell.cell-assigned {
  background: linear-gradient(135deg, rgba(16,185,129,0.22), rgba(16,185,129,0.08));
  border-color: rgba(16,185,129,0.40);
  color: var(--primary-hover);
}
.ds-cell.cell-urlaub      { background: rgba(251,191,36,0.20); color: #fcd34d; border-color: rgba(251,191,36,0.45); }
.ds-cell.cell-krank       { background: rgba(239,68,68,0.20); color: #fca5a5; border-color: rgba(239,68,68,0.45); }
.ds-cell.cell-dienstreise { background: rgba(59,130,246,0.20); color: #93c5fd; border-color: rgba(59,130,246,0.45); }
.ds-cell.cell-schulung    { background: rgba(167,139,250,0.20); color: #c4b5fd; border-color: rgba(167,139,250,0.45); }
.ds-cell.cell-pending     {
  background: repeating-linear-gradient(45deg, rgba(251,191,36,0.22) 0 6px, rgba(251,191,36,0.06) 6px 12px);
  color: #fcd34d; border-color: rgba(251,191,36,0.45);
}
.ds-cell.is-holiday {
  background: repeating-linear-gradient(45deg, rgba(167,139,250,0.18) 0 6px, rgba(167,139,250,0.06) 6px 12px);
  color: #c4b5fd; border-color: rgba(167,139,250,0.40);
  font-weight: 600;
}

/* Row-Hover hebt den Mitarbeiter-Namen leicht hervor */
table.dash-strip tbody tr:hover td.ds-name { color: var(--primary-hover); }

html.light .ds-cell.cell-assigned    { background: rgba(4,120,87,0.10); color: var(--primary-2); border-color: rgba(4,120,87,0.30); }
html.light .ds-cell.cell-urlaub      { color: #92400e; background: rgba(217,119,6,0.10); border-color: rgba(217,119,6,0.30); }
html.light .ds-cell.cell-krank       { color: #b91c1c; background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.30); }
html.light .ds-cell.cell-dienstreise { color: #1d4ed8; background: rgba(59,130,246,0.10); border-color: rgba(59,130,246,0.30); }
html.light .ds-cell.cell-schulung    { color: #6d28d9; background: rgba(167,139,250,0.10); border-color: rgba(167,139,250,0.30); }

/* Quick-Hours-Picker (Stunden pro Tag in der Zuteilung) */
.quick-hours {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 6px;
}
.quick-hours button {
  padding: 4px 10px; margin: 0;
  font-size: 12px; font-weight: 600; line-height: 1.4;
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer; box-shadow: none;
  width: auto; min-width: 0;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.quick-hours button:hover {
  border-color: var(--primary); color: var(--primary-hover);
}
.quick-hours button.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
}
.quick-hours button.quick-hours-clear { color: var(--muted); }
.quick-hours button.quick-hours-clear:hover { color: #fca5a5; border-color: #fca5a5; }
html.light .quick-hours button { background: rgba(15,23,42,0.03); }
html.light .quick-hours button.active { background: rgba(4,120,87,0.10); color: var(--primary-2); }

/* Werktage/Wochenende-Filter: Checkbox + Chip-Picker für Sa/So */
.day-filter {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  padding: 8px 10px; margin-top: 4px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.day-filter .checkbox-row { margin-top: 0; }
html.light .day-filter { background: rgba(15,23,42,0.02); }

.weekend-chip-block { margin-top: 10px; }
.weekend-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 32px;
}
.weekend-chips .we-chip {
  width: auto; min-width: 0; padding: 6px 10px; margin: 0;
  font-size: 13px; font-weight: 600; line-height: 1;
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer; box-shadow: none;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.weekend-chips .we-chip:hover {
  border-color: var(--primary);
  color: var(--primary-hover);
}
.weekend-chips .we-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
html.light .weekend-chips .we-chip { background: rgba(15,23,42,0.03); }
html.light .weekend-chips .we-chip.active {
  background: rgba(4,120,87,0.10); color: var(--primary-2); border-color: var(--primary-2);
  box-shadow: 0 0 0 1px var(--primary-2) inset;
}

.checklist {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 220px; overflow-y: auto;
  padding: 8px 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.checklist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
  font-size: 14px; color: var(--text);
  cursor: pointer;
  margin: 0;
}
.checklist-item input { width: auto; }
.checklist-item:hover { background: var(--card-hover); border-radius: 6px; }

input, select, textarea {
  width: 100%; padding: 14px 14px; margin-bottom: 4px;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 16px; font-family: inherit; line-height: 1.3;
  appearance: none; -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="checkbox"] { margin-bottom: 0; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
input[type="date"], input[type="time"] { min-height: 50px; }
input[type="checkbox"] {
  width: 20px; height: 20px; min-height: auto; padding: 0;
  appearance: auto; -webkit-appearance: auto;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat; background-position: right 16px center;
  padding-right: 38px;
}
textarea { min-height: 70px; resize: vertical; }
::placeholder { color: var(--muted-2); }

/* ========== BUTTONS ========== */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 50px; padding: 14px 18px;
  background: var(--grad-emerald);
  color: var(--btn-primary-color); border: none; border-radius: var(--radius);
  font-size: 16px; font-weight: 700; letter-spacing: 0.2px;
  cursor: pointer; margin-top: 18px; text-decoration: none; text-align: center;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: transform 0.05s, box-shadow 0.15s;
  -webkit-user-select: none; user-select: none;
}
button:active, .btn:active { transform: translateY(1px); box-shadow: 0 2px 8px var(--primary-glow); }
button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-secondary {
  background: var(--card-hover); color: var(--text);
  border: 1px solid var(--border-2); box-shadow: none;
}
.btn-secondary:active { background: var(--border); }
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff; box-shadow: 0 4px 14px rgba(239,68,68,0.30);
}
.btn-sm {
  padding: 8px 12px; font-size: 13px; width: auto;
  margin: 0; min-height: 36px; border-radius: 8px; font-weight: 600;
}

/* ========== MESSAGES / BADGES ========== */
.msg {
  padding: 12px 14px; border-radius: var(--radius);
  margin-top: 14px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
}
.msg.error   { background: var(--danger-soft);  color: #fca5a5; border-color: rgba(239,68,68,0.25); }
.msg.success { background: var(--primary-soft); color: #6ee7b7; border-color: rgba(16,185,129,0.30); }

.badge {
  display: inline-block;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: middle;
}
.badge-ok      { background: var(--primary-soft); color: var(--primary-hover); }
.badge-bad     { background: var(--danger-soft);  color: #fca5a5; }
.badge-pending { background: var(--amber-soft);   color: var(--amber); }

.tag {
  display: inline-block;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--card-hover); color: var(--text-soft);
  border: 1px solid var(--border-2);
}
.tag-urlaub      { background: rgba(251,191,36,0.15); color: #fcd34d; border-color: rgba(251,191,36,0.30); }
.tag-krank       { background: var(--danger-soft);    color: #fca5a5; border-color: rgba(239,68,68,0.30); }
.tag-dienstreise { background: var(--info-soft);      color: #93c5fd; border-color: rgba(59,130,246,0.30); }
.tag-schulung    { background: var(--purple-soft);    color: #c4b5fd; border-color: rgba(167,139,250,0.30); }
.tag-sonstiges   { background: var(--card-hover);     color: var(--text-soft); }
.tag-assigned    { background: var(--primary-soft);   color: var(--primary-hover); border-color: rgba(16,185,129,0.30); }

/* ========== STAT CARDS (Dashboard) ========== */
.grid-2 {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin-bottom: 16px;
}
.emoji-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  margin: 8px 0 12px;
}
.emoji-picker button {
  width: 100%; aspect-ratio: 1 / 1;
  padding: 0; margin: 0;
  font-size: 22px; line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", "EmojiOne Color", "Android Emoji", emoji;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
  box-shadow: none;
}
.emoji-picker button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}
.emoji-picker button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px var(--primary) inset;
}
.emoji-picker button.clear {
  font-family: inherit;
  font-size: 14px; color: var(--muted);
}
.emoji-picker button.clear:hover {
  color: #fca5a5; border-color: #fca5a5; background: rgba(239,68,68,0.10);
}
html.light .emoji-picker button { background: rgba(15,23,42,0.03); }
html.light .emoji-picker button.active {
  background: rgba(4,120,87,0.10);
  box-shadow: 0 0 0 2px var(--primary-2) inset;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 18px 20px;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.20);
  text-align: center;
}
.stat-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; width: auto;
  background: var(--border-2);
}
.stat-card-primary::before { background: var(--grad-emerald); box-shadow: 0 0 12px var(--primary-glow); }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.stat-value { font-size: 30px; font-weight: 800; margin: 10px 0 6px; color: var(--text); letter-spacing: -0.5px; line-height: 1.1; }
.stat-value.pos { color: var(--primary-hover); }
.stat-value.neg { color: #fca5a5; }
.stat-value-sm  { font-size: 20px; }
.stat-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Mitarbeiter-Dashboard (employee Übersicht) — Card-Look zentriert per Default,
   ABER der ID-spezifische Override #empDashboard unten gewinnt fuer Full-Width-Layout. */
.view[data-view="dashboard"] {
  max-width: 880px; margin: 0 auto;
}
.view[data-view="dashboard"] .card { text-align: center; }
.view[data-view="dashboard"] .card h2 { text-align: center; }

/* Mitarbeiter-Dashboard: volle Breite + 2-Spalten-Flex-Layout. Linke Spalte stapelt
   Stempeluhr + Erinnerung + KPI-Stats. Rechte Spalte ist Naechste-Tage als ganzer Block. */
#empDashboard {
  max-width: none !important; margin: 0 !important;
  padding: 16px 24px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;     /* Karten haben ihre natuerliche Hoehe — keine Stretch-Quetscherei */
}
#empDashboard .emp-left {
  flex: 1.7 1 0;
  display: flex; flex-direction: column;
  gap: 14px;
  min-width: 0;
}
#empDashboard #nextDaysCard {
  flex: 1 1 0;
  min-width: 0;
  /* keine align-self: stretch + keine fixe Hoehe — die Card sitzt einfach oben rechts in
     Hoehe ihres Inhalts. Falls die Liste mal sehr lang wird, scrollt die Seite normal. */
}
/* Linksbuendige Karten (statt zentriert vom Default-Employee-Style) */
#empDashboard .card,
#empDashboard .card h2 { text-align: left; }
#empDashboard .punch-card { text-align: left; }
#empDashboard .stat-card { text-align: left; }
#empDashboard .stat-card-link { text-align: left; }
#empDashboard .grid-2 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 0;
}
#empDashboard .grid-2 .stat-card { padding: 22px 24px; }
#empDashboard .grid-2 .stat-value { font-size: 32px; margin: 10px 0 6px; }
#empDashboard .grid-2 .stat-sub   { font-size: 12px; }
#empDashboard .grid-2 .stat-value-sm { font-size: 20px; }

/* Stempeluhr-Card kompakter — Default-Padding ist zu opulent fuer einfache Action */
#empDashboard .punch-card { padding: 16px 20px; }
#empDashboard .punch-card h2 { margin: 0 0 10px; font-size: 16px; }
#empDashboard .punch-card #punchIdle p.muted { display: none; }   /* Idle: Erklaerungs-Satz weg */
#empDashboard .btn-punch { padding: 12px 18px; font-size: 16px; }

/* Naechste Tage: groessere Rows, volle Breite ausnutzen.
   Flex statt Grid, damit Wochentag + Datum garantiert nebeneinander passen
   und der Trenn-Abstand zum Body stabil ist (vorher: Grid-Spalte 80px war
   zu knapp fuer "Mo 11.05.2026", lief in die naechste Spalte). */
#empDashboard #nextDaysCard { padding: 18px 22px; }
#empDashboard #nextDaysCard .day-row {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: none;
  margin: 0;
  padding: 14px 6px;
  grid-template-columns: unset;
}
#empDashboard #nextDaysCard .day-row-date {
  flex: 0 0 130px;
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
  white-space: nowrap;
}
#empDashboard #nextDaysCard .day-row-date strong {
  flex: 0 0 24px;
  color: var(--text);
  letter-spacing: 0.02em;
}
#empDashboard #nextDaysCard .day-row-body {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
}
#empDashboard #nextDaysCard h2 { margin-bottom: 6px; }
/* Heute-Reihe leicht hervorheben (erste Zeile = heute) */
#empDashboard #nextDaysCard .day-row:first-child {
  background: var(--primary-soft);
  border-radius: 8px;
  padding-left: 12px; padding-right: 12px;
}
#empDashboard #nextDaysCard .day-row:first-child .day-row-date strong {
  color: var(--primary-hover);
}

/* Fehlende-Stunden-Card etwas mehr Atem */
#empDashboard .missing-stamps-card { padding: 18px 22px; }
#empDashboard .missing-stamps-card h2 { margin: 0 0 4px; }
#empDashboard .missing-stamp-row { padding: 12px 16px; }

/* Auf engem Viewport (<1100px) wieder 1-Spalten-Layout */
@media (max-width: 1100px) {
  /* Wenn die Karten gestapelt sind, sollen sie die volle Breite einnehmen — sonst
     bleiben sie wegen `align-items: flex-start` auf Inhalts-Breite. */
  #empDashboard {
    flex-direction: column;
    align-items: stretch;
  }
  #empDashboard .emp-left,
  #empDashboard #nextDaysCard {
    flex: none;          /* width voll, Hoehe wachst mit Inhalt */
    width: 100%;
    max-height: none;
    overflow: visible;
  }
  /* Auf schmalerem Viewport: Stats nicht mehr in 3 starren Spalten — auto-fit hilft */
  #empDashboard .grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  }
}
@media (max-width: 760px) {
  /* Tablets / grosze Phones: 2 Karten pro Reihe, etwas kompaktere Stat-Cards */
  #empDashboard { padding: 12px 14px; }
  #empDashboard .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
  #empDashboard .grid-2 .stat-card { padding: 14px 16px; }
  #empDashboard .grid-2 .stat-value { font-size: 24px; margin: 6px 0 4px; }
  #empDashboard .grid-2 .stat-sub { font-size: 11px; }
  #empDashboard .grid-2 .stat-value-sm { font-size: 16px; }
}
@media (max-width: 460px) {
  /* Kleine Phones: einspaltig, alle Karten gut lesbar */
  #empDashboard .grid-2 {
    grid-template-columns: 1fr !important;
  }
}

.day-row {
  display: grid; grid-template-columns: 100px 1fr; gap: 14px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  align-items: center;
  text-align: left;
  max-width: 540px; margin: 0 auto;
}
.day-row:last-child { border-bottom: none; }
.day-row-date { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }

/* ========== HISTORY ENTRY ========== */
.entry {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.entry:first-child { padding-top: 4px; }
.entry:last-child  { border-bottom: none; padding-bottom: 4px; }
.entry-info { flex: 1; min-width: 0; }
.entry-date { font-weight: 700; font-size: 15px; color: var(--text); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.entry-date .hours {
  display: inline-block; padding: 2px 9px;
  background: var(--primary-soft); color: var(--primary-hover);
  border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.3px;
  border: 1px solid rgba(16,185,129,0.25);
}
.entry-meta { font-size: 13px; color: var(--muted); margin-top: 5px; }
.entry-note { font-size: 13px; color: var(--text-soft); margin-top: 6px; }

/* ========== TABLES ========== */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 22px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding-top: 14px; padding-bottom: 14px; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; align-items: end; }
.toolbar > div { flex: 1; min-width: 130px; }
.toolbar label { margin-top: 0; }

.list-actions { display: flex; gap: 10px; row-gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.totals {
  margin-top: 14px; padding: 12px 14px;
  background: var(--primary-soft);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius);
  font-size: 14px; color: var(--text-soft);
}
.totals strong { color: var(--primary-hover); font-size: 16px; }

.info-box {
  margin-top: 12px; padding: 10px 12px;
  background: rgba(59,130,246,0.10);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--radius);
  font-size: 14px; color: #93c5fd;
}
.info-box strong { color: #fff; }

.muted { color: var(--muted); font-size: 14px; }
.hidden { display: none !important; }
.link-muted { color: var(--muted); text-decoration: none; }
.link-muted:hover { color: var(--primary-hover); }

/* ========== KALENDER ========== */
.cal-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.cal-header .btn-sm { min-width: 36px; padding: 6px 10px; font-size: 18px; line-height: 1; }

.month-strip {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
  padding-bottom: 6px;
}
.month-pill {
  padding: 6px 12px; min-height: 32px;
  background: transparent; border: 1px solid var(--border-2); color: var(--muted-2);
  border-radius: 8px; font-size: 13px; font-weight: 600;
  width: auto; margin: 0; cursor: pointer; box-shadow: none;
}
.month-pill.active {
  background: var(--primary-soft); color: var(--primary-hover);
  border-color: rgba(16,185,129,0.40);
}

.legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
  padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot-work     { background: rgba(16,185,129,0.55); }
.dot-vacation { background: rgba(251,191,36,0.55); }
.dot-sick     { background: rgba(239,68,68,0.55); }
.dot-trip     { background: rgba(59,130,246,0.55); }
.dot-training { background: rgba(167,139,250,0.55); }
.dot-pending  { background: repeating-linear-gradient(45deg, rgba(251,191,36,0.55) 0 3px, rgba(251,191,36,0.20) 3px 6px); }
.dot-assigned { background: var(--primary); box-shadow: 0 0 6px var(--primary-glow); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-wd {
  text-align: center; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700;
  padding: 4px 0;
}
.cal-cell {
  position: relative;
  min-height: 86px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px 8px;
  font-size: 13px; color: var(--text-soft);
  cursor: pointer;
  transition: transform 0.08s, border-color 0.15s, background 0.15s;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
}
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell:hover:not(.empty) { border-color: var(--border-2); }
.cal-cell.is-today {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft) inset;
}
.cal-cell.cell-weekend { background: rgba(255,255,255,0.015); color: var(--muted-2); }
.cal-cell.cell-work {
  background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(16,185,129,0.06));
  border-color: rgba(16,185,129,0.30);
  color: var(--primary-hover);
}
.cal-cell.cell-urlaub      { background: rgba(251,191,36,0.18); border-color: rgba(251,191,36,0.40); color: #fcd34d; }
.cal-cell.cell-krank       { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.40); color: #fca5a5; }
.cal-cell.cell-dienstreise { background: rgba(59,130,246,0.18); border-color: rgba(59,130,246,0.40); color: #93c5fd; }
.cal-cell.cell-schulung    { background: rgba(167,139,250,0.18); border-color: rgba(167,139,250,0.40); color: #c4b5fd; }
.cal-cell.cell-sonstiges   { background: rgba(148,163,184,0.18); border-color: rgba(148,163,184,0.40); }
.cal-cell.cell-pending     {
  background:
    repeating-linear-gradient(45deg, rgba(251,191,36,0.20) 0 6px, rgba(251,191,36,0.06) 6px 12px);
  border-color: rgba(251,191,36,0.40); color: #fcd34d;
}
.cal-cell.cell-assigned {
  background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(16,185,129,0.06));
  border-color: rgba(16,185,129,0.30);
  color: var(--primary-hover);
}
html.light .cal-cell.cell-assigned {
  background: rgba(4,120,87,0.10); border-color: rgba(4,120,87,0.30); color: var(--primary-2);
}
.cell-day { font-weight: 700; font-size: 14px; color: inherit; line-height: 1; }
.cell-label {
  font-size: 11px; font-weight: 600; line-height: 1.2;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  opacity: 0.95;
}
.cell-hours {
  margin-top: auto;
  font-size: 11px; font-weight: 700; opacity: 0.85;
  align-self: flex-end;
}

/* Wochenansicht: 7 grosse Zellen nebeneinander, mehrere Eintraege pro Tag sichtbar */
.cal-grid-week { gap: 8px; }
.cal-grid-week .cal-wd-week {
  font-size: 14px; padding: 10px 4px;
  text-align: left;
  text-transform: none; letter-spacing: 0;
}
.cal-grid-week .cal-wd-week strong { font-size: 16px; color: var(--text); }
.cal-cell-week {
  min-height: 220px;
  padding: 12px 14px 14px;
  font-size: 14px;
  border-radius: 14px;
  align-items: stretch;
}
.cal-cell-week .cell-day { font-size: 22px; margin-bottom: 4px; }
.cal-cell-week .cell-label { font-size: 13px; -webkit-line-clamp: 2; }
.cal-cell-week .cell-entries {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 6px;
  flex: 1; min-height: 0;
  overflow: hidden;
}
.cal-cell-week .cell-entry-row {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 12px; line-height: 1.25;
  padding: 4px 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}
html.light .cal-cell-week .cell-entry-row { background: rgba(15,23,42,0.04); }
.cal-cell-week .cell-entry-time { font-weight: 700; }
.cal-cell-week .cell-entry-proj {
  font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-cell-week .cell-hours {
  font-size: 14px; margin-top: 4px;
}
@media (max-width: 760px) {
  /* Auf Mobile: Wochen-Zellen vertikal stapeln statt 7 Spalten quetschen */
  .cal-grid-week { grid-template-columns: 1fr; gap: 6px; }
  .cal-grid-week .cal-wd-week { display: none; }
  .cal-cell-week {
    min-height: 0;
    padding: 10px 12px 12px;
  }
  .cal-cell-week .cell-day { font-size: 18px; }
}

.cal-grid-small { gap: 2px; }
.cal-grid-small .cal-wd { font-size: 9px; padding: 2px 0; }
.cal-grid-small .cal-cell {
  padding: 2px; font-size: 10px; border-radius: 4px;
  min-height: 0; aspect-ratio: 1 / 1;
}
.cal-grid-small .cell-day { font-size: 10px; }
.cal-grid-small .cell-hours,
.cal-grid-small .cell-label { display: none; }

.year-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.year-month h3 { margin: 0 0 6px; font-size: 13px; color: var(--text-soft); text-align: center; }

/* ========== MODAL ========== */
.modal {
  position: fixed; inset: 0;
  background: rgba(2,6,23,0.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-card {
  background: var(--card-solid);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  max-height: 88dvh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.modal-card-wide { max-width: 920px; }
.modal-card-xl   { max-width: min(1280px, 95vw); max-height: 92dvh; }
.modal.modal-top { z-index: 200; }   /* für Sub-Modale über bestehenden Modalen */
.modal-row-flex {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modal-row-flex > div:first-child { flex: 1; min-width: 0; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; color: var(--text); text-transform: none; letter-spacing: 0; }
.modal-close {
  width: 36px; min-height: 36px; padding: 0;
  background: transparent; border: 1px solid var(--border-2); border-radius: 10px;
  color: var(--muted); font-size: 22px; line-height: 1;
  margin: 0; box-shadow: none;
}
.modal-body { padding: 16px 18px; }

/* Empty-State innerhalb von Modalen — schön mittig + großzügig */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  text-align: center;
}
.empty-state-icon {
  font-size: 36px;
  opacity: 0.7;
  filter: grayscale(0.2);
}

/* Day-Detail-Modal etwas großzügiger und immer mittig */
#empCalDayModal .modal-card,
#dayModal .modal-card {
  max-width: 520px;
  min-width: min(420px, calc(100vw - 32px));
}
#empCalDayModal .modal-head,
#dayModal .modal-head {
  padding: 18px 22px;
}
#empCalDayBody,
#dayModalBody {
  padding: 18px 22px;
}
.modal-row { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.modal-row:last-child { border-bottom: none; }

/* ========== PIN-FELD ========== */
input[type="password"][inputmode="numeric"] {
  letter-spacing: 0.5em; text-align: center; font-size: 22px;
  padding: 16px 14px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablet */
@media (max-width: 960px) {
  :root { --sidebar-w: 220px; }
}

/* Phone */
@media (max-width: 760px) {
  .sidebar { width: min(86vw, 320px); }
  .view { padding: 14px 14px; }
  .topbar { padding: 12px 14px; padding-top: calc(12px + var(--safe-top)); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 22px; }
  .row, .row-3 { grid-template-columns: 1fr; gap: 8px; }
  table { font-size: 13px; }
  th, td { padding: 8px 4px; }
  .day-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 14px;
    max-width: none;
  }
  .day-row-date { font-size: 13px; gap: 10px; }
  .day-row-body { padding-left: 28px; line-height: 1.4; }
  /* Naechste Tage (Mitarbeiter-Dashboard) auf Mobile stapeln statt Inline */
  #empDashboard #nextDaysCard .day-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 12px;
  }
  #empDashboard #nextDaysCard .day-row-date { flex: 0 0 auto; }
  #empDashboard #nextDaysCard .day-row-body  { padding-left: 34px; }
  .cal-grid { gap: 4px; }
  .cal-cell { font-size: 11px; padding: 6px 5px; min-height: 70px; }
  .cell-day { font-size: 12px; }
  .cell-label { font-size: 10px; -webkit-line-clamp: 2; margin-top: 3px; }
  .cell-hours { font-size: 9px; }
  .legend { font-size: 11px; gap: 10px; }
  /* Mitarbeiter-Kalender Header auf Mobile groesser (Cells bleiben kompakt) */
  .view[data-view="kalender"] #calYearTitle { font-size: 22px; }
  .view[data-view="kalender"] .cal-header .btn-sm { font-size: 22px; min-width: 44px; padding: 8px 12px; }
  .view[data-view="kalender"] .month-strip { gap: 8px; margin-bottom: 14px; }
  .view[data-view="kalender"] .month-pill {
    font-size: 16px; padding: 10px 14px; min-height: 42px;
    font-weight: 600;
  }
  .view[data-view="kalender"] .legend {
    font-size: 14px; gap: 14px; padding: 12px 0;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  }
  .view[data-view="kalender"] .legend .dot { width: 12px; height: 12px; }
  .toolbar > div { flex: 1 1 100%; }
  .year-grid { grid-template-columns: 1fr; }
}

/* Sehr klein: 1-Spalten Stat-Cards */
@media (max-width: 420px) {
  .grid-2 { grid-template-columns: 1fr; }
  .day-row { padding: 12px 12px; }
  .day-row-body { padding-left: 24px; }
  .cal-cell { padding: 5px 4px; min-height: 64px; }
}

/* ========== EMB-LOGO ========== */
.logo-wrap {
  display: flex; align-items: center;
  height: 38px;
  position: relative;
}
.logo-wrap-large { height: 64px; margin-bottom: 4px; }
.logo {
  height: 100%; width: auto; max-width: 100%;
  object-fit: contain;
  display: none;
}
.logo-on-dark  { display: var(--logo-dark-display); }
.logo-on-light { display: var(--logo-light-display); }

/* ========== THEME-TOGGLE ========== */
.theme-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 40px; padding: 8px 14px;
  margin: 0 0 12px;
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 13px; font-weight: 500;
  cursor: pointer; box-shadow: none;
}
.theme-toggle:active { background: var(--card-hover); }
.theme-toggle-icon { font-size: 16px; }

/* ========== INFO-BOX VARIANTEN ========== */
.info-box-amber {
  background: rgba(217,119,6,0.12);
  border-color: rgba(217,119,6,0.30);
  color: #fcd34d;
}
.info-box-amber strong { color: #fde68a; }
html.light .info-box-amber strong { color: #78350f; }

/* ========== TAG: HOLIDAY ========== */
.tag-holiday {
  background: rgba(167,139,250,0.18);
  color: #c4b5fd;
  border-color: rgba(167,139,250,0.35);
}

/* ========== KALENDER: FEIERTAG ========== */
.cal-cell.cell-holiday {
  background: repeating-linear-gradient(45deg, rgba(167,139,250,0.18) 0 6px, rgba(167,139,250,0.05) 6px 12px);
  border-color: rgba(167,139,250,0.35);
  color: #c4b5fd;
}
.dot-holiday {
  background: repeating-linear-gradient(45deg, rgba(167,139,250,0.55) 0 3px, rgba(167,139,250,0.20) 3px 6px);
}

/* ========== CUSTOM DATEPICKER ========== */
.datepicker { position: relative; }
.datepicker input[readonly] { cursor: pointer; padding-right: 50px; }
.datepicker-toggle {
  position: absolute; right: 4px; top: 4px; bottom: 4px;
  width: 44px; min-height: auto; padding: 0; margin: 0;
  background: transparent; color: var(--muted);
  border: none; border-radius: 8px;
  font-size: 18px; cursor: pointer; box-shadow: none;
}
.datepicker-toggle:active { background: var(--card-hover); }
.datepicker-pop {
  position: absolute; top: calc(100% + 6px); left: 0;
  z-index: 60;
  width: min(320px, calc(100vw - 28px));
  background: var(--card-solid);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  padding: 12px;
}
.dp-head {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 10px;
}
.dp-title {
  flex: 1; text-align: center;
  font-weight: 700; font-size: 14px; color: var(--text);
}
.dp-nav {
  width: 30px; min-height: 30px; padding: 0; margin: 0;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border-2); border-radius: 6px;
  font-size: 14px; line-height: 1;
  box-shadow: none;
}
.dp-nav:active { background: var(--card-hover); }
.dp-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.dp-wd {
  text-align: center; font-size: 10px;
  color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 0;
}
.dp-cell {
  width: 100%; aspect-ratio: 1 / 1; min-height: 32px;
  padding: 0; margin: 0;
  background: transparent; border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-soft); font-size: 13px; font-weight: 500;
  cursor: pointer; box-shadow: none;
}
.dp-cell:hover:not(.empty) { background: var(--card-hover); }
.dp-cell.empty { cursor: default; }
.dp-cell.weekend { color: var(--muted-2); }
.dp-cell.holiday { color: #c4b5fd; }
html.light .dp-cell.holiday { color: #6d28d9; }
.dp-cell.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}
.dp-cell.disabled:hover { background: transparent; }

/* Range-Modus: Tage zwischen Start und Ende hinterlegen */
.dp-cell.in-range {
  background: var(--primary-soft);
  color: var(--primary-hover);
  border-radius: 0;
}
html.light .dp-cell.in-range { color: var(--primary-2); }
.dp-cell.range-start {
  background: var(--grad-emerald);
  color: var(--btn-primary-color);
  border-color: var(--primary);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.dp-cell.range-end {
  background: var(--grad-emerald);
  color: var(--btn-primary-color);
  border-color: var(--primary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.dp-cell.range-start.range-end {
  border-radius: 6px;
}

/* Step-Hint im Datepicker (Range-Modus) */
.dp-step {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.dp-step strong { color: var(--primary-hover); }
html.light .dp-step strong { color: var(--primary-2); }
.dp-cell.today {
  border-color: var(--primary);
  font-weight: 700; color: var(--primary-hover);
}
.dp-cell.selected {
  background: var(--grad-emerald);
  color: #042418; font-weight: 700;
  border-color: var(--primary);
}
html.light .dp-cell.selected { color: #ffffff; }
.dp-foot {
  display: flex; gap: 6px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.dp-quick {
  flex: 1; padding: 8px; min-height: 34px; margin: 0;
  background: var(--card-hover); color: var(--text-soft);
  border: 1px solid var(--border-2); border-radius: 8px;
  font-size: 12px; font-weight: 600;
  box-shadow: none;
}
.dp-quick:active { background: var(--border); }

/* ========== CUSTOM TIMEPICKER ========== */
/* ========== NUMBER STEPPER ========== */
.number-stepper {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--card-solid);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
}
.number-stepper input[type="number"] {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 0;
  background: transparent;
  margin: 0;
  -moz-appearance: textfield;
  min-width: 0;
}
.number-stepper input[type="number"]::-webkit-outer-spin-button,
.number-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.number-stepper input[type="number"]:focus {
  outline: none;
  background: rgba(16,185,129,0.06);
}
.stepper-btn {
  width: 48px; min-width: 48px;
  background: transparent;
  border: none; border-radius: 0;
  color: var(--muted);
  font-size: 22px; font-weight: 700; line-height: 1;
  padding: 0; margin: 0;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: background 0.1s, color 0.1s;
  box-shadow: none;
}
.stepper-btn:hover { background: var(--card-hover); color: var(--text); }
.stepper-btn:active { background: var(--primary-soft); color: var(--primary-hover); }
.stepper-down { border-right: 1px solid var(--border); }
.stepper-up   { border-left:  1px solid var(--border); }
html.light .number-stepper { background: #fff; }

.timepicker { position: relative; }
.timepicker input[readonly] { cursor: pointer; padding-right: 50px; text-align: center; font-size: 18px; font-weight: 600; letter-spacing: 0.5px; }
.timepicker-toggle {
  position: absolute; right: 4px; top: 4px; bottom: 4px;
  width: 44px; min-height: auto; padding: 0; margin: 0;
  background: transparent; color: var(--muted);
  border: none; border-radius: 8px;
  font-size: 18px; cursor: pointer; box-shadow: none;
}
.timepicker-toggle:active { background: var(--card-hover); }
.timepicker-pop {
  position: absolute; top: calc(100% + 6px); left: 0;
  z-index: 60;
  width: min(280px, calc(100vw - 28px));
  background: var(--card-solid);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  padding: 12px;
}
.tp-quicks {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tp-quick {
  width: 100%; min-height: 32px; padding: 4px;
  background: transparent; color: var(--muted-2);
  border: 1px solid var(--border-2); border-radius: 6px;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  margin: 0; box-shadow: none;
}
.tp-quick:active { background: var(--card-hover); }
.tp-quick.active {
  background: var(--primary-soft); color: var(--primary-hover);
  border-color: rgba(16,185,129,0.40);
}
.tp-display {
  text-align: center; font-size: 24px; font-weight: 800;
  color: var(--primary-hover);
  font-variant-numeric: tabular-nums;
  padding: 4px 0 8px;
  letter-spacing: 1px;
}
html.light .tp-display { color: var(--primary-2); }
.tp-cols { display: flex; gap: 8px; }
.tp-col { flex: 1; min-width: 0; }
.tp-col-head {
  text-align: center; font-size: 11px;
  color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 4px 0;
}
.tp-col-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px;
  max-height: 180px; overflow-y: auto;
  padding: 2px;
  border: 1px solid var(--border); border-radius: 8px;
}
.tp-cell {
  width: 100%; padding: 6px 4px; min-height: 30px;
  background: transparent; color: var(--text-soft);
  border: 1px solid transparent; border-radius: 4px;
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
  margin: 0; box-shadow: none;
}
.tp-cell:hover { background: var(--card-hover); }
.tp-cell.active {
  background: var(--grad-emerald); color: var(--btn-primary-color);
  border-color: var(--primary); font-weight: 700;
}
.tp-foot { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.tp-now, .tp-ok {
  flex: 1; padding: 8px; min-height: 36px; margin: 0;
  border: 1px solid var(--border-2); border-radius: 8px;
  font-size: 13px; font-weight: 600;
  box-shadow: none;
}
.tp-now { background: var(--card-hover); color: var(--text-soft); }
.tp-now:active { background: var(--border); }
.tp-ok {
  background: var(--grad-emerald); color: var(--btn-primary-color);
  border-color: var(--primary);
}

/* ========== PAGINATION ========== */
.pagination {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 14px 0 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.page-btn {
  width: auto; min-width: 36px; min-height: 34px; padding: 6px 10px;
  background: var(--card-hover); color: var(--text-soft);
  border: 1px solid var(--border-2); border-radius: 8px;
  font-size: 13px; font-weight: 600;
  margin: 0; box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover:not(:disabled):not(.active) { background: var(--border); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-btn.active {
  background: var(--grad-emerald); color: var(--btn-primary-color);
  border-color: var(--primary);
}
.page-dots { padding: 0 4px; color: var(--muted); font-size: 13px; }
.page-info { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ========== PROJEKT-ZUTEILUNGS-BLOECKE ========== */
.proj-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
html.light .proj-block { background: rgba(15,23,42,0.025); }
.proj-block-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 10px;
}
.proj-block-title {
  font-weight: 700; font-size: 15px; color: var(--text);
  margin-top: 2px;
}
.proj-emps { display: flex; flex-direction: column; gap: 8px; }
.proj-emp {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.proj-emp-name { font-size: 13px; min-width: 160px; flex-shrink: 0; }
.proj-emp-days { display: flex; flex-wrap: wrap; gap: 6px; }
.day-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 4px 3px 10px;
  background: var(--primary-soft); color: var(--primary-hover);
  border: 1px solid rgba(16,185,129,0.30);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
html.light .day-chip { color: var(--primary-2); border-color: rgba(4,120,87,0.30); }
.day-chip-past {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
  opacity: 0.75;
}
html.light .day-chip-past { color: var(--muted); border-color: var(--border); }
.day-chip-x {
  width: 18px; height: 18px; min-height: 18px;
  padding: 0; margin: 0;
  background: transparent; color: inherit;
  border: none; border-radius: 50%;
  font-size: 14px; line-height: 1;
  cursor: pointer; box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.day-chip-x:hover { background: var(--danger); color: #fff; }
@media (max-width: 520px) {
  .proj-emp-name { min-width: 0; width: 100%; }
}

/* ========== FOTO-PICKER (MA Stempeln) ========== */
.photo-picker {
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255,255,255,0.02);
}
html.light .photo-picker { background: rgba(15,23,42,0.025); }
.photo-pick-btn { width: 100%; margin: 0 0 10px; }
.photo-previews {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
}
.photo-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px; overflow: hidden;
  background: var(--card-hover);
  border: 1px solid var(--border);
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-rm {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; min-height: 24px; padding: 0; margin: 0;
  background: rgba(0,0,0,0.65); color: #fff;
  border: none; border-radius: 50%;
  font-size: 16px; line-height: 1;
  cursor: pointer; box-shadow: none;
  display: flex; align-items: center; justify-content: center;
}
.photo-rm:hover { background: var(--danger); }

/* ========== PROJEKTMAPPE ========== */
tr.proj-row { cursor: pointer; }
tr.proj-row:hover { background: rgba(255,255,255,0.03); }
.folder-entry {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
html.light .folder-entry { background: rgba(15,23,42,0.025); }
.folder-meta {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.folder-note {
  font-size: 14px; color: var(--text-soft);
  margin-bottom: 10px;
  white-space: pre-wrap;
}
.folder-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.folder-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px; overflow: hidden;
  background: var(--card-hover);
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.folder-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.folder-photo:hover img { transform: scale(1.04); }
.folder-photo-del {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; min-height: 28px; padding: 0; margin: 0;
  background: rgba(0,0,0,0.65); color: #fff;
  border: none; border-radius: 50%;
  font-size: 18px; line-height: 1;
  cursor: pointer; box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
}
.folder-photo:hover .folder-photo-del { opacity: 1; }
.folder-photo-del:hover { background: var(--danger); }

/* ========== LIGHTBOX ========== */
.lightbox {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0;
  background: rgba(255,255,255,0.10); color: #fff;
  border: 1px solid rgba(255,255,255,0.20); border-radius: 50%;
  font-size: 24px; line-height: 1;
  cursor: pointer; box-shadow: none;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.20); }

/* ========== KUNDEN -> PROJEKTE ========== */
tr.cust-row { cursor: pointer; }
tr.cust-row:hover { background: rgba(255,255,255,0.03); }
.proj-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.05s;
}
html.light .proj-card { background: rgba(15,23,42,0.025); }
.proj-card:hover { border-color: var(--primary); }
.proj-card:active { transform: translateY(1px); }
.proj-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.proj-card-title {
  font-weight: 700; font-size: 15px; color: var(--text);
}
/* Wenn Projektmappen-Modal über Kunden-Modal offen ist, höher z-index */
#projFolderModal { z-index: 110; }
#custProjectsModal { z-index: 100; }

/* ========== FIRMENKALENDER TABELLE ========== */
.firmkal-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table.firmkal {
  border-collapse: separate; border-spacing: 0;
  width: 100%; font-size: 12px;
  table-layout: auto;
}
table.firmkal th, table.firmkal td {
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px 4px;
  vertical-align: top;
}
table.firmkal thead th {
  background: var(--card-hover);
  position: sticky; top: 0; z-index: 2;
  text-align: center;
  padding: 6px 4px;
  font-weight: 700; color: var(--muted);
  text-transform: none; letter-spacing: 0;
  font-size: 11px;
}
table.firmkal th.firmkal-name, table.firmkal td.firmkal-name {
  position: sticky; left: 0; z-index: 3;
  background: var(--card-solid);
  min-width: 160px; max-width: 200px;
  text-align: left;
  white-space: nowrap;
  border-right: 2px solid var(--border-2);
  font-size: 13px;
  padding: 8px 10px;
}
table.firmkal thead th.firmkal-name { z-index: 4; background: var(--card-hover); }
.firmkal-day .dnum { font-size: 13px; font-weight: 700; color: var(--text); }
.firmkal-day .dwd  { font-size: 10px; color: var(--muted); margin-top: 1px; }
.firmkal-day.is-weekend { background: rgba(255,255,255,0.02); }
.firmkal-day.is-holiday { background: rgba(167,139,250,0.10); color: #c4b5fd; }
.firmkal-day.is-today   { background: var(--primary-soft); color: var(--primary-hover); }
html.light .firmkal-day.is-weekend { background: rgba(15,23,42,0.025); }
html.light .firmkal-day.is-holiday { background: rgba(167,139,250,0.10); color: #6d28d9; }
html.light .firmkal-day.is-today   { background: var(--primary-soft); color: var(--primary-2); }

.firmkal-cell {
  min-width: 84px; max-width: 120px;
  height: 64px;
  background: transparent;
  font-size: 11px;
  overflow: hidden;
  cursor: pointer;
  transition: outline 0.1s;
}
.firmkal-cell:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.firmkal-cell.is-weekend { background: rgba(255,255,255,0.015); }
.firmkal-cell.is-holiday {
  background: repeating-linear-gradient(45deg, rgba(167,139,250,0.16) 0 4px, rgba(167,139,250,0.04) 4px 8px);
}
.firmkal-cell.cell-assigned    { background: rgba(16,185,129,0.18);  color: var(--primary-hover); }
.firmkal-cell.cell-urlaub      { background: rgba(251,191,36,0.18);  color: #fcd34d; }
.firmkal-cell.cell-krank       { background: rgba(239,68,68,0.18);   color: #fca5a5; }
.firmkal-cell.cell-dienstreise { background: rgba(59,130,246,0.18);  color: #93c5fd; }
.firmkal-cell.cell-schulung    { background: rgba(167,139,250,0.18); color: #c4b5fd; }
.firmkal-cell.cell-sonstiges   { background: rgba(148,163,184,0.18); }
.firmkal-cell.cell-pending     { background: repeating-linear-gradient(45deg, rgba(251,191,36,0.20) 0 4px, rgba(251,191,36,0.06) 4px 8px); color: #fcd34d; }
.firmkal-cell.cell-work        { background: linear-gradient(135deg, rgba(16,185,129,0.10), rgba(16,185,129,0.04)); color: var(--primary-hover); font-weight: 600; }
html.light .firmkal-cell.cell-assigned    { background: rgba(4,120,87,0.10); color: var(--primary-2); }
html.light .firmkal-cell.cell-urlaub      { background: rgba(217,119,6,0.10); color: #92400e; }
html.light .firmkal-cell.cell-krank       { background: rgba(239,68,68,0.10); color: #b91c1c; }
html.light .firmkal-cell.cell-dienstreise { background: rgba(59,130,246,0.10); color: #1d4ed8; }
html.light .firmkal-cell.cell-schulung    { background: rgba(167,139,250,0.12); color: #6d28d9; }
html.light .firmkal-cell.cell-work        { background: rgba(4,120,87,0.10); color: var(--primary-2); }
.firmkal-label {
  display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
  word-break: break-word;
  line-height: 1.2;
  padding: 2px 4px;
}

/* ========== FIRMENKALENDER JAHRESANSICHT ========== */
table.firmkal-year th.firmkal-month-head {
  text-align: center;
  font-size: 11px; font-weight: 700;
  color: var(--text);
  background: var(--card);
  padding: 4px 0;
  border-bottom: 2px solid var(--border-2);
  text-transform: uppercase; letter-spacing: 0.5px;
}
table.firmkal-year th.firmkal-day {
  padding: 2px 0;
  min-width: 18px; max-width: 22px;
}
table.firmkal-year th.firmkal-day .dnum { font-size: 9px; font-weight: 600; }
table.firmkal-year .firmkal-cell {
  min-width: 18px; max-width: 22px;
  height: 26px;
}
table.firmkal-year th.is-month-start, table.firmkal-year td.is-month-start {
  border-left: 2px solid var(--border-2);
}
