:root {
  --primary-color: #498100;
  --secondary-color: #346704;
  --accent-color: #27ae60;
  --warning-color: #f39c12;
  --emergency-color: #e74c3c;
  --success-color: #27ae60;
  --light-bg: #ecf0f1;
  --border-color: #bdc3c7;
  --text-color: #2c3e50;
  --light-text: #7f8c8d;
}

/* Dunkel / Hoher Kontrast: siehe theme.css */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--primary-color);
  min-height: 100vh;
  color: var(--text-color);
}

#app {
  width: 100%;
  min-height: 100vh;
}

/* ===== SCREEN DISPLAY ===== */
.screen {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== LOGIN SCREEN ===== */
#loginScreen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
  padding: 20px;
  background: var(--primary-color);
}

.login-container {
  background: white;
  border-radius: 10px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 100%;
}

.login-container h1 {
  color: var(--primary-color);
  margin-bottom: 30px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#loginError {
  color: var(--emergency-color);
  font-size: 14px;
  margin-top: 10px;
}

/* ===== NAVBAR ===== */
.navbar {
  background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
}

.navbar-logo {
  height: 40px;
  margin-right: 12px;
  border-radius: 5px;
}

.navbar-menu {
  display: flex;
  gap: 10px;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 900px;
  margin: 20px auto;
  padding: 0 20px;
}

/* ===== ADMIN INFO BANNER ===== */
.admin-info-banner {
  background: white;
  color: var(--text-color);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.admin-info-banner h3 {
  margin-bottom: 10px;
  font-size: 18px;
  color: var(--secondary-color);
}

.admin-info-banner p,
.admin-info-banner .rich-content {
  line-height: 1.6;
  font-size: 14px;
}

.admin-info-banner .rich-content p {
  margin: 0 0 8px;
}

.admin-info-banner .rich-content p:last-child {
  margin-bottom: 0;
}

.admin-info-images {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
}

.admin-info-images img {
  cursor: zoom-in;
}

.info-photo-upload {
  margin: -10px 0 20px;
}

/* .btn-sm is transparent-white by default (made for the colored sidebar/banners),
   which makes it invisible here on the plain page background — force the
   green success style regardless of class order. */
.info-photo-upload .btn-sm {
  background: var(--accent-color);
  color: white;
  border: none;
}

.info-photo-upload .btn-sm:hover {
  background: #229954;
}

/* ===== NEWS / ANMERKUNGEN FELD ===== */
.admin-news-banner {
  background: #fffdf5;
  color: var(--text-color);
  padding: 18px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--warning-color);
}

.admin-news-banner h3 {
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--warning-color);
}

.admin-news-banner p {
  line-height: 1.6;
  font-size: 15px;
  white-space: pre-wrap;
}

/* ===== DUTY BANNER ===== */
.duty-banner {
  background: rgba(255, 255, 255, 0.95);
  color: var(--secondary-color);
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--accent-color);
  font-size: 15px;
  font-weight: 600;
}

/* ===== DATE NAVIGATION ===== */
.date-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.date-display {
  font-size: 18px;
  font-weight: 600;
  color: white;
  background: var(--emergency-color);
  padding: 10px 20px;
  border-radius: 5px;
  min-width: 200px;
  text-align: center;
}

/* Prev/next day buttons in the daily checklist view */
.date-nav .btn-sm {
  background: #f1c40f;
  color: var(--secondary-color);
  border: 1px solid #d4ac0d;
  font-weight: 600;
}

.date-nav .btn-sm:hover {
  background: #d4ac0d;
}

