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

:root {
  --yellow: #fecc00;
  --black: #000000;
  --white: #ffffff;
  --gray-light: #ececec;
  --gray-mid: #999999;
  --radius: 6px;
  --max-width: 1100px;
}

body {
  font-family: 'Graphik', 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--black);
  background: var(--gray-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.site-header {
  background: var(--white);
  padding: 1rem 2rem;
  border-bottom: 3px solid var(--yellow);
}

.logo { height: 56px; }

main { flex: 1; padding: 2rem 1rem; }

.site-footer {
  background: var(--black);
  color: var(--white);
  text-align: center;
  padding: 1rem;
  font-size: 0.875rem;
}

.site-footer a { color: var(--yellow); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.container--narrow { max-width: 640px; }

.container--centered { text-align: center; padding-top: 4rem; }

/* Typography */
h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.subtitle { color: var(--gray-mid); margin-bottom: 1.5rem; }
.text-muted { color: var(--gray-mid); }

/* Forms */
fieldset {
  border: none;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

legend {
  font-weight: 700;
  font-size: 1rem;
  padding: 0;
  margin-bottom: 1rem;
  float: left;
  width: 100%;
  text-align: center;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid #ccc;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--yellow);
}

.form-group--checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.form-group--checkbox input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
  accent-color: var(--black);
}

.form-group--checkbox label { margin-bottom: 0; font-weight: 400; }

.contact-fields { margin-top: 1rem; }

.field-error { color: #d00; font-size: 0.875rem; margin-top: 0.25rem; display: block; }

/* Rating scale */
.rating-statement { font-size: 0.9rem; color: var(--gray-mid); margin: 0.125rem 0 0.5rem; }

.form-group--rating { margin-bottom: 1.5rem; }

.rating-scale {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.rating-label { font-size: 0.75rem; color: var(--gray-mid); }

.rating-option { cursor: pointer; }

.rating-option input[type="radio"] { display: none; }

.rating-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1.5px solid #ccc;
  border-radius: 50%;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.rating-option input:checked + span {
  background: var(--yellow);
  border-color: var(--yellow);
}

.rating-option:hover span {
  border-color: var(--black);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.15s, color 0.15s;
}

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

.btn--primary:hover { background: #e6b800; }

.btn--secondary {
  background: transparent;
  border-color: var(--black);
  color: var(--black);
}

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

.btn--full { width: 100%; text-align: center; margin-top: 0.5rem; }

/* Google QR placeholder */
.google-qr-placeholder {
  margin: 2rem auto 0;
  width: 160px;
  height: 160px;
  border: 2px dashed #ccc;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Success page */
.success-icon {
  width: 4rem;
  height: 4rem;
  background: var(--yellow);
  border-radius: 50%;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

/* Dashboard nav */
.site-header { display: flex; align-items: center; justify-content: space-between; }
.site-header a { text-decoration: none; }
.site-nav { display: flex; gap: 1rem; align-items: center; }
.btn--sm { padding: 0.375rem 0.875rem; font-size: 0.875rem; }

/* Dashboard layout */
.db-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-top: 0.5rem;
}

.db-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.db-section-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.db-section-head h2 { margin-bottom: 0; }

.count-badge {
  background: var(--gray-light);
  color: var(--gray-mid);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}

/* Period filter */
.period-filter { display: flex; gap: 0.25rem; }

.period-btn {
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--gray-mid);
  background: var(--gray-light);
  transition: background 0.15s, color 0.15s;
}

.period-btn:hover { background: #ddd; color: var(--black); }
.period-btn--active { background: var(--yellow); color: var(--black); }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--gray-light);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.kpi-card--big { background: var(--black); color: var(--white); }

/* Dezente Ampelfarben – 5 Stufen */
.kpi-card--amp .kpi-label { color: #6b7280; opacity: 1; }
.kpi-card--amp .kpi-sub   { color: #9ca3af; opacity: 1; }

.kpi-card--amp-1 { background: #f0fdf4; }
.kpi-card--amp-1 .kpi-value { color: #166534; }

.kpi-card--amp-2 { background: #f7fee7; }
.kpi-card--amp-2 .kpi-value { color: #3f6212; }

.kpi-card--amp-3 { background: #fffbeb; }
.kpi-card--amp-3 .kpi-value { color: #92400e; }

.kpi-card--amp-4 { background: #fff7ed; }
.kpi-card--amp-4 .kpi-value { color: #9a3412; }

.kpi-card--amp-5 { background: #fef2f2; }
.kpi-card--amp-5 .kpi-value { color: #991b1b; }

.kpi-label { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; opacity: 0.75; }
.kpi-card--big .kpi-label { opacity: 0.6; }

.kpi-value { font-size: 2.25rem; font-weight: 700; line-height: 1; }
.kpi-card:not(.kpi-card--big) .kpi-value { font-size: 1.75rem; color: var(--black); }
.kpi-value--bad { color: #ef4444; }

.kpi-sub { font-size: 0.8rem; opacity: 0.5; margin-top: 0.25rem; }

/* Chart */
.chart-wrap {
  margin-bottom: 1.5rem;
  max-height: 220px;
}

/* Feedback list */
.feedback-list-title { margin-bottom: 0.75rem; }

.feedback-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }

.feedback-item {
  border-left: 3px solid var(--yellow);
  padding: 0.75rem 1rem;
  background: var(--gray-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.feedback-meta { font-size: 0.8rem; color: var(--gray-mid); display: block; margin-bottom: 0.25rem; }
.feedback-item p { margin-bottom: 0.25rem; }
.text-danger { color: #ef4444; }

/* Ranking table */
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th {
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-mid);
  padding: 0.5rem 0.75rem;
  border-bottom: 1.5px solid var(--gray-light);
}
.ranking-table td { padding: 0.75rem; border-bottom: 1px solid var(--gray-light); }
.ranking-table tr:last-child td { border-bottom: none; }
.ranking-table a { color: var(--black); font-weight: 500; }
.ranking-table a:hover { color: #555; }
.rank { color: var(--gray-mid); font-weight: 700; width: 2rem; }

/* Score badges */
.score-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.9rem;
}
.score-badge--good { background: #dcfce7; color: #166534; }
.score-badge--ok   { background: #fef9c3; color: #854d0e; }
.score-badge--bad  { background: #fee2e2; color: #991b1b; }
.score-badge--empty { background: var(--gray-light); color: var(--gray-mid); }

/* Alert */
.alert-warning {
  background: #fef9c3;
  border: 1.5px solid #fde047;
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.alert-warning a { color: #854d0e; font-weight: 600; }

/* Dashboard topbar controls */
.db-topbar-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.375rem 0.75rem;
  border: 1.5px solid #ccc;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 600;
  background: var(--white);
  cursor: pointer;
  min-width: 200px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--yellow);
}

/* Hero KPI grid */
.kpi-grid--hero {
  grid-template-columns: 1fr 1fr 1fr;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .kpi-grid--hero { grid-template-columns: 1fr; }
}

/* QR grid */
.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.qr-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* ===== LOGIN PAGE ===== */
body.login-body { background: white; }

.login-layout { display: flex; min-height: 100vh; }

.login-panel--dark {
  flex: 0 0 58%;
  background: #0f1923;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.login-panel--light {
  flex: 1;
  background: #f4f5f6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.login-logo-circle {
  width: 80px;
  height: 80px;
  border: 2.5px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.login-logo-circle img {
  height: 36px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.login-title { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.login-title span { color: var(--yellow); }
.login-subtitle { color: rgba(255,255,255,0.45); font-size: 0.95rem; margin-bottom: 2rem; text-align: center; }

.login-divider {
  width: 80%;
  max-width: 320px;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 2rem;
}

.login-stats { display: flex; gap: 3rem; }

.login-stat { text-align: center; }
.login-stat-value { font-size: 1.75rem; font-weight: 800; color: var(--yellow); line-height: 1; }
.login-stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.45); margin-top: 0.25rem; }

.login-form-panel { width: 100%; max-width: 380px; }
.login-form-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--yellow);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.login-form-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.375rem; color: #0f1923; }
.login-form-subtitle { color: #888; font-size: 0.95rem; margin-bottom: 2rem; }

.btn--dark {
  background: #0f1923;
  color: white;
  border: 2px solid #0f1923;
  border-radius: 99px;
  padding: 0.875rem 1.5rem;
  width: 100%;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: background 0.15s;
}
.btn--dark:hover { background: #1e2d3d; border-color: #1e2d3d; }

.login-footer { font-size: 0.8rem; color: #bbb; margin-top: 2rem; text-align: center; }

@media (max-width: 768px) {
  .login-panel--dark { display: none; }
  .login-panel--light { padding: 2rem 1.5rem; }
}

/* ===== APP LAYOUT (Sidebar) ===== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.375rem 1.25rem 1.125rem;
  border-bottom: 1px solid #f3f4f6;
}

.sidebar-logo-circle {
  width: 40px;
  height: 40px;
  border: 2px solid #0f1923;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-circle img { height: 18px; }

.sidebar-logo-text {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.25;
  color: #0f1923;
}
.sidebar-logo-text span { color: var(--yellow); }

.sidebar-nav {
  flex: 1;
  padding: 0.875rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.6875rem 0.875rem;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: background 0.12s;
}
.sidebar-nav-item:hover { background: #f3f4f6; }
.sidebar-nav-item.active { background: #0f1923; color: white; }

.sidebar-nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.sidebar-user-name { font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.125rem; }
.sidebar-user-role { font-size: 0.8rem; color: #888; margin-bottom: 0.875rem; }

.btn--outline-sidebar {
  display: block;
  background: transparent;
  border: 1.5px solid #e5e7eb;
  color: #374151;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s;
  margin-bottom: 0.75rem;
  width: 100%;
}
.btn--outline-sidebar:hover { background: #f3f4f6; }

.sidebar-version { font-size: 0.75rem; color: #bbb; text-align: center; }

.app-main { margin-left: 260px; flex: 1; }
.app-content { padding: 2rem; max-width: 1140px; }

/* ===== BENUTZER VERWALTUNG ===== */
.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.user-table { width: 100%; border-collapse: collapse; }
.user-table th {
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-mid);
  padding: 0.5rem 0.75rem;
  border-bottom: 1.5px solid var(--gray-light);
}
.user-table td {
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid var(--gray-light);
  vertical-align: middle;
  font-size: 0.9375rem;
}
.user-table tr:last-child td { border-bottom: none; }
.user-table .user-name { font-weight: 700; }

.role-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
}

.status-active { color: #166534; font-weight: 600; font-size: 0.875rem; }
.status-inactive { color: #991b1b; font-weight: 600; font-size: 0.875rem; }

.table-actions { display: flex; gap: 0.375rem; }

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1.5px solid #e5e7eb;
  background: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  text-decoration: none;
  color: #374151;
  transition: background 0.12s;
  font-family: inherit;
}
.action-btn:hover { background: #f3f4f6; }
.action-btn--danger { border-color: #fca5a5; color: #991b1b; }
.action-btn--danger:hover { background: #fee2e2; }
.action-btn--success { border-color: #86efac; color: #166534; }
.action-btn--success:hover { background: #dcfce7; }

/* Modal / Inline Form */
.inline-form-panel {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1.5px solid var(--yellow);
  display: none;
}
.inline-form-panel.visible { display: block; }
.inline-form-panel h2 { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ===== AUFGABEN ===== */
.task-list { display: flex; flex-direction: column; gap: 0.75rem; }

.task-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  border-left: 4px solid #fca5a5;
}
.task-card--done { border-left-color: #86efac; opacity: 0.65; }

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.625rem;
}
.task-card-meta { font-size: 0.8rem; color: #888; margin-bottom: 0.2rem; }
.task-card-name { font-weight: 700; font-size: 1rem; }
.task-card-scores { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.625rem; }
.task-score-chip {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: #f3f4f6;
  color: #374151;
}
.task-score-chip--bad { background: #fee2e2; color: #991b1b; }
.task-contact-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #854d0e;
  background: #fef9c3;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}
.task-card-comment { font-size: 0.9rem; color: #555; font-style: italic; margin-bottom: 0.75rem; }
.task-note { font-size: 0.875rem; color: #374151; background: #f9fafb; padding: 0.625rem 0.875rem; border-radius: 6px; margin-bottom: 0.75rem; }
.task-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.task-status-badge { padding: 0.2rem 0.6rem; border-radius: 99px; font-size: 0.8rem; font-weight: 700; }
.task-status-badge--open { background: #fee2e2; color: #991b1b; }
.task-status-badge--done { background: #dcfce7; color: #166534; }

.note-form { display: flex; gap: 0.5rem; flex: 1; min-width: 200px; }
.note-form input {
  flex: 1;
  padding: 0.375rem 0.75rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
}
.note-form input:focus { outline: none; border-color: var(--yellow); }

/* ===== ARZTFEEDBACK ===== */
.doctor-table { width: 100%; border-collapse: collapse; }
.doctor-table th {
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-mid);
  padding: 0.5rem 0.75rem;
  border-bottom: 1.5px solid var(--gray-light);
}
.doctor-table td {
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid var(--gray-light);
  vertical-align: top;
  font-size: 0.9rem;
}
.doctor-table tr:last-child td { border-bottom: none; }
.doctor-text-cell { max-width: 220px; font-size: 0.85rem; color: #555; }
.doctor-complaint { color: #991b1b; font-weight: 500; }
/* Center score column (1) and toggle column (6) */
.doctor-table th:nth-child(1),
.doctor-table td:nth-child(1),
.doctor-table th:nth-child(6),
.doctor-table td:nth-child(6) { text-align: center; }

/* Toggle button */
.arzt-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: none;
  border: 1px solid var(--gray-light);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  color: var(--gray-mid);
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.arzt-toggle:hover { background: var(--gray-light); color: var(--text); }
.arzt-toggle svg { transition: transform 0.2s; }
.arzt-toggle.open svg { transform: rotate(180deg); }
.arzt-toggle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}

/* Collapsible detail row */
.arzt-detail-row { display: none; }
.arzt-detail-row.open { display: table-row; }
.arzt-detail-row td {
  padding: 0 0.75rem 1rem 0.75rem;
  background: #fafafa;
  border-bottom: 1px solid var(--gray-light);
}
.arzt-detail-content {
  padding: 0.875rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.arzt-detail-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.arzt-score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.arzt-score-label {
  font-size: 0.75rem;
  color: var(--gray-mid);
  font-weight: 500;
  white-space: nowrap;
}
.arzt-detail-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #444;
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-light);
}
.arzt-detail-text p { margin: 0; }
.arzt-text-body { color: #555; font-weight: 400; }

/* Rating category groups (3 sub-questions) */
.rating-category {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1.5px solid var(--gray-light);
}
.rating-category:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.rating-category-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #0f1923;
}
.rating-category-comment {
  margin-top: 0.625rem;
  background: #f9fafb;
  border-left: 3px solid #d1d5db;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.75rem 0.875rem;
}
.rating-category-comment label {
  display: block;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.375rem;
  font-weight: 500;
}
.rating-category-comment textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  resize: vertical;
  background: white;
  color: #374151;
}
.rating-category-comment textarea:focus { outline: none; border-color: #9ca3af; }

/* ===== STANDORTE ===== */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.location-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.375rem;
  border: 1.5px solid transparent;
  transition: border-color 0.15s;
  display: block;
  text-decoration: none;
  color: inherit;
}
.location-card:hover { border-color: var(--yellow); }
.location-card-name { font-weight: 700; font-size: 1.0625rem; margin-bottom: 0.375rem; color: #0f1923; }
.location-card-meta { font-size: 0.85rem; color: #888; line-height: 1.5; margin-bottom: 0.875rem; }
.location-card-tags { display: flex; gap: 0.375rem; flex-wrap: wrap; margin-bottom: 0.875rem; }
.therapy-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: #fef9c3;
  color: #854d0e;
}
.location-card-actions { display: flex; gap: 0.5rem; }

/* Location detail page */
.location-detail-header {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.location-detail-info h1 { margin-bottom: 0.25rem; }
.location-detail-info .text-muted { font-size: 0.9rem; }
.location-detail-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== ANALYSE ===== */
.filter-panel {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 0.375rem; }
.filter-group label { font-size: 0.8rem; font-weight: 600; color: #888; }
.filter-group select,
.filter-group input[type="number"] {
  padding: 0.4375rem 0.75rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  background: white;
  min-width: 160px;
}
.filter-group select:focus,
.filter-group input:focus { outline: none; border-color: var(--yellow); }
.btn--filter {
  padding: 0.4375rem 1rem;
  background: #0f1923;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.btn--filter:hover { background: #1e2d3d; }

.analyse-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .analyse-grid { grid-template-columns: 1fr; } }

.analyse-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.375rem;
}
.analyse-card h3 { font-size: 1rem; margin-bottom: 1rem; color: #374151; }
.analyse-card--wide { grid-column: 1 / -1; }

.heatmap-wrap { overflow-x: auto; }
.heatmap-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.heatmap-table th {
  padding: 0.375rem 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
}
.heatmap-table th:first-child { text-align: left; }
.heatmap-table td { padding: 0.375rem 0.5rem; text-align: center; }
.heatmap-table td:first-child { text-align: left; font-weight: 600; font-size: 0.85rem; white-space: nowrap; }

.heatmap-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 32px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.8rem;
}
.heatmap-cell--good { background: #dcfce7; color: #166534; }
.heatmap-cell--ok   { background: #fef9c3; color: #854d0e; }
.heatmap-cell--bad  { background: #fee2e2; color: #991b1b; }
.heatmap-cell--empty { background: #f3f4f6; color: #bbb; }

.comment-filter-list { display: flex; flex-direction: column; gap: 0.625rem; max-height: 400px; overflow-y: auto; }
.comment-filter-item {
  border-left: 3px solid var(--yellow);
  padding: 0.625rem 0.875rem;
  background: #f9fafb;
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
}
.comment-filter-item.low-score { border-left-color: #fca5a5; }
.comment-filter-meta { font-size: 0.75rem; color: #888; margin-bottom: 0.25rem; }

/* Analyse – Standort-Checkboxen */
.location-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  min-width: 180px;
}
.location-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}
.location-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #0f1923;
  cursor: pointer;
}
.filter-date-row { display: flex; gap: 0.5rem; align-items: center; }
.filter-date-row input[type="date"] {
  padding: 0.4375rem 0.75rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
}
.filter-date-row input[type="date"]:focus { outline: none; border-color: var(--yellow); }

/* Benutzer – Edit-Panel */
.edit-user-panel {
  background: white;
  border-radius: var(--radius);
  padding: 1.375rem;
  margin-bottom: 1.5rem;
  border: 1.5px solid #e5e7eb;
  display: none;
}
.edit-user-panel.visible { display: block; }
.edit-user-panel h2 { margin-bottom: 1.25rem; }

/* ===== MOBILE NAVIGATION ELEMENTS ===== */

/* Sidebar overlay (hidden on desktop) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 150;
}
.sidebar-overlay.visible { display: block; }

/* Prevent body scroll when sidebar is open */
body.no-scroll { overflow: hidden; }

/* Mobile top bar (hidden on desktop) */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}
.mobile-topbar-brand {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: #0f1923;
  text-transform: uppercase;
}
.mobile-topbar-brand b { color: var(--yellow); }

.hamburger-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
}
.hamburger-btn:hover { background: #f3f4f6; }
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #0f1923;
  border-radius: 2px;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

@media (max-width: 768px) {
  /* Mobile topbar visible */
  .mobile-topbar { display: flex; }

  /* Sidebar: slide-in drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  .sidebar.sidebar--open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.15);
  }

  /* Main area: full width */
  .app-main { margin-left: 0; }
  .app-content { padding: 1rem; }

  /* Typography */
  h1 { font-size: 1.375rem; }
  h2 { font-size: 1.1rem; }

  /* Dashboard topbar */
  .db-topbar { flex-direction: column; align-items: flex-start; gap: 0.625rem; }
  .page-topbar { flex-wrap: wrap; gap: 0.5rem; }

  /* KPI cards: 2 columns on tablet, 1 on very small */
  .kpi-grid--hero { grid-template-columns: 1fr 1fr; }

  /* Ranking table → cards on mobile */
  .ranking-table { display: block; }
  .ranking-table thead { display: none; }
  .ranking-table tbody { display: flex; flex-direction: column; gap: 0.5rem; }
  .ranking-table tbody tr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.875rem;
    border-bottom: none !important;
  }
  .ranking-table td { border-bottom: none; padding: 0; }
  .ranking-table td.rank { display: none; }
  .ranking-table td:nth-child(2) { flex: 1; font-weight: 600; }
  .ranking-table td:nth-child(3) { color: #888; font-size: 0.85rem; white-space: nowrap; }

  /* Tables: horizontal scroll */
  .doctor-table { min-width: 520px; }
  .arzt-detail-scores { gap: 0.75rem; }
  .user-table   { min-width: 640px; }
  .heatmap-table { min-width: 540px; }

  /* Touch targets: min 44px */
  .action-btn  { width: 44px; height: 44px; font-size: 1rem; }
  .period-btn  { padding: 0.5rem 1rem; min-height: 40px; }
  .btn--sm     { padding: 0.5rem 1rem; min-height: 40px; }
  .btn--filter { padding: 0.5rem 1rem; min-height: 40px; }

  /* Filter panel: vertical stack */
  .filter-panel { flex-direction: column; gap: 0.625rem; }
  .filter-group select,
  .filter-group input[type="number"],
  .filter-group input[type="date"] { min-width: 100%; width: 100%; }

  /* Aufgaben: note form vertical */
  .note-form { flex-direction: column; }
  .task-card-actions { flex-wrap: wrap; }

  /* Location grid: 1 column */
  .location-grid { grid-template-columns: 1fr; }

  /* Section padding reduction */
  .db-section { padding: 1rem; }
  fieldset { padding: 1rem; }

  /* Inline form panels */
  .inline-form-panel { padding: 1rem; }
}

@media (max-width: 480px) {
  /* Single-column KPI on very small screens */
  .kpi-grid--hero { grid-template-columns: 1fr; }
  .app-content { padding: 0.875rem; }
  .kpi-value { font-size: 2rem; }
  .kpi-card:not(.kpi-card--big) .kpi-value { font-size: 1.5rem; }
}

/* Readonly display inputs */
.input-readonly {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  background: #f9fafb;
  color: #374151;
  cursor: default;
}

/* ===== WATERMARK (public forms) ===== */
.public-form::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  height: 240px;
  background: url('/img/logo.png') no-repeat center;
  background-size: contain;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}
.public-form .container { position: relative; z-index: 1; }
.public-form .rating-category-title { text-align: center; }
.public-form .rating-statement { text-align: center; }
.public-form .rating-scale { justify-content: center; }

/* ===== ANALYSE MOBILE ===== */
@media (max-width: 768px) {
  /* Prevent charts and filter from causing horizontal scroll */
  .analyse-grid canvas { max-width: 100%; }
  .filter-panel input[type="date"] { min-width: 100% !important; width: 100% !important; }
  .location-checkbox { font-size: 0.875rem; }
  .analyse-card { overflow-x: hidden; }
}
