/* NetDoku-inspiriertes Dashboard-Theme */
:root {
  --header-bg: #2d3748;
  --header-text: #fff;
  --header-muted: rgba(255,255,255,0.85);
  --bg: #f7fafc;
  --bg-card: #fff;
  --accent: #3182ce;
  --accent-dim: #2c5282;
  --text: #2d3748;
  --text-muted: #718096;
  --border: #e2e8f0;
  --error: #e53e3e;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  /* Stat-Karten Farben */
  --stat-pink: #ed64a6;
  --stat-blue: #4299e1;
  --stat-orange: #ed8936;
  --stat-purple: #9f7aea;
  --stat-teal: #38b2ac;
  --stat-green: #27ae60;
  --stat-yellow: #d4a017;
  --stat-slate: #64748b;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

/* Dezenter Verlauf: oben links weiß → unten rechts hellgrau */
body:not(.login-page):not(.setup-page) {
  background: linear-gradient(135deg, #ffffff 0%, #e5e8ec 100%);
  background-attachment: fixed;
}

/* Setup & Login – unverändert */
.setup-page, .login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.setup-card { max-width: 520px; }
.card h1 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.subtitle { color: var(--text-muted); margin: 0 0 1.5rem; }
.form h2 { font-size: 1rem; margin: 1.5rem 0 0.75rem; color: var(--text-muted); }
.form-row { margin-bottom: 1rem; }
.column-checkboxes { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; max-height: 12rem; overflow-y: auto; padding: 0.5rem 0; }
.column-checkboxes .column-check { display: flex; align-items: center; gap: 0.25rem; margin: 0; font-weight: normal; white-space: nowrap; }

/* Multi-Select-Dropdown */
.multiselect-dropdown { position: relative; width: 100%; max-width: 420px; }
.multiselect-trigger {
  width: 100%; text-align: left; padding: 0.65rem 2.2rem 0.65rem 0.85rem; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 1rem; cursor: pointer; color: var(--text); display: flex; align-items: center; justify-content: flex-start;
}
.multiselect-trigger:hover { border-color: var(--accent); }
.multiselect-trigger::after { content: '▾'; position: absolute; right: 0.85rem; font-size: 0.9em; color: var(--text-muted); }
.multiselect-trigger.open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2); }
.multiselect-panel {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 2px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 4px 12px rgba(0,0,0,0.15); max-height: 220px; overflow-x: auto; overflow-y: auto; z-index: 100;
  display: none; padding: 0.5rem; min-width: 100%; text-align: left;
}
.multiselect-dropdown.open .multiselect-panel { display: block; }
.multiselect-panel .column-check {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.5rem;
  margin: 0.35rem 0; padding: 0.25rem 0.5rem; cursor: pointer;
  white-space: nowrap; text-align: left;
}
.multiselect-panel .column-check:hover { background: rgba(49, 130, 206, 0.06); border-radius: 4px; }
.multiselect-panel .column-check input {
  margin: 0; width: 1.1rem; min-width: 1.1rem; height: 1.1rem; flex-shrink: 0;
}
.multiselect-panel .column-check .column-check-label {
  flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis;
}
.multiselect-panel .multiselect-empty { color: var(--text-muted); font-size: 0.9rem; padding: 0.5rem; }
.form-row label { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; }
.form-row input, .form-row select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}
.form-row textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.password-with-generate, .password-with-eye {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.password-with-generate input, .password-with-eye input { flex: 1; min-width: 0; }
.password-with-generate .btn, .password-with-eye .btn { flex-shrink: 0; }
.pwd-eye-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pwd-eye-btn:hover { color: var(--text); }
.form-row-color .color-input-wrap { display: flex; align-items: center; gap: 0.75rem; }
.form-row-color .color-preview {
  display: inline-block; width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); flex-shrink: 0;
}
.form-row-color .color-picker-input {
  width: auto; min-width: 4rem; height: 2.5rem; padding: 0.2rem; cursor: pointer;
}

.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: rgba(49, 130, 206, 0.08); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.form-actions-row { display: flex; gap: 0.75rem; align-items: center; margin-top: 1rem; }
.form-actions-row .btn-danger { margin-left: auto; }
.error { color: var(--error); margin-top: 0.75rem; font-size: 0.9rem; }

/* Header – dunkel wie NetDoku */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--header-bg);
  color: var(--header-text);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}
.app-header-brand:hover { color: inherit; opacity: 0.95; }
.app-header-brand-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.app-header-brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}
.app-header-brand-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  letter-spacing: 0.02em;
}
.app-header h1 { margin: 0; font-size: 1.25rem; font-weight: 600; }

.app-header nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.app-header nav a {
  color: var(--header-muted);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.app-header nav a:hover, .app-header nav a.active {
  color: var(--header-text);
  background: rgba(255,255,255,0.1);
}
.user-info {
  color: var(--header-muted);
  font-size: 0.9rem;
  margin-right: 1rem;
}
.app-header .btn-sm {
  background: transparent;
  color: var(--header-muted);
  border: 1px solid rgba(255,255,255,0.3);
}
.app-header .btn-sm:hover {
  background: rgba(255,255,255,0.1);
  color: var(--header-text);
}
.app-header-right a.btn-sm { text-decoration: none; }
.app-header-right a.btn-sm.active {
  background: rgba(255,255,255,0.15);
  color: var(--header-text);
}

/* Main */
.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Dashboard-Bereich */
.dashboard-welcome {
  margin-bottom: 1.5rem;
}
.dashboard-welcome h2 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  color: var(--text);
}
.dashboard-welcome p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Stat-Karten Reihe */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow), 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  pointer-events: none;
}
.stat-card-pink { background: var(--stat-pink); }
.stat-card-blue { background: var(--stat-blue); }
.stat-card-orange { background: var(--stat-orange); }
.stat-card-purple { background: var(--stat-purple); }
.stat-card-teal { background: var(--stat-teal); }
.stat-card-green { background: var(--stat-green); }
.stat-card-yellow { background: var(--stat-yellow); }
.stat-card-slate { background: var(--stat-slate); }
.stat-card-icon,
.stat-card-value,
.stat-card-label { position: relative; z-index: 1; }
.stat-card-clickable { cursor: pointer; }
.stat-card-clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
}
.stat-card-icon { font-size: 1.5rem; margin-bottom: 0.5rem; opacity: 0.95; }
.stat-card-value { font-size: 1.75rem; font-weight: 700; }
.stat-card-label { font-size: 0.85rem; opacity: 0.95; }
.stat-card-export-btn {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s, transform 0.2s;
}
.stat-card-export-btn:hover {
  background: rgba(255,255,255,0.4);
  transform: scale(1.05);
}