/* ===== TASKS CONTAINER ===== */
.tasks-container {
  background: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.loader {
  text-align: center;
  padding: 40px;
  color: var(--light-text);
}

/* ===== TASK ITEM ===== */
.task-item {
  display: flex;
  align-items: flex-start;
  padding: 15px;
  margin-bottom: 10px;
  background: var(--light-bg);
  border-left: 4px solid var(--primary-color);
  border-radius: 5px;
  transition: all 0.3s;
}

.task-item.completed {
  background: #d5f4e6;
  border-left-color: var(--accent-color);
  opacity: 0.7;
}

.task-item.optional {
  border-left-color: var(--warning-color);
}

.task-item.incomplete-late {
  background: #ffe6e6;
  border-left-color: var(--emergency-color);
  animation: pulse-emergency 1s infinite;
}

@keyframes pulse-emergency {
  0%, 100% { background: #ffe6e6; }
  50% { background: #ffcccc; }
}

.task-checkbox {
  width: 24px;
  height: 24px;
  margin-right: 15px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 3px;
}

.task-content {
  flex-grow: 1;
}

.task-name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 5px;
  word-break: break-word;
}

.task-meta {
  font-size: 12px;
  color: var(--light-text);
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.task-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.task-badge.optional {
  background: rgba(243, 156, 18, 0.2);
  color: var(--warning-color);
}

.task-badge.completed {
  background: rgba(39, 174, 96, 0.2);
  color: var(--accent-color);
}

/* Overdue mandatory task after 20:00 → warning */
.task-item.task-warning {
  background: #fff8e6;
  border-left-color: var(--warning-color);
}
.task-badge.warning {
  background: rgba(243, 156, 18, 0.2);
  color: var(--warning-color);
}

/* Forgotten mandatory task (day over) → error */
.task-item.task-error {
  background: #fdecea;
  border-left-color: var(--emergency-color);
}
.task-badge.error {
  background: rgba(231, 76, 60, 0.2);
  color: var(--emergency-color);
}

/* ===== COMMENTS ===== */
.task-comments {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.comment-form input {
  flex-grow: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
}

.comment-form button {
  padding: 8px 12px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.comments-list {
  font-size: 13px;
  margin-top: 10px;
}

.comment-item {
  background: white;
  padding: 8px 12px;
  margin-bottom: 5px;
  border-left: 3px solid var(--primary-color);
  border-radius: 3px;
}

.comment-author {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 3px;
}

.comment-text {
  color: var(--text-color);
  word-break: break-word;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-block;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-color);
  filter: brightness(0.9);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #1a252f;
}

.btn-success {
  background: var(--accent-color);
  color: white;
}

.btn-success:hover {
  background: #229954;
}

.btn-warning {
  background: var(--warning-color);
  color: white;
}

.btn-warning:hover {
  background: #d68910;
}

.btn-danger {
  background: var(--emergency-color);
  color: white;
}

.btn-danger:hover {
  background: var(--emergency-color);
  filter: brightness(0.9);
}

.btn-small {
  padding: 8px 15px;
  font-size: 12px;
}

.btn-sm {
  padding: 8px 15px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid white;
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ===== DRIVE ===== */
.drive-actions-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.drive-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 130px;
  padding: 22px 18px;
  background: var(--primary-color, #4a6fa5);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.drive-action-btn:hover {
  filter: brightness(0.92);
  transform: translateY(-2px);
}

.drive-action-icon {
  font-size: 42px;
  line-height: 1;
}

.drive-action-label {
  text-align: center;
}

/* Toolbar buttons sit on a WHITE modal background, so they need their own
   visible style instead of .btn-sm (which is white-on-transparent, made for
   the colored sidebar and is invisible here). */
.drive-toolbar-btn {
  padding: 8px 14px;
  font-size: 13px;
  background: #eef1f5;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
}

.drive-toolbar-btn:hover {
  background: #dfe4ea;
}

/* Quill rich-text editor (used for Drive notes) */
#driveNoteBody {
  background: #fff;
}

#driveNoteBody .ql-toolbar {
  border-radius: 6px 6px 0 0;
  background: #f7f7f9;
}

#driveNoteBody .ql-container {
  border-radius: 0 0 6px 6px;
  font-size: 15px;
  flex: 1;
  min-height: 280px;
}

#driveNoteBody .ql-editor {
  min-height: 280px;
}

/* ===== STATS ===== */
.stats-info {
  text-align: center;
  padding: 15px;
  background: white;
  border-radius: 8px;
  color: var(--light-text);
  font-size: 14px;
}

/* ===== ADMIN DASHBOARD ===== */
.admin-container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.admin-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.admin-card h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  border-bottom: 2px solid var(--light-bg);
  padding-bottom: 10px;
}

/* ===== DESIGN EDITOR ===== */
.color-picker-group {
  margin-bottom: 15px;
}

.color-picker-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 13px;
}

