/* ============================================================
   NordPrax Operations Console – Ressourcen-Kalender Styles
   ============================================================ */

/* ── Kalender Container ───────────────────────────────────────── */

.np-cal-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ops);
  font-size: var(--text-sm);
  color: var(--text);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03);
}

/* ── Toolbar ──────────────────────────────────────────────────── */

.np-cal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 2px solid var(--teal);
  background: var(--bg-subtle);
  min-height: 40px;
  flex-shrink: 0;
  flex-wrap: wrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.np-cal-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.np-cal-toolbar-center {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: var(--text-md);
  min-width: 120px;
}

.np-cal-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.np-cal-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.np-cal-nav-btn:hover {
  background: var(--bg-muted);
}

.np-cal-view-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.np-cal-view-btn:hover {
  background: var(--bg-muted);
}

.np-cal-view-btn.active {
  background: var(--teal-50);
  border-color: var(--teal-600);
  color: var(--teal-600);
}

.np-cal-today-btn {
  background: var(--teal-600);
  border: none;
  border-radius: var(--radius-sm);
  padding: 3px 12px;
  cursor: pointer;
  font-size: var(--text-xs);
  color: #fff;
  font-weight: 600;
}

.np-cal-today-btn:hover {
  background: var(--teal-dark);
}

/* Slot-Mode Toggle */
.np-cal-slot-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: none;
}

.np-cal-slot-toggle.active {
  background: var(--green-50);
  border-color: var(--green-600);
  color: var(--green-600);
}

/* Sync-Button */
.np-cal-sync-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--teal-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--teal-600);
  background: none;
  transition: all 120ms ease;
}