/* Projekt-Kacheln – modernes Design */
.project-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.project-tile {
  border-radius: 20px;
  padding: 1.5rem;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.project-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 20px 20px 0 0;
}
.project-tile-sign {
  border: 2px solid rgba(0,0,0,0.12);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
}
.project-tile-sign:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.2), 0 8px 20px rgba(0,0,0,0.1);
  border-color: rgba(0,0,0,0.2);
}
.project-tile-back,
.project-tile-archiv {
  background: linear-gradient(145deg, #6b7280 0%, #5a6070 100%);
  border: 2px dashed rgba(255,255,255,0.4);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.project-tile-archiv { background: linear-gradient(145deg, #374151 0%, #2d3748 100%); }
.project-tile-back:hover,
.project-tile-archiv:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.2);
}
.project-tile-sign-content {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0;
  position: relative;
  z-index: 1;
}
.project-tile-sign .project-tile-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-shadow: 0 0 1px #000, 0 0 2px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.project-tile-sign .project-tile-meta {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255,255,255,0.95);
  margin: 0;
  text-shadow: 0 0 1px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.project-tile-light .project-tile-title,
.project-tile-light .project-tile-meta {
  color: #000;
  text-shadow: 0 0 1px #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}
.project-tile-light .project-tile-actions { border-top-color: rgba(0,0,0,0.2); }
.project-tile-light .project-tile-open { border-color: #333; }
.project-tile-light .project-tile-actions-right button,
.project-tile-light .project-edit-btn,
.project-tile-light .project-delete-btn {
  border-color: #333;
  color: #000;
}
.project-tile-light .project-tile-actions-right button:hover,
.project-tile-light .project-edit-btn:hover,
.project-tile-light .project-delete-btn:hover { background: rgba(0,0,0,0.08); }
.project-tile-back .project-tile-title,
.project-tile-archiv .project-tile-title { font-size: 1.2rem; font-weight: 600; margin: 0 0 0.2rem; }
.project-tile-back .project-tile-meta,
.project-tile-archiv .project-tile-meta { font-size: 0.9rem; opacity: 0.9; margin: 0; }
.project-tile-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.35);
  position: relative;
  z-index: 1;
}
.project-tile-actions-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.project-tile-back .project-tile-actions,
.project-tile-archiv .project-tile-actions { display: none; }
.project-tile-sign .project-tile-open {
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.95);
  color: #333;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
}
.project-tile-sign .project-tile-open:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}
.project-tile-actions-right { display: flex; gap: 0.4rem; }
.project-tile-sign .project-tile-actions-right button {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 0.4rem 0.55rem;
  font-size: 1rem;
  border-radius: 10px;
  color: #fff;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}
.project-tile-sign .project-tile-actions-right button:hover,
.project-tile-sign .project-edit-btn:hover,
.project-tile-sign .project-delete-btn:hover {
  background: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.9);
  transform: translateY(-1px);
}
.project-tile-sign .project-edit-btn,
.project-tile-sign .project-delete-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.6);
  color: #fff;
  cursor: pointer;
  padding: 0.4rem 0.55rem;
  font-size: 1rem;
  border-radius: 10px;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}
.project-tile-sign .project-restore-btn {
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  background: rgba(255,255,255,0.95);
  color: #333;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.2s ease;
}
.project-tile-sign .project-restore-btn:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