.color-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-input {
  width: 50px;
  height: 40px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.color-input + input[type="text"] {
  flex-grow: 1;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
}

/* ===== TABLES ===== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.admin-table th {
  background: var(--light-bg);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table tr:hover {
  background: var(--light-bg);
}

/* ===== PUTZPLAN: erste Spalte bleibt beim horizontalen Scrollen sichtbar,
   damit man auf dem Handy nicht mehr weiß, welche Zeile man liest ===== */
.putzplan-table {
  min-width: 640px;
}

.putzplan-table .putz-col-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}

.putzplan-table thead .putz-col-sticky {
  z-index: 3;
  background: var(--light-bg);
}

/* Kräftige Linie zwischen Kopfzeile und Daten, dünne Linien zwischen den
   Aufgaben-Zeilen (stärker als die generische .admin-table-Linie, damit sie
   auch auf den farbig hinterlegten Zeilen gut sichtbar bleibt) */
.putzplan-table thead th {
  border-bottom: 3px solid var(--primary-color);
}

/* Kopfzeile (Aufgabe / Woche 1 / Woche 2 / ...) rot hinterlegt – Admin + Assistenz */
.putzplan-table thead th,
.putzplan-table thead .putz-col-sticky {
  background: #f5a3a3;
}

.putzplan-table tbody td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

/* Dünne Linien zwischen den Spalten (Aufgabe / Woche 1 / Woche 2 / ...) */
.putzplan-table th,
.putzplan-table td {
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.putzplan-table th:last-child,
.putzplan-table td:last-child {
  border-right: none;
}

/* Kompaktere Darstellung auf kleinen Bildschirmen, damit weniger gescrollt
   werden muss und man nicht mehr ins Querformat drehen muss */
@media (max-width: 600px) {
  .putzplan-table {
    min-width: 460px;
  }

  .putzplan-table th,
  .putzplan-table td {
    padding: 6px 8px;
    font-size: 12px;
  }

  .putzplan-table .putz-entry strong {
    font-size: 12px;
  }
}

/* ===== MODALS ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 10px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  color: var(--primary-color);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--light-text);
}

.modal-close:hover {
  color: var(--text-color);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar {
    gap: 15px;
  }

  .navbar-brand {
    flex-basis: 100%;
    margin-bottom: 10px;
  }

  .date-nav {
    flex-direction: column;
  }

  .date-display {
    min-width: 100%;
  }

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

  .task-item {
    flex-direction: column;
  }

  .task-checkbox {
    margin-right: 0;
    margin-bottom: 10px;
  }

  .comment-form {
    flex-direction: column;
  }

  .modal-content {
    width: 95%;
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 20px;
  }

  .navbar {
    padding: 10px;
  }

  .navbar-brand {
    font-size: 16px;
  }

  .container,
  .admin-container {
    padding: 0 10px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* ===== DIENSTPLAN GRID ===== */
.schedule-grid {
  font-size: 13px;
}
.schedule-grid th, .schedule-grid td {
  border: 1px solid #e0e0e0;
  padding: 4px 6px;
  min-width: 90px;
}
.shift-chip {
  background: #f8fdf9;
  border-radius: 4px;
  padding: 4px 6px;
  margin-bottom: 4px;
  cursor: pointer;
  line-height: 1.3;
  transition: background 0.15s;
}
.shift-chip:hover {
  background: #eef7f0;
}
.add-shift {
  color: #999;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.add-shift:hover {
  color: var(--primary-color);
  background: rgba(52,152,219,0.08);
}
.extra-chip {
  display: inline-block;
  background: #fff3cd;
  border-radius: 12px;
  padding: 3px 10px;
  margin: 2px;
  font-size: 12px;
  cursor: pointer;
}
.extra-chip:hover {
  background: #ffe8a1;
}

/* ===== ASSISTANT SCHEDULE SECTION ===== */
.schedule-section {
  margin-top: 25px;
}
.schedule-toggle {
  width: 100%;
  padding: 12px;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.schedule-toggle:hover {
  opacity: 0.9;
}
.schedule-month-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 15px 0;
}
#asGrid .schedule-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#asGrid .schedule-grid th,
#asGrid .schedule-grid td {
  border: 1px solid #e0e0e0;
  padding: 4px 6px;
  min-width: 80px;
}
#asGrid .schedule-grid th {
  background: var(--secondary-color);
  color: white;
  font-size: 11px;
}
#asGrid .shift-chip {
  background: #f8fdf9;
  border-radius: 4px;
  padding: 4px 6px;
  margin-bottom: 4px;
  line-height: 1.3;
}
#asGrid .shift-chip.mine {
  background: #e3f2fd;
  cursor: pointer;
  font-weight: 600;
}

