/* ============================================================
   FAZ Frühdenker AI Tool – Styles
   Editorial, clean, newsroom-efficient
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;600;700&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --faz-dark: #0f172a;
  --faz-blue: #1e40af;
  --faz-blue-light: #2563eb;
  --faz-blue-pale: #dbeafe;
  --faz-blue-ghost: #eff6ff;
  --faz-slate: #475569;
  --faz-gray: #94a3b8;
  --faz-light: #f8fafc;
  --faz-border: #e2e8f0;
  --faz-white: #ffffff;
  --faz-green: #059669;
  --faz-red: #dc2626;
  --faz-orange: #d97706;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
}

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

body {
  font-family: var(--sans);
  background: var(--faz-light);
  color: var(--faz-dark);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* ---- HEADER ---- */
.app-header {
  background: var(--faz-dark);
  color: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.header-title h1 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.header-title h1 span { color: #60a5fa; }
.header-title p {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 1px;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ella-logo {
  height: 36px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.ella-logo:hover { opacity: 1; }

.user-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.user-badge.admin { background: #1e3a5f; color: #60a5fa; }
.user-badge.redakteur { background: #1e293b; color: #94a3b8; }

.btn-logout {
  background: none;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.2s;
}
.btn-logout:hover { border-color: #ef4444; color: #ef4444; }

/* ---- TABS ---- */
.tab-bar {
  background: var(--faz-white);
  border-bottom: 1px solid var(--faz-border);
  display: flex;
  padding: 0 24px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  background: none;
  border: none;
  padding: 14px 20px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--faz-gray);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--faz-slate); background: var(--faz-blue-ghost); }
.tab-btn.active {
  color: var(--faz-blue);
  border-bottom-color: var(--faz-blue);
  font-weight: 700;
}
.tab-icon { font-size: 16px; }

/* ---- MAIN CONTENT ---- */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- CARDS ---- */
.card {
  background: var(--faz-white);
  border: 1px solid var(--faz-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }

.card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--faz-dark);
  margin-bottom: 4px;
}
.card-subtitle {
  font-size: 13px;
  color: var(--faz-gray);
  margin-bottom: 20px;
}

/* ---- FORMS ---- */
label.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--faz-slate);
  margin-bottom: 6px;
}
label.form-hint {
  display: block;
  font-size: 11px;
  color: var(--faz-gray);
  margin-bottom: 8px;
}

textarea, input[type="text"], select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--faz-border);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--faz-white);
}
textarea:focus, input[type="text"]:focus, select:focus {
  border-color: var(--faz-blue);
  box-shadow: 0 0 0 3px rgba(30,64,175,0.08);
}
textarea { resize: vertical; line-height: 1.7; }
textarea.input-highlight {
  background: var(--faz-blue-ghost);
  border-color: #bfdbfe;
}

