@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

:root {
  --radius: 6px;
  --transition: 160ms ease;
}

/* ---------- Outdoor Theme (default) ---------- */
body.theme-outdoor {
  --bg: #1C2620;
  --surface: #24322A;
  --surface-raised: #2C3D32;
  --text: #E8E4D9;
  --text-dim: #A9B3A6;
  --accent: #C08A4E;
  --accent-text: #1C2620;
  --border: #3A4A3E;
  --danger: #C0654E;
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
}

/* ---------- Indoor Theme (Cyberpunk) ---------- */
body.theme-indoor {
  --bg: #0A0A12;
  --surface: #14141F;
  --surface-raised: #1B1B2A;
  --text: #E6E6F0;
  --text-dim: #8888A0;
  --accent: #FF2E88;
  --accent-text: #0A0A12;
  --border: #2A2A3D;
  --danger: #FF5A5A;
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Calibri', 'Candara', 'Segoe UI', sans-serif;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  max-width: 100vw;
}

.theme-indoor {
  background-image:
    linear-gradient(180deg, rgba(255,46,136,0.04), transparent 200px);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
}

a { color: var(--accent); }

button {
  font-family: 'Calibri', 'Candara', 'Segoe UI', sans-serif;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  transition: background var(--transition), transform var(--transition);
}
button:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  padding: 10px 18px;
  font-size: 14px;
}
.theme-indoor .btn-primary {
  box-shadow: 0 0 16px rgba(255,46,136,0.35);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 13px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

input, select {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: 'Calibri', 'Candara', 'Segoe UI', sans-serif;
  font-size: 14px;
}
input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 340px;
}
.login-card h1 {
  font-size: 28px;
  margin-bottom: 4px;
}
.login-card .subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 28px;
}
.login-card label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  margin-top: 16px;
}
.login-card input { width: 100%; }
.login-card .btn-primary { width: 100%; margin-top: 24px; }
.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 16px;
}

.color-select { position: relative; }
.color-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 14px;
  font-family: 'Calibri', 'Candara', 'Segoe UI', sans-serif;
}
.color-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.color-select-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
}
.color-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
}
.color-select-option:hover { background: var(--surface); }

.feedback-choice-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.feedback-choice-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 10px;
  font-size: 13px;
  text-align: left;
}
.feedback-choice-btn.selected {
  background: var(--surface);
  box-shadow: 0 0 0 2px currentColor inset;
  font-weight: 600;
}
.feedback-choice-icon { font-size: 18px; }

.auto-clockout-reason-btn.selected {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface-raised);
  font-weight: 600;
}

.notif-fab {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 19px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
}
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.notif-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { border-left: 3px solid var(--accent); padding-left: 10px; }
.notif-row-title { font-weight: 600; margin-bottom: 3px; }
.notif-row-message { color: var(--text-dim); font-size: 12px; margin-bottom: 3px; }
.notif-row-time { color: var(--text-dim); font-size: 11px; }

.posting-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.posting-card-title { font-size: 14px; margin-bottom: 3px; }
.posting-card-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.applicant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.danger-zone {
  border: 1.5px solid var(--danger);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 12px;
  background: rgba(192, 101, 78, 0.06);
}

.coverage-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.coverage-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.coverage-dot.green { background: #6FBF8B; color: #6FBF8B; }
.coverage-dot.yellow { background: #E0B84E; color: #E0B84E; }
.coverage-dot.red { background: var(--danger); color: var(--danger); }
.coverage-dot.neutral { background: var(--text-dim); color: var(--text-dim); box-shadow: none; }
.coverage-date { width: 110px; flex-shrink: 0; font-size: 13px; }
.coverage-date .weekday { color: var(--text-dim); font-size: 11px; }
.coverage-numbers { flex: 1; font-size: 13px; color: var(--text-dim); }
.coverage-numbers b { color: var(--text); }

.handover-note-card {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 13px;
}
.handover-note-icon { font-size: 16px; flex-shrink: 0; }
.handover-note-meta { color: var(--text-dim); font-size: 11px; margin-top: 3px; }

.colleague-position-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.live-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #e34c4c;
  box-shadow: 0 0 0 rgba(227,76,76,0.5);
  animation: live-pulse 1.6s infinite;
  margin-right: 4px;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(227,76,76,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(227,76,76,0); }
  100% { box-shadow: 0 0 0 0 rgba(227,76,76,0); }
}

.live-board-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.live-board-row:last-child { border-bottom: none; }
.live-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.live-avatar-initials {
  width: 42px; height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  background: var(--accent);
  color: var(--accent-text);
}
.live-board-info { flex: 1; min-width: 0; }
.live-board-name { font-size: 14px; }
.live-board-meta { font-size: 12px; color: var(--text-dim); }
.live-board-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- Start-View: 'Heute im Einsatz' ---------- */
html, body { touch-action: manipulation; }

.home-today-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}

