/* kalender-categories.css — Category management: list items, inline editor, delete dialog
   Covers color editing and safe deletion UI for calendar categories.
   Follows existing kalender-* CSS patterns: Nunito Sans, 10px radius, smooth transitions.
   ────────────────────────────────────────────────────────────────── */


/* ════════════════════════════════════════════════════════════
   1. CATEGORY LIST ITEMS — hover-reveal action icons
   Used inside the filter popover for managing categories.
   ════════════════════════════════════════════════════════════ */

/* Container row — holds checkbox + name + action buttons */
.cat-mgmt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  position: relative;
  transition: background 0.12s ease;
  min-height: 44px; /* touch-friendly */
}

.cat-mgmt-row:hover {
  background: rgba(0, 0, 0, 0.025);
}

/* Category color dot — 12px circle with subtle glow */
.cat-mgmt-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full, 50%);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cat-mgmt-row:hover .cat-mgmt-dot {
  transform: scale(1.1);
}

/* Category name */
.cat-mgmt-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, rgb(19, 19, 19));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

/* Action buttons container — slides in from right on hover */
.cat-mgmt-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.cat-mgmt-row:hover .cat-mgmt-actions,
.cat-mgmt-row:focus-within .cat-mgmt-actions {
  opacity: 1;
  transform: translateX(0);
}

/* Individual action button — pencil / trash */
.cat-mgmt-btn {
  width: 32px;
  height: 32px;
  min-width: 44px; /* touch target via padding */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-md, 8px);
  color: var(--color-text-secondary, rgb(60, 60, 58));
  cursor: pointer;
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease, transform 0.1s ease;
}

.cat-mgmt-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.cat-mgmt-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text-primary, rgb(19, 19, 19));
}

.cat-mgmt-btn:active {
  transform: scale(0.9);
  transition: transform 0.08s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cat-mgmt-btn:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 1px;
}

/* Trash button — danger variant */
.cat-mgmt-btn--danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

/* Event count badge (shown when category has events) */
.cat-mgmt-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary, rgb(60, 60, 58));
  background: rgba(0, 0, 0, 0.04);
  padding: 1px 7px;
  border-radius: var(--radius-md);
  line-height: 1.4;
  flex-shrink: 0;
  margin-right: 2px;
  transition: opacity 0.15s ease;
}


/* ════════════════════════════════════════════════════════════
   2. INLINE COLOR EDITOR — expands below category name
   Triggered when user clicks the pencil icon.
   ════════════════════════════════════════════════════════════ */

/* Editor container — smooth expand/collapse */
.cat-color-editor {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease,
              padding 0.3s ease;
  padding: 0 8px;
}

.cat-color-editor.expanded {
  max-height: 160px;
  opacity: 1;
  padding: 10px 8px 12px;
}

/* Editor label */
.cat-color-editor-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary, rgb(60, 60, 58));
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
  display: block;
}

/* Swatches grid — same colors as category creation */
.cat-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.cat-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full, 50%);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  outline: 2px solid transparent;
  outline-offset: 1px;
  position: relative;
  flex-shrink: 0;
  /* Ensure 44px touch target */
  padding: 0;
  margin: 0;
}

/* Invisible touch expander */
.cat-color-swatch::before {
  content: '';
  position: absolute;
  inset: -8px;
}

.cat-color-swatch:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cat-color-swatch:active {
  transform: scale(1.05);
  transition: transform 0.08s ease;
}

.cat-color-swatch:focus-visible {
  outline-color: rgba(31, 31, 30, 0.3);
}

/* Selected swatch — ring + checkmark */
.cat-color-swatch.selected {
  border-color: #fff;
  outline-color: currentColor;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Checkmark inside selected swatch */
.cat-color-swatch.selected::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 5px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: translate(-50%, -60%) rotate(-45deg);
}

/* Inline editor action buttons */
.cat-color-editor-actions {
  display: flex;
  gap: 8px;
}

.cat-color-editor-actions button {
  padding: 10px 16px; /* 44px touch target */
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, transform 0.1s ease;
  min-height: 44px;
}

