/* kalender-dark.css — ALL [data-theme="dark"] rules for every component */
/* Auto-split from kalender.css + kalender-ai.css — 1079 lines */

/* === From kalender.css === */


[data-theme="dark"] .cal-filter-popover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .cal-filter-popover .cal-add-cat-form {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .cal-filter-popover .cal-add-cat-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cal-filter-popover .cal-add-cat-btn {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cal-filter-popover .cal-color-swatch.selected {
  border-color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .cal-filter-popover .cal-add-cat-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .fc-filterCats-button,
[data-theme="dark"] .fc-filterCats-button.fc-button {
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--color-text-primary) !important;
}


[data-theme="dark"] .fc-viewDropdown-button.fc-button {
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--color-text-primary) !important;
}

[data-theme="dark"] .fc-viewDropdown-button.fc-button:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .cal-view-dropdown-menu {
  background: var(--color-bg-primary, #1e1e2e);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .cal-view-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .cal-view-dropdown-item.active .cal-view-dropdown-shortcut {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .cal-view-dropdown-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

[data-theme="dark"] .cal-view-dropdown-shortcut {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .cal-briefing-stat-num {
  color: #e0e0e0;
}

[data-theme="dark"] .cal-briefing {
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.08), rgba(var(--color-primary-rgb), 0.03));
  border-color: rgba(var(--color-primary-rgb), 0.15);
}

[data-theme="dark"] .cal-briefing-dismiss:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .cal-briefing-stat {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .cal-briefing-tip {
  border-top-color: rgba(255, 255, 255, 0.06);
}

/* Smart suggestion chips in briefing — light mode base moved to kalender-components.css */

[data-theme="dark"] .cal-briefing-suggestion {
  color: #fbbf24;
  background: rgba(255, 171, 0, 0.10);
  border-color: rgba(255, 171, 0, 0.20);
}

[data-theme="dark"] .custom-cat-trigger {
  background: rgba(255,255,255,0.04);
  border-color: var(--color-border);
}
[data-theme="dark"] .custom-cat-trigger:hover {
  border-color: rgba(255,255,255,0.15);
}
[data-theme="dark"] .custom-cat-options {
  position: fixed;
  background: var(--color-card);
  border-color: var(--color-border);
  box-shadow: var(--shadow-modal);
}
[data-theme="dark"] .custom-cat-option:hover {
  background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .custom-cat-option.selected {
  background: rgba(var(--color-primary-rgb, 105,108,255), 0.15);
}

/* Dark mode — inline category creation */
[data-theme="dark"] .custom-cat-add-btn {
  border-top-color: rgba(255,255,255,0.06);
  color: var(--color-text-primary);
}
[data-theme="dark"] .custom-cat-add-btn:hover {
  background: rgba(0, 0, 0, 0.07);
}
[data-theme="dark"] .custom-cat-add-form {
  border-top-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .custom-cat-add-form input.custom-cat-add-input {
  border-color: rgba(255,255,255,0.12);
  color: #e0e0e0;
}
[data-theme="dark"] .custom-cat-add-form input.custom-cat-add-input:focus {
  border-color: rgba(31, 31, 30, 0.3);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}
[data-theme="dark"] .custom-cat-add-swatch.selected {
  border-color: rgba(255,255,255,0.7);
}
[data-theme="dark"] .custom-cat-add-actions .custom-cat-add-cancel {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
}
[data-theme="dark"] .custom-cat-add-actions .custom-cat-add-cancel:hover {
  background: rgba(255,255,255,0.1);
}

[data-theme="dark"] .cal-recurrence-scope {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cal-loading-overlay {
  background: var(--color-card, #1a2035);
}

[data-theme="dark"] .cal-skeleton-pill {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.06) 25%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.06) 75%
  );
  background-size: 200% 100%;
}

[data-theme="dark"] .cal-skeleton-event {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
}

[data-theme="dark"] .cal-skeleton-cell {
  border-color: var(--color-border);
}

[data-theme="dark"] .cal-skeleton-toolbar,
[data-theme="dark"] .cal-skeleton-header {
  border-bottom-color: var(--color-border);
}


[data-theme="dark"] .cal-conflict-suggest-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cal-conflict-suggest-btn:hover {
  background: rgba(var(--color-primary-rgb, 105, 108, 255), 0.1);
}

/* ════════════════════════════════════════════════════════════
   DARK MODE
   ════════════════════════════════════════════════════════════ */

/* ── FullCalendar CSS variable overrides ── */
[data-theme="dark"] {
  --fc-border-color: rgba(255, 255, 255, 0.20);
}

/* ── 1. Grid lines — white-based instead of black-based ── */
[data-theme="dark"] .cal-body .fc-scrollgrid td,
[data-theme="dark"] .cal-body .fc-scrollgrid th {
  border-color: rgba(255, 255, 255, 0.16) !important;
}

[data-theme="dark"] .cal-body .fc-col-header-cell {
  border-bottom-color: rgba(255, 255, 255, 0.10) !important;
}

[data-theme="dark"] .cal-body .fc-scrollgrid td:last-child,
[data-theme="dark"] .cal-body .fc-scrollgrid th:last-child {
  border-right: none !important;
}

[data-theme="dark"] .cal-body .fc-scrollgrid td:first-child,
[data-theme="dark"] .cal-body .fc-scrollgrid th:first-child {
  border-left: none !important;
}

/* ── 2. Today circle — blue on dark bg ── */
[data-theme="dark"] .cal-body .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  background: var(--color-text-primary) !important;
  color: #ffffff !important;
}

/* ── 2b. Day numbers — readable on dark bg (fix contrast 1.82→9.5:1) ── */
[data-theme="dark"] .fc-daygrid-day-number {
  color: #e8ecf4;
}

/* ── 2c. Month title — readable on dark bg (fix contrast 1.82→9.5:1) ── */
[data-theme="dark"] .fc-toolbar-title {
  color: #e8ecf4 !important;
}

/* ── 3. Event pills — dark mode: 16% bg, 24% hover, brighter accent ── */
[data-theme="dark"] .fc-event.cat-personlig {
  --cat-bg: rgba(74, 144, 226, 0.16); --cat-bg-hover: rgba(74, 144, 226, 0.24); --cat-color: #7ab4f5;
}
[data-theme="dark"] .fc-event.cat-aflevering {
  --cat-bg: rgba(226, 70, 104, 0.16); --cat-bg-hover: rgba(226, 70, 104, 0.24); --cat-color: #f87185;
}
[data-theme="dark"] .fc-event.cat-grammatik {
  --cat-bg: rgba(34, 197, 94, 0.16); --cat-bg-hover: rgba(34, 197, 94, 0.24); --cat-color: #4ade80;
}
[data-theme="dark"] .fc-event.cat-skole {
  --cat-bg: rgba(6, 182, 212, 0.16); --cat-bg-hover: rgba(6, 182, 212, 0.24); --cat-color: #22d3ee;
}
[data-theme="dark"] .fc-event.cat-proeve {
  --cat-bg: rgba(139, 92, 246, 0.16); --cat-bg-hover: rgba(139, 92, 246, 0.24); --cat-color: #a78bfa;
}
[data-theme="dark"] .fc-event.cat-andet {
  --cat-bg: rgba(245, 158, 11, 0.16); --cat-bg-hover: rgba(245, 158, 11, 0.24); --cat-color: #fbbf24;
}
[data-theme="dark"] .fc-event.cat-deadline {
  --cat-bg: rgba(225, 29, 72, 0.16); --cat-bg-hover: rgba(225, 29, 72, 0.24); --cat-color: #fb7185;
}
[data-theme="dark"] .fc-event.cat-moeder {
  --cat-bg: rgba(14, 165, 233, 0.16); --cat-bg-hover: rgba(14, 165, 233, 0.24); --cat-color: #38bdf8;
}
[data-theme="dark"] .fc-event.cat-arbejde {
  --cat-bg: rgba(13, 148, 136, 0.16); --cat-bg-hover: rgba(13, 148, 136, 0.24); --cat-color: #2dd4bf;
}
[data-theme="dark"] .fc-event.cat-google_cal {
  --cat-bg: rgba(66, 133, 244, 0.16); --cat-bg-hover: rgba(66, 133, 244, 0.24); --cat-color: #7ab4f5;
}
[data-theme="dark"] .cal-body .fc-event:not([class*="cat-"]) {
  --cat-bg: rgba(74, 144, 226, 0.16); --cat-bg-hover: rgba(74, 144, 226, 0.24);
}

/* ── 4. Event text colors — pastel 300-shades for dark bg via --cat-text ── */
[data-theme="dark"] .fc-event.cat-personlig  { --cat-text: #93c5fd; }
[data-theme="dark"] .fc-event.cat-aflevering { --cat-text: #fca5a5; }
[data-theme="dark"] .fc-event.cat-grammatik  { --cat-text: #86efac; }
[data-theme="dark"] .fc-event.cat-skole      { --cat-text: #67e8f9; }
[data-theme="dark"] .fc-event.cat-proeve     { --cat-text: #c4b5fd; }
[data-theme="dark"] .fc-event.cat-andet      { --cat-text: #fcd34d; }
[data-theme="dark"] .fc-event.cat-deadline   { --cat-text: #fda4af; }
[data-theme="dark"] .fc-event.cat-moeder     { --cat-text: #7dd3fc; }
[data-theme="dark"] .fc-event.cat-arbejde    { --cat-text: #5eead4; }
[data-theme="dark"] .fc-event.cat-google_cal { --cat-text: #93c5fd; }
[data-theme="dark"] .cal-body .fc-event:not([class*="cat-"]) { --cat-text: #93c5fd; }

/* ── 4b. Event text — use per-category --cat-text for readable dark mode contrast ── */
[data-theme="dark"] .fc-event .fc-event-title,
[data-theme="dark"] .fc-event .fc-event-time {
  color: var(--cat-text, #a5b4fc);
}

/* ── 5. Hover states — white-based subtle hover ── */
[data-theme="dark"] .cal-body .fc-daygrid-day:hover {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .cal-body .fc-event:hover {
  background: var(--cat-bg-hover) !important;
}

/* ── 5b. Time prefix — slightly brighter for dark bg readability ── */
[data-theme="dark"] .cal-body .fc-event .fc-time-prefix,
.dark-mode .cal-body .fc-event .fc-time-prefix {
  opacity: 0.6;
  color: rgba(255, 255, 255, 0.8);
}

/* ── 5c. Drag mirror — darker shadow on dark bg ── */
[data-theme="dark"] .cal-body .fc-event-mirror,
.dark-mode .cal-body .fc-event-mirror {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* (fc-highlight consolidated — see Drag UX section near end of file) */

/* ── 5e. Undo toast — dark glassmorphism ── */
[data-theme="dark"] .cal-undo-toast,
.dark-mode .cal-undo-toast {
  background: rgba(26, 32, 53, 0.78);
  color: #e2e2e8;
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2), 0 12px 24px -4px rgba(0,0,0,0.3);
}
[data-theme="dark"] .cal-undo-toast-btn,
.dark-mode .cal-undo-toast-btn {
  color: var(--color-primary, #696cff);
}
[data-theme="dark"] .cal-undo-toast-dismiss,
.dark-mode .cal-undo-toast-dismiss {
  color: rgba(255, 255, 255, 0.45);
}
[data-theme="dark"] .cal-undo-toast-dismiss:hover,
.dark-mode .cal-undo-toast-dismiss:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .cal-mini .fc-daygrid-day:hover .fc-daygrid-day-number {
  background: rgba(255, 255, 255, 0.06);
}

/* (sidebar removed — filter popover dark mode is above) */


/* ── 7. Drawer backdrop — darker overlay ── */
[data-theme="dark"] .cal-drawer-overlay {
  background: rgba(0, 0, 0, 0.6);
}


[data-theme="dark"] .cal-drawer {
  box-shadow:
    -12px 0 40px rgba(0, 0, 0, 0.5),
    -2px 0 8px rgba(0, 0, 0, 0.25),
    inset 1px 0 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .cal-drawer-header {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .cal-drawer-body .input {
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-primary, #e8ecf4);
  color-scheme: dark;
}

[data-theme="dark"] .cal-drawer-body select.input option:checked {
  background: linear-gradient(0deg, var(--color-primary) 0%, var(--color-primary) 100%);
  color: #fff;
}

[data-theme="dark"] .cal-drawer-body .input:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .cal-drawer-body .input:focus {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .cal-drawer-times .input[type="time"] {
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .cal-drawer-times .input[type="time"]:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .cal-drawer-times .input[type="time"]:focus {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .cal-drawer-footer {
  border-top-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .cal-drawer-footer .btn-secondary {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--color-text-primary);
}

[data-theme="dark"] .cal-drawer-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--color-text-primary);
}

/* ── Dark mode toolbar buttons — unified contrast ── */

[data-theme="dark"] .cal-body .fc-prev-button,
[data-theme="dark"] .cal-body .fc-next-button {
  color: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="dark"] .cal-body .fc-prev-button:hover,
[data-theme="dark"] .cal-body .fc-next-button:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

[data-theme="dark"] .cal-body .fc-today-button,
[data-theme="dark"] .cal-body .fc-today-button.fc-button,
[data-theme="dark"] .cal-body .fc-today-button.fc-button.fc-button-primary {
  color: #e8ecf4 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .cal-body .fc-today-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
}

[data-theme="dark"] .cal-body .fc-filterCats-button,
[data-theme="dark"] .cal-body .fc-filterCats-button.fc-button {
  color: #e8ecf4 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .cal-body .fc-filterCats-button:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
}

[data-theme="dark"] .cal-body .fc-addEvent-button,
[data-theme="dark"] .cal-body .fc-addEvent-button.fc-button {
  background: var(--color-text-primary) !important;
  border-color: var(--color-text-primary) !important;
  color: #fff !important;
}

[data-theme="dark"] .cal-drawer-close:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ── 8. Loading skeleton dark — handled in LOADING SKELETON OVERLAY section ── */

/* Button group (prev,next wrapper) — no border in dark mode */
[data-theme="dark"] .cal-body .fc-button-group {
  border: none !important;
  background: transparent !important;
}

/* ── 10. Column headers — explicit color for AA contrast (fix 3.44→4.9:1) ── */
[data-theme="dark"] .cal-body .fc-col-header-cell-cushion {
  color: #8a92a6;
  opacity: 1;
}

/* Today header badge — dark mode: neutral highlight */
[data-theme="dark"] .cal-body .fc-timegrid .fc-col-header-cell.fc-day-today .fc-col-header-cell-cushion {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .cal-body .fc-timegrid-slot-label-cushion {
  opacity: 0.65;
}

/* ── 11. Time grid — full dark mode overrides ── */

/* Time grid slots — white-based faint lines */
[data-theme="dark"] .cal-body .fc-timegrid-slot {
  border-color: rgba(255, 255, 255, 0.04) !important;
}

/* Hour lines — clear rhythm in dark */
[data-theme="dark"] .cal-body .fc-timegrid-slot.fc-timegrid-slot-lane[data-time$=":00:00"] {
  border-top-color: rgba(255, 255, 255, 0.10) !important;
}

/* Half-hour lines — dashed, subtle hierarchy */
[data-theme="dark"] .cal-body .fc-timegrid-slot.fc-timegrid-slot-lane[data-time$=":30:00"] {
  border-top-color: rgba(255, 255, 255, 0.04) !important;
  border-top-style: dashed !important;
}

/* Column dividers — visible but subtle */
[data-theme="dark"] .cal-body .fc-scrollgrid .fc-timegrid-col {
  border-right-color: rgba(255, 255, 255, 0.12) !important;
}

/* Day column hover */
[data-theme="dark"] .cal-body .fc-timegrid-col:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Today column wash — consistent with light mode */
[data-theme="dark"] .cal-body .fc-timegrid-col.fc-day-today {
  background: rgba(0, 0, 0, 0.04) !important;
}

/* ── Day view dark mode ── */

/* Day header — weekday inherits dark text color */
[data-theme="dark"] .cal-day-header-weekday {
  color: var(--color-text-tertiary);
}

/* Day header — date number */
[data-theme="dark"] .cal-day-header-num {
  color: var(--color-text-primary);
}

/* Day header — month */
[data-theme="dark"] .cal-day-header-month {
  color: var(--color-text-tertiary);
}

/* Today circle uses --color-primary which works in both modes */

/* Day view: disable today wash in dark mode too */
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-col.fc-day-today {
  background: transparent !important;
}

/* Day view: off-hours tint in dark mode — on entire slot row */
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot {
  background: rgba(255, 255, 255, 0.018);
}

/* Day view: working hours — clean dark surface */
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="08:00:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="08:30:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="09:00:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="09:30:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="10:00:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="10:30:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="11:00:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="11:30:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="12:00:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="12:30:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="13:00:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="13:30:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="14:00:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="14:30:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="15:00:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="15:30:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="16:00:00"],
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot[data-time="16:30:00"] {
  background: transparent;
}

/* Day view: bolder hour lines in dark */
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot.fc-timegrid-slot-lane[data-time$=":00:00"] {
  border-top-color: rgba(255, 255, 255, 0.14) !important;
}

/* Day view: time labels in dark */
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-slot-label-cushion {
  opacity: 0.75;
}

/* Day view: no column hover in dark */
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-timegrid-col:hover {
  background: transparent;
}

/* Day view: no column divider in dark */
[data-theme="dark"] .fc-view-harness .fc-timeGridDay-view .fc-scrollgrid .fc-timegrid-col {
  border-right-color: transparent !important;
}

/* All-day separator */
[data-theme="dark"] .cal-body .fc-timegrid .fc-daygrid-body {
  border-bottom-color: var(--color-border) !important;
}

/* Time grid events hover */
[data-theme="dark"] .cal-body .fc-timegrid-event:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Overlapping events — darker shadow */
[data-theme="dark"] .cal-body .fc-timegrid-event-harness-inset .fc-timegrid-event {
  box-shadow: -1px 0 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .cal-body .fc-timegrid-event-harness-inset .fc-timegrid-event:hover {
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

/* Now indicator — slightly brighter line in dark mode for visibility */
[data-theme="dark"] .cal-body .fc-timegrid-now-indicator-line {
  border-color: #F87171 !important;
}

[data-theme="dark"] .cal-body .fc-timegrid-col.fc-day-today .fc-timegrid-now-indicator-line::before {
  background: #F87171;
}

/* Time grid axis border */
[data-theme="dark"] .cal-body .fc-timegrid-axis {
  border-right-color: rgba(255, 255, 255, 0.12) !important;
}

/* (timegrid fc-highlight consolidated — see Drag UX section near end of file) */

/* Scrollbar dark variant */
[data-theme="dark"] .cal-body .fc-scroller::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .cal-body .fc-scroller::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* List view — dark mode overrides */
[data-theme="dark"] .cal-body .fc-list-day-cushion {
  background: rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] .cal-body .fc-list-day.fc-day-today .fc-list-day-cushion {
  background: rgba(96, 165, 250, 0.12) !important;
  color: #93c5fd;
}

[data-theme="dark"] .cal-body .fc-list-event td {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .cal-body .fc-list-event:hover td {
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .cal-body .fc-list-event:hover .cal-list-card__title {
  color: #93c5fd !important;
}

[data-theme="dark"] .cal-list-card__chip {
  background: color-mix(in srgb, var(--chip-color, var(--color-primary)) 20%, transparent);
}

[data-theme="dark"] .cal-list-card__desc {
  color: rgba(255, 255, 255, 0.4);
}

/* (fc-highlight consolidated — see Drag UX section near end of file) */

/* Other-month days — slightly more visible on dark */
[data-theme="dark"] .cal-body .fc-daygrid-day.fc-day-other .fc-daygrid-day-number {
  color: rgba(255, 255, 255, 0.25);
  opacity: 1;
}

/* Drawer error in dark mode */
[data-theme="dark"] .cal-drawer-error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

/* Drawer conflict warning in dark mode */
[data-theme="dark"] .cal-drawer-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

/* Drawer delete button */
[data-theme="dark"] .cal-drawer-footer .btn-delete {
  border-color: transparent;
  color: #fca5a5;
}

[data-theme="dark"] .cal-drawer-footer .btn-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

/* Drawer UX polish — dark mode */
[data-theme="dark"] .cal-drawer-body .input.input-error {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .char-count.char-count-danger {
  color: #fca5a5;
}

/* More events link */
[data-theme="dark"] .cal-body .fc-daygrid-more-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Category form dark mode — moved to popover-scoped section above */

/* ── Dark: Drawer body scrollbar ── */
[data-theme="dark"] .cal-drawer-body::-webkit-scrollbar {
  width: 4px;
}
[data-theme="dark"] .cal-drawer-body::-webkit-scrollbar-track {
  background: transparent;
}
[data-theme="dark"] .cal-drawer-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}
[data-theme="dark"] .cal-drawer-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Category form dark mode — moved to popover-scoped section above */

/* ── Dark: "Din sekretær" label — fix contrast (3.81→5.0:1) ── */
[data-theme="dark"] .nl-bar-label {
  color: var(--color-text-secondary);
}

/* ── Dark: Focus indicator for events — visible ring ── */
[data-theme="dark"] .fc-event:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 2px;
}

[data-theme="dark"] .cal-event-popup {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}


/* ── Dark mode: brighter focus glow ── */
[data-theme="dark"] .cal-body .fc-prev-button:focus-visible,
[data-theme="dark"] .cal-body .fc-next-button:focus-visible,
[data-theme="dark"] .cal-body .fc-today-button:focus-visible,
[data-theme="dark"] .cal-body .fc-addEvent-button:focus-visible,
[data-theme="dark"] .cal-body .fc-button-group .fc-button:focus-visible,
[data-theme="dark"] .cal-body .fc-event:focus-visible,
[data-theme="dark"] .cal-drawer-close:focus-visible,
[data-theme="dark"] .cal-drawer-footer .btn:focus-visible,
[data-theme="dark"] .cal-drawer-footer .btn-delete:focus-visible {
  box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb, 105, 108, 255), 0.25) !important;
}

[data-theme="dark"] .cal-context-menu {
  background: var(--color-card);
  border-color: var(--color-border);
  box-shadow: var(--shadow-popup);
}
[data-theme="dark"] .cal-ctx-item:hover {
  background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .cal-ctx-divider {
  background: rgba(255,255,255,0.06);
}

/* ── Dark mode ── */
[data-theme="dark"] .cal-confirm-overlay.active {
  background: rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .cal-confirm-card {
  background: var(--color-card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .cal-confirm-icon {
  background: rgba(226, 70, 104, 0.12);
}
[data-theme="dark"] .cal-confirm-title {
  color: rgba(255, 255, 255, 0.92);
}
[data-theme="dark"] .cal-confirm-msg {
  color: rgba(255, 255, 255, 0.55);
}
[data-theme="dark"] .cal-confirm-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
[data-theme="dark"] .cal-confirm-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ── Dark mode ── */
[data-theme="dark"] .cal-quick-add-card {
  background: var(--color-card);
  border-color: var(--color-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .cal-quick-add-input {
  color: rgba(255, 255, 255, 0.92);
}
[data-theme="dark"] .cal-quick-add-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
[data-theme="dark"] .cal-quick-add-hint {
  color: rgba(255, 255, 255, 0.35);
}
[data-theme="dark"] .cal-quick-add-actions {
  border-top-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}
[data-theme="dark"] .cal-quick-add-details {
  color: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .cal-quick-add-details:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .cal-quick-add-save {
  background: var(--color-text-primary);
  color: #fff;
}
[data-theme="dark"] .cal-quick-add-save:hover {
  background: var(--color-primary-hover);
}


/* ════════════════════════════════════════════════════════════
   SMART DRAWER — DARK MODE
   ════════════════════════════════════════════════════════════ */

/* ── Dark: NL Input Group ── */

[data-theme="dark"] .smart-drawer-nl-group .smart-drawer-nl-input {
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.04);
  color-scheme: dark;
}

[data-theme="dark"] .smart-drawer-nl-group .smart-drawer-nl-input:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .smart-drawer-nl-group .smart-drawer-nl-input:focus {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .smart-drawer-nl-group.nl-active .smart-drawer-nl-input {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
}

[data-theme="dark"] .smart-drawer-nl-group.nl-active .smart-drawer-nl-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.22);
}

/* ── Dark: NL Hint Text ── */

[data-theme="dark"] .smart-drawer-nl-hint {
  color: var(--color-text-secondary);
}

/* ── Dark: AI Spinner — brighter border for visibility ── */

[data-theme="dark"] .smart-drawer-ai-spinner {
  border-color: rgba(0, 0, 0, 0.07);
  border-top-color: var(--color-text-primary);
}

/* ── Dark: AI Field Badges — slightly more opaque backgrounds ── */

[data-theme="dark"] .ai-field-badge--high {
  background: rgba(var(--color-primary-rgb), 0.18);
  color: #7ab8ff;
}

[data-theme="dark"] .ai-field-badge--inferred {
  background: rgba(255, 171, 0, 0.16);
  color: #fbbf24;
}

/* ── Dark: Field Fill Animation — brighter flash ── */

[data-theme="dark"] .cal-drawer-body .input.ai-just-filled {
  animation: smart-drawer-field-flash-dark 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes smart-drawer-field-flash-dark {
  0%   { background-color: rgba(0, 0, 0, 0.15); }
  100% { background-color: rgba(255, 255, 255, 0.04); }
}

/* ── Dark: Progressive Disclosure ── */

[data-theme="dark"] .smart-drawer-details-toggle {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .smart-drawer-details-toggle:hover {
  color: var(--color-text-primary);
}

/* ── Dark: Inline Messages ── */

[data-theme="dark"] .smart-drawer-inline-msg {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.15);
  color: #e8ecf4;
}

/* ── Dark: Summary Preview ── */

[data-theme="dark"] .smart-drawer-preview {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
  color: #e8ecf4;
}


/* === From kalender-ai.css === */


/* ════════════════════════════════════════════
   DARK MODE
   ════════════════════════════════════════════ */


[data-theme="dark"] .nl-bar-label { opacity: 0.35; }

[data-theme="dark"] .nl-bar-inner {
  background: rgba(26, 32, 53, 0.88);
  border-color: var(--color-border);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nl-bar-inner:focus-within {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Dark mode — all card variants */
[data-theme="dark"] .nl-result,
[data-theme="dark"] .nl-clarify,
[data-theme="dark"] .nl-answer,
[data-theme="dark"] .nl-query-results,
[data-theme="dark"] .nl-modify-confirm,
[data-theme="dark"] .nl-delete-confirm,
[data-theme="dark"] .nl-slot-suggestions,
[data-theme="dark"] .nl-study-plan {
  background: var(--color-card);
  border-color: var(--color-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Dark mode — loading card */
[data-theme="dark"] .nl-loading {
  background: var(--color-card);
  border-color: var(--color-border);
}

/* Dark mode — error card */
[data-theme="dark"] .nl-error {
  border-color: rgba(239, 68, 68, 0.15);
}

/* Dark mode — clarify chips */
[data-theme="dark"] .nl-clarify-chip {
  background: transparent;
  border-color: rgba(var(--color-primary-rgb), 0.25);
  color: rgba(var(--color-primary-rgb), 1);
}

[data-theme="dark"] .nl-clarify-chip:hover {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

/* Dark mode — clarify input */
[data-theme="dark"] .nl-clarify-input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
}

[data-theme="dark"] .nl-clarify-input:focus {
  border-color: var(--color-primary);
}

/* Dark mode — slot cards */
[data-theme="dark"] .nl-slot-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-border);
}

[data-theme="dark"] .nl-slot-card:hover {
  background: rgba(var(--color-primary-rgb), 0.10);
  border-color: var(--color-primary);
}

/* Dark mode — shortcut badge */
[data-theme="dark"] .nl-bar-shortcut {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-border);
}

/* Dark mode — mic button */
[data-theme="dark"] .nl-bar-mic:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .nl-bar-mic.nl-mic--listening {
  background: transparent;
}

/* Mic connecting spinner — base rule moved to kalender-ai.css */

/* Dark mode — delete overlay items */
[data-theme="dark"] .nl-overlay-list--delete .nl-overlay-item:hover {
  background: rgba(239, 68, 68, 0.10);
}

/* Dark mode — dismiss buttons */
[data-theme="dark"] .nl-result-dismiss:hover,
[data-theme="dark"] .nl-answer-dismiss:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Dark mode — ghost/outline buttons */
[data-theme="dark"] .nl-result-actions .btn-ghost,
[data-theme="dark"] .nl-result-actions .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.10);
  color: var(--color-text-secondary);
}

[data-theme="dark"] .nl-result-actions .btn-ghost:hover,
[data-theme="dark"] .nl-result-actions .btn-outline-secondary:hover {
  border-color: rgba(255, 255, 255, 0.20);
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Dark mode — NL undo toast glassmorphism */
[data-theme="dark"] .nl-undo-toast {
  background: rgba(26, 32, 53, 0.78);
  color: #e2e2e8;
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2), 0 12px 24px -4px rgba(0,0,0,0.3);
}
[data-theme="dark"] .nl-undo-toast-action {
  color: var(--color-primary, #696cff);
}

/* Dark mode — category toast glassmorphism */
[data-theme="dark"] .cat-toast {
  background: rgba(26, 32, 53, 0.78);
  color: #e2e2e8;
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2), 0 12px 24px -4px rgba(0,0,0,0.3);
}
[data-theme="dark"] .cat-toast-dismiss {
  color: rgba(255, 255, 255, 0.45);
}
[data-theme="dark"] .cat-toast-dismiss:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}

/* Dark mode — overlay changes */
[data-theme="dark"] .nl-overlay-changes {
  background: rgba(var(--color-primary-rgb), 0.08);
}

/* Dark mode — overlay picker */
[data-theme="dark"] .nl-overlay-picker-btn:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
}

[data-theme="dark"] .nl-overlay-picker-btn.active {
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.10);
}

/* Dark mode — overlay items */
[data-theme="dark"] .nl-overlay-item:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
}

/* Dark mode — shimmer */
[data-theme="dark"] .nl-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.02) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.02) 75%
  );
  background-size: 200% 100%;
  animation: nl-shimmer 1.5s ease infinite;
}


/* ── Multi-event card: Dark Mode ── */

[data-theme="dark"] .nl-card-multi {
  background: var(--sk-bg, #1a1a2e);
  border-color: var(--color-border);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 1px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .nl-card-header {
  color: #e5e7eb;
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .nl-card-header svg {
  color: var(--color-primary);
}

[data-theme="dark"] .nl-card-event-row {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .nl-card-event-row + .nl-card-event-row {
  border-top-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .nl-card-actions {
  border-top-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .nl-card-event-row:hover {
  background: rgba(var(--color-primary-rgb), 0.10);
}

[data-theme="dark"] .nl-card-event-title {
  color: #e5e7eb;
}

[data-theme="dark"] .nl-card-event-time {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .nl-card-event-duration {
  color: #6b7280;
}

[data-theme="dark"] .nl-btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
}

[data-theme="dark"] .nl-btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.4);
}

[data-theme="dark"] .nl-btn-secondary {
  border-color: var(--color-border);
  color: var(--color-text-secondary);
  background: transparent;
}

[data-theme="dark"] .nl-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
}

/* ════════════════════════════════════════════════════════════
   DRAG UX — DARK MODE
   ════════════════════════════════════════════════════════════ */

/* ── Drag ghost — white-based dashed border ── */
[data-theme="dark"] .cal-drag-ghost {
  border-color: rgba(255, 255, 255, 0.2) !important;
  border-left-color: var(--cat-color, var(--color-text-primary)) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

/* ── Drop zone highlight — brighter on dark bg ── */
[data-theme="dark"] .cal-body .fc-highlight {
  background: rgba(var(--color-primary-rgb, 105, 108, 255), 0.14) !important;
  border-color: rgba(var(--color-primary-rgb, 105, 108, 255), 0.22) !important;
  box-shadow: inset 0 0 14px rgba(var(--color-primary-rgb, 105, 108, 255), 0.07) !important;
}

[data-theme="dark"] .cal-body .fc-timegrid .fc-highlight {
  background: rgba(var(--color-primary-rgb, 105, 108, 255), 0.12) !important;
  border-color: rgba(var(--color-primary-rgb, 105, 108, 255), 0.18) !important;
  box-shadow: inset 0 0 8px rgba(var(--color-primary-rgb, 105, 108, 255), 0.08) !important;
}

/* ── Pause/break events — dark mode ── */
[data-theme="dark"] .cal-body .fc-event.cat-pause {
  --cat-bg: rgba(148, 163, 184, 0.08);
  --cat-bg-hover: rgba(148, 163, 184, 0.14);
  --cat-text: #94a3b8;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

/* ── Insight dark mode ── */
[data-theme="dark"] .cal-insight-dot {
  border-color: #1e293b;
}
[data-theme="dark"] .cal-popup-insight {
  border-top-color: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .cal-popup-insight-row {
  color: #fde68a;
}
[data-theme="dark"] .cal-popup-insight-btn {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
}
[data-theme="dark"] .cal-popup-insight-btn:hover {
  background: rgba(37, 99, 235, 0.25);
}

/* ── NL Plan card dark mode ── */
[data-theme="dark"] .nl-card-plan {
  background: var(--color-card);
  color: var(--color-text-primary);
}
[data-theme="dark"] .nl-plan-header {
  border-bottom-color: var(--color-border);
}
[data-theme="dark"] .nl-plan-group {
  border-bottom-color: var(--color-border);
}
[data-theme="dark"] .nl-plan-group-title {
  color: var(--color-text-secondary);
}
[data-theme="dark"] .nl-plan-event-row {
  border-color: var(--color-border);
}
[data-theme="dark"] .nl-plan-event-title {
  color: var(--color-text-primary);
}
[data-theme="dark"] .nl-plan-event-meta {
  color: var(--color-text-secondary);
}
[data-theme="dark"] .nl-plan-actions {
  border-top-color: var(--color-border);
}

/* ════════════════════════════════════════════
   WEEKLY REVIEW — dark mode
   ════════════════════════════════════════════ */


/* ── Dark: Briefing container (hidden, insights on events now) ── */
[data-theme="dark"] .cal-briefing { display: none; }