select {
  cursor: pointer;
  appearance: auto;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row > * { flex: 1; }

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

/* ---- RADIO GROUP ---- */
.radio-group {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 16px;
  background: var(--faz-light);
  border-radius: 8px;
  margin-bottom: 16px;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}
.radio-group input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--faz-blue);
}
.radio-label-bold {
  font-size: 13px;
  font-weight: 700;
  color: var(--faz-slate);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- BUTTONS ---- */
.btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--faz-blue);
  color: white;
}
.btn-primary:hover { background: #1e3a8a; }
.btn-secondary {
  background: var(--faz-dark);
  color: white;
}
.btn-secondary:hover { background: #1e293b; }
.btn-ghost {
  background: none;
  color: var(--faz-gray);
  border: 1px solid transparent;
}
.btn-ghost:hover { color: var(--faz-red); border-color: var(--faz-border); }
.btn-copy {
  background: var(--faz-white);
  color: var(--faz-slate);
  border: 1px solid var(--faz-border);
  font-size: 12px;
  padding: 5px 12px;
}
.btn-copy:hover { background: var(--faz-light); }
.btn-copy.copied { background: #ecfdf5; color: var(--faz-green); border-color: #a7f3d0; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- SPINNER ---- */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--faz-border);
  border-top-color: var(--faz-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}
.spinner.active { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- OUTPUT AREAS ---- */
.output-area {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--faz-border);
  display: none;
}
.output-area.visible { display: block; }

.output-block {
  position: relative;
  margin-bottom: 16px;
}
.output-block label {
  font-size: 12px;
  font-weight: 700;
  color: var(--faz-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  display: block;
}
.output-block textarea,
.output-block input[type="text"] {
  background: var(--faz-light);
  border-color: var(--faz-border);
  font-size: 14px;
}
.output-block .btn-copy {
  position: absolute;
  top: 28px;
  right: 4px;
}

.output-code {
  background: var(--faz-dark);
  color: #a7f3d0;
  font-family: var(--mono);
  font-size: 12px;
  padding: 16px;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.8;
}

/* ---- MODE TOGGLE ---- */
.mode-toggle {
  display: flex;
  background: var(--faz-light);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--faz-border);
}
.mode-toggle button {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--faz-gray);
  transition: all 0.2s;
}
.mode-toggle button.active {
  background: var(--faz-white);
  color: var(--faz-blue);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ---- NEWSLETTER ITEMS (split view) ---- */
.newsletter-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.newsletter-item {
  border: 1px solid var(--faz-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.newsletter-item:hover { border-color: #93c5fd; }
.newsletter-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--faz-light);
  border-bottom: 1px solid var(--faz-border);
  cursor: pointer;
}
.newsletter-item-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--faz-dark);
}
.newsletter-item-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--faz-blue);
  background: var(--faz-blue-pale);
  padding: 2px 8px;
  border-radius: 12px;
  flex-shrink: 0;
}
.newsletter-item-body {
  padding: 16px;
  display: none;
}
.newsletter-item-body.open { display: block; }
.newsletter-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ---- O-TON FINDER ---- */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.search-bar input { flex: 1; }
.search-bar .btn { flex-shrink: 0; }

.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-row select { width: auto; min-width: 160px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--faz-border);
  background: var(--faz-white);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-chip.active {
  background: var(--faz-blue);
  color: white;
  border-color: var(--faz-blue);
}

.video-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.video-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--faz-border);
  border-radius: var(--radius);
  background: var(--faz-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.video-card:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow-md);
}
.video-thumb {
  width: 200px;
  height: 112px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--faz-light);
}
.video-info { flex: 1; min-width: 0; }
.video-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--faz-dark);
  margin-bottom: 4px;
  line-height: 1.4;
}
.video-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--faz-gray);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.video-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.video-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-oton {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

/* Transcript hits */
.transcript-hits {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--faz-border);
}
.transcript-hit {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--faz-light);
  font-size: 13px;
}
.transcript-hit:last-child { border-bottom: none; }
.hit-timestamp {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--faz-blue);
  background: var(--faz-blue-ghost);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.hit-timestamp:hover { background: var(--faz-blue-pale); }
.hit-text {
  color: var(--faz-slate);
  line-height: 1.5;
}
.hit-text mark {
  background: #fef08a;
  color: var(--faz-dark);
  padding: 0 2px;
  border-radius: 2px;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--faz-gray);
}
.no-results .icon { font-size: 32px; margin-bottom: 8px; }

/* ---- PROMPT EDITOR ---- */
.prompt-section {
  border: 1px solid var(--faz-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--faz-light);
  border-bottom: 1px solid var(--faz-border);
}
.prompt-header h3 { font-weight: 700; font-size: 14px; }
.prompt-header code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faz-gray);
}
.prompt-body { padding: 16px; }
.prompt-body textarea {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  min-height: 180px;
}
.prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.prompt-status { font-size: 13px; color: var(--faz-gray); }
.prompt-status.saved { color: var(--faz-green); font-weight: 600; }
.prompt-status.error { color: var(--faz-red); }

/* ---- KEYWORDS INPUT ---- */
.keywords-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--faz-border);
  border-radius: 8px;
  min-height: 42px;
  align-items: center;
  cursor: text;
  background: var(--faz-white);
  transition: border-color 0.2s;
}
.keywords-input:focus-within {
  border-color: var(--faz-blue);
  box-shadow: 0 0 0 3px rgba(30,64,175,0.08);
}
.keyword-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--faz-blue-pale);
  color: var(--faz-blue);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.keyword-tag button {
  background: none;
  border: none;
  color: var(--faz-blue);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  opacity: 0.6;
}
.keyword-tag button:hover { opacity: 1; }
.keywords-input input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  padding: 4px;
  font-size: 13px;
  font-family: var(--sans);
}

