/* Board uses DM Sans from ps-base.css */
/* ============================================================
   PAPIRO STUDIO — Board CSS
   css/ps-board.css
   Kanban · Cards · Modal · Calendario · Gantt · Media
   ============================================================ */

/* ── Kanban board ─────────────────────────────────────────── */
.kanban-board {
  display: flex; gap: 11px;
  padding: 14px 16px 28px;
  overflow-x: auto; overflow-y: hidden;
  flex: 1;
  align-items: flex-start;
  min-width: 0;
}

/* ── Column ───────────────────────────────────────────────── */
.kanban-col {
  flex: 0 0 268px;
  background: var(--bg-elevated); border-radius: var(--r-lg);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100%; max-height: 100%;
}
.col-head {
  padding: 10px 12px 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; flex-shrink: 0;
}
.col-name  { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.col-dates { font-size: 10px; color: var(--text-disabled); }
.col-badge {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-full); font-size: 11px; font-weight: 600;
  color: var(--text-muted); padding: 1px 7px; min-width: 22px; text-align: center;
}

/* Column progress bar */
.col-progress-wrap { padding: 6px 12px 2px; flex-shrink: 0; }
.col-progress-track {
  height: 3px; background: var(--border); border-radius: var(--r-full); overflow: hidden;
}
.col-progress-fill {
  height: 100%; border-radius: var(--r-full); transition: width .4s ease;
  background: linear-gradient(90deg, #10B981, #059669);
}
.col-progress-fill.is-complete { background: linear-gradient(90deg, #059669, #047857); }
.col-progress-fill.is-overdue  { background: linear-gradient(90deg, #E63025, #C9261C); }
.col-progress-fill.is-future   { background: var(--border-md); }
.col-progress-label {
  display: flex; justify-content: space-between; margin-top: 3px;
  font-size: 9px; color: var(--text-disabled);
}
.col-cards { padding: 7px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; }
.col-empty { text-align: center; padding: 20px 10px; color: var(--text-disabled); font-size: 11px; font-style: italic; }

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border-radius: var(--r-md);
  border: 1px solid var(--border); padding: 9px 11px 8px;
  cursor: pointer; position: relative;
  transition: border-color var(--tr-base), box-shadow var(--tr-base), transform var(--tr-base), opacity var(--tr-slow), filter var(--tr-slow);
}
.card:hover    { border-color: var(--border-md); box-shadow: var(--sh-sm); transform: translateY(-1px); }
.card.is-priority { border-left: 3px solid var(--ps-red); }
.card.is-past  { opacity: .55; filter: grayscale(.6); background: var(--bg-elevated); }
.card.is-past .card-title { color: var(--text-muted); }
.card.is-past .card-date  { color: var(--border-md); }
.card.is-past:hover { opacity: .72; filter: grayscale(.35); transform: none; box-shadow: none; }
.card.hidden   { display: none; }

.card-date   { font-size: 10px; color: var(--text-disabled); margin-bottom: 3px; }
.card-title  { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.4; margin-bottom: 4px; }
.card-hook   { font-size: 11px; color: var(--text-muted); line-height: 1.4; margin-bottom: 7px; font-style: italic; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 4px; flex-wrap: wrap; }
.card-tags   { display: flex; flex-wrap: wrap; gap: 3px; }
.card-meta   { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* Card status pill */
.card-status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: var(--r-full);
  font-size: 10px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
/* Card paid badge */
.card-paid-badge {
  font-size: 9px; font-weight: 600; color: #8B5CF6;
  background: rgba(139,92,246,.14); border-radius: var(--r-full); padding: 1px 5px;
}

/* ── Edit Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,17,23,.65); backdrop-filter: blur(3px);
  z-index: var(--z-modal);
  display: none; align-items: flex-start; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card); border-radius: var(--r-xl);
  border: 1px solid var(--border); box-shadow: var(--sh-xl);
  width: 100%; max-width: 700px; padding: 0; margin: auto;
  display: flex; flex-direction: column;
  animation: modal-in .18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Modal header */
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px; border-bottom: 1px solid var(--border);
  gap: 10px; flex-shrink: 0; background: var(--bg-card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.modal-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border); gap: 10px; flex-shrink: 0;
}
.modal-topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.modal-title-input {
  flex: 1; font-size: 16px; font-weight: 700; color: var(--text-primary);
  border: none; outline: none; background: transparent;
  font-family: var(--font-sans); min-width: 0;
  padding: 0;
}
.modal-title-input::placeholder { color: var(--text-disabled); font-weight: 500; }
.modal-close {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--bg-elevated); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 16px; flex-shrink: 0;
  transition: background var(--tr-base);
}
.modal-close:hover { background: var(--border); }

/* Status badge in topbar */
.modal-status-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 700;
  cursor: pointer; border: 1.5px solid transparent;
  transition: filter var(--tr-base); white-space: nowrap; flex-shrink: 0;
}
.modal-status-badge:hover { filter: brightness(.92); }

/* Modal tabs */
.modal-tabs {
  display: flex; border-bottom: 2px solid var(--border);
  padding: 0 18px; flex-shrink: 0; background: var(--bg-card);
}
.modal-tab {
  padding: 10px 16px; font-size: 12px; font-weight: 600;
  font-family: inherit; border: none; border-bottom: 2px solid transparent;
  background: none; color: var(--text-muted); cursor: pointer;
  margin-bottom: -2px; white-space: nowrap;
  transition: color var(--tr-fast), border-color var(--tr-fast);
  appearance: none; outline: none;
}
.modal-tab:hover  { color: var(--text-primary); }
.modal-tab.active { color: var(--ps-red); border-bottom-color: var(--ps-red); font-weight: 700; }

/* Modal tab panels */
.modal-tab-panel {
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 13px;
}

/* Modal body — single column */
.modal-body { overflow-y: auto; flex: 1; }
.modal-main { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }

/* Inline rows in modal */
.modal-row-3 { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }

.modal-flags-row {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px;
}
.flag-block { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 160px; }

/* Status pipeline — compact pill grid */
.status-pipeline {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.status-pill-btn {
  display: inline-flex; align-items: center;
  padding: 5px 10px; border-radius: var(--r-md);
  font-size: 11px; font-weight: 500; cursor: pointer;
  transition: all var(--tr-base); font-family: var(--font-sans); white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill-btn:hover  { filter: brightness(.92); transform: translateY(-1px); }
.status-pill-btn.active { font-weight: 700; box-shadow: var(--sh-sm); }

/* Redes / Objetivo selectors */
.redes-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.red-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-muted); transition: all var(--tr-base); user-select: none;
}
.red-chip:hover { border-color: var(--border-md); }
.red-dot { width: 8px; height: 8px; border-radius: 50%; }
/* Active states — set inline via JS */

.obj-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.obj-chip {
  padding: 4px 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted);
  transition: all var(--tr-base); user-select: none;
}
.obj-chip:hover { border-color: var(--text-disabled); color: var(--text-secondary); }
.obj-chip.obj-active { font-weight: 700; border-width: 1.5px; }

/* Paid amount */
.paid-amount-row { display: flex; align-items: center; gap: 8px; }
.paid-amount-input {
  padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--border-md);
  font-size: 13px; color: var(--text-primary); background: var(--bg-input);
  font-family: var(--font-sans); outline: none; width: 120px;
  transition: border-color var(--tr-base);
}
.paid-amount-input:focus { border-color: var(--border-focus); }