/* Nächste Termine (Dashboard) */
.my-next-appointments { margin-top: 2rem; }
.my-next-appointments h3 { font-size: 1.1rem; margin: 0 0 1rem; }
.my-appts-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.my-appts-toggle-wrap { margin-top: 0.75rem; display: flex; gap: 0.5rem; }
.my-appts-table th, .my-appts-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.my-appts-table th { font-weight: 600; color: var(--text-muted); }
.project-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}
.team-badge-kennzeichen {
  display: inline-flex;
  align-items: stretch;
  min-width: 90px;
  max-width: 200px;
  height: 1.5rem;
  background: #fff;
  border: 2px solid #333;
  border-left: 6px solid var(--team-accent, #003399);
  border-radius: 4px;
  overflow: hidden;
  font-family: 'Courier New', 'DIN Alternate', 'FE-Schrift', monospace;
  font-weight: 700;
  font-size: 0.65rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.team-badge-eu {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0 0.15rem;
  background: #003399;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
}
.team-badge-name {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0 0.4rem;
  color: #000;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-badge-hoverable { cursor: help; }

/* Team-Car Popover (Hover über Kennzeichen) */
.team-car-popover {
  position: fixed;
  z-index: 10000;
  visibility: hidden;
  pointer-events: auto;
}
.team-car-popover-inner {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  padding: 0;
  overflow: hidden;
}
.team-car-image-wrap {
  position: relative;
  width: 180px;
  height: 120px;
}
.team-car-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.team-car-member {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  padding: 4px;
}
.team-car-member-left { left: 18%; }
.team-car-member-right { right: 18%; }
.team-car-member-name {
  font-size: 0.55rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  word-break: break-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Projekt-Detail Header */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.project-header .project-header-actions { flex-shrink: 0; }
.project-header-left { display: flex; flex-direction: column; gap: 0.25rem; }
.project-header-left > div:first-child { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.project-header h2 { margin: 0; font-size: 1.4rem; }
.project-header-badge {
  background: var(--header-bg);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}
.project-header-location { color: var(--text-muted); font-size: 0.9rem; }
.project-header-actions { display: flex; gap: 0.5rem; }
.project-header-actions .btn { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.project-header-actions .btn:hover { background: var(--bg); }
.project-header-actions .btn-danger { background: var(--error); color: #fff; border-color: var(--error); }

/* Kacheln-Navigation (Funktionen) */
.tile-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.tile-nav-item {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
}
.tile-nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 50%);
  opacity: 0.6;
  pointer-events: none;
}
.tile-nav-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.tile-nav-item:hover, .tile-nav-item.active {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(49, 130, 206, 0.2);
}
.tile-nav-item.active {
  background: rgba(49, 130, 206, 0.06);
  box-shadow: 0 4px 16px rgba(49, 130, 206, 0.15), inset 0 1px 0 rgba(255,255,255,0.5);
}
.tile-nav-icon, .tile-nav-label { position: relative; z-index: 1; }
.tile-nav-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.tile-nav-label { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.tile-nav-item.tile-color-pink { border-color: var(--stat-pink); }
.tile-nav-item.tile-color-pink:hover, .tile-nav-item.tile-color-pink.active { border-color: var(--stat-pink); }
.tile-nav-item.tile-color-blue { border-color: var(--stat-blue); }
.tile-nav-item.tile-color-blue:hover, .tile-nav-item.tile-color-blue.active { border-color: var(--stat-blue); }
.tile-nav-item.tile-color-orange { border-color: var(--stat-orange); }
.tile-nav-item.tile-color-orange:hover, .tile-nav-item.tile-color-orange.active { border-color: var(--stat-orange); }
.tile-nav-item.tile-color-teal { border-color: var(--stat-teal); }
.tile-nav-item.tile-color-teal:hover, .tile-nav-item.tile-color-teal.active { border-color: var(--stat-teal); }
.tile-nav-item.tile-color-purple { border-color: var(--stat-purple); }
.tile-nav-item.tile-color-purple:hover, .tile-nav-item.tile-color-purple.active { border-color: var(--stat-purple); }
.tile-nav-item.tile-color-slate { border-color: var(--stat-slate); }
.tile-nav-item.tile-color-slate:hover, .tile-nav-item.tile-color-slate.active { border-color: var(--stat-slate); }
.tile-nav-item.tile-nav-action { background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%); border-color: #2b6cb0; }
.tile-nav-item.tile-nav-action .tile-nav-icon, .tile-nav-item.tile-nav-action .tile-nav-label { color: #fff; }
.tile-nav-item.tile-nav-action:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(49, 130, 206, 0.35); }
.tile-nav-item.tile-nav-action::before { background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 50%); }

/* Listen-Bereich */
.list-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.list-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.list-section-header h3 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item-actions { display: flex; gap: 0.35rem; }
.list-item-actions .btn { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* Inner-Content (nach Kacheln) */
.inner-content { margin-top: 0.5rem; }

/* Projekt-Projekteinstellungen – Sub-Navigation & Kacheln */
.settings-subnav { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.settings-subnav-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); }
.settings-subnav-btn:hover { border-color: var(--accent); color: var(--accent); }
.settings-subnav-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.settings-section-title { font-size: 1.1rem; color: var(--text-muted); margin: 0 0 1rem; font-weight: 600; }
.project-settings-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.settings-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  font-family: inherit;
}
.settings-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border-color: transparent;
}
.settings-tile-icon { font-size: 1.75rem; margin-bottom: 0.5rem; line-height: 1; }
.settings-tile-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.settings-tile-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.3; }
.settings-tile-help { border-left: 4px solid var(--stat-blue); }
.settings-tile-help:hover { background: rgba(66, 153, 225, 0.06); box-shadow: 0 6px 20px rgba(66, 153, 225, 0.15); }
.settings-tile-edit { border-left: 4px solid var(--accent); background: linear-gradient(135deg, rgba(49, 130, 206, 0.08) 0%, var(--bg-card) 100%); }
.settings-tile-edit:hover { background: rgba(49, 130, 206, 0.12); box-shadow: 0 6px 20px rgba(49, 130, 206, 0.2); }
.settings-tile-zusatz { border-left: 4px solid var(--stat-purple); }
.settings-tile-zusatz:hover { background: rgba(159, 122, 234, 0.06); box-shadow: 0 6px 20px rgba(159, 122, 234, 0.15); }
.settings-tile-display { border-left: 4px solid var(--stat-teal); }
.settings-tile-display:hover { background: rgba(56, 178, 172, 0.06); box-shadow: 0 6px 20px rgba(56, 178, 172, 0.15); }
.settings-tile-danger { border-left: 4px solid var(--error); }
.settings-tile-danger:hover { background: rgba(229, 62, 62, 0.06); box-shadow: 0 6px 20px rgba(229, 62, 62, 0.15); }
.settings-tile-import { border-left: 4px solid var(--stat-green, #38a169); }
.settings-tile-import:hover { background: rgba(56, 161, 105, 0.06); box-shadow: 0 6px 20px rgba(56, 161, 105, 0.15); }
.settings-tile-teams { border-left: 4px solid var(--stat-purple, #805ad5); }
.settings-tile-teams:hover { background: rgba(128, 90, 213, 0.06); box-shadow: 0 6px 20px rgba(128, 90, 213, 0.15); }
.settings-tile-status { border-left: 4px solid var(--stat-blue, #3182ce); }
.settings-tile-status:hover { background: rgba(49, 130, 206, 0.06); box-shadow: 0 6px 20px rgba(49, 130, 206, 0.15); }
.settings-tile-access { border-left: 4px solid var(--stat-teal, #319795); }
.settings-tile-access:hover { background: rgba(49, 151, 149, 0.06); box-shadow: 0 6px 20px rgba(49, 151, 149, 0.15); }
.settings-detail-area { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* Hilfe / Bedienungsanleitung */
.help-manual { max-width: 56rem; line-height: 1.6; }
.help-manual h3 { margin: 0 0 1rem; font-size: 1.25rem; }
.help-manual h4 { margin: 1.5rem 0 0.6rem; font-size: 1.05rem; color: var(--accent); }
.help-manual h4:first-of-type { margin-top: 0; }
.help-manual p { margin: 0.5rem 0; }
.help-manual ul { margin: 0.5rem 0 1rem; padding-left: 1.5rem; }
.help-manual li { margin-bottom: 0.35rem; }
.help-manual strong { font-weight: 600; }
.help-manual em { color: var(--text-muted); font-style: italic; }

/* Tab-Inner Fallback (wenn nicht als Kacheln) */
.tabs-inner { display: flex; gap: 0.5rem; margin: 1rem 0; flex-wrap: wrap; }
.tab-inner {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}
.tab-inner:hover, .tab-inner.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; background: var(--bg); font-size: 0.85rem; }
td { font-size: 0.9rem; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-content.modal-wide { max-width: 780px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-content.modal-wide.modal-sessions { max-width: 920px; }
.modal-content.modal-wide #modal-body { overflow-y: auto; flex: 1; }
.modal-content.modal-large { min-width: 520px; min-height: 480px; max-height: 90vh; }
.modal-content.modal-large .multiselect-panel { max-height: 400px; }
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-close:hover { color: var(--text); }
#modal-body h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
#modal-body h3 .obj-nav-btn { flex-shrink: 0; margin-left: 0.25rem; }
#modal-body h3 .obj-nav-btn.obj-nav-btn-icon { display: inline-flex; align-items: center; justify-content: center; padding: 0.35rem; }
#modal-body h3 .obj-nav-btn.obj-nav-btn-icon svg { display: block; }

/* Import, Forms */
#import-form { margin: 1rem 0; }
#import-form input[type=file] { margin-right: 1rem; }
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
  background: var(--border);
  color: var(--text-muted);
}
.badge-geplant { background: #ed8936; color: #fff; }
.badge-erledigt { background: #27ae60; color: #fff; }
.badge-inactive { background: #94a3b8; color: #fff; }
.import-preview-scroll {
  max-height: 220px;
  overflow: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.import-preview-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.import-preview-table tr.header-row { background: rgba(49, 130, 206, 0.12); font-weight: 600; }
.import-preview-table th, .import-preview-table td { padding: 0.4rem 0.6rem; }
.import-preview-table th { background: var(--bg); }
#import-mapping-form h4 { margin: 1rem 0 0.5rem; font-size: 1rem; }
.import-mode-row .radio-label { display: block; margin-bottom: 0.5rem; font-weight: normal; cursor: pointer; }
.object-filters { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.object-filters-search { flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; width: 100%; }
.filter-actions-wrap { margin-left: auto; }
.object-filters-search input { flex: 1; min-width: 200px; max-width: 400px; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.object-filter-address-only-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.object-filter-address-only-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.object-filters-search .access-toggle-switch:has(input:checked) {
  background: var(--accent);
}
.object-filters-search .access-toggle-switch:has(input:checked)::after {
  transform: translateX(1.25rem);
}
.filter-preset-wrap { display: flex; align-items: center; gap: 0.35rem; }
.filter-preset-dd .filter-dd-panel { min-width: 220px; max-height: 280px; overflow-y: auto; }
.filter-preset-item { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0.6rem; cursor: pointer; border-radius: var(--radius-sm); }
.filter-preset-item:hover { background: var(--bg); }
.filter-preset-item.filter-preset-separator { cursor: default; padding: 0.25rem 0.6rem; border-top: 1px solid var(--border); margin-top: 0.25rem; }
.filter-preset-item.filter-preset-separator:hover { background: transparent; }
.filter-preset-item .filter-preset-del { opacity: 0.5; padding: 0.15rem 0.35rem; margin: -0.15rem -0.35rem -0.15rem 0.25rem; border-radius: var(--radius-sm); font-size: 0.9rem; }
.filter-preset-item .filter-preset-del:hover { opacity: 1; background: rgba(229, 62, 62, 0.2); color: var(--error); }
.btn-icon { padding: 0.4rem 0.6rem; }
.object-filters-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
#filter-zusatzdaten-container { display: contents; }
.object-list-count { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 0.75rem; font-weight: 500; }
.filter-dropdown-wrap { position: relative; }
.filter-dd-btn {
  padding: 0.5rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}
.filter-dd-btn:hover { border-color: var(--accent); background: rgba(49, 130, 206, 0.06); }
.filter-dd-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  min-width: 180px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 100;
  padding: 0.5rem 0.75rem;
}
.filter-dd-panel.open { display: block; }
.filter-select-all { margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); font-weight: 500; }
.filter-search-wrap { margin-bottom: 0.5rem; }
.filter-search-wrap .filter-search-input { width: 100%; padding: 0.35rem 0.5rem; font-size: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); box-sizing: border-box; }
.filter-search-wrap .filter-search-input:focus { outline: none; border-color: var(--accent); }
.filter-checkboxes { display: flex; flex-direction: column; gap: 0.25rem; }
.filter-cb-label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-weight: normal; font-size: 0.9rem; }
.filter-status-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; flex-shrink: 0; color: var(--text); }
.filter-status-icon svg { width: 20px; height: 20px; }
.filter-status-icon-empty { color: var(--text-muted); font-size: 1rem; }
.filter-status-label { margin-left: 0.15rem; min-width: 0; }
.filter-cb-label-hidden { display: none !important; }
.filter-empty { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
/* Objekt-Detail-Modal */
.object-detail-modal { max-height: 70vh; overflow-y: auto; }
.object-detail-modal .obj-section { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.object-detail-modal .obj-section:last-of-type { border-bottom: none; }
.object-detail-modal h4 { margin: 0 0 0.75rem; font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.obj-data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0; }
.obj-data-table th { text-align: left; padding: 0.35rem 0.75rem 0.35rem 0; color: var(--text-muted); font-weight: 500; width: 9rem; }
.obj-data-table td { padding: 0.35rem 0; }
.contact-cards { display: flex; flex-direction: column; gap: 1rem; }
.contact-card { background: var(--bg); padding: 0.75rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.contact-card-header { margin-bottom: 0.5rem; }
.badge-warn { background: #ed8936; color: #fff; }
.contact-card .obj-data-table th { width: 6rem; }
.contact-checkboxes { display: flex; flex-direction: column; gap: 0.6rem; }
.contact-checkboxes .cb-item { display: flex; flex-direction: row; align-items: center; }
.contact-checkboxes .cb-item .cb-label { flex: 0 0 12rem; width: 12rem; cursor: pointer; font-weight: normal; margin: 0; }
.contact-checkboxes .cb-datetime { flex: 0 0 11rem; width: 11rem; margin-left: 2rem; font-size: 0.9em; font-style: italic; color: var(--text-muted); cursor: pointer; padding: 2px 4px; border-radius: 3px; }
.contact-checkboxes .cb-datetime:hover { color: var(--text); background: var(--bg-muted, #f0f0f0); }
.contact-checkboxes .cb-datetime.cb-datetime-empty { color: var(--text-muted); }
.contact-checkboxes .cb-datetime-edit { flex: 0 0 12rem; width: 12rem; margin-left: 2rem; font-size: 0.9em; padding: 2px 6px; }
.object-detail-modal .appt-table { margin-top: 0.5rem; font-size: 0.9rem; }
.object-detail-modal .appt-table th, .object-detail-modal .appt-table td { padding: 0.5rem 0.6rem; }
#obj-kommentar { width: 100%; min-height: 8rem; padding: 0.65rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 1rem; font-family: inherit; resize: vertical; }
#obj-kommentar:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2); }

/* Objekt-Historie */
.obj-section-history { max-height: 12rem; overflow-y: auto; }
.obj-history-list { margin: 0; padding: 0 0 0 1.25rem; font-size: 0.85rem; line-height: 1.6; list-style: disc; }
.obj-history-list li { margin-bottom: 0.35rem; }
.obj-history-date { color: var(--text-muted); font-size: 0.8rem; margin-right: 0.5rem; }
.obj-history-user { font-weight: 500; color: var(--text); }
.obj-history-action { color: var(--text); }

/* Kalender – Wochenansicht Mo–Fr, 6–20 Uhr (Struktur wie Backup: einfacher Container, Scroll über .project-calendar-container) */
.project-calendar-container { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; box-sizing: border-box; }
.week-calendar { margin: 0.5rem 0; overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
.week-calendar .cal-week-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; }
/* Grid-Kalender (Projekt): Stundenblöcke 6–20 Uhr, bis zu 2 Termine pro Slot mit je 3 Zeilen */
.cal-grid { display: grid; grid-template-columns: 4rem repeat(5, 1fr); grid-template-rows: auto repeat(14, minmax(3.5rem, 1fr)); gap: 0; font-size: 0.85rem; width: 100%; min-width: 600px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
/* PC: Kalender nutzt volle Breite */
@media (min-width: 769px) {
  .project-calendar-container .cal-grid { width: 100%; }
}
/* Mobile/Tablet bis 1280px: Kalender-Inhalt fest 600px, nur .project-calendar-container scrollt (Freitag erreichbar) */
@media (max-width: 1280px) {
  .appt-calendar-section { width: 100%; max-width: 100%; min-width: 0; touch-action: auto; overflow-x: visible; }
  .project-calendar-container { width: 100%; max-width: 100%; min-width: 0; touch-action: auto; overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
  .project-calendar-container .week-calendar { width: 700px; min-width: 700px; overflow: visible; }
  .project-calendar-container .cal-grid { min-width: 700px; width: 700px; grid-template-columns: 3rem repeat(5, 1fr); font-size: 0.75rem; box-sizing: border-box; }
  .project-calendar-container .cal-grid-cell.cal-time-col { font-size: 0.6rem; }
  .project-calendar-container .cal-grid-cell { padding: 0.2rem 0.25rem; }
  .project-calendar-container .cal-grid .cal-date { font-size: 0.65rem; }
  .project-calendar-container .cal-appt-block { padding: 0.2rem 0.25rem; }
  .project-calendar-container .cal-appt-block .cal-line1 { font-size: 0.65rem; }
  .project-calendar-container .cal-appt-block .cal-line2,
  .project-calendar-container .cal-appt-block .cal-line3 { font-size: 0.55rem; }
}
.cal-grid-cell { border: 1px solid var(--border); padding: 0.35rem 0.5rem; background: var(--bg); min-width: 0; }
.cal-grid-cell.cal-time-col { font-weight: 500; white-space: nowrap; }
.cal-grid.cal-grid-halfhour .cal-grid-cell.cal-time-col { display: flex; align-items: flex-start; }
.cal-grid-cell.cal-grid-header { text-align: center; }
.cal-grid .cal-date { font-size: 0.8rem; color: var(--text-muted); }
.cal-holiday-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: text-top;
}
.cal-appt-wrap { min-height: 0; min-width: 0; max-width: 100%; padding: 3px; display: flex; flex-direction: column; overflow: hidden; }
.cal-appt-wrap-stacked { flex-direction: column; gap: 3px; }
.cal-appt-wrap-stacked .cal-appt-block { flex: 1 1 0; min-height: 3.25rem; }
.cal-appt-block { flex: 1; min-height: 100%; min-width: 0; max-width: 100%; border-radius: 4px; padding: 0.28rem 0.4rem; display: flex; flex-direction: column; justify-content: flex-start; box-sizing: border-box; overflow: hidden; }
.cal-appt-block.cal-appt-3lines { gap: 0.08rem; min-height: 0; }
.cal-appt-block.cal-appt-block-stacked { flex: 1 1 0; min-height: 3.25rem; padding: 0.25rem 0.35rem; }
.cal-appt-block.cal-appt-block-stacked .cal-line1 { font-size: 0.74rem; line-height: 1.2; }
.cal-appt-block.cal-appt-block-stacked .cal-line2, .cal-appt-block.cal-appt-block-stacked .cal-line3 { font-size: 0.65rem; line-height: 1.15; }
.cal-appt-block .cal-line1 { font-weight: 600; font-size: 0.8rem; line-height: 1.25; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; min-width: 0; }
.cal-appt-block .cal-line1-left { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-appt-block .cal-line1-right { margin-left: auto; text-align: right; min-width: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.95; }
.cal-appt-block .cal-line2, .cal-appt-block .cal-line3 { font-size: 0.68rem; line-height: 1.2; opacity: 0.95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex-shrink: 0; }
.cal-appt-block.cal-appt-block-stacked .cal-line2, .cal-appt-block.cal-appt-block-stacked .cal-line3 { flex-shrink: 0; }
/* Tabellen-Kalender (Objekt) */
.cal-week-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; table-layout: fixed; }
.cal-week-table th, .cal-week-table td { border: 1px solid var(--border); padding: 0.35rem 0.5rem; vertical-align: top; }
.cal-week-table .cal-time-col { background: var(--bg); font-weight: 500; white-space: nowrap; width: 4rem; }
.cal-week-table th:not(.cal-time-col), .cal-week-table td:not(.cal-time-col) { width: 10rem; min-width: 10rem; }
.cal-week-table th { background: var(--bg); text-align: center; }
.cal-week-table .cal-date { font-size: 0.8rem; color: var(--text-muted); }
.cal-week-table td.has-appt { background: rgba(49, 130, 206, 0.1); }
.cal-slot-appts { display: flex; flex-direction: column; gap: 0.2rem; }
.cal-slot-teams { display: flex; flex-direction: row; gap: 0.25rem; }
.cal-slot-team-col { display: flex; flex-direction: column; gap: 0.2rem; flex: 1 1 0; min-width: 0; }
.cal-week-table .cal-appt { font-size: 0.75rem; padding: 0.2rem 0.2rem 0.2rem 0.35rem; background: var(--accent); color: #fff; border-radius: 0 4px 4px 0; margin-bottom: 0.2rem; }
.cal-appt-3lines { display: flex; flex-direction: column; gap: 0.1rem; line-height: 1.2; }
.cal-appt-3lines .cal-line1 { font-weight: 600; }
.cal-appt-3lines .cal-line2, .cal-appt-3lines .cal-line3 { font-size: 0.7rem; opacity: 0.95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cal-appt-clickable { cursor: pointer; }
.cal-appt-past { opacity: 0.55; }
.cal-appt-continued { min-height: 0.6rem; padding: 0.15rem 0.25rem; display: flex; align-items: center; }
.cal-appt-continued .cal-continued { font-size: 0.7rem; opacity: 0.9; }
.cal-week-table td.has-appt { vertical-align: top; }
.cal-tile-wrap { height: 100%; min-height: 3.5rem; display: flex; flex-direction: column; gap: 0.2rem; }
.cal-appt-tile { flex: 1; min-height: 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.cal-appt-tile.cal-appt-3lines { justify-content: flex-start; padding-top: 0.35rem; }
.cal-appt-small { flex: 0 0 auto; padding: 0.15rem 0.25rem; font-size: 0.7rem; }
.appt-calendar-section { margin-bottom: 1.5rem; }
.appt-calendar-section h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.appt-table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal-nav { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.cal-nav-label { font-weight: 600; min-width: 4rem; }
.cal-nav-btn { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
.appt-team-filter { margin-bottom: 0.75rem; }
.appt-team-filter label { margin-right: 0.5rem; }
.appt-team-filter select { padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.appt-row-past { opacity: 0.6; }
.appt-row-past td { color: var(--text-muted); }
.appt-past-section { margin-top: 1.5rem; }
.appt-past-section summary { cursor: pointer; color: var(--text-muted); font-size: 0.95rem; padding: 0.5rem 0; }
.appt-past-section summary:hover { color: var(--text); }
.team-color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 0.5rem; vertical-align: middle; }
.team-members-row { margin-top: 0.35rem; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.team-member-badge { display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.45rem; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; color: var(--text); }
.team-projects-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.team-project-badge-wrap { display: inline-flex; align-items: center; gap: 0.2rem; }
.team-project-badge-wrap .project-badge { margin: 0; }
.team-badge-remove { display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; padding: 0; border: none; background: rgba(0,0,0,0.1); color: var(--text-muted); border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; }
.team-badge-remove:hover { background: rgba(200,0,0,0.2); color: #c00; }

/* Projektzugriff – Nutzerliste mit Toggle */
.access-team-grant { margin-bottom: 1rem; padding: 0.75rem 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.access-team-grant p { margin: 0 0 0.5rem; }
.access-team-grant-row { display: flex; align-items: center; gap: 0.5rem; }
.access-team-grant-row select { padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); min-width: 16rem; max-width: 100%; }
.access-toggle-list { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.75rem; max-height: 20rem; overflow-y: auto; }
.access-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.access-toggle-row .access-user-name { font-weight: 500; }
.access-toggle-row .access-user-role { font-size: 0.8rem; color: var(--text-muted); margin-left: 0.5rem; }
.access-toggle-switch { position: relative; width: 2.5rem; height: 1.25rem; background: var(--border); border-radius: 999px; cursor: pointer; flex-shrink: 0; transition: background 0.2s; }
.access-toggle-switch.active { background: var(--accent); }
.access-toggle-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform 0.2s; }
.access-toggle-switch.active::after { transform: translateX(1.25rem); }
.access-toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.objekt-link { color: var(--accent); text-decoration: none; cursor: pointer; }
.objekt-link:hover { text-decoration: underline; }

/* Status-Spalte Objektliste */
.status-col { width: 2.5rem; text-align: center; padding: 0.5rem !important; }
.mark-col { width: 2rem; text-align: center; padding: 0.35rem !important; vertical-align: middle; }
.obj-mark-star { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); transition: color 0.15s; }
.obj-mark-star:hover { color: #d4a017; }
.obj-mark-star.obj-mark-star-on { color: #d4a017; }
.obj-mark-star svg { display: block; width: 16px; height: 16px; pointer-events: none; }
.status-icon { display: inline-flex; align-items: center; justify-content: center; }
.status-icon svg { display: block; width: 16px; height: 16px; }
.status-icon.status-custom { color: var(--text); }

/* Objekt-Status-Buttons in der Liste */
.obj-actions-col { width: 1%; white-space: nowrap; padding: 0.35rem 0.5rem !important; }
.obj-status-actions { display: flex; gap: 0.25rem; align-items: center; }
.obj-status-btn {
  padding: 0.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.obj-status-btn:hover { opacity: 1; background: var(--bg); }
.obj-status-btn svg { display: block; width: 18px; height: 18px; }
.status-shortcut-indicator { display: inline-flex; align-items: center; color: var(--text-muted); }
.status-shortcut-indicator svg { width: 16px; height: 16px; }
.form-row-shortcut .label-with-icon { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.form-row-shortcut .label-icon { display: inline-flex; color: var(--text-muted); }
.form-row-shortcut .label-icon svg { width: 18px; height: 18px; }

/* Objekt-Status im Modal */
.status-hint { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 0.5rem; }
.status-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.status-btn { background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.status-btn:hover { border-color: var(--accent); background: rgba(49, 130, 206, 0.06); }
.status-btn.status-btn-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.status-btn-modal {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem;
  min-width: 5.5rem; padding: 0.75rem 1rem; border: 2px solid transparent; border-radius: 8px;
  cursor: pointer; font-size: 0.8rem; font-weight: 500; transition: all 0.2s;
}
.status-btn-modal .status-btn-icon { display: flex; align-items: center; justify-content: center; }
.status-btn-modal .status-btn-icon svg { display: block; }
.status-btn-modal .status-btn-label { text-align: center; line-height: 1.2; }
.status-btn-modal.status-btn-auto { background: rgba(0,0,0,0.06); color: var(--text); border-color: var(--border); }
.status-btn-modal.status-btn-auto:hover { background: rgba(0,0,0,0.1); }
.status-btn-modal.status-btn-auto.status-btn-active { background: #6c757d; color: #fff; border-color: #6c757d; }
.status-btn-modal.status-btn-erledigt { background: rgba(39, 174, 96, 0.15); color: #1e8449; border-color: rgba(39, 174, 96, 0.4); }
.status-btn-modal.status-btn-erledigt:hover { background: rgba(39, 174, 96, 0.25); }
.status-btn-modal.status-btn-erledigt.status-btn-active { background: #27ae60; color: #fff; border-color: #27ae60; }
.status-btn-modal.status-btn-nicht-gebaut { background: rgba(192, 57, 43, 0.12); color: #a93226; border-color: rgba(192, 57, 43, 0.35); }
.status-btn-modal.status-btn-nicht-gebaut:hover { background: rgba(192, 57, 43, 0.22); }
.status-btn-modal.status-btn-nicht-gebaut.status-btn-active { background: #c0392b; color: #fff; border-color: #c0392b; }
.status-btn-modal.status-btn-problem { background: rgba(230, 126, 34, 0.15); color: #b8570f; border-color: rgba(230, 126, 34, 0.4); }
.status-btn-modal.status-btn-problem:hover { background: rgba(230, 126, 34, 0.25); }
.status-btn-modal.status-btn-problem.status-btn-active { background: #e67e22; color: #fff; border-color: #e67e22; }

.object-row:hover { background: rgba(49, 130, 206, 0.08) !important; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.section-header h2 { margin: 0; }
.text-muted { color: var(--text-muted); }

/* Back-Link */
.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  display: inline-block;
}
.back-link:hover { text-decoration: underline; }

/* Einstellungs-Panel */
.settings-admin-only { margin: 2rem 0; }
.settings-panel { margin-top: 1rem; }
.settings-tile-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.settings-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  position: relative;
  overflow: visible;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
}
.settings-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 45%);
  pointer-events: none;
}
.settings-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.settings-tile.active {
  border-color: var(--accent);
  background: rgba(49, 130, 206, 0.06);
  box-shadow: 0 4px 16px rgba(49, 130, 206, 0.15), inset 0 1px 0 rgba(255,255,255,0.6);
}
.settings-tile-icon,
.settings-tile-label,
.settings-tile-desc { position: relative; z-index: 1; }
.settings-tile-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.settings-tile-label { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; word-wrap: break-word; overflow-wrap: break-word; }
.settings-tile-desc { font-size: 0.8rem; color: var(--text-muted); }
.settings-section h3 { margin: 0 0 1rem; font-size: 1.1rem; }
.settings-section h4 { margin: 1rem 0 0.5rem; font-size: 0.95rem; color: var(--text-muted); }
.settings-section h4:first-child { margin-top: 0; }
.settings-activity-tabs { margin-bottom: 1rem; display: flex; gap: 0.5rem; }
.settings-activity-tab { padding: 0.4rem 0.9rem; }
.settings-activity-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.settings-activity-panel { max-height: 400px; overflow-y: auto; }
.settings-aktivitaeten-filter {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: 0.5rem 0;
}
.settings-aktivitaeten-filter label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.settings-aktivitaeten-filter .aktivitaeten-filter-select { min-width: 180px; padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.aktivitaeten-action-cell { cursor: help; }

/* Alle Termine (Büro/Admin) */
.alle-termine-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: 0.75rem 0;
}
.alle-termine-filters label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.alle-termine-filters .alle-termine-filter-select { min-width: 160px; padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.alle-termine-filters .alle-termine-filter-input { padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.alle-termine-filters .alle-termine-search-input { min-width: 220px; padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.alle-termine-filters .alle-termine-show-past-wrap { white-space: nowrap; }
.alle-termine-filters .alle-termine-show-past-cb { margin-right: 0.35rem; }
.alle-termine-list { max-height: 70vh; overflow-y: auto; }
.alle-termine-table { width: 100%; }
.alle-termine-table th { text-align: left; padding: 0.5rem 0.6rem; }
.alle-termine-table td { padding: 0.5rem 0.6rem; }
tr.kw-group-header td { font-weight: 600; background: var(--bg-2, #f0f0f0); padding: 0.6rem 0.75rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.status-icon-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.status-icon-option {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; padding: 0; border: 2px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text-muted);
  cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.status-icon-option:hover { border-color: var(--accent); color: var(--accent); background: rgba(49, 130, 206, 0.08); }
.status-icon-option.status-icon-option-selected { border-color: var(--accent); background: rgba(49, 130, 206, 0.15); color: var(--accent); }
.status-icon-option svg { width: 20px; height: 20px; }
.status-list-icon { display: inline-flex; align-items: center; vertical-align: middle; margin-right: 0.35rem; color: var(--text-muted); }
.status-list-icon svg { width: 18px; height: 18px; }
.settings-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0; }
.settings-table th, .settings-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.settings-table th { background: var(--bg); color: var(--text-muted); font-weight: 500; }
.audit-log-table td { word-break: break-word; }
.audit-log-table td:nth-child(4) { max-width: 280px; }
.settings-security-form .form-group { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.settings-security-form .form-group:last-of-type { border-bottom: none; }
.text-warning { color: #b45309; }
.settings-backup-panel { overflow: visible; min-height: 200px; }
.backup-list { margin: 1rem 0; }
.settings-section { overflow: visible; }
.settings-security-form .form-group label:first-of-type { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.settings-toggle-row { display: flex; align-items: center; margin-bottom: 0.75rem; padding: 0.75rem 0.5rem; background: rgba(0,0,0,0.03); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.settings-toggle-wrap { display: inline-flex; align-items: center; gap: 0.75rem; flex-wrap: nowrap; white-space: nowrap; }
.settings-toggle-wrap .settings-toggle-label { font-weight: 600; color: var(--text); font-size: 1rem; cursor: default; user-select: none; }
/* Schalter: Klick nur auf den Schalter (nicht auf Label) – Rot = Inaktiv, Grün = Aktiv */
.settings-toggle-switch { position: relative; display: inline-block; width: 3.5rem; height: 1.75rem; flex-shrink: 0; border-radius: 999px; cursor: pointer; transition: background 0.2s, box-shadow 0.2s; box-shadow: inset 0 1px 3px rgba(0,0,0,0.15); }
.settings-toggle-switch { background: #e53e3e; border: 2px solid #c53030; }
.settings-toggle-switch:hover { background: #c53030; box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }
.settings-toggle-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.settings-toggle-switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 1.2rem; height: 1.2rem; background: #fff; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.3); transition: transform 0.2s; pointer-events: none; }
.settings-toggle-switch:has(input:checked) { background: #27ae60; border: 2px solid #1e8449; }
.settings-toggle-switch:has(input:checked):hover { background: #1e8449; }
.settings-toggle-switch:has(input:checked)::after { transform: translateX(1.7rem); }
.settings-security-form textarea { font-family: monospace; font-size: 0.9rem; resize: vertical; }
.form-hint { font-size: 0.9rem; color: var(--text-muted); margin: 0.25rem 0 0.5rem; }
.form-hint a { color: var(--accent); }
.alert-warning { background: #fef3c7; border: 1px solid #f59e0b; color: #92400e; padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; }
.geo-quick-countries { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.geo-quick-countries .btn-sm { margin: 0; }
.badge-current { font-size: 0.8rem; color: var(--accent); font-weight: 500; }
.sessions-tabs { margin-bottom: 1rem; display: flex; gap: 0.5rem; }
.sessions-tabs .sessions-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
#sessions-table-container { max-height: 400px; overflow-y: auto; overflow-x: auto; }
.session-device-cell[title] { cursor: help; }
.session-ip-cell { vertical-align: top; }
.session-ip-cell .session-ip-line1 { min-height: 1.25em; line-height: 1.2; font-size: 1.2em; }
.session-ip-cell .session-ip-line2 { font-size: 0.85em; color: var(--text-muted, #666); white-space: nowrap; }

/* Manuelle Termine (ohne Objekt) */
.manual-appt-label { display: inline-flex; align-items: center; gap: 0.25rem; font-style: italic; }
.manual-appt-clickable { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; }
.manual-appt-clickable:hover { color: var(--accent); }
a.manual-appt-link { color: var(--text); text-decoration: none; cursor: pointer; }
a.manual-appt-link:hover { color: var(--accent); text-decoration: underline; }
.cal-appt-manual { border: 2px dashed rgba(255,255,255,0.5); }
.cal-appt-clickable { cursor: pointer; }
.cal-appt-conflict {
  color: #4b5563;
  border-left-color: #9ca3af !important;
  box-shadow: inset 0 0 0 1px rgba(107, 114, 128, 0.25);
}
.cal-appt-conflict .cal-line1 { color: #374151; }
.cal-appt-conflict .cal-line2,
.cal-appt-conflict .cal-line3 { color: #6b7280; }
.form-info-box { background: rgba(49, 130, 206, 0.1); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.9rem; color: var(--accent); }

/* ========================================
   MOBILE MENU
   ======================================== */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--header-bg);
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
  flex-direction: column;
}
.mobile-menu.open { display: flex; }
.mobile-menu-user {
  padding: 0.75rem 1rem;
  color: var(--header-muted);
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  color: var(--header-text);
  text-decoration: none;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.mobile-menu-item:hover, .mobile-menu-item:active {
  background: rgba(255,255,255,0.1);
}
.mobile-menu-item-danger { color: #fc8181; }

/* ========================================
   RESPONSIVE / MOBILE STYLES
   ======================================== */

/* Tablet (max 768px) */
@media (max-width: 768px) {
  .app-main { padding: 1rem; }
  
  /* Header anpassen */
  .app-header { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; position: relative; }
  .app-header-brand-logo { height: 32px; }
  .app-header-brand-title { font-size: 1.1rem; }
  .app-header-right-desktop { display: none; }
  .mobile-menu-btn { display: flex; }
  
  /* Stat-Cards */
  .stat-cards { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .stat-card { padding: 0.9rem 0.75rem; }
  .stat-card-icon { font-size: 1.2rem; margin-bottom: 0.3rem; }
  .stat-card-value { font-size: 1.4rem; }
  .stat-card-label { font-size: 0.75rem; }
  .stat-card-export-btn { padding: 0.2rem 0.4rem; font-size: 0.6rem; }
  
  /* Tile Navigation */
  .tile-nav { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.75rem; }
  .tile-nav-item { padding: 0.9rem 0.5rem; min-width: 0; }
  .tile-nav-icon { font-size: 1.3rem; }
  .tile-nav-label { font-size: 0.75rem; }
  
  /* Projekt-Kacheln */
  .project-tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
  .project-tile { padding: 1.25rem; }
  
  /* Objektliste Filter */
  .object-filters { flex-direction: column; gap: 0.75rem; }
  .object-filters-search { flex-direction: column; width: 100%; }
  .object-filters-search input { max-width: 100%; width: 100%; }
  .filter-preset-wrap { width: 100%; }
  .filter-preset-dd { width: 100%; }
  .filter-preset-dd .filter-dd-btn { width: 100%; justify-content: space-between; }
  .filter-dropdowns { flex-wrap: wrap; gap: 0.5rem; }
  .filter-dropdown-wrap { flex: 1 1 calc(50% - 0.25rem); min-width: 120px; }
  .filter-dd-btn { width: 100%; justify-content: space-between; font-size: 0.85rem; padding: 0.5rem 0.75rem; }
  
  /* Tabellen scrollbar machen */
  #object-list { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #object-list table { min-width: 600px; font-size: 0.85rem; }
  #object-list th, #object-list td { padding: 0.5rem 0.6rem; }
  
  /* Modal */
  .modal-content { margin: 0.5rem; max-width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); }
  .modal-content.modal-wide { max-width: calc(100vw - 1rem); }
  .modal-content.modal-large { min-width: auto; width: calc(100vw - 1rem); min-height: auto; }
  
  /* Kalender */
  .cal-nav { flex-wrap: wrap; gap: 0.5rem; }
  .cal-nav-label { font-size: 0.9rem; min-width: auto; }
  .cal-view-toggle { order: -1; width: 100%; justify-content: center; }
  .cal-view-btn { flex: 1; justify-content: center; }
  .cal-week-table th:not(.cal-time-col), .cal-week-table td:not(.cal-time-col) { width: 6rem; min-width: 6rem; }
  .cal-week-scroll { max-height: 50vh; }
  /* Projekt-Kalender: wie 1280px-Block (Grid skaliert, einfacher Container) */
  .project-calendar-container .cal-grid { grid-template-columns: 3rem repeat(5, 1fr); font-size: 0.75rem; }
  .project-calendar-container .cal-grid-cell { padding: 0.2rem 0.25rem; }
  .project-calendar-container .cal-grid .cal-date { font-size: 0.65rem; }
  .project-calendar-container .cal-appt-block { padding: 0.2rem 0.25rem; }
  .project-calendar-container .cal-appt-block .cal-line1 { font-size: 0.65rem; }
  .project-calendar-container .cal-appt-block .cal-line2,
  .project-calendar-container .cal-appt-block .cal-line3 { font-size: 0.55rem; }
  
  /* Settings */
  .settings-tile-nav { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .project-settings-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .settings-tile { padding: 1rem; }
  .settings-tile-icon { font-size: 1.5rem; }
  .settings-tile-label { font-size: 0.9rem; }
  
  /* Projekt-Header */
  .project-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .project-header-actions { width: 100%; display: flex; justify-content: flex-end; }
}

/* Smartphone (max 480px) */
@media (max-width: 480px) {
  .app-main { padding: 0.75rem; }
  
  /* Header kompakter */
  .app-header { padding: 0.5rem 0.75rem; }
  .app-header-brand { gap: 0.4rem; }
  .app-header-brand-logo { height: 28px; }
  .app-header-brand-title { font-size: 1rem; }
  .app-header-right { flex-wrap: wrap; justify-content: flex-end; }
  .app-header .btn-sm { padding: 0.3rem 0.5rem; font-size: 0.75rem; }
  #change-password-btn, #nav-sessions-btn { display: none !important; }
  
  /* Stat-Cards: 3 nebeneinander, kompakter */
  .stat-cards { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .stat-card { padding: 0.6rem 0.5rem; border-radius: 8px; }
  .stat-card-icon { font-size: 1rem; margin-bottom: 0.2rem; }
  .stat-card-value { font-size: 1.1rem; }
  .stat-card-label { font-size: 0.65rem; }
  .stat-card-export-btn { position: static; margin-top: 0.3rem; width: 100%; font-size: 0.55rem; padding: 0.15rem 0.25rem; }
  
  /* Tile Navigation: 2x2 Grid */
  .tile-nav { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .tile-nav-item { padding: 0.75rem 0.5rem; }
  .tile-nav-icon { font-size: 1.2rem; margin-bottom: 0.2rem; }
  .tile-nav-label { font-size: 0.7rem; }
  
  /* Projekt-Kacheln */
  .project-tiles { grid-template-columns: 1fr; gap: 0.75rem; }
  .project-tile { padding: 1rem; border-radius: 12px; }
  .project-tile-name { font-size: 1rem; }
  
  /* Filter */
  .filter-dropdown-wrap { flex: 1 1 100%; }
  .filter-actions-wrap { flex-direction: column; gap: 0.5rem; }
  .filter-actions-wrap .btn { width: 100%; }
  #filter-actions-wrap { flex-wrap: wrap; }
  
  /* Tabellen noch kompakter */
  #object-list table { min-width: 500px; font-size: 0.8rem; }
  #object-list th, #object-list td { padding: 0.4rem 0.5rem; }
  .obj-status-actions { gap: 0.15rem; }
  .obj-status-btn { padding: 0.2rem; }
  .obj-status-btn svg { width: 14px; height: 14px; }
  
  /* Modal fullscreen-ähnlich */
  .modal-content { margin: 0; border-radius: 0; max-width: 100vw; max-height: 100vh; height: 100vh; }
  .modal-content.modal-wide, .modal-content.modal-large { max-width: 100vw; width: 100vw; }
  .modal-close { top: 0.5rem; right: 0.75rem; font-size: 1.75rem; }
  #modal-body { padding: 0.75rem; }
  #modal-body h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
  
  /* Formulare */
  .form-row { margin-bottom: 0.75rem; }
  .form-row label { font-size: 0.85rem; margin-bottom: 0.3rem; }
  .form-row input, .form-row select, .form-row textarea { padding: 0.5rem 0.65rem; font-size: 0.9rem; }
  .form-actions { flex-direction: column; gap: 0.5rem; }
  .form-actions .btn { width: 100%; }
  .form-actions-row { flex-direction: column; }
  .form-actions-row .btn-danger { margin-left: 0; width: 100%; }
  
  /* Kalender */
  .cal-nav { padding: 0.5rem; }
  .cal-nav-btn { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
  .cal-nav-label { font-size: 0.85rem; }
  .cal-view-toggle { gap: 0.25rem; }
  .cal-view-btn { padding: 0.35rem 0.6rem; font-size: 0.75rem; }
  .cal-day-header { font-size: 0.8rem; padding: 0.4rem; }
  .cal-appt { padding: 0.35rem 0.5rem; font-size: 0.75rem; border-radius: 4px; }
  .cal-appt-3lines .cal-line1 { font-size: 0.7rem; }
  .cal-appt-3lines .cal-line2, .cal-appt-3lines .cal-line3 { font-size: 0.6rem; }
  
  /* Wochenansicht auf Mobile: horizontal scrollbar */
  .cal-week-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cal-week-table { min-width: 700px; }
  .cal-week-table th:not(.cal-time-col), .cal-week-table td:not(.cal-time-col) { width: 5rem; min-width: 5rem; }
  .cal-time-col { width: 3rem; min-width: 3rem; font-size: 0.7rem; }
  /* Projekt-Kalender (Grid): auf Smartphone noch kompakter (2.25rem Zeit-Spalte) */
  .project-calendar-container .cal-grid { grid-template-columns: 2.25rem repeat(5, 1fr); font-size: 0.65rem; }
  .project-calendar-container .cal-grid-cell.cal-time-col { font-size: 0.5rem; }
  .project-calendar-container .cal-grid-cell { padding: 0.15rem 0.2rem; }
  .project-calendar-container .cal-grid .cal-date { font-size: 0.55rem; }
  .project-calendar-container .cal-appt-block { padding: 0.15rem 0.2rem; }
  .project-calendar-container .cal-appt-block .cal-line1 { font-size: 0.6rem; }
  .project-calendar-container .cal-appt-block .cal-line2,
  .project-calendar-container .cal-appt-block .cal-line3 { font-size: 0.5rem; }
  .project-calendar-container .cal-appt-wrap-stacked .cal-appt-block { min-height: 2.5rem; }
  
  /* Settings */
  .settings-tile-nav { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .project-settings-tiles { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .settings-tile { padding: 0.75rem; }
  .settings-tile-icon { font-size: 1.25rem; margin-bottom: 0.3rem; }
  .settings-tile-label { font-size: 0.8rem; }
  .settings-tile-desc { font-size: 0.7rem; }
  
  /* Dashboard */
  .dashboard-welcome h2 { font-size: 1.2rem; }
  .dashboard-welcome p { font-size: 0.85rem; }
  
  /* Buttons größer für Touch */
  .btn { min-height: 44px; padding: 0.6rem 1rem; }
  .btn-sm { min-height: 36px; padding: 0.4rem 0.75rem; }
  
  /* Team-Badge */
  .team-badge { font-size: 0.7rem; }
  .team-badge-color { width: 0.6rem; }
  .team-badge-name { padding: 0 0.3rem; }
  
  /* Objekt-Detail */
  .object-detail-grid { grid-template-columns: 1fr; }
  .status-buttons { flex-wrap: wrap; }
  .status-btn { flex: 1 1 calc(50% - 0.25rem); min-width: 0; font-size: 0.8rem; padding: 0.5rem; }
  
  /* Termin-Liste im Modal */
  .appt-list-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .appt-list-item .team-badge { align-self: flex-start; }
}

/* Kleine Smartphones (max 360px) */
@media (max-width: 360px) {
  .app-header-brand-title { display: none; }
  .stat-card-label { font-size: 0.6rem; }
  .stat-card-value { font-size: 1rem; }
  .tile-nav-label { font-size: 0.65rem; }
  #object-list table { min-width: 450px; font-size: 0.75rem; }
}

/* Touch-Optimierung */
@media (hover: none) and (pointer: coarse) {
  .btn, .btn-sm, .filter-dd-btn, .cal-nav-btn, .cal-view-btn, .tile-nav-item, .stat-card-clickable, .project-tile, .settings-tile {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  }
  
  /* Größere Touch-Targets */
  .obj-status-btn { min-width: 40px; min-height: 40px; padding: 0.4rem; }
  .modal-close { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  
  /* Hover-Effekte auf Touch-Geräten deaktivieren */
  .stat-card-clickable:hover { transform: none; }
  .project-tile:hover { transform: none; }
  .settings-tile:hover { transform: none; }
}

/* Gelöschte Teams in der Übersicht */
.team-deleted-row { opacity: 0.6; background: #f8f8f8; }
.team-deleted-row td { color: #888; }
.team-deleted-badge {
  display: inline-block;
  background: #dc3545;
  color: #fff;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-weight: 500;
}