/* ---- DIENSTPLAN ---- */

.dp-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.dp-month-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--faz-dark);
  min-width: 200px;
  text-align: center;
}

.dp-calendar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.dp-weekday-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--faz-gray);
  text-align: center;
  padding: 6px 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dp-day {
  border: 1px solid var(--faz-border);
  border-radius: var(--radius);
  padding: 10px 8px;
  min-height: 68px;
  background: var(--faz-white);
  transition: box-shadow 0.15s;
}

.dp-day:hover {
  box-shadow: var(--shadow-md);
}

.dp-day-number {
  font-size: 11px;
  font-weight: 600;
  color: var(--faz-gray);
  margin-bottom: 6px;
}

.dp-day-editor-wrap {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.dp-day-editor {
  font-size: 12px;
  font-weight: 600;
  color: var(--faz-dark);
  line-height: 1.3;
}

.dp-day-holiday-label {
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  color: var(--faz-gray);
}

.dp-day-empty-label {
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
}

.dp-day.dp-holiday {
  background: var(--faz-light);
  opacity: 0.55;
}

.dp-day.dp-gesperrt {
  background: #f1f5f9;
  border-color: #cbd5e1;
  opacity: 0.7;
}

.dp-day-gesperrt-label {
  font-size: 11px;
  font-weight: 500;
  font-style: italic;
  color: var(--faz-slate);
}

.dp-day.dp-empty {
  border-color: var(--faz-red);
  background: var(--faz-red);
}

.dp-day.dp-empty .dp-day-number {
  color: rgba(255,255,255,0.75);
}

.dp-day.dp-today {
  border: 2px solid var(--faz-blue);
}

.dp-day.dp-admin-clickable {
  cursor: pointer;
}

.dp-day.dp-admin-clickable:hover {
  outline: 2px dashed var(--faz-gray);
  outline-offset: -2px;
}

.dp-day.dp-gesperrt.dp-admin-clickable:hover {
  outline-color: var(--faz-orange);
  opacity: 1;
}

/* ---- VERTEILUNGS-AUSWERTUNG ---- */
.dp-dist-wrap {
  background: var(--faz-light);
  border: 1px solid var(--faz-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 4px;
}

.dp-dist-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--faz-slate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.dp-dist-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 280px;
}

.dp-dist-table td {
  padding: 3px 8px 3px 0;
  font-size: 13px;
  color: var(--faz-dark);
  vertical-align: middle;
}

.dp-dist-table td:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dp-dist-count {
  font-weight: 700;
  color: var(--faz-blue);
  text-align: right;
  padding-left: 16px !important;
}

.dp-dist-footer {
  font-size: 12px;
  color: var(--faz-gray);
  margin-top: 8px;
  border-top: 1px solid var(--faz-border);
  padding-top: 6px;
}

/* ---- VERFÜGBARKEITS-GRID ---- */
.dp-avail-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.dp-avail-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 12px;
}

.dp-avail-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--faz-dark);
  flex-wrap: wrap;
}

.dp-avail-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--faz-gray);
  width: 100%;
  padding-left: 15px;
}

/* ---- DAY EDIT POPUP ---- */
.dp-day-popup {
  position: fixed;
  background: var(--faz-white);
  border: 1px solid var(--faz-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  min-width: 210px;
  overflow: hidden;
  padding: 4px 0;
}

.dp-popup-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faz-dark);
  white-space: nowrap;
}

.dp-popup-item:hover {
  background: var(--faz-blue-ghost);
}

.dp-popup-item.dp-popup-active {
  font-weight: 700;
  color: var(--faz-blue);
}

.dp-popup-divider {
  height: 1px;
  background: var(--faz-border);
  margin: 3px 0;
}

.dp-popup-sperren {
  color: var(--faz-slate);
  font-size: 12px;
}

.dp-popup-sperren:hover {
  background: #fff7ed;
  color: var(--faz-orange);
}