.cat-color-editor-save {
  background: var(--color-text-primary);
  color: #fff;
}

.cat-color-editor-save:hover {
  opacity: 0.88;
}

.cat-color-editor-save:active {
  transform: scale(0.96);
}

.cat-color-editor-cancel {
  background: var(--color-bg);
  color: var(--color-text-secondary, rgb(60, 60, 58));
}

.cat-color-editor-cancel:hover {
  background: rgba(0, 0, 0, 0.08);
}

.cat-color-editor-cancel:active {
  transform: scale(0.96);
}

/* "Saving..." state */
.cat-color-editor-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* ════════════════════════════════════════════════════════════
   3. DELETE CONFIRMATION DIALOG
   Compact, focused dialog — dark card style matching calendar popovers.
   ════════════════════════════════════════════════════════════ */

/* Overlay — semi-transparent backdrop */
.cat-delete-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.18s ease;
  padding: 16px;
}

.cat-delete-overlay.active {
  background: rgba(0, 0, 0, 0.2);
}

/* Dialog card */
.cat-delete-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 28px 22px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  transform: scale(0.92) translateY(8px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}

.cat-delete-overlay.active .cat-delete-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Warning icon container */
.cat-delete-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.cat-delete-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Title */
.cat-delete-title {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 650;
  color: var(--color-text-primary, rgb(19, 19, 19));
  margin: 0 0 6px;
  line-height: 1.3;
}

/* Message / description */
.cat-delete-msg {
  font-family: var(--font-family);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--color-text-secondary, rgb(60, 60, 58));
  margin: 0 0 8px;
  line-height: 1.5;
}

/* Event count warning — highlighted box */
.cat-delete-event-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
  border: 0.5px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  margin-bottom: 18px;
}

.cat-delete-event-count svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Category preview — shows which category is being deleted */
.cat-delete-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 14px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.cat-delete-preview-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full, 50%);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.cat-delete-preview-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary, rgb(19, 19, 19));
}

/* Reassignment dropdown — "Flyt begivenheder til:" */
.cat-delete-reassign {
  margin-bottom: 18px;
  text-align: left;
}

.cat-delete-reassign-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary, rgb(60, 60, 58));
  margin-bottom: 6px;
}

.cat-delete-reassign-select {
  width: 100%;
  padding: 10px 12px; /* 44px touch target */
  min-height: 44px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--color-text-primary, rgb(19, 19, 19));
  background: var(--color-bg, #f8f8f6);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23697a8d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.cat-delete-reassign-select:hover {
  border-color: rgba(0, 0, 0, 0.18);
}

.cat-delete-reassign-select:focus {
  outline: none;
  border-color: rgba(31, 31, 30, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

/* Action buttons row */
.cat-delete-actions {
  display: flex;
  gap: 10px;
}

/* Shared button base */
.cat-delete-cancel,
.cat-delete-confirm {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, transform 0.1s ease;
  min-height: 44px; /* touch-friendly */
}

/* Cancel button — neutral */
.cat-delete-cancel {
  background: var(--color-bg);
  color: var(--color-text-primary, rgb(19, 19, 19));
}

.cat-delete-cancel:hover {
  background: rgba(0, 0, 0, 0.08);
}

.cat-delete-cancel:active {
  transform: scale(0.97);
}

/* Delete/confirm button — danger red */
.cat-delete-confirm {
  background: #ef4444;
  color: #fff;
}

.cat-delete-confirm:hover {
  background: #dc2626;
}

.cat-delete-confirm:active {
  transform: scale(0.97);
}

.cat-delete-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading state — spinner inside delete button */
.cat-delete-confirm.loading {
  pointer-events: none;
  position: relative;
}

.cat-delete-confirm.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cat-delete-spin 0.6s linear infinite;
}

.cat-delete-confirm.loading span {
  visibility: hidden;
}

@keyframes cat-delete-spin {
  to { transform: rotate(360deg); }
}


/* ════════════════════════════════════════════════════════════
   4. EVENT CARD CATEGORY INDICATOR
   Shows category color as left border or dot on event cards.
   ════════════════════════════════════════════════════════════ */

/* Category badge — small colored dot + label inline */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}