.np-cal-sync-btn:hover {
  background: var(--teal-50);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.np-cal-sync-btn.syncing {
  opacity: 0.6;
  cursor: wait;
}

.np-cal-sync-icon {
  display: inline-block;
}

.np-cal-sync-btn.syncing .np-cal-sync-icon {
  animation: np-cal-sync-spin 1s linear infinite;
}

@keyframes np-cal-sync-spin {
  to { transform: rotate(360deg); }
}

/* ── Kalender Scroll-Bereich ──────────────────────────────────── */

.np-cal-scroll {
  flex: 1;
  overflow: auto;
  position: relative;
}

/* ── Ressourcen-Grid Ansicht (Mitarbeiter links, Tage oben) ──── */

.np-cal-rg {
  display: grid;
  min-width: max-content;
}

/* Ecke oben-links */
.np-cal-rg-corner {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 15;
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
  box-shadow: 2px 2px 6px rgba(0,0,0,0.06);
}

/* Zeit-Header (oben) */
.np-cal-rg-time-hdr {
  position: sticky;
  left: 120px;
  top: 0;
  z-index: 14;
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Tag-Header */
.np-cal-rg-day-hdr {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border-subtle);
  padding: 6px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.np-cal-rg-day-hdr.today {
  background: var(--teal-50);
  box-shadow: inset 0 -3px 0 var(--teal-600), 0 2px 4px rgba(0,0,0,0.04);
}

.np-cal-rg-day-hdr.weekend {
  background: rgba(0,0,0,0.06);
  border-bottom: 2px solid rgba(0,0,0,0.1);
  color: var(--text-muted);
  font-size: 9px;
}

.np-cal-rg-day-hdr.holiday {
  background: var(--bg-muted);
  color: var(--text-muted);
}

.np-cal-rg-dow {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.np-cal-rg-dnum {
  font-size: var(--text-sm);
  font-weight: 600;
}

.np-cal-rg-dhol {
  font-size: 8px;
  color: var(--red-600);
  font-weight: 500;
}

/* Ressourcen-Akzent-Punkt */
.np-cal-resource-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
}

/* Mitarbeiter-Name (sticky links) */
.np-cal-rg-name {
  position: sticky;
  left: 0;
  z-index: 6;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
  font-weight: 600;
  font-size: var(--text-sm);
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: 120px;
  min-width: 120px;
  box-shadow: 2px 0 6px rgba(0,0,0,0.06);
}

.np-cal-rg-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Zeit-Spalte (sticky links neben Name) */
.np-cal-rg-time {
  position: sticky;
  left: 120px;
  z-index: 5;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  width: 28px;
  min-width: 28px;
  box-shadow: 2px 0 4px rgba(0,0,0,0.04);
}

.np-cal-rg-tl {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1px;
  font-size: 9px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Tag-Zelle */
.np-cal-rg-cell {
  position: relative;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  background: var(--bg-white);
  transition: background 80ms ease;
}

.np-cal-rg-cell:hover {
  background: rgba(0,0,0,0.015);
}

.np-cal-rg-cell.off-day {
  background: rgba(0,0,0,0.04);
  border-right: 2px solid rgba(0,0,0,0.08);
  opacity: 1;
  cursor: default;
}

/* Ungerade Ressourcenzeilen leicht getönt */
.np-cal-rg-cell.np-cal-rg-cell-odd {
  background: var(--bg-subtle, rgba(0,0,0,0.018));
}

.np-cal-rg-cell.np-cal-rg-cell-odd:hover {
  background: rgba(0,0,0,0.03);
}

.np-cal-rg-cell.np-cal-rg-cell-odd.off-day {
  background: rgba(0,0,0,0.06);
}

/* Arbeitszeit-Hintergrund */
.np-cal-rg-wh {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(47, 158, 68, 0.035);
  z-index: 0;
  pointer-events: none;
}

/* Stundenlinien */
.np-cal-rg-hline {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid var(--border);
  pointer-events: none;
  z-index: 1;
}

/* Volle Stunde – stärkere Linie */
.np-cal-rg-hline.full-hour {
  border-top: 1px solid rgba(0,0,0,0.18);
}

/* ── Hover-Zeitlinie ─────────────────────────────────────────── */

.np-cal-rg-hover-line {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1.5px dashed var(--teal-600);
  pointer-events: none;
  z-index: 20;
  opacity: 0.7;
}

.np-cal-rg-hover-label {
  position: absolute;
  left: 4px;
  top: -10px;
  background: var(--teal-600);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1.5;
}

/* ── Termin-Bloecke (Ressourcen-Grid) ────────────────────────── */

.np-cal-rg-ev {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  overflow: hidden;
  cursor: pointer;
  z-index: 3;
  border-left: 3px solid;
  line-height: 1.3;
  min-height: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  word-break: break-word;
  hyphens: auto;
  box-sizing: border-box;
}

/* Parallele Termine nebeneinander */
.np-cal-rg-ev.parallel {
  right: auto;
}

.np-cal-rg-ev:hover {
  z-index: 4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.np-cal-rg-ev.dragging {
  opacity: 0.4;
  box-shadow: none;
}

/* Vergangener Termin mit offenem Ticket – Rot-Hervorhebung */
.np-cal-rg-ev.np-cal-rg-ev-overdue {
  border-left-width: 3px !important;
  border-left-color: var(--red-600) !important;
}
.np-cal-rg-ev.np-cal-rg-ev-overdue::after {
  content: '⚠';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  color: var(--red-600);
  line-height: 1;
}

.np-cal-rg-ev[draggable="true"] {
  cursor: grab;
}

.np-cal-rg-ev[draggable="true"]:active {
  cursor: grabbing;
}

/* Drop-Zone Feedback */
.np-cal-rg-cell.drop-hover {
  background: rgba(47, 158, 68, 0.08) !important;
  outline: 2px dashed var(--green-600);
  outline-offset: -2px;
}

/* Drag-Zeit-Tooltip */
.np-cal-drag-time {
  position: fixed;
  z-index: 10000;
  background: var(--bg-primary, #1a1a2e);
  color: var(--green-400, #4ade80);
  font-family: var(--font-mono, monospace);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--green-600, #16a34a);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  text-align: center;
  line-height: 1.3;
}

/* Inline-Modus für kurze Termine */
.np-cal-rg-ev-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
}

.np-cal-rg-ev-inline .np-cal-rg-ev-title {
  display: inline;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
}

.np-cal-rg-ev-inline .np-cal-rg-ev-cust {
  display: inline;
  white-space: nowrap;
}

.np-cal-rg-ev-time {
  font-size: 9px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.np-cal-rg-ev-title {
  font-weight: 700;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.np-cal-rg-ev-cust {
  font-size: 9px;
  opacity: 0.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Freie Slots (Ressourcen-Grid) ───────────────────────────── */

.np-cal-rg-free {
  position: absolute;
  left: 2px;
  right: 2px;
  background: var(--green-50);
  border: 1px dashed var(--green-600);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 9px;
  color: var(--green-600);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
}

.np-cal-rg-free:hover {
  background: rgba(47, 158, 68, 0.18);
  z-index: 3;
  box-shadow: 0 1px 4px rgba(47,158,68,0.2);
}

/* ── Jetzt-Linie (Ressourcen-Grid) ───────────────────────────── */

.np-cal-rg-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red-600);
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(224,49,49,0.4);
}

.np-cal-rg-now::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-600);
  box-shadow: 0 0 4px rgba(224,49,49,0.4);
}

/* Gemeinsame freie Slots (Overlay-Zeile) */
.np-cal-common-slots {
  background: var(--green-50);
  border-bottom: 2px solid var(--green-600);
  padding: 4px 12px;
  font-size: var(--text-xs);
  color: var(--green-600);
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.np-cal-common-slots.visible {
  display: flex;
}

.np-cal-common-slot-chip {
  padding: 2px 8px;
  background: var(--bg-white);
  border: 1px solid var(--green-600);
  border-radius: 10px;
  font-size: var(--text-2xs);
  cursor: pointer;
}

.np-cal-common-slot-chip:hover {
  background: var(--green-600);
  color: #fff;
}

/* ── Aktuelle Zeitlinie ───────────────────────────────────────── */

.np-cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--red-600);
  z-index: 6;
  pointer-events: none;
}

.np-cal-now-line::before {
  content: '';
  position: absolute;
  left: -3px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red-600);
}

/* ── Abwesenheiten / Feiertage ────────────────────────────────── */

.np-cal-absence {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(134, 142, 150, 0.1) 4px,
    rgba(134, 142, 150, 0.1) 8px
  );
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

/* ── Kapazitaetsansicht (30/60/90 Tage) ───────────────────────── */

.np-cal-capacity {
  display: grid;
  gap: 0;
}

.np-cal-capacity-row {
  display: flex;
  min-height: 36px;
  border-bottom: 1px solid var(--border-subtle);
}

.np-cal-capacity-name {
  width: 140px;
  min-width: 140px;
  padding: 8px 10px;
  font-weight: 600;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  position: sticky;
  left: 0;
  background: var(--bg-white);
  z-index: 2;
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 6px rgba(0,0,0,0.06);
}

.np-cal-capacity-cell {
  min-width: 28px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: var(--text-2xs);
  font-weight: 600;
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.np-cal-capacity-cell:hover {
  opacity: 0.8;
  outline: 1px solid var(--text-muted);
}

/* Kapazitaet: Farbkodierung */
.np-cal-cap-free     { background: rgba(47, 158, 68, 0.15); color: var(--green-600); }
.np-cal-cap-partial  { background: rgba(255, 212, 59, 0.2); color: #b8860b; }
.np-cal-cap-busy     { background: rgba(232, 89, 12, 0.15); color: var(--orange-600); }
.np-cal-cap-full     { background: rgba(224, 49, 49, 0.15); color: var(--red-600); }
.np-cal-cap-absent   { background: var(--bg-muted); color: var(--text-muted); }
.np-cal-cap-off      { background: transparent; }

/* Kapazitaet: Datums-Header */
.np-cal-capacity-dates {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--border);
  min-height: 40px;
}

.np-cal-capacity-date {
  min-width: 28px;
  flex: 1;
  padding: 4px 0;
  text-align: center;
  font-size: var(--text-2xs);
  color: var(--text-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.np-cal-capacity-date.today {
  background: var(--teal-50);
  font-weight: 600;
  color: var(--teal-600);
}

.np-cal-capacity-date.weekend {
  color: var(--text-muted);
  background: var(--bg-muted);
}

.np-cal-capacity-date-day {
  font-size: 9px;
  text-transform: uppercase;
}

/* ── Termin-Dialog ────────────────────────────────────────────── */

.np-cal-booking-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  min-width: 380px;
  max-width: 480px;
  z-index: 100;
}

.np-cal-booking-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
}

/* ── Loading / Empty / Error States ───────────────────────────── */

.np-cal-loading,
.np-cal-empty,
.np-cal-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 8px;
  color: var(--text-muted);
  font-size: var(--text-md);
  flex: 1;
}

.np-cal-loading .np-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--teal-600);
  border-radius: 50%;
  animation: np-cal-spin 0.7s linear infinite;
  margin-bottom: 4px;
}

