:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --border: #E4E2DC;
  --border-strong: #C8C5BC;
  --text: #1A1916;
  --text-muted: #7A786F;
  --text-hint: #B0ADA5;
  --accent: #2C5282;
  --accent-bg: #EBF0F8;
  --amber: #92400E;
  --amber-bg: #FEF3C7;
  --red: #7F1D1D;
  --red-bg: #FEE2E2;
  --green: #1A4731;
  --green-bg: #D1FAE5;
  --purple: #3B1F6E;
  --purple-bg: #EDE9FE;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  height: 100dvh;
}
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  touch-action: manipulation;
}
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}

/* TOP BAR */
.topbar {
  background: #FFE000;
  border-bottom: 2px solid #DC2626;
  padding: 5px 14px;
  padding-top: max(5px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(220,38,38,0.2);
}
.topbar-title { font-size: 13px; font-weight: 600; letter-spacing: -0.2px; }
.topbar-name {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 9px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.topbar-name:hover { border-color: var(--border-strong); }

/* BOTTOM NAV */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  
  padding: 6px 16px 4px;
}
.nav-group {
  display: flex;
  flex: 1;
  justify-content: space-around;
  align-items: flex-end;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 28px;
  padding: 8px 6px 2px;
  max-width: 420px;
}
.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding: 0 4px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-hint);
  font-family: inherit;
  font-size: 9px;
  font-weight: 500;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-icon-wrap {
  width: 44px;
  height: 30px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  background: transparent;
}
.nav-btn.active .nav-icon-wrap { background: var(--accent); }
.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-icon-wrap svg { fill: #fff; }
.nav-icon { display: flex; align-items: center; justify-content: center; }
/* Backup Button */
.nav-btn-backup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-hint);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.backup-fab {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFE000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CONTENT */
.content {
  flex: 1;
  padding: 12px 12px 80px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.section { display: none; }
.section.active { display: block; }

/* MONTH NAV */
.month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: var(--shadow);
  position: relative;
}
.month-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.month-btn:hover { background: var(--bg); }
.today-btn {
  width: auto;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.month-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.month-name:hover { background: var(--bg); }
.month-name::after { content: '▾'; font-size: 11px; color: var(--text-hint); }
.month-dropdown {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  min-width: 180px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}
.month-dropdown-item {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.1s;
}
.month-dropdown-item:hover { background: var(--bg); }
.month-dropdown-item.active { color: var(--accent); font-weight: 600; }

/* CALENDAR */
.cal-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}
.cal-header-cell {
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-hint);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-day {
  min-height: clamp(44px, 9vh, 80px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 3px 3px;
  cursor: pointer;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color 0.12s, box-shadow 0.12s;
  overflow: hidden;
}
.cal-day:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.cal-day.empty { background: transparent; border: none; cursor: default; }
.cal-day.empty:hover { box-shadow: none; }
.cal-day.today { border-color: var(--accent); border-width: 2px; }
.cal-day.feiertag { background: #FFFBEB; }
.cal-day.feiertag .day-num { color: #B45309; font-weight: 700; }
.ft-label { font-size: 8px; color: #B45309; text-align: center; line-height: 1.2; margin-top: 1px; }
.feiertag-banner {
  background: #FEF3C7; border: 1px solid #F59E0B; border-radius: 8px;
  padding: 8px 12px; margin-bottom: 10px; display: none;
}
.feiertag-banner.visible { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.feiertag-banner-text { font-size: 13px; font-weight: 600; color: #92400E; }
.feiertag-banner-sub  { font-size: 11px; color: #B45309; margin-top: 2px; }
.feiertag-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #92400E; cursor: pointer; }
.cal-day.weekend .day-num { color: var(--text-muted); }
.day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.day-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.3;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* SHIFT COLORS */
.s-T92  { background: #DBEAFE; color: #1E3A5F; }
.s-N92  { background: #EDE9FE; color: #3B1F6E; }
.s-T93  { background: #D1FAE5; color: #1A4731; }
.s-N93  { background: #C7D2FE; color: #1E1B4B; }
.s-T97  { background: #CCFBF1; color: #0F3A32; }
.s-N97  { background: #A7F3D0; color: #064E3B; }
.s-T62  { background: #FEF3C7; color: #78350F; }
.s-S62  { background: #FED7AA; color: #7C2D12; }
.s-NTW  { background: #FCE7F3; color: #701A50; }
.dot-150 { background: #F59E0B; }
.dot-krank { background: #EF4444; }
.dot-urlaub { background: #10B981; }
.dot-sonderurlaub { background: #0EA5E9; }
.dot-umkl { background: #6366F1; }
.s-RT   { background: #F1F0EB; color: #3A3830; }
.s-HS   { background: #D1FAE5; color: #065F46; }
.s-SP   { background: #DBEAFE; color: #1E3A5F; }
.s-RTH  { background: #FEF9C3; color: #713F12; }
.s-SON  { background: #F3F4F6; color: #374151; }
.s-SCH  { background: #E0F2FE; color: #0C4A6E; }
.rt-fields {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 10px;
  display: none;
}
.rt-fields.visible { display: block; }
.rt-time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.rt-time-row label { font-size: 11px; font-weight: 500; color: var(--text-muted); display: block; margin-bottom: 3px; }
.rt-time-row input[type=time],
.rt-time-row select.time-sel {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  font-family: inherit;
  font-size: 11px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.rt-time-row input[type=time]:focus,
.rt-time-row select.time-sel:focus { border-color: var(--accent); }
.time-picker-wrap { display: flex; gap: 4px; align-items: center; }
.time-picker-wrap select {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 2px;
  font-family: inherit;
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}
.time-picker-wrap select:focus { border-color: var(--accent); }
.time-picker-wrap .tp-sep { font-size: 14px; font-weight: 600; color: var(--text-muted); flex-shrink:0; }

/* CHANGELOG REMOVED */

.wache-btn {
  padding: 6px 10px; border: 1.5px solid var(--border);
  border-radius: 8px; background: var(--surface);
  font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--text); transition: all 0.15s; white-space: nowrap;
  flex: 1 1 calc(33% - 4px); text-align: center;
}
.wache-btn.active {
  background: var(--accent); color: white;
  border-color: var(--accent);
}
/* 2. SCHICHT */
.shift2-banner {
  display: none; align-items: center; gap: 8px;
  background: #FEF3C7; border-left: 3px solid #D97706;
  border-radius: 6px; padding: 8px 12px; margin-bottom: 10px;
  font-size: 12px; font-weight: 600; color: #92400E;
}
.shift2-block {
  margin-top: 5px; padding-top: 5px;
  border-top: 1px dashed var(--border);
}
.shift2-row {
  font-size: 10px; color: var(--text-muted); display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
}
.shift2-badge {
  font-size: 9px; font-weight: 700; background: #FEF3C7; color: #92400E;
  border-radius: 3px; padding: 1px 4px; white-space: nowrap;
}
.add-shift2-btn {
  width: 100%; margin-top: 8px; padding: 10px 10px 10px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; text-align: left;
  letter-spacing: 0.4px; text-transform: uppercase;
  transition: border-color 0.15s;
}
.add-shift2-btn:active { border-color: var(--accent); color: var(--accent); }

.kein-dienst-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 0;
}
.kein-dienst-row input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* MODAL / ENTRY FORM */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.22s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes hint-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.7); transform: scale(1); }
  50% { box-shadow: 0 0 0 9px rgba(220,38,38,0); transform: scale(1.1); }
}
.hinweis-fab {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 95;
  box-shadow: 0 2px 8px rgba(0,0,0,0.13);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.hinweis-fab.has-unread {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
  box-shadow: 0 2px 14px rgba(220,38,38,0.4);
  animation: hint-pulse 1.5s ease-in-out infinite;
}
.modal-handle {
  display: none;
}
.modal-header {
  padding: 10px 16px 8px;
  padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 14px; font-weight: 600; }
.modal-date { font-size: 11px; color: var(--text-muted); }
.modal-body {
  padding: 10px 14px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

/* SHIFT PICKER */
.shift-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-bottom: 8px;
}
.shift-disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  background: var(--bg) !important;
  border-color: var(--border) !important;
}
.shift-opt {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 2px;
  cursor: pointer;
  background: var(--surface);
  text-align: center;
  transition: all 0.12s;
}
.shift-opt:hover { border-color: var(--accent); }
.shift-opt.selected { border-color: var(--accent); background: var(--accent-bg); }
.shift-opt .sc { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 600; color: var(--text); }
.shift-opt.selected .sc { color: var(--accent); }
.shift-opt .st { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.shift-opt.selected .st { color: var(--accent); }

/* TOGGLE 150% */
.toggle-150 {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
  margin-bottom: 10px;
}
.toggle-150.active { background: var(--amber-bg); border-color: #F59E0B; color: var(--amber); }
.toggle-pill {
  width: 30px; height: 17px;
  border-radius: 9px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-pill::after {
  content: '';
  position: absolute;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: white;
  top: 3px; left: 3px;
  transition: transform 0.2s;
}
.toggle-150.active .toggle-pill { background: #F59E0B; }
.toggle-150.active .toggle-pill::after { transform: translateX(16px); }

/* FORM ROWS */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.overtime-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 10px;
  background: var(--bg);
}
.overtime-block .ob-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.overtime-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.overtime-row label { font-size: 11px; font-weight: 500; color: var(--text-muted); display: block; margin-bottom: 3px; }
.overtime-row input[type=text] {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  font-family: inherit;
  font-size: 16px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.overtime-row input:focus { border-color: var(--accent); }
/* iOS-Fix: Safari zoomt automatisch wenn font-size < 16px */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: 16px !important; }
}
.ot-clear-btn {
  display: none; flex-shrink: 0;
  background: #9CA3AF; color: #fff; border: none; border-radius: 50%;
  width: 20px; height: 20px; font-size: 12px;
  align-items: center; justify-content: center;
  cursor: pointer; padding: 0; line-height: 1;
}
.ot-clear-btn:active { background: #6B7280; }
.ot-clear-btn.visible { display: flex; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.form-group select, .form-group input[type=text] {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-family: inherit;
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.form-group select:focus, .form-group input[type=text]:focus { border-color: var(--accent); }
.form-group.full { grid-column: 1 / -1; }

/* CHECKBOXES */
.check-group { display: flex; flex-direction: column; gap: 8px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.12s;
  font-size: 12px;
}
.check-item:hover { border-color: var(--border-strong); }
.check-item input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; }
.check-item.checked-krank { background: var(--red-bg); border-color: #EF4444; color: var(--red); }
.check-item.checked-urlaub { background: var(--green-bg); border-color: #10B981; color: var(--green); }
.check-item.checked-umkleide { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.check-item.checked-fa { background: #EDE9FE; border-color: #7F77DD; color: #3B1F6E; }
.check-item.checked-sonderurlaub { background: #E0F2FE; border-color: #0EA5E9; color: #075985; }

/* WARNING */
.warning {
  background: var(--amber-bg);
  border: 1px solid #F59E0B;
  border-radius: var(--radius-sm);
  padding: 12px 12px;
  font-size: 12px;
  color: var(--amber);
  margin-bottom: 8px;
  display: none;
}
.warning-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.ausnahme-btn {
  background: var(--amber);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ausnahme-fields {
  background: var(--bg);
  border: 1px solid #F59E0B;
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 8px;
  display: none;
}
.ausnahme-fields.visible { display: block; }
.ausnahme-fields .af-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

/* MODAL FOOTER */
.modal-footer {
  padding: 10px 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  background: var(--surface);
  flex-shrink: 0;
}
.btn { border-radius: var(--radius-sm); padding: 7px 14px; font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.12s; border: 1px solid transparent; flex: 1; }
.btn-primary { background: var(--text); color: white; }
.btn-primary:hover { background: #333; }
.btn-cancel { background: var(--bg); border-color: var(--border); color: var(--text-muted); flex: 0 0 auto; }
.btn-cancel:hover { border-color: var(--border-strong); color: var(--text); }
.btn-delete { background: var(--red-bg); border-color: #EF4444; color: var(--red); flex: 0 0 auto; }
.btn-delete:hover { background: #FCA5A5; }

/* OVERVIEW */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 62px;
}
.stat-card:active { background: var(--surface-hover, rgba(0,0,0,0.04)); border-color: var(--accent); }
.stat-card-arrow {
  position: absolute; top: 6px; right: 7px;
  font-size: 10px; color: var(--text-hint); opacity: 0.6;
}
.stat-card-wide { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--accent); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 1px; font-weight: 500; }
.stat-value { font-size: 18px; font-weight: 600; letter-spacing: -0.5px; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.entry-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.entry-item:last-child { border-bottom: none; }
.entry-item:hover { background: var(--surface-hover, rgba(0,0,0,0.03)); }
.entry-item:active { background: var(--surface-active, rgba(0,0,0,0.07)); }
.entry-date { font-size: 13px; color: var(--text-muted); min-width: 58px; font-family: 'DM Mono', monospace; }
.entry-shift { flex: 1; }
.entry-code { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 600; border-radius: 3px; padding: 1px 5px; display: inline-block; }
.entry-role { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.entry-hours { font-size: 14px; font-weight: 700; min-width: 34px; text-align: right; }
.entry-hours.strikethrough { text-decoration: line-through; color: var(--text-hint); font-size: 12px; }
.entry-flags { display: flex; flex-direction: column; gap: 2px; min-width: 28px; align-items: flex-end; }
.eflag { font-size: 9px; font-weight: 600; border-radius: 3px; padding: 1px 4px; }
.eflag-warn {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 600; border-radius: 3px; padding: 2px 5px;
  background: #FEF3C7; color: #92400E; border: 1px solid #F59E0B;
  cursor: pointer;
}
/* Warn-Info Dialog */
.warn-info-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 400;
  align-items: flex-end; justify-content: center;
}
.warn-info-overlay.open { display: flex; }
.warn-info-box {
  background: var(--surface); border-radius: 16px 16px 0 0;
  width: 100%; max-width: 480px; padding: 20px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
  animation: slideUp 0.2s ease;
}
.warn-info-icon { font-size: 32px; text-align: center; margin-bottom: 8px; }
.warn-info-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; text-align: center; }
.warn-info-msg { font-size: 13px; color: var(--text-muted); line-height: 1.5; text-align: center; margin-bottom: 16px; }
.warn-info-actions { display: flex; gap: 10px; }
.warn-info-btn { flex: 1; padding: 12px; border: none; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; cursor: pointer; }
.warn-info-btn.primary { background: var(--accent); color: white; }
.warn-info-btn.secondary { background: var(--surface-hover, #f0f0f0); color: var(--text); }
.f150 { background: var(--amber-bg); color: var(--amber); }
.fkrank { background: var(--red-bg); color: var(--red); }
.furlaub { background: var(--green-bg); color: var(--green); }
.fsonderurlaub { background: #E0F2FE; color: #075985; }
.fumkl { background: var(--accent-bg); color: var(--accent); }
.fot { background: #FEF3C7; color: #78350F; }
.ffa { background: #EDE9FE; color: #3B1F6E; }
.entry-ot { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-family: 'DM Mono', monospace; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-hint); font-size: 14px; }

/* SETTINGS */
.settings-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.settings-header {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg);
}
.settings-row {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row label { font-size: 12px; flex: 1; }
.settings-row input[type=text] {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  flex: 2;
}
.settings-row input[type=text]:focus { border-color: var(--accent); }
.save-btn {
  background: var(--text); color: white;
  border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
}
.save-btn.saved { background: #16A34A !important; }
.shift-list-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.shift-list-row:last-child { border-bottom: none; }
.shift-badge { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; border-radius: 4px; padding: 2px 8px; min-width: 60px; text-align: center; }
.shift-info { flex: 1; color: var(--text-muted); }
.shift-hrs { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text-hint); }

.rule-item { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-muted); line-height: 1.5; word-break: break-word; overflow-wrap: break-word; }
.rule-item:last-child { border-bottom: none; }
.rule-item strong { color: var(--text); }

.copyright {
  text-align: center;
  font-size: 10px;
  color: var(--text-hint);
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  cursor: pointer;
  transition: color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.copyright:hover { color: var(--text); }
.copyright:active { color: var(--accent); }
/* BACKUP BOUNCE ANIMATION */
@keyframes backup-bounce {
  0%       { transform: translateY(0); }
  10%      { transform: translateY(-20px); }
  22%      { transform: translateY(-9px); }
  34%      { transform: translateY(-15px); }
  46%      { transform: translateY(-4px); }
  56%      { transform: translateY(-8px); }
  64%      { transform: translateY(0); }
  100%     { transform: translateY(0); }
}
#nav-backup.bouncing .backup-fab {
  animation: backup-bounce 2s ease-in-out infinite;
}

.export-btn {
  width: 100%;
  background: var(--text);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
  letter-spacing: -0.2px;
}
.export-btn:hover { background: #333; }
.backup-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.backup-btn {
  width: 100%;
  background: none;
  color: var(--accent);
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 11px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.backup-btn:last-child { border-bottom: none; }
.backup-btn:hover { background: var(--accent-bg); }
.backup-btn.danger { color: var(--red); }
.backup-btn.danger:hover { background: var(--red-bg); }
.delete-month-btn {
  width: 100%;
  background: none;
  color: var(--red);
  border: 1px solid #EF4444;
  border-radius: var(--radius);
  padding: 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.15s;
}
.delete-month-btn:hover { background: var(--red-bg); }
/* NUMPAD TIMEPICKER */
.numpad-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  align-items: flex-end;
  justify-content: center;
}
.numpad-overlay.open { display: flex; }
.numpad-sheet {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 0 0 max(20px, env(safe-area-inset-bottom));
  animation: slideUp 0.2s ease;
}
.numpad-header {
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.numpad-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.numpad-display {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  min-width: 120px;
  text-align: center;
}
.numpad-display .nd-placeholder { color: var(--text-hint); }
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 16px;
}
.np-btn {
  border: none;
  background: var(--bg);
  border-radius: var(--radius);
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  padding: 14px 0;
  cursor: pointer;
  transition: background 0.1s;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.np-btn:active { background: var(--border); }
.np-btn.np-del { font-size: 18px; background: var(--bg); color: var(--text-muted); }
.np-btn.np-ok  { background: var(--accent); color: white; font-size: 16px; font-weight: 600; }
.np-btn.np-ok:active { background: #1a3a6a; }
.numpad-time-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ntw-field {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}
.ntw-field.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.ntw-sep { font-size: 18px; font-weight: 600; color: var(--text-muted); }

/* BACKUP DIALOG */
.backup-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.backup-dialog-overlay.open { display: flex; }
.backup-dialog-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
}
.bd-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
}
.bd-btn {
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.1s;
}
.bd-btn:last-child { border-bottom: none; }
.bd-btn:hover { background: var(--accent-bg); }
.bd-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.bd-btn.disabled:hover { background: none; }

/* INFO DIALOG */
.info-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.info-dialog-overlay.open { display: flex; }
.info-dialog-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.info-dialog-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.info-dialog-content { font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.info-dialog-content h3 { font-size: 13px; font-weight: 600; margin: 16px 0 8px; color: var(--text); }
.info-dialog-content p { margin: 8px 0; }
.info-dialog-btn {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}



/* SCHICHTSTATISTIK */
.shiftstat-overlay {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 200;
  flex-direction: column; overflow: hidden;
}
.shiftstat-overlay.open { display: flex; }
.shiftstat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(20px, calc(env(safe-area-inset-top) + 12px));
  border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.shiftstat-header h2 { font-size: 16px; font-weight: 700; margin: 0; }
.shiftstat-nav { display: flex; align-items: center; gap: 10px; }
.shiftstat-nav-btn { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 16px; cursor: pointer; color: var(--text); }
.shiftstat-year { font-size: 15px; font-weight: 600; min-width: 50px; text-align: center; }
.shiftstat-footer {
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.shiftstat-close-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.shiftstat-body { flex: 1; overflow-y: auto; padding: 16px; }
.shiftstat-section { margin-bottom: 20px; }
.shiftstat-section-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.shiftstat-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.shiftstat-row:last-child { border-bottom: none; }
.shiftstat-label { font-size: 14px; color: var(--text); }
.shiftstat-sub { font-size: 12px; color: var(--text-hint); margin-top: 1px; }
.shiftstat-count { font-size: 18px; font-weight: 700; color: var(--accent); }
.shiftstat-unit { font-size: 11px; color: var(--text-muted); margin-top: 1px; text-align: right; }
.shiftstat-total { background: var(--surface); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.shiftstat-total-label { font-size: 12px; color: var(--text-muted); }
.shiftstat-total-value { font-size: 28px; font-weight: 700; }
.shiftstat-total-sub { font-size: 11px; color: var(--text-hint); }
.shiftstat-hint { font-size: 11px; color: var(--text-hint); text-align: center; padding: 12px 0; font-style: italic; }

/* JAHRESÜBERBLICK TABELLE */
.jahres-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.jahres-table th { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 6px 8px 6px; text-align: right; }
.jahres-table th:first-child { text-align: left; }
.jahres-table td { padding: 7px 6px; border-top: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.jahres-table td:first-child { text-align: left; color: var(--text-muted); }
.jahres-table tr.jahres-total td { font-weight: 700; font-size: 14px; border-top: 2px solid var(--border); color: var(--text); }
.jahres-table td.diff-pos { color: #059669; font-weight: 600; }
.jahres-table td.diff-neg { color: #DC2626; font-weight: 600; }
.jahres-table td.diff-zero { color: var(--text-muted); }
.jahres-entry-row {
  display: flex; align-items: center; padding: 9px 0;
  border-bottom: 1px solid var(--border); gap: 10px;
}
.jahres-entry-row:last-child { border-bottom: none; }
.jahres-entry-date { font-size: 13px; color: var(--text-muted); min-width: 80px; font-family: 'DM Mono', monospace; }
.jahres-entry-shift { flex: 1; }
.jahres-entry-val { font-size: 14px; font-weight: 700; text-align: right; }
.jahres-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 10px; border: 1px solid var(--border);
}
.jahres-summary-label { font-size: 13px; color: var(--text-muted); }
.jahres-summary-val { font-size: 20px; font-weight: 700; }
.jahres-section-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 16px 0 8px 0; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.jahres-tag-krank { background: #FEE2E2; color: #7F1D1D; border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.jahres-tag-urlaub { background: #D1FAE5; color: #1A4731; border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.jahres-tag-sonderurlaub { background: #E0F2FE; color: #075985; border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.jahres-tag-fa { background: #EDE9FE; color: #3B1F6E; border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.jahres-empty { text-align: center; color: var(--text-hint); font-size: 13px; padding: 32px 0; font-style: italic; }

.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.confirm-overlay.open { display: flex; }
.confirm-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 300px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.confirm-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.confirm-msg { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.confirm-btns { display: flex; gap: 8px; justify-content: flex-end; }
.confirm-btns button { border-radius: var(--radius-sm); padding: 7px 14px; font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: none; color: var(--text); }
.confirm-btns .confirm-ok { background: #EF4444; border-color: #EF4444; color: white; }
.confirm-btns .confirm-ok:hover { background: #DC2626; }