/* Media section */
.media-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-disabled); margin-bottom: 5px;
}
.media-type-row, .media-format-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.media-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted);
  transition: all var(--tr-base); user-select: none;
}
.media-chip:hover { border-color: var(--text-disabled); }
.media-chip.active { background: var(--sidebar-bg); color: #fff; border-color: rgba(255,255,255,.2); }
.media-chip-icon  { font-size: 12px; line-height: 1; }
.media-divider { border: none; border-top: 1px solid var(--border); margin: 10px 0 8px; }

/* Image gallery */
.media-gallery { display: flex; flex-wrap: wrap; gap: 7px; }
.media-thumb {
  position: relative; width: 72px; height: 72px; flex-shrink: 0;
  border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border);
}
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb-remove {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; border: none; font-size: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--tr-base);
}
.media-thumb:hover .media-thumb-remove { opacity: 1; }
.media-add-btn {
  width: 72px; height: 72px; border-radius: var(--r-sm);
  border: 2px dashed var(--border-md); background: var(--bg-elevated);
  color: var(--text-disabled); font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--tr-base); flex-shrink: 0;
}
.media-add-btn:hover { border-color: var(--ps-red); color: var(--ps-red); background: var(--ps-red-muted); }

/* Drop zone */
.image-drop-zone {
  border: 2px dashed var(--border-md); border-radius: var(--r-md);
  padding: 16px; text-align: center; cursor: pointer;
  transition: all var(--tr-base); background: var(--bg-elevated); margin-top: 8px;
}
.image-drop-zone:hover { border-color: var(--ps-red); background: var(--ps-red-muted); }
.image-drop-zone p { font-size: 12px; color: var(--text-disabled); margin-top: 6px; }
.image-drop-zone .drop-icon { font-size: 24px; }