.np-cal-loading .np-loading-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.np-cal-loading .np-loading-hint {
  font-size: var(--text-2xs);
  color: var(--text-muted);
  opacity: 0;
  animation: np-cal-fade-hint 0.5s ease 2s forwards;
}

@keyframes np-cal-spin {
  to { transform: rotate(360deg); }
}

@keyframes np-cal-fade-hint {
  to { opacity: 0.7; }
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 767px) {
  .np-cal-toolbar {
    gap: 4px;
  }

  .np-cal-toolbar-center {
    font-size: var(--text-sm);
  }

  .np-cal-rg-name {
    width: 90px;
    min-width: 90px;
    font-size: var(--text-xs);
  }

  .np-cal-rg-time {
    width: 22px;
    min-width: 22px;
    left: 90px;
  }

  .np-cal-rg-time-hdr {
    left: 90px;
  }

  .np-cal-capacity-name {
    width: 100px;
    min-width: 100px;
    font-size: var(--text-xs);
  }
}

/* ── Scrollbar ────────────────────────────────────────────────── */

.np-cal-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.np-cal-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.np-cal-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.np-cal-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* ── Dark Mode ───────────────────────────────────────────────── */

[data-theme="dark"] .np-cal-wrap {
  background: var(--bg-white);
  border-color: var(--border);
}

