/* 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-slate: #64748b;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

/* Setup & Login */
.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; }
.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 {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

.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); }
.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-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; }

/* Projekt-Kacheln (farbige Karten wie NetDoku) */
.project-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.project-tile {
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow), 0 2px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}
.project-tile::after {
  content: '';
  position: absolute;
  top: -60%;
  right: -60%;
  width: 80%;
  height: 80%;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 55%);
  pointer-events: none;
}
.project-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.1);
}
.project-tile-header,
.project-tile-meta,
.project-tile-actions { position: relative; z-index: 1; }
.project-tile-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.35rem; }
.project-tile-title { font-size: 1.1rem; font-weight: 600; margin: 0; flex: 1; min-width: 0; }
.project-tile-id {
  flex-shrink: 0;
  background: rgba(0,0,0,0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
}
.project-tile-meta { font-size: 0.9rem; color: rgba(0,0,0,0.7); margin-bottom: 1rem; }
.project-tile-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}
.project-tile .btn-open {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.9);
  color: inherit;
}
.project-tile-actions-right { display: flex; gap: 0.35rem; }
.project-tile-actions-right button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  opacity: 0.8;
  font-size: 1rem;
}
.project-tile-actions-right button:hover { opacity: 1; }

/* 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-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;
}

/* 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); }

/* 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; }

/* 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-body { overflow-y: auto; flex: 1; }
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-close:hover { color: var(--text); }

/* 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);
}
.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-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.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-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-empty { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.filter-text-wrap input { max-width: 220px; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* 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; gap: 1.5rem; flex-wrap: wrap; }
.contact-checkboxes .cb-label { cursor: pointer; font-weight: normal; }
.contact-checkboxes .cb-label[title] { border-bottom: 1px dotted var(--text-muted); }
.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 */
.week-calendar { margin: 0.5rem 0; overflow-x: auto; }
.week-calendar .cal-week-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; }
.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-week-table .cal-appt { font-size: 0.75rem; padding: 0.2rem; background: var(--accent); color: #fff; border-radius: 4px; 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; }
.appt-calendar-section { margin-bottom: 1.5rem; }
.appt-calendar-section h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.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; }
.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; }
.status-icon { display: inline-flex; align-items: center; justify-content: center; }
.status-icon svg { display: block; }

/* 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; }

/* 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.5rem; }
.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); }

.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(180px, 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: 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;
}
.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; }
.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-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; }
.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; }
.settings-security-form .form-group label:first-of-type { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.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; }