.home-today-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.home-today-row:last-child { border-bottom: none; }
.home-today-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.home-today-dot.dot-outdoor { background: #C08A4E; }
.home-today-dot.dot-indoor { background: #FF2E88; box-shadow: 0 0 8px rgba(255,46,136,0.5); }
.home-today-time { color: var(--text-dim); min-width: 95px; flex-shrink: 0; }
.home-today-name { flex: 1; }

/* ---------- App-Dock (permanente untere Navigationsleiste, mobile) ---------- */
.bottom-dock {
  display: none; /* wird nur unter 720px per Media Query eingeblendet */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  z-index: 95;
  gap: 4px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
}
.bottom-dock::-webkit-scrollbar { display: none; }

.dock-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 66px;
  flex-shrink: 0;
  padding: 7px 2px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}
.dock-tile:active { background: var(--surface-raised); }
.dock-tile.active {
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.dock-tile-icon { font-size: 20px; line-height: 1; }
.dock-tile-label {
  font-size: 9.5px;
  margin-top: 3px;
  text-align: center;
  color: var(--text-dim);
  white-space: normal;
  line-height: 1.15;
}
.dock-tile.active .dock-tile-label { color: var(--text); font-weight: 600; }

.dock-tile-outdoor { box-shadow: inset 0 -2px 0 #C08A4E; }
.dock-tile-outdoor .dock-tile-icon { filter: drop-shadow(0 0 4px rgba(192,138,78,0.6)); }
.dock-tile-indoor { box-shadow: inset 0 -2px 0 #FF2E88; }
.dock-tile-indoor .dock-tile-icon { filter: drop-shadow(0 0 4px rgba(255,46,136,0.6)); }
.dock-tile-outdoor.active { box-shadow: inset 0 0 0 1px var(--accent), inset 0 -2px 0 #C08A4E; }
.dock-tile-indoor.active { box-shadow: inset 0 0 0 1px var(--accent), inset 0 -2px 0 #FF2E88; }

/* ---------- App Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}
.sidebar h1 {
  font-size: 20px;
  margin-bottom: 4px;
}
.sidebar .subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 28px;
}
.nav-item {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}
.nav-item:hover { color: var(--text); }
.nav-item.active {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--border);
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sidebar-footer .user-name { font-size: 14px; }
.sidebar-footer .user-role { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }

.main {
  flex: 1;
  padding: 32px 40px;
  max-width: 900px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
}
.main-header h2 { font-size: 24px; }

.division-toggle, .coverage-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.division-toggle button, .coverage-toggle button {
  background: var(--surface);
  color: var(--text-dim);
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 0;
}
.division-toggle button.active, .coverage-toggle button.active {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

/* ---------- Agenda / Shift list ---------- */
.day-group { margin-bottom: 28px; }
.day-label {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.shift-row {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.shift-time {
  width: 90px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 15px;
  padding-top: 2px;
}
.shift-body { flex: 1; }
.shift-title { font-size: 15px; margin-bottom: 2px; }
.shift-location { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  font-size: 12px;
}
.chip .avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.chip .remove {
  background: none; color: var(--text-dim); font-size: 14px; padding: 0 2px;
}
.chip .remove:hover { color: var(--danger); }

.add-assignment {
  display: flex; gap: 8px; align-items: center; margin-top: 10px;
}
.add-assignment select { font-size: 13px; padding: 6px 10px; }

.availability-note {
  font-size: 12px;
  margin-left: 4px;
}
.availability-note.ok { color: #6FBF8B; }
.availability-note.conflict { color: var(--danger); }

.empty-state {
  color: var(--text-dim);
  font-size: 14px;
  padding: 24px 0;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- New shift form ---------- */
.new-shift-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 28px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid label {
  display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px;
}
.form-grid input, .form-grid select { width: 100%; }

/* ---------- Employees list ---------- */
.employee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.employee-name { font-size: 14px; }
.employee-email { font-size: 12px; color: var(--text-dim); }
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.toast.error { border-color: var(--danger); color: var(--danger); }

.hidden { display: none !important; }

/* ---------- Wochenplan Grid ---------- */
.weekplan-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 700px;
}
.weekplan-table th {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.weekplan-table td {
  border: 1px solid var(--border);
  padding: 6px;
  vertical-align: top;
  min-width: 110px;
  min-height: 50px;
}
.weekplan-position-label {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  white-space: nowrap;
  background: var(--surface);
}
.weekplan-cell {
  cursor: pointer;
  min-height: 44px;
}
.weekplan-cell:hover {
  background: var(--surface-raised);
}
.weekplan-chip {
  display: block;
  font-size: 11px;
  background: var(--surface-raised);
  border-radius: 4px;
  padding: 3px 6px;
  margin-bottom: 3px;
}
.weekplan-add-hint {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  padding: 10px 0;
}

.indoor-cal-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}
.indoor-cal-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---------- Buchungskalender (Zeitachse) ---------- */
.indoor-cal-wrapper {
  display: grid;
  grid-template-columns: 50px repeat(7, 1fr);
  min-width: 900px;
}
.indoor-cal-hour-label {
  font-size: 10px;
  color: var(--text-dim);
  text-align: right;
  padding-right: 6px;
  position: relative;
  top: -6px;
}
.indoor-cal-day-header {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.indoor-cal-day-column {
  position: relative;
  border-left: 1px solid var(--border);
}
.indoor-cal-hour-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px solid var(--border);
  opacity: 0.4;
}
.indoor-cal-block {
  position: absolute;
  left: 2px; right: 2px;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 11px;
  overflow: hidden;
  cursor: pointer;
  color: #0A0A12;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.indoor-cal-block.conflict {
  outline: 2px solid var(--danger);
  outline-offset: 1px;
}
.indoor-cal-block .block-time { font-weight: 700; }
.indoor-cal-block .block-title { font-weight: 600; }
.indoor-cal-block .block-meta { font-size: 10px; opacity: 0.85; }

/* ============================================================
   Mobile (App-artige Darstellung statt Webseite)
   ============================================================ */
@media (max-width: 720px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    display: none; /* ersetzt durch das App-Dock unten */
  }

  .bottom-dock {
    display: flex;
  }

  .main {
    padding: 16px;
    padding-bottom: 100px; /* Platz für das fixierte Dock */
    max-width: 100%;
  }

  .main-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .main-header h2 { font-size: 20px; }

  .division-toggle { width: 100%; }
  .division-toggle button { flex: 1; padding: 10px 8px; font-size: 12px; }

  .shift-row {
    flex-direction: column;
    gap: 4px;
  }
  .shift-time {
    width: auto;
    font-size: 13px;
    color: var(--text-dim);
  }

  .add-assignment {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .add-assignment select,
  .add-assignment button {
    width: 100%;
  }
  .availability-note {
    margin-left: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .chip-row { gap: 8px; }
  .chip { font-size: 11px; }

  .login-card {
    width: 90vw;
    max-width: 340px;
    padding: 28px 24px;
  }

  .indoor-cal-legend {
    grid-template-columns: repeat(2, 1fr);
  }

  .toast {
    left: 16px;
    right: 16px;
    max-width: none;
    bottom: 16px;
  }
}