/* Modal footer */
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-shrink: 0;
}

/* ── Status dropdown ──────────────────────────────────────── */
.status-dropdown {
  display: none; position: fixed; z-index: calc(var(--z-modal) + 10);
  background: var(--bg-card); border-radius: var(--r-lg);
  border: 1px solid var(--border); box-shadow: var(--sh-lg);
  padding: 6px; min-width: 220px;
}
.status-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 12px; transition: background var(--tr-base);
}
.status-dropdown-item:hover { background: var(--bg-elevated); }
.status-dropdown-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dropdown-label { font-weight: 600; flex: 1; }
.status-dropdown-desc  { font-size: 10px; color: var(--text-disabled); }

/* ── PIN modal ────────────────────────────────────────────── */
.pin-modal   { max-width: 340px; }
.pin-body    { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 20px 24px; text-align: center; }
.pin-icon    { font-size: 34px; }
.pin-desc    { font-size: 13px; color: var(--text-muted); line-height: 1.5; max-width: 240px; }
.pin-input {
  width: 150px; text-align: center; font-size: 20px; letter-spacing: 6px;
  padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--border-md);
  outline: none; color: var(--text-primary); background: var(--bg-elevated); font-family: var(--font-sans);
  transition: border-color var(--tr-base);
}
.pin-input:focus  { border-color: var(--ps-red); }
.pin-error  { font-size: 12px; color: var(--ps-red); min-height: 16px; }
.pin-submit { width: 150px; justify-content: center; padding: 9px; }

/* ── Calendar view ────────────────────────────────────────── */
.calendar-view {
  padding: 16px 20px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 0;
}
.calendar-month-title {
  font-size: calc(var(--fs-xl, 20px) * 0.9); font-weight: 700;
  color: var(--text-primary); letter-spacing: -.02em;
  margin-bottom: 14px; flex-shrink: 0;
}
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px; background: var(--border-md);
  border-radius: var(--r-lg); overflow: hidden;
  border: 1.5px solid var(--border-md);
}
.cal-header-cell {
  background: var(--bg-elevated); color: var(--text-secondary);
  font-size: var(--fs-xs); font-weight: 700; text-align: center;
  padding: 10px 4px; text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 1px solid var(--border-md);
}
.cal-day {
  background: var(--bg-card); min-height: 105px; padding: 6px 5px;
  display: flex; flex-direction: column; gap: 3px;
  transition: background var(--tr-fast);
}
.cal-day:hover           { background: var(--bg-card-hover); }
.cal-day.is-other-month  { background: var(--bg-page); opacity: .7; }
.cal-day.is-today        { background: rgba(229,56,43,.06); }
.cal-day-num {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted);
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0; align-self: flex-start; line-height: 1;
}
.cal-day.is-today .cal-day-num {
  background: var(--ps-red); color: #fff;
  font-weight: 800; box-shadow: 0 2px 8px rgba(229,56,43,.4);
  width: 26px; height: 26px;
}
.cal-event {
  font-size: var(--fs-xs); font-weight: 500;
  padding: 3px 6px; border-radius: var(--r-sm);
  cursor: pointer; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: filter var(--tr-fast), transform var(--tr-fast);
  border-left: 3px solid currentColor;
}
.cal-event:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* ── Gantt view ───────────────────────────────────────────── */
.gantt-view { padding: 16px 20px; overflow: auto; flex: 1; }
.gantt-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.gantt-table th {
  background: var(--bg-elevated); color: var(--text-muted);
  font-size: 10px; font-weight: 600; padding: 8px 10px; text-align: left;
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.gantt-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); font-size: 12px; vertical-align: middle; }
.gantt-table tr:hover td { background: var(--bg-elevated); }
.gantt-table tr.is-past td { opacity: .5; }
.gantt-bar-cell { width: 55%; padding: 5px 10px !important; }
.gantt-bar-track { height: 20px; background: var(--bg-elevated); border-radius: var(--r-sm); position: relative; overflow: hidden; }
.gantt-bar {
  position: absolute; top: 0; height: 100%; border-radius: var(--r-sm);
  display: flex; align-items: center; padding: 0 6px;
  font-size: 10px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden;
}
.gantt-today-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--ps-red); opacity: .7;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .kanban-board { padding: 10px 8px 20px; gap: 8px; }
  .kanban-col   { flex: 0 0 245px; }
  .modal-row-3  { flex-direction: column; }
  .modal-flags-row { flex-direction: column; gap: 10px; }
  .search-wrap  { margin-left: 0; }
}