.cat-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full, 50%);
  flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.06);
}

.cat-badge-label {
  color: var(--color-text-secondary, rgb(60, 60, 58));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}


/* ════════════════════════════════════════════════════════════
   5. RENAME INPUT — inline editing of category name
   Appears when double-clicking a category name.
   ════════════════════════════════════════════════════════════ */

.cat-mgmt-rename-input {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  font-family: var(--font-family);
  color: var(--color-text-primary, rgb(19, 19, 19));
  background: var(--color-bg, #f8f8f6);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cat-mgmt-rename-input:focus {
  border-color: rgba(31, 31, 30, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}


/* ════════════════════════════════════════════════════════════
   6. SUCCESS TOAST — "Kategori opdateret" feedback
   Uses same pattern as cal-undo-toast.
   ════════════════════════════════════════════════════════════ */

@keyframes cat-toast-enter {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes cat-toast-exit {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
}

/* ── Unified toast — white glassmorphism (matches dokumenter/cal-undo-toast) ── */
.cat-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  color: var(--color-text-primary, rgb(19, 19, 19));
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-family);
  padding: 10px 20px;
  border-radius: 100px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 12px 24px -4px rgba(0, 0, 0, 0.12);
  animation: cat-toast-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
  white-space: nowrap;
}

.cat-toast--success {
  border-color: rgba(5, 150, 105, 0.2);
}

.cat-toast--error {
  border-color: rgba(220, 38, 38, 0.2);
}

.cat-toast--exiting {
  animation: cat-toast-exit 0.2s ease both;
  pointer-events: none;
}

.cat-toast-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.cat-toast-dismiss {
  background: none;
  border: none;
  color: var(--color-text-secondary, rgb(60, 60, 58));
  font-size: 18px;
  cursor: pointer;
  padding: 10px; /* 44px touch target */
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-left: 4px;
  border-radius: 100px;
  transition: background 0.15s ease, color 0.15s ease;
}

.cat-toast-dismiss:hover {
  color: var(--color-text-primary, rgb(19, 19, 19));
  background: rgba(128, 128, 128, 0.09);
}


/* ════════════════════════════════════════════════════════════
   7. ANIMATIONS — shared keyframes
   ════════════════════════════════════════════════════════════ */

@keyframes cat-editor-expand {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 160px;
  }
}

/* Subtle bounce for swatch selection */
@keyframes cat-swatch-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1.1); }
}