.dp-editor-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Redakteur colors */
.dp-color-0 { background-color: #1e40af; } /* Jan Malte – faz-blue */
.dp-color-1 { background-color: #059669; } /* Jan Niklas – green */
.dp-color-2 { background-color: #d97706; } /* Sebastian – orange */
.dp-color-3 { background-color: #7c3aed; } /* Niklas – purple */
.dp-color-4 { background-color: #db2777; } /* Magdalena – pink */

.dp-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--faz-gray);
}

.dp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--faz-light);
  border-radius: var(--radius);
}

.dp-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--faz-slate);
}

/* ---- VERFÜGBARKEITS-KALENDER (Redakteur self-reporting) ---- */
.dp-verf-calendar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.dp-verf-day {
  cursor: default;
  min-height: 52px;
  padding: 8px 6px;
}

.dp-verf-day:not(.dp-holiday):not(.dp-gesperrt) {
  cursor: pointer;
}

.dp-verf-day:not(.dp-holiday):not(.dp-gesperrt):hover {
  background: var(--faz-blue-ghost);
  border-color: var(--faz-blue-pale);
}

.dp-verf-day.dp-verf-selected {
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.dp-verf-day.dp-verf-selected .dp-day-number {
  color: var(--faz-green);
}

.dp-verf-check {
  font-size: 14px;
  font-weight: 700;
  color: var(--faz-green);
  text-align: center;
  margin-top: 2px;
}

/* ---- VERFÜGBARKEITS-STATUS-BADGES (Admin avail grid) ---- */
.dp-verf-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.dp-verf-badge-ok {
  background: #ecfdf5;
  color: var(--faz-green);
}

.dp-verf-badge-missing {
  background: #fef2f2;
  color: var(--faz-red);
}

/* ---- VERFÜGBARKEITS-COUNT-BADGE (Admin calendar cell) ---- */
.dp-day {
  position: relative; /* needed for absolute count badge */
}

.dp-verf-count-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--faz-green);
  color: white;
  font-size: 9px;
  font-weight: 700;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: default;
}

/* ---- ADMIN DIENSTE-ZÄHLER ---- */
#dp-admin-counter {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 16px;
  background: var(--faz-light);
  border: 1px solid var(--faz-border);
  border-radius: var(--radius);
  font-size: 12px;
}

.dp-counter-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dp-counter-name {
  color: var(--faz-slate);
}

.dp-counter-num {
  font-weight: 700;
  color: var(--faz-dark);
  min-width: 14px;
}

.dp-counter-sep {
  color: var(--faz-border);
  font-size: 14px;
  padding: 0 2px;
}

/* ---- POPUP VERFÜGBARKEITS-INDIKATOREN ---- */
.dp-popup-avail {
  margin-left: auto;
  font-size: 10px;
  flex-shrink: 0;
  line-height: 1;
}

.dp-popup-avail-ok   { color: var(--faz-green); }
.dp-popup-avail-warn { color: var(--faz-orange); font-size: 12px; }
.dp-popup-avail-none { color: var(--faz-gray); }

/* ---- CELL WARN BLINK ---- */
@keyframes dpCellBlinkAnim {
  0%   { box-shadow: none; }
  30%  { box-shadow: 0 0 0 3px var(--faz-orange); }
  70%  { box-shadow: 0 0 0 3px var(--faz-orange); }
  100% { box-shadow: none; }
}

.dp-cell-blink-warn {
  animation: dpCellBlinkAnim 0.55s ease-out;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .app-header { padding: 12px 16px; }
  .header-logo { width: 36px; height: 36px; }
  .header-title h1 { font-size: 18px; }
  .main-content { padding: 16px; }
  .card { padding: 16px; }
  .form-row { flex-direction: column; gap: 12px; }
  .video-card { flex-direction: column; }
  .video-thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
  .search-bar { flex-direction: column; }
}

/* ---- LOADING OVERLAY ---- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.loading-overlay.active { display: flex; }
.loading-box {
  background: var(--faz-white);
  padding: 32px 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.loading-box .spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-width: 4px;
  margin-bottom: 12px;
}
.loading-box p {
  font-size: 14px;
  color: var(--faz-slate);
  font-weight: 500;
}