/* ── Light mode board overrides ─────────────────────────── */
[data-theme="light"] .modal-overlay { background: rgba(15,17,23,.5); }
[data-theme="light"] .modal-tabs { background: #FFFFFF; border-bottom-color: #D8DCE9; }
[data-theme="light"] .modal-tab        { color: #5A6480; }
[data-theme="light"] .modal-tab:hover  { color: #0D1022; }
[data-theme="light"] .modal-tab.active { color: var(--ps-red); }
[data-theme="light"] .kanban-col    { background: #F0F2F8; border-color: #DDE1EB; }
[data-theme="light"] .col-head      { border-color: #DDE1EB; }
[data-theme="light"] .card          { background: #FFFFFF; border-color: #DDE1EB; }
[data-theme="light"] .card:hover    { border-color: #C8CDD9; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
[data-theme="light"] .card.is-past  { background: #F6F8FC; }
[data-theme="light"] .col-badge     { background: #FFFFFF; border-color: #DDE1EB; }
[data-theme="light"] .media-chip    { background: #FFFFFF; border-color: #DDE1EB; color: #6B7280; }
[data-theme="light"] .media-chip.active { background: #111320; }
[data-theme="light"] .red-chip      { background: #FFFFFF; border-color: #DDE1EB; }
[data-theme="light"] .obj-chip      { background: #FFFFFF; border-color: #DDE1EB; }
[data-theme="light"] .cal-day             { background: #FFFFFF; }
[data-theme="light"] .cal-day:hover       { background: #F7F9FC; }
[data-theme="light"] .cal-day.is-other-month { background: #F4F6FB; opacity: 1; }
[data-theme="light"] .cal-header-cell     { background: #EDF0F7; color: #475569; border-bottom-color: #D8DCE9; }
[data-theme="light"] .cal-day-num         { color: #5A6480; }
[data-theme="light"] .calendar-grid       { background: #C8CDD8; border-color: #C8CDD8; }
[data-theme="light"] .cal-day.is-today    { background: rgba(229,56,43,.05); }
[data-theme="light"] .status-dropdown { background: #FFFFFF; border-color: #DDE1EB; }
[data-theme="light"] .status-dropdown-item:hover { background: #F0F2F8; }
[data-theme="light"] .gantt-table th { background: #F0F2F8; border-color: #DDE1EB; }
[data-theme="light"] .gantt-table td { border-color: #DDE1EB; }
[data-theme="light"] .gantt-table tr:hover td { background: #F6F8FC; }
[data-theme="light"] .gantt-bar-track { background: #E2E5EC; }
[data-theme="light"] .modal-flags-row { background: #F6F8FC; border-color: #DDE1EB; }
[data-theme="light"] .pin-input { background: #F6F8FC; border-color: #C8CDD9; color: #0D1117; }
[data-theme="light"] .modal-title-input { color: #0D1117; }
[data-theme="light"] .image-drop-zone { background: #F6F8FC; border-color: #C8CDD9; }
[data-theme="light"] .media-add-btn { background: #F6F8FC; border-color: #C8CDD9; }

/* ── Adaptive modal: status buttons ──────────────────────── */
.status-btn-group {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px;
}
.status-btn {
  display: flex; align-items: center; padding: 5px 11px;
  border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600;
  border: 1.5px solid var(--border-md); background: var(--bg-elevated);
  color: var(--text-muted); cursor: pointer; font-family: var(--font-sans);
  transition: all var(--tr-fast); white-space: nowrap;
}
.status-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.status-btn.active { font-weight: 700; }

/* ── Adaptive modal: priority chips ─────────────────────── */
.priority-chips {
  display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px;
}
.priority-chip {
  padding: 4px 12px; border-radius: var(--r-full); font-size: var(--fs-xs);
  font-weight: 600; border: 1.5px solid var(--border-md);
  background: var(--bg-elevated); color: var(--text-muted);
  cursor: pointer; font-family: var(--font-sans);
  transition: all var(--tr-fast);
}
.priority-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }

/* Light mode adjustments */
[data-theme="light"] .status-btn   { background: #F4F6FB; border-color: #D0D5E8; color: #5A6480; }
[data-theme="light"] .priority-chip{ background: #F4F6FB; border-color: #D0D5E8; color: #5A6480; }

/* ── Generic card (non-parrilla) ─────────────────────────── */
.generic-card { cursor:pointer; }
.generic-card:hover { transform:translateY(-1px); box-shadow:var(--sh-sm); }
.col-add-btn:hover { background:var(--bg-elevated) !important; color:var(--text-primary) !important; }

/* Column header dot */
.col-head .col-dot { width:10px;height:10px;border-radius:50%; }

/* ═══════════════════════════════════════════════════════════
   DRAG & DROP
   ═══════════════════════════════════════════════════════════ */
.card[draggable="true"] { cursor: grab; }
.card[draggable="true"]:active { cursor: grabbing; }
.card.is-dragging { opacity: 0.35 !important; box-shadow: none !important; }

.drag-handle {
  display: inline-block; color: var(--text-disabled);
  font-size: 12px; margin-right: 4px; cursor: grab;
  opacity: 0; transition: opacity var(--tr-fast);
  vertical-align: middle; line-height: 1;
}
.card:hover .drag-handle { opacity: 1; }

.kanban-col.drag-over {
  background: var(--nav-active-bg);
  outline: 2px dashed var(--ps-red);
  outline-offset: -2px;
  transition: background 0.12s;
}

.dnd-drop-indicator {
  height: 3px; background: var(--ps-red); border-radius: 99px;
  margin: 3px 4px; animation: indicator-fade-in .1s ease;
  box-shadow: 0 0 6px var(--ps-red);
}
@keyframes indicator-fade-in { from { opacity:0; transform:scaleX(.7); } to { opacity:1; transform:scaleX(1); } }

.col-flash { animation: col-flash-anim .5s ease; }
@keyframes col-flash-anim {
  0%   { background: rgba(229,56,43,.15); }
  50%  { background: rgba(229,56,43,.08); }
  100% { background: transparent; }
}

/* ── Completion burst ── */
@keyframes burst-anim {
  0%   { transform: scale(0.5) translateY(0); opacity:1; }
  60%  { transform: scale(1.4) translateY(-30px); opacity:1; }
  100% { transform: scale(1)   translateY(-70px); opacity:0; }
}

/* ═══════════════════════════════════════════════════════════
   CALENDAR CONTROLS
   ═══════════════════════════════════════════════════════════ */
.cal-controls {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 14px; flex-shrink: 0;
}
.cal-nav {
  display: flex; align-items: center; gap: 6px;
}
.cal-nav-btn {
  width: 30px; height: 30px; border-radius: var(--r-md);
  border: 1.5px solid var(--border-md); background: var(--bg-elevated);
  color: var(--text-primary); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--tr-fast); font-family: var(--font-sans);
}
.cal-nav-btn:hover { background: var(--bg-card); border-color: var(--ps-red); color: var(--ps-red); }
.cal-today-btn { font-size: 11px; font-weight: 600; width: auto; padding: 0 10px; }
.cal-nav-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  min-width: 180px; text-align: center; letter-spacing: -.01em;
}
.cal-mode-switcher {
  display: flex; gap: 3px;
  background: var(--bg-elevated); border-radius: var(--r-md);
  padding: 3px; border: 1px solid var(--border-md);
}
.cal-mode-btn {
  padding: 5px 12px; border-radius: var(--r-sm); font-size: 11px;
  font-weight: 600; border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-family: var(--font-sans);
  transition: all var(--tr-fast);
}
.cal-mode-btn:hover { color: var(--text-primary); background: var(--bg-card); }
.cal-mode-btn.active {
  background: var(--ps-red); color: #fff;
  box-shadow: 0 1px 4px rgba(229,56,43,.35);
}

/* Biweek/week grid: fewer columns */
.cal-week { min-height: 300px; }
.cal-biweek { min-height: 240px; }

/* ═══════════════════════════════════════════════════════════
   CALENDAR LIST VIEW
   ═══════════════════════════════════════════════════════════ */
.cal-list-wrap { display: flex; flex-direction: column; gap: 0; }
.cal-list-group { margin-bottom: 16px; }
.cal-list-group.is-today .cal-list-date { color: var(--ps-red); }
.cal-list-date {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  padding: 6px 0; border-bottom: 1px solid var(--border); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .04em;
}
.cal-list-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--border-md); flex-shrink: 0;
}
.cal-list-dot.today { background: var(--ps-red); }
.cal-list-day-name { color: var(--text-disabled); font-weight: 400; margin-left: 4px; }
.cal-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-md);
  cursor: pointer; transition: background var(--tr-fast);
  border-left: 3px solid transparent;
}
.cal-list-item:hover { background: var(--bg-elevated); }
.cal-list-item.is-past { opacity: .6; }
.cal-list-time {
  font-size: 11px; color: var(--text-muted); width: 52px;
  flex-shrink: 0; font-family: var(--font-mono, monospace);
}
.cal-list-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cal-list-title { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
.cal-list-tags { display: flex; gap: 3px; flex-shrink: 0; }
.cal-list-tag {
  font-size: 9px; padding: 1px 5px; border-radius: 99px;
  background: var(--bg-elevated); color: var(--text-muted);
  border: 1px solid var(--border-md); font-weight: 600;
}
.cal-list-st { font-size: 10px; font-weight: 600; flex-shrink: 0; white-space: nowrap; }

/* Light mode calendar */
[data-theme="light"] .cal-controls { color: var(--text-primary); }
[data-theme="light"] .cal-mode-btn:hover { background: #E8EBF4; }
[data-theme="light"] .cal-nav-btn { background: #F4F6FB; border-color: #C8CDD8; }
[data-theme="light"] .cal-list-item:hover { background: #F4F6FB; }

/* ═══════════════════════════════════════════════════════════
   NOTIFICATION BELL
   ═══════════════════════════════════════════════════════════ */
.tb-notif-wrap { position: relative; }
.tb-notif-btn  { position: relative; }
.tb-notif-btn.has-alerts { color: var(--ps-red) !important; }

.tb-notif-badge {
  position: absolute; top: -4px; right: -5px;
  min-width: 16px; height: 16px; border-radius: 99px;
  background: var(--ps-red); color: #fff; font-size: 9px;
  font-weight: 800; display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid var(--bg-topbar, #fff);
  animation: badge-pop .3s cubic-bezier(.175,.885,.32,1.275);
}
.tb-notif-badge.has-alerts {
  animation: badge-pulse 2s infinite;
}
@keyframes badge-pop   { from{transform:scale(0)} to{transform:scale(1)} }
@keyframes badge-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }

.tb-notif-panel {
  position: absolute; top: calc(100% + 8px); right: -8px;
  width: 320px; background: var(--bg-card);
  border: 1.5px solid var(--border-md); border-radius: var(--r-lg);
  box-shadow: var(--sh-xl); z-index: 500; overflow: hidden;
}
.tb-notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--text-primary);
}
.tb-notif-list { max-height: 380px; overflow-y: auto; }

.notif-empty { padding: 24px; text-align: center; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; cursor: pointer; border-left: 3px solid transparent;
  transition: background var(--tr-fast);
  border-bottom: 1px solid var(--border);
}
.notif-item:hover { background: var(--bg-elevated); }
.notif-item.notif-overdue { border-left-color: #EF4444; }
.notif-item.notif-today   { border-left-color: #F59E0B; }
.notif-item.notif-soon    { border-left-color: #3B82F6; }
.notif-icon    { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.notif-body    { flex: 1; min-width: 0; }
.notif-title   { font-size: 12px; font-weight: 600; color: var(--text-primary);
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-meta    { font-size: 10px; color: var(--text-muted); margin-top: 2px;
                 display: flex; align-items: center; gap: 4px; }
.notif-sep     { color: var(--text-disabled); }
.notif-type-badge {
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: 99px; flex-shrink: 0; align-self: flex-start;
  margin-top: 2px; white-space: nowrap; text-transform: uppercase; letter-spacing: .04em;
}

/* Light mode notif */
[data-theme="light"] .tb-notif-panel  { background: #FFFFFF; border-color: #D0D5E8; }
[data-theme="light"] .notif-item:hover{ background: #F4F6FB; }