/* ===== JAHRESÜBERSICHT URLAUBSKALENDER (Miniatur) ===== */
.year-cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.year-cal-month {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
}

.year-cal-month-title {
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text-color);
}

.year-cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 9px;
  color: var(--light-text);
  text-align: center;
  margin-bottom: 2px;
}

.year-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.year-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  border-radius: 3px;
  color: var(--light-text);
}

.year-cal-day.empty {
  visibility: hidden;
}

/* ===== NEWS (schwarzes Brett) ===== */
.news-feed {
  max-height: 600px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.news-post {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.news-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.news-post-date {
  color: var(--light-text);
  font-size: 12px;
}

.news-post-delete {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  padding: 2px 4px;
}

.news-post-delete:hover {
  opacity: 1;
}

.news-post-text {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.news-post-image {
  max-width: 100%;
  max-height: 320px;
  border-radius: 6px;
  cursor: zoom-in;
  display: block;
}

/* ===== Anleitungen (📖) ===== */
.guide-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.guide-link:hover { color: var(--accent-color, #4a90d9); }
.guide-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 3000; align-items: center; justify-content: center; padding: 12px; }
.guide-box { background: #fff; color: #2c3e50; border-radius: 10px; width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #eee; font-size: 17px; }
.guide-close { border: none; background: none; font-size: 22px; cursor: pointer; padding: 4px 8px; color: #666; }
.guide-body { overflow-y: auto; padding: 12px 16px; line-height: 1.5; position: relative; }
.guide-body img { max-width: 100%; height: auto; }
.guide-body h2 { font-size: 18px; margin: 18px 0 6px; }
.guide-body h2:first-child { margin-top: 0; }
.guide-body h2.guide-target { background: #fff3b0; border-radius: 4px; padding: 2px 6px; }
.guide-foot { padding: 10px 16px; border-top: 1px solid #eee; }
.guide-foot:empty { display: none; }
.guide-note { font-size: 12px; color: #8a6d00; margin-top: 3px; }
.guide-note.bad { color: #c0392b; }
.guide-select { max-width: 100%; padding: 6px; }

/* ===== News: Antworten + Ändern ===== */
.news-post-delete + .news-post-delete { margin-left: 0; }
.news-edited { font-style: italic; }
.news-replies { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.news-replies:empty { display: none; }
.news-reply { margin-left: 14px; padding: 8px 10px; border-left: 3px solid var(--accent-color, #4a90d9); background: rgba(0,0,0,0.03); border-radius: 0 6px 6px 0; }
.news-reply .news-post-text { margin-bottom: 0; }
.news-reply .news-post-image { max-height: 200px; margin-top: 6px; }
.news-reply-bar { margin-top: 8px; }
.news-reply-toggle { background: none; border: 1px solid var(--border-color, #ccc); color: var(--light-text, #666); font-size: 13px; padding: 4px 10px; }
.news-reply-form { gap: 6px; align-items: flex-end; margin-top: 6px; }
.news-reply-form textarea, .news-edit-box textarea { flex: 1; width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid var(--border-color, #ccc); border-radius: 6px; font-family: inherit; font-size: 14px; }
.news-edit-box { margin-bottom: 8px; }

/* ===== Persönliche Info für Assistenten ===== */
.info-badge { display: inline-block; background: #e74c3c; color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
.my-info-banner { background: #fff3cd; border: 1px solid #f0c36d; color: #6b4e00; border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; cursor: pointer; }
.my-info-text { white-space: pre-wrap; font-size: 15px; line-height: 1.5; padding: 12px 14px; border-radius: 8px; background: rgba(0,0,0,0.03); border-left: 4px solid var(--border-color, #ccc); }
.my-info-text.unread { border-left-color: #e74c3c; background: #fff8f7; }
.my-info-read { color: #27ae60; font-weight: 600; }
.assistant-info-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.assistant-info-item { border: 1px solid var(--border-color, #ddd); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.assistant-info-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.assistant-info-head strong { font-size: 15px; }
.assistant-info-item textarea { width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid var(--border-color, #ccc); border-radius: 6px; font-family: inherit; font-size: 14px; resize: vertical; }
.assistant-info-item button { align-self: flex-start; }
.ai-status.unread { color: #e67e22; font-weight: 600; }
.ai-status.read { color: #27ae60; font-weight: 600; }
#assistantInfoList button:disabled { opacity: 0.45; cursor: default; }
.my-info-item { padding: 12px 14px; border-radius: 8px; background: rgba(0,0,0,0.03); border-left: 4px solid var(--border-color, #ccc); margin-bottom: 12px; }
.my-info-item.unread { border-left-color: #e74c3c; background: #fff8f7; }
.my-info-item .my-info-text { padding: 0; background: none; border: none; margin: 4px 0 10px; }
.my-info-date { color: #999; font-size: 12px; }
.ai-items { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; border-top: 1px solid var(--border-color, #eee); padding-top: 8px; }
.ai-item { font-size: 13px; padding: 6px 8px; border-radius: 6px; background: rgba(0,0,0,0.03); border-left: 3px solid #27ae60; }
.ai-item.unread { border-left-color: #e67e22; }
.ai-item-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.ai-item-text { white-space: pre-wrap; margin-top: 3px; }
.ai-del { margin-left: auto; background: none; border: none; cursor: pointer; opacity: 0.5; font-size: 13px; padding: 0 2px; }
.ai-del:hover { opacity: 1; }

/* ===== Sicherung (Admin) ===== */
.backup-state { font-weight: 700; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.backup-state.ok { background: #e8f5e9; color: #2e7d32; }
.backup-state.bad { background: #fff3e0; color: #e65100; }
.backup-facts td { padding: 4px 12px 4px 0; vertical-align: top; font-size: 14px; }
.backup-facts td:first-child { color: #777; white-space: nowrap; }
.backup-log-line { font-family: monospace; font-size: 12px; padding: 2px 0; }
.backup-log-line.bad { color: #c0392b; }

/* Reiter für zusammengefasste Menüpunkte (common.js: renderMenuGroupTabs) */
.page-tabs { display: flex; gap: 4px; margin: -8px 0 18px; overflow-x: auto; border-bottom: 2px solid var(--border-color, #ddd); -webkit-overflow-scrolling: touch; }
.page-tab { flex: 0 0 auto; padding: 10px 16px; background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; font-size: 15px; font-weight: 600; color: #666; cursor: pointer; white-space: nowrap; }
.page-tab:hover { color: var(--primary-color); }
.page-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
@media (max-width: 480px) { .page-tab { padding: 10px 12px; font-size: 14px; } }
body.print-mode .page-tabs { display: none !important; }

/* Versionsnummer unten links, etwas dunkler als die Sekundärfarbe */
.version-badge { position: fixed; bottom: 8px; left: 12px; font-size: 12px; font-weight: 600; color: #1f2d3a; color: color-mix(in srgb, var(--secondary-color, #2c3e50) 75%, black); background: rgba(255,255,255,0.85); padding: 2px 8px; border-radius: 10px; z-index: 9999; pointer-events: none; }
body.print-mode .version-badge { display: none; }

/* Urlaub: Umschalter „pro Woche / pro Monat“ (common.js: vacHoursFieldHtml) */
.vac-unit { display: inline-flex; border: 1px solid var(--primary-color); border-radius: 6px; overflow: hidden; flex: 0 0 auto; }
.vac-unit button { background: #fff; color: var(--primary-color); border: none; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.vac-unit button.active { background: var(--primary-color); color: #fff; }
.vac-unit-hint { font-size: 12px; color: #777; margin-top: 4px; min-height: 14px; }

/* ===== Barrierefreiheit (v4, a11y.js) ===== */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100000; background: #fff; color: #000; padding: 10px 16px; border: 3px solid #1a5fb4; border-radius: 6px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 8px; }
/* Deutlich sichtbarer Tastatur-Fokus (WCAG 2.4.7 / 2.4.13) */
:focus-visible { outline: 3px solid #1a5fb4 !important; outline-offset: 2px !important; box-shadow: 0 0 0 5px #fff !important; }
.as-sidebar :focus-visible, .admin-sidebar :focus-visible { outline-color: #fff !important; box-shadow: 0 0 0 5px #1a5fb4 !important; }
/* Weniger Bewegung, wenn im Gerät eingestellt */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .as-menu-btn:hover, .admin-menu-btn:hover { transform: none !important; }
}
/* Leichte Sprache: größere Schrift, mehr Abstand, Erklärung oben auf jeder Seite */
.ls-intro { display: none; }
html.ls .ls-intro { display: block; background: #fffbe6; border: 2px solid #e0c200; border-radius: 10px; padding: 14px 18px; margin: 0 0 18px; font-size: 19px; line-height: 1.6; color: #222; }
html.ls body { font-size: 18px; line-height: 1.6; }
html.ls .as-menu-btn, html.ls .admin-menu-btn { font-size: 17px; padding: 14px 16px; }
html.ls .page-tab { font-size: 17px; padding: 12px 16px; }
html.ls .btn, html.ls button { min-height: 44px; }
html.ls .task-name { font-size: 19px; }
html.ls .as-header h1, html.ls .admin-header h1 { font-size: 28px; }
.ls-toggle[aria-pressed="true"] { background: #fff !important; color: #1b1b1b !important; font-weight: 700; }

/* Erledigte Aufgaben: nicht durchsichtig (Kontrast), sondern grün + durchgestrichen */
.task-item.completed { opacity: 1 !important; }
.task-item.completed .task-name { text-decoration: line-through; text-decoration-thickness: 2px; }
/* Mindestgröße für Tipp-Ziele (WCAG 2.5.8: 24 × 24 px) */
input[type="checkbox"], input[type="radio"] { min-width: 24px; min-height: 24px; }
[role="button"]:not(button) { min-height: 24px; display: inline-block; }
div[role="button"] { display: block; }
#driveBreadcrumb a { display: inline-block; min-height: 24px; line-height: 24px; }
.guide-link { display: inline-block; min-height: 24px; }
input[type="text"], input[type="date"], input[type="time"], input[type="number"], input[type="password"], select { min-height: 28px; }
/* Handy: Formular „Neue Putzaufgabe“ untereinander statt 4 gequetschte Spalten */
@media (max-width: 600px) { .admin-form-group[style*="grid-template-columns:1fr auto auto auto"] { grid-template-columns: 1fr !important; } }

/* Einstellungen → Sprache & Größe (i18n.js) */
.prefs-row { display: flex; flex-wrap: wrap; gap: 10px; }
.prefs-choice { min-width: 130px; padding: 12px 16px; line-height: 1.3; text-align: center; }

/* Passwortfelder: Knopf „Anzeigen“ + Stärke-Anzeige (common.js) */
.pw-wrap { display: flex; gap: 6px; align-items: stretch; width: 100%; }
.pw-wrap input { flex: 1; min-width: 0; }
.pw-toggle { flex: none; padding: 0 12px; border: 1px solid var(--border-color, #ccc); border-radius: 6px; background: #f4f4f4; color: #222; cursor: pointer; font-size: 14px; }
.pw-strength { font-size: 13px; margin-top: 4px; min-height: 1.1em; font-weight: 600; }

/* Passwort-Anforderungen über dem Feld „Neues Passwort“ */
.pw-rules { font-size: 14px; line-height: 1.5; background: #f3f6f1; border: 1px solid #d6ddd2; border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; color: #222; }
.pw-rules ul { margin: 4px 0 6px 20px; padding: 0; }
.pw-rules li { margin: 2px 0; }
html.dark .pw-rules { background: #272b27; border-color: #3a3f3a; color: #e8ebe6; }
html.high-contrast .pw-rules { border: 2px solid #fff !important; }

/* Volle Bildschirmhöhe auch bei Schriftgröße Klein/Groß: html.style.zoom verkleinert sonst 100vh mit,
   dann endet das Menü links zu früh (Streifen darunter). --app-zoom setzt i18n.js. */
body, #app, #loginScreen, .as-layout, .admin-layout { min-height: calc(100vh / var(--app-zoom, 1)) !important; }

/* ===== Einstellungen → Anzeige / Barrierefreiheit ===== */
.prefs-page { display: flex; flex-direction: column; gap: 26px; }
.prefs-section h3 { margin: 0 0 6px; }
.prefs-text { color: #555; margin: 0 0 10px; line-height: 1.5; }
.prefs-row { display: flex; gap: 10px; flex-wrap: wrap; }
.prefs-row .prefs-choice { flex: 1; min-width: 100px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.prefs-icon { font-size: 1.3em; }
.prefs-big { font-size: 1.15em; font-weight: 700; }
.prefs-switch { width: 100%; padding: 12px; font-size: 1.05em; font-weight: 700; }

/* Ruhige Anzeige: keine Bewegung */
html.a11y-calm *, html.a11y-calm *::before, html.a11y-calm *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
html.a11y-calm .as-menu-btn:hover, html.a11y-calm .admin-menu-btn:hover { transform: none !important; }

/* Leichter tippen und lesen */
html.a11y-touch body { line-height: 1.7; }
html.a11y-touch :is(.btn, button, select, input:not([type="checkbox"]):not([type="radio"]):not([type="color"])) { min-height: 48px; }
html.a11y-touch :is(.btn, button):not(.bottom-nav button) { padding-left: 16px; padding-right: 16px; }
html.a11y-touch .bottom-nav button { min-height: 60px; }
html.a11y-touch input[type="checkbox"], html.a11y-touch input[type="radio"] { min-width: 32px; min-height: 32px; }
html.a11y-touch :is(.as-menu-btn, .admin-menu-btn, .page-tab) { padding-top: 14px !important; padding-bottom: 14px !important; margin-bottom: 8px; }
html.a11y-touch :is(.prefs-row, .btn-group) { gap: 14px; }
html.a11y-touch a:not(.btn) { text-decoration: underline !important; text-underline-offset: 3px; }
html.a11y-touch :focus-visible { outline: 4px solid #1a5fb4 !important; outline-offset: 3px !important; box-shadow: 0 0 0 7px #fff !important; }
html.a11y-touch p, html.a11y-touch li { max-width: 70ch; }

/* Vorlesen-Knopf (a11y.js) */
#ttsBtn { position: fixed; left: 12px; bottom: 12px; z-index: 9990; display: none; align-items: center; gap: 6px;
  padding: 10px 16px; min-height: 48px; border-radius: 999px; border: 2px solid #1b1b1b; background: #fff; color: #1b1b1b;
  font-size: 16px; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.25); cursor: pointer; }
html.a11y-tts #ttsBtn { display: inline-flex; }
#ttsBtn[aria-pressed="true"] { background: #1b1b1b; color: #fff; }
/* Handy: nur rundes Symbol, damit nichts verdeckt wird (Beschriftung bleibt für Screenreader) */
@media (max-width: 768px) {
  #ttsBtn { bottom: 84px; width: 52px; height: 52px; padding: 0; justify-content: center; font-size: 22px; }
  #ttsBtn .tts-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html.a11y-tts :is(.as-content, .admin-content) { padding-bottom: 150px !important; }
}
html.dark #ttsBtn { background: #1e211e; color: #e8ebe6; border-color: #e8ebe6; }
html.high-contrast #ttsBtn { background: #000 !important; color: #fff !important; border: 2px solid #fff !important; }
html.high-contrast #ttsBtn[aria-pressed="true"] { background: #ffe600 !important; color: #000 !important; }
@media print { #ttsBtn { display: none !important; } }
html.a11y-tts .version-badge { bottom: 70px !important; }
@media (max-width: 768px) { html.a11y-tts .version-badge { bottom: 142px !important; } }
.pw-rules p { margin: 4px 0 0; }

/* Datumsfelder dürfen schmaler werden als ihr Inhalt (sonst ragen sie am Handy aus dem Rahmen) */
input[type="date"], input[type="time"], input[type="month"] { min-width: 0; max-width: 100%; box-sizing: border-box; }
/* Urlaubskalender (Monat): immer volle Breite, am Handy kompakt statt abgeschnitten */
.vac-cal { table-layout: fixed; width: 100%; }
@media (max-width: 600px) { .vac-cal th, .vac-cal td { padding: 6px 2px !important; font-size: 12px; } }

/* Telegram verbinden */
.tg-mode { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.tg-mode .btn { flex: 1; min-width: 140px; }
.tg-steps { padding-left: 22px; margin: 0 0 14px; line-height: 1.6; }
.tg-steps li { margin-bottom: 10px; }
.tg-more { margin: 4px 0 0; color: #555; font-size: 14px; }
.tg-label { display: block; font-weight: 600; margin-bottom: 4px; }
.tg-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tg-row input { flex: 1; min-width: 180px; padding: 10px; font-size: 16px; border: 1px solid var(--border-color, #ccc); border-radius: 6px; }
.tg-msg { min-height: 1.4em; margin: 10px 0; font-weight: 600; }
.tg-help { margin-top: 10px; font-size: 14px; }
.tg-help summary { cursor: pointer; color: #555; }
.tg-help ul, .tg-help p { margin: 8px 0; padding-left: 18px; line-height: 1.5; }
html.dark .tg-more, html.dark .tg-help summary { color: #b4bbb3; }
.tg-open { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px !important; min-height: 44px; background: #2a7ab8 !important; color: #fff !important; border-radius: 10px; font-weight: 700; text-decoration: none !important; }
html.high-contrast .tg-open { background: #000 !important; color: #ffe600 !important; border: 2px solid #ffe600 !important; }

/* Mein Dienst: „Meine nächsten Dienste“ über der Tabelle */
.my-next-box { margin: 10px 0 16px; }
.my-next-title { margin: 0 0 8px; font-size: 1.05em; }
.my-next { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.my-next li { display: flex; gap: 12px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: #eef5e9; border-left: 4px solid var(--primary-color); }
.my-next li strong { min-width: 78px; }
.my-next-tag { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: #fff3cd; color: #6b4e00; }
.my-next-empty { color: #555; margin: 0; }
html.dark .my-next li { background: #1f3322; }
html.high-contrast .my-next li { border: 2px solid #fff; }

/* Putzplan: nicht erledigte Wochen ruhig statt rot durchgestrichen */
td.putz-missed { background: #f3f3f3 !important; text-align: center; }
.putz-x { color: #767676; font-weight: 700; }
html.dark td.putz-missed { background: #272b27 !important; }
html.dark .putz-x { color: #b4bbb3; }

/* Zukünftige Dienstpläne (Admin): Umschalter „Nur Abweichungen / Alle Namen“ */
.prelim-toggle { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.prelim-hint { color: #555; font-size: 13px; margin: 0 0 10px; }
.prelim-free { font-size: 11px; color: #1e7e34; margin-top: 3px; }
html.dark .prelim-free { color: #7fd48f; }

/* Assistenten verwalten: aufklappbare Karten */
.as-card { border: 1px solid var(--d-line, #e3e5e0); border-radius: 12px; margin-bottom: 10px; background: var(--d-card, #fff); }
.as-card summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; cursor: pointer; list-style: none; }
.as-card summary::-webkit-details-marker { display: none; }
.as-card summary::after { content: '▸'; margin-left: auto; color: #666; }
.as-card[open] summary::after { content: '▾'; }
.as-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); flex: none; }
.as-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.as-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef0ec; color: #333; }
.as-tag-ok { background: #e3f3e6; color: #1e5e2c; }
.as-tag-warn { background: #fff3e0; color: #7a4100; }
.as-card-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; padding: 4px 14px 14px; }
.as-card-body > label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.as-card-body input[type="text"], .as-card-body input[type="date"], .as-card-body input[type="number"] { padding: 8px; border: 1px solid var(--border-color, #ccc); border-radius: 6px; font-weight: 400; }
.as-card-body input[type="color"] { width: 48px; height: 36px; padding: 0; border: 1px solid var(--border-color, #ccc); border-radius: 6px; }
.as-inline { display: flex; gap: 6px; }
.as-inline input { flex: 1; min-width: 0; }
.as-card-body > label.as-check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.as-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
html.dark .as-tag { background: #2f352f; color: #e8ebe6; }
html.dark .as-tag-ok { background: #1f3322; color: #bfe8c7; }
html.dark .as-tag-warn { background: #3a3218; color: #f3e1b0; }

/* Einkaufsliste: Aktionen hinter „⋯“ */
.shop-actions { position: relative; display: inline-flex; align-items: center; }
.shop-actions-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-direction: column; gap: 6px; padding: 8px; min-width: 140px;
  background: var(--d-card, #fff); border: 1px solid var(--d-line, #ccc); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.shop-actions-menu[hidden] { display: none; }
.shop-more { min-width: 40px; font-size: 18px !important; line-height: 1; background: transparent !important; border: 1px solid var(--d-line, #ccc) !important; color: inherit !important; }

/* Startseite „Heute“ (Admin) */
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.today-card { margin: 0 !important; }
.today-card h2 { font-size: 1.15em; }
.today-big { font-size: 1.1em; margin: 0 0 8px; }
.today-list { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; }
.today-link { margin: 12px 0 0; font-weight: 600; }
.today-card .day-progress-bar { margin: 8px 0 12px; }