.cat-color-swatch.just-selected {
  animation: cat-swatch-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Row highlight when color just changed */
@keyframes cat-row-flash {
  0%   { background: rgba(0, 0, 0, 0.07); }
  100% { background: transparent; }
}

.cat-mgmt-row.just-updated {
  animation: cat-row-flash 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}


/* ════════════════════════════════════════════════════════════
   8. DARK MODE — all category management components
   ════════════════════════════════════════════════════════════ */

/* ── Category list items ── */
[data-theme="dark"] .cat-mgmt-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .cat-mgmt-name {
  color: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .cat-mgmt-dot {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .cat-mgmt-btn {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .cat-mgmt-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .cat-mgmt-btn--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

[data-theme="dark"] .cat-mgmt-count {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Inline color editor ── */
[data-theme="dark"] .cat-color-editor-label {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .cat-color-swatch {
  box-shadow: none;
}

[data-theme="dark"] .cat-color-swatch:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cat-color-swatch.selected {
  border-color: #1e1e2e;
  outline-color: currentColor;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .cat-color-editor-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .cat-color-editor-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ── Delete confirmation dialog ── */
[data-theme="dark"] .cat-delete-overlay.active {
  background: rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .cat-delete-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"] .cat-delete-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

[data-theme="dark"] .cat-delete-title {
  color: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] .cat-delete-msg {
  color: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .cat-delete-event-count {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.20);
}

[data-theme="dark"] .cat-delete-preview {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .cat-delete-preview-dot {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .cat-delete-preview-name {
  color: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .cat-delete-reassign-label {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .cat-delete-reassign-select {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
}

[data-theme="dark"] .cat-delete-reassign-select:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .cat-delete-reassign-select:focus {
  border-color: rgba(31, 31, 30, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

[data-theme="dark"] .cat-delete-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .cat-delete-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .cat-delete-confirm {
  background: #dc2626;
}

[data-theme="dark"] .cat-delete-confirm:hover {
  background: #b91c1c;
}

/* ── Category badge — dark ── */
[data-theme="dark"] .cat-badge-dot {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .cat-badge-label {
  color: rgba(255, 255, 255, 0.55);
}

/* ── Rename input — dark ── */
[data-theme="dark"] .cat-mgmt-rename-input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .cat-mgmt-rename-input:focus {
  border-color: rgba(31, 31, 30, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

/* ── Toast dark mode → see kalender-dark.css ── */

/* ── Row flash animation — dark ── */
[data-theme="dark"] .cat-mgmt-row.just-updated {
  animation: cat-row-flash-dark 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cat-row-flash-dark {
  0%   { background: rgba(0, 0, 0, 0.07); }
  100% { background: transparent; }
}


/* ════════════════════════════════════════════════════════════
   9. RESPONSIVE — mobile adjustments
   ════════════════════════════════════════════════════════════ */

@media (max-width: 575px) {
  /* Always show action buttons on mobile (no hover) */
  .cat-mgmt-actions {
    opacity: 1;
    transform: translateX(0);
  }

  /* Larger delete dialog on mobile */
  .cat-delete-card {
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    padding: 24px 20px 20px;
  }

  .cat-delete-overlay {
    align-items: flex-end;
  }

  .cat-delete-overlay.active .cat-delete-card {
    transform: translateY(0);
    animation: cat-delete-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes cat-delete-slide-up {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Bigger touch targets for buttons */
  .cat-delete-cancel,
  .cat-delete-confirm {
    min-height: 48px;
    font-size: 15px;
  }

  /* Toast at bottom on mobile */
  .cat-toast {
    left: 16px;
    right: 16px;
    transform: translateX(0);
    bottom: 90px;
  }
}

@media (max-width: 767px) {
  .cat-toast {
    bottom: 140px;
  }
}

/* ════════════════════════════════════════════════════════════
   10. PAUSE/BREAK EVENT STYLING — muted, semi-transparent
   Events created by "Breathing Room Buffer" feature.
   ════════════════════════════════════════════════════════════ */

/* Pause events — muted, semi-transparent with dashed border */
.cal-body .fc-event.cat-pause {
  --cat-color: var(--color-text-tertiary);
  --cat-bg: rgba(148, 163, 184, 0.12);
  --cat-bg-hover: rgba(148, 163, 184, 0.18);
  --cat-text: #64748b;
  background: var(--cat-bg) !important;
  color: var(--cat-text);
  border: 0.5px dashed rgba(148, 163, 184, 0.4) !important;
  opacity: 0.7;
}

.cal-body .fc-event.cat-pause:hover {
  background: var(--cat-bg-hover) !important;
  opacity: 0.85;
}

.cal-body .fc-event.cat-pause .fc-event-title {
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   11. BRIEFING BUFFER BUTTON — "Tilføj pause" actionable chip
   ════════════════════════════════════════════════════════════ */

.cal-briefing-buffer-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 6px 14px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  color: rgb(19, 19, 19);
  background: rgba(0, 0, 0, 0.07);
  border: 0.5px solid rgba(0, 0, 0, 0.10);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  vertical-align: middle;
}

.cal-briefing-buffer-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}

.cal-briefing-buffer-btn:active {
  transform: scale(0.96);
}

.cal-briefing-buffer-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.cal-briefing-buffer-btn:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 2px;
}

/* Success state for the suggestion after pause is added */
.cal-briefing-suggestion--success {
  color: #065f46;
  background: rgba(34, 197, 94, 0.08) !important;
  border-color: rgba(34, 197, 94, 0.2);
}


@media (prefers-reduced-motion: reduce) {
  .cat-mgmt-panel *,
  .cat-toast {
    animation: none !important;
    transition: none !important;
  }
}