[data-theme="dark"] .np-cal-toolbar {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .np-cal-nav-btn {
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .np-cal-nav-btn:hover {
  background: var(--bg-muted);
}

[data-theme="dark"] .np-cal-view-btn {
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .np-cal-view-btn:hover {
  background: var(--bg-muted);
}

[data-theme="dark"] .np-cal-view-btn.active {
  background: var(--teal-50);
  border-color: var(--teal-600);
  color: var(--teal-600);
}

[data-theme="dark"] .np-cal-slot-toggle {
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .np-cal-slot-toggle.active {
  background: var(--green-50);
  border-color: var(--green-600);
  color: var(--green-600);
}

/* Ressourcen-Grid Dark Mode */
[data-theme="dark"] .np-cal-rg-corner,
[data-theme="dark"] .np-cal-rg-time-hdr,
[data-theme="dark"] .np-cal-rg-day-hdr {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .np-cal-rg-corner,
[data-theme="dark"] .np-cal-rg-name {
  box-shadow: 2px 0 8px rgba(0,0,0,0.2);
}

[data-theme="dark"] .np-cal-rg-day-hdr.today {
  background: var(--teal-50);
}

[data-theme="dark"] .np-cal-rg-name {
  background: var(--bg-white);
  border-color: var(--border);
}

[data-theme="dark"] .np-cal-rg-time {
  background: var(--bg-subtle);
  border-color: var(--border);
  box-shadow: 2px 0 6px rgba(0,0,0,0.15);
}

[data-theme="dark"] .np-cal-rg-cell {
  background: var(--bg-white);
  border-color: var(--border-subtle);
}

[data-theme="dark"] .np-cal-rg-cell:hover {
  background: rgba(255,255,255,0.03);
}

[data-theme="dark"] .np-cal-rg-cell.off-day {
  background: var(--bg-muted);
}

[data-theme="dark"] .np-cal-rg-ev {
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

[data-theme="dark"] .np-cal-rg-ev:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
}

[data-theme="dark"] .np-cal-rg-hline.full-hour {
  border-top-color: rgba(255,255,255,0.12);
}

[data-theme="dark"] .np-cal-rg-cell.off-day {
  background: rgba(255,255,255,0.03);
  border-right-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .np-cal-rg-day-hdr.weekend {
  background: rgba(255,255,255,0.04);
  border-bottom-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .np-cal-rg-free {
  background: var(--green-50);
  border-color: var(--green-600);
  color: var(--green-600);
}

[data-theme="dark"] .np-cal-rg-free:hover {
  background: rgba(81, 207, 102, 0.2);
}

[data-theme="dark"] .np-cal-common-slots {
  background: var(--green-50);
  border-color: var(--green-600);
  color: var(--green-600);
}

[data-theme="dark"] .np-cal-common-slot-chip {
  background: var(--bg-white);
  border-color: var(--green-600);
  color: var(--green-600);
}

/* Kapazitaetsansicht Dark Mode */
[data-theme="dark"] .np-cal-capacity-dates {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .np-cal-capacity-date {
  color: var(--text-secondary);
  border-right-color: var(--border-subtle);
}

[data-theme="dark"] .np-cal-capacity-date.today {
  background: var(--teal-50);
  color: var(--teal-600);
}

[data-theme="dark"] .np-cal-capacity-date.weekend {
  background: var(--bg-muted);
  color: var(--text-muted);
}

[data-theme="dark"] .np-cal-capacity-name {
  background: var(--bg-white);
  border-right-color: var(--border);
}

[data-theme="dark"] .np-cal-capacity-row {
  border-bottom-color: var(--border-subtle);
}

[data-theme="dark"] .np-cal-capacity-cell {
  border-right-color: var(--border-subtle);
}

[data-theme="dark"] .np-cal-cap-free     { background: rgba(81,207,102,.15); color: var(--green-600); }
[data-theme="dark"] .np-cal-cap-partial  { background: rgba(255,146,43,.15); color: var(--orange-600); }
[data-theme="dark"] .np-cal-cap-busy     { background: rgba(255,107,107,.15); color: var(--red-600); }
[data-theme="dark"] .np-cal-cap-full     { background: rgba(255,107,107,.25); color: var(--red-600); }
[data-theme="dark"] .np-cal-cap-absent   { background: var(--bg-muted); color: var(--text-muted); }

[data-theme="dark"] .np-cal-booking-dialog {
  background: var(--bg-white);
  border-color: var(--border);
}

[data-theme="dark"] .np-cal-booking-overlay {
  background: rgba(0,0,0,0.5);
}

/* ── Freie-Slots-Modus: Events dimmen, freie Slots hervorheben ── */
.np-cal-free-only .np-cal-rg-ev {
  opacity: 0.2;
  pointer-events: none;
  filter: grayscale(1);
}

.np-cal-free-only .np-cal-rg-free {
  z-index: 4;
  font-size: 11px;
  font-weight: 600;
  border-width: 2px;
  background: rgba(47, 158, 68, 0.12);
}

.np-cal-free-only .np-cal-rg-free:hover {
  background: rgba(47, 158, 68, 0.25);
  box-shadow: 0 2px 8px rgba(47, 158, 68, 0.25);
}

/* Badge im Slot-Toggle wenn aktiv */
.np-cal-slot-toggle.active {
  position: relative;
}

.np-cal-slot-toggle.active::after {
  content: 'Nur freie Slots';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--green-600);
  white-space: nowrap;
  pointer-events: none;
  margin-top: 1px;
}

/* ── Hotline-Zeitbänder ─────────────────────────────────────── */

.np-cal-rg-hotline {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    -45deg,
    rgba(249, 115, 22, 0.13),
    rgba(249, 115, 22, 0.13) 3px,
    rgba(249, 115, 22, 0.04) 3px,
    rgba(249, 115, 22, 0.04) 8px
  );
  border-top: 1px solid rgba(249, 115, 22, 0.4);
  border-bottom: 1px solid rgba(249, 115, 22, 0.4);
  box-sizing: border-box;
}

.np-cal-rg-hotline::after {
  content: attr(title);
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: rgba(194, 65, 12, 0.85);
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  pointer-events: none;
}

[data-theme="dark"] .np-cal-rg-hotline {
  background: repeating-linear-gradient(
    -45deg,
    rgba(249, 115, 22, 0.18),
    rgba(249, 115, 22, 0.18) 3px,
    rgba(249, 115, 22, 0.06) 3px,
    rgba(249, 115, 22, 0.06) 8px
  );
  border-color: rgba(249, 115, 22, 0.5);
}

[data-theme="dark"] .np-cal-rg-hotline::after {
  color: rgba(253, 186, 116, 0.9);
}
