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

:root {
  --bg:           #f0f2f5;
  --white:        #ffffff;
  --primary:      #4f46e5;
  --primary-dark: #4338ca;
  --text:         #1e293b;
  --muted:        #64748b;
  --border:       #e2e8f0;
  --shadow-sm:    0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:    0 4px 16px rgba(15,23,42,.10), 0 2px 4px rgba(15,23,42,.06);
  --shadow-lg:    0 24px 64px rgba(15,23,42,.18), 0 8px 24px rgba(15,23,42,.10);
  --col-todo:     #3b82f6;
  --col-inprog:   #f59e0b;
  --col-pending:  #8b5cf6;
  --col-done:     #10b981;
  --high:         #ef4444;
  --medium:       #f59e0b;
  --low:          #10b981;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(ellipse at 0% 0%, rgba(99,102,241,.07) 0%, transparent 55%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── Space Overlay ─── */
.space-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.space-overlay.open { display: flex; }

.space-card {
  background: var(--white);
  border-radius: 20px;
  padding: 36px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modalIn .2s ease;
  position: relative;
  border-top: 3px solid var(--primary);
}
.space-card-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.space-card-close:hover {
  background: var(--hover);
  color: var(--text);
}

.space-card-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.03em;
  margin-bottom: 4px;
}
.space-card-sub {
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 28px;
}

.space-section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 10px;
  text-align: left;
}

.space-section-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.space-section-form input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.space-section-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.space-section-form .btn-primary,
.space-section-form .btn-secondary { width: 100%; padding: 11px; }

.space-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: .78rem;
  color: #92400e;
  line-height: 1.5;
  text-align: left;
}
.space-hint svg { flex-shrink: 0; margin-top: 1px; }

.space-err {
  font-size: .8rem;
  color: var(--high);
  min-height: 1.1em;
  text-align: left;
}

.space-divider {
  color: var(--muted);
  font-size: .8rem;
  margin: 20px 0;
  position: relative;
}
.space-divider::before,
.space-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 44%;
  height: 1px;
  background: var(--border);
}
.space-divider::before { left: 0; }
.space-divider::after  { right: 0; }

/* ─── Header ─── */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border), 0 4px 20px rgba(15,23,42,.05);
}
.header-content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 62px;
  gap: 16px;
}
h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.02em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo-icon { flex-shrink: 0; display: block; }
.logo-wordmark { display: flex; flex-direction: column; line-height: 1; gap: 3px; }
.logo-name { font-size: 1.15rem; font-weight: 800; color: #1e293b; letter-spacing: -.02em; line-height: 1; }
.logo-sub  { font-size: .52rem; font-weight: 700; color: #94a3b8; letter-spacing: .14em; text-transform: uppercase; line-height: 1; }
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Space Display ─── */
.space-display {
  display: none;
  align-items: center;
  gap: 7px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  max-width: 180px;
  overflow: hidden;
}
.space-display.visible { display: flex; }
.space-display-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ─── Board Settings Gear ─── */
.board-settings-wrapper { position: relative; }
.board-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.board-settings-btn:hover { background: var(--border); color: var(--text); }
.board-settings-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
  min-width: 160px;
}
.board-settings-dropdown.open { display: block; }
.board-settings-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .88rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: background .12s;
}
.board-settings-item:hover { background: var(--bg); }
.board-settings-item--danger { color: var(--danger, #dc2626); }
.board-settings-item--danger:hover { background: #fff1f1; }

/* ─── Notifications ─── */
.notif-wrapper { position: relative; }
.notif-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  padding: 6px;
  border-radius: 8px;
  transition: background .15s;
}
.notif-btn:hover { background: var(--bg); color: var(--text); }
.notif-btn svg { display: block; }
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--high);
  color: #fff;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.notif-badge.visible { display: inline-flex; }
.notif-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
}
.notif-panel.open { display: block; }
.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .88rem;
}
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #eef2ff; }
.notif-item.unread:hover { background: #e0e7ff; }
.notif-msg { font-size: .83rem; line-height: 1.4; margin-bottom: 3px; }
.notif-time { font-size: .73rem; color: var(--muted); }
.no-notifs { padding: 24px; text-align: center; color: var(--muted); font-size: .85rem; }

/* ─── Buttons ─── */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79,70,229,.28);
  transition: background .18s, box-shadow .18s, transform .15s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 4px 14px rgba(79,70,229,.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(79,70,229,.3); }
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 20px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: background .18s;
}
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 6px;
  transition: background .15s;
}
.btn-close:hover { background: var(--bg); color: var(--text); }
.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: .82rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background .15s;
}
.btn-text:hover { background: #eef2ff; }
.btn-danger {
  background: #fee2e2;
  color: var(--high);
  border: 1px solid #fca5a5;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: background .18s;
}
.btn-danger:hover { background: #fecaca; }

/* ─── Board Wrapper ─── */
.board-wrapper {
  display: flex;
  gap: 20px;
  padding: 28px 24px;
  max-width: 1440px;
  margin: 0 auto;
  align-items: flex-start;
}

/* ─── Board ─── */
.board {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 4px;
}

/* ─── Column ─── */
.column {
  flex: 1;
  min-width: 180px;
  background: var(--white);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(15,23,42,.07), 0 0 0 1px rgba(15,23,42,.03);
  min-height: 520px;
}
.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2.5px solid var(--border);
}
.column-header.todo       { border-bottom-color: var(--col-todo); }
.column-header.inprogress { border-bottom-color: var(--col-inprog); }
.column-header.pending    { border-bottom-color: var(--col-pending); }
.column-header.done       { border-bottom-color: var(--col-done); }
.column-header.overdue    { border-bottom-color: var(--high); }
#col-todo .task-count        { background: rgba(59,130,246,.1);  color: var(--col-todo); }
#col-inprogress .task-count  { background: rgba(245,158,11,.1);  color: var(--col-inprog); }
#col-pending .task-count     { background: rgba(139,92,246,.1);  color: var(--col-pending); }
#col-done .task-count        { background: rgba(16,185,129,.1);  color: var(--col-done); }
#col-overdue .task-count     { background: rgba(239,68,68,.1);   color: var(--high); }

/* Status-colored column titles */
#col-todo .column-title       { color: var(--col-todo); }
#col-inprogress .column-title { color: var(--col-inprog); }
#col-pending .column-title    { color: var(--col-pending); }
#col-done .column-title       { color: var(--col-done); }
#col-overdue .column-title    { color: var(--high); }

/* Left-border status accent on task cards */
#col-todo .task-card        { border-left: 3px solid var(--col-todo); }
#col-inprogress .task-card  { border-left: 3px solid var(--col-inprog); }
#col-pending .task-card     { border-left: 3px solid var(--col-pending); }
#col-done .task-card        { border-left: 3px solid var(--col-done); }
#col-overdue .task-card     { border-left: 3px solid var(--high); }

.column-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.task-count {
  background: var(--bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .78rem;
  font-weight: 700;
}

/* ─── Priority filter per column ─── */
.col-priority-filter {
  width: 100%;
  padding: 5px 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.col-priority-filter:focus { border-color: var(--primary); }
.col-priority-filter.active { border-color: var(--primary); background: #eef2ff; color: var(--primary); font-weight: 500; }

/* ─── Task List ─── */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 60px;
  border-radius: 8px;
  transition: background .15s;
}
.task-list.drag-over {
  background: #eef2ff;
  outline: 2px dashed var(--primary);
  outline-offset: 3px;
}

/* ─── Task Card ─── */
.task-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: box-shadow .18s, transform .18s;
  user-select: none;
}
.task-card:hover { box-shadow: 0 8px 24px rgba(15,23,42,.12), 0 2px 6px rgba(15,23,42,.06); transform: translateY(-2px); }
.task-card.dragging { opacity: .45; cursor: grabbing; transform: scale(1.02); }
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.task-title {
  font-weight: 600;
  font-size: .88rem;
  line-height: 1.45;
  flex: 1;
}
.task-desc {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.task-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-actions { display: flex; gap: 2px; flex-shrink: 0; }
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--muted);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.btn-icon:hover        { background: var(--bg); color: var(--text); }
.btn-icon.delete:hover { background: #fee2e2; color: var(--high); }
.btn-icon svg { display: block; }

/* ─── Priority Badge ─── */
.priority-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.priority-high   { background: #fee2e2; color: var(--high); }
.priority-medium { background: #fef3c7; color: #d97706; }
.priority-low    { background: #d1fae5; color: #059669; }

/* ─── Due / Created Date ─── */
.due-date { font-size: .75rem; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.due-date.overdue { color: var(--high); font-weight: 600; }
.created-date { font-size: .72rem; color: var(--muted); opacity: .8; display: inline-flex; align-items: center; gap: 3px; }

/* ─── Comment count ─── */
.comment-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 500;
}

/* ─── Resource indicator ─── */
.resource-indicator {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  opacity: .7;
}

/* ─── Empty State ─── */
.empty-state { text-align: center; padding: 32px 16px; color: var(--muted); font-size: .85rem; }
.empty-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  opacity: .35;
  color: var(--muted);
}

/* ─── Modal ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}
.modal-lg { max-width: 600px; }
.modal-sm { max-width: 380px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.detail-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.delete-confirm-body { font-size: .93rem; color: var(--text); margin: 4px 0 20px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ─── Form ─── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.required { color: var(--high); }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  box-sizing: border-box;
}
.form-group textarea { resize: vertical; }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

/* ─── Detail View ─── */
#detailTitle {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.3;
  flex: 1;
  padding-right: 10px;
  color: var(--text);
}
.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.detail-chip {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-chip-label {
  font-size: .67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: .79rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-todo       { background: #e0e7ff; color: #3730a3; }
.status-inprogress { background: #fef3c7; color: #92400e; }
.status-pending    { background: #ede9fe; color: #6d28d9; }
.status-done       { background: #d1fae5; color: #065f46; }
.detail-status-sel {
  appearance: none;
  -webkit-appearance: none;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: .79rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  border: none;
  outline: none;
  transition: box-shadow .15s;
  background: #e0e7ff;
  color: #3730a3;
}
.detail-status-sel[data-status="inprogress"] { background: #fef3c7; color: #92400e; }
.detail-status-sel[data-status="pending"]    { background: #ede9fe; color: #6d28d9; }
.detail-status-sel[data-status="done"]       { background: #d1fae5; color: #065f46; }
.detail-status-sel:focus { box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.detail-desc {
  font-size: .88rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 18px;
  white-space: pre-wrap;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
}
.detail-created { font-size: .875rem; color: var(--text); font-weight: 600; }
.detail-due { font-size: .875rem; color: var(--high); font-weight: 600; }
.detail-due.overdue { text-decoration: underline; }
.save-status-btn { margin-top: 5px; align-self: flex-start; }
.detail-resources-section { margin-bottom: 18px; }
.detail-resources-label {
  font-size: .67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

/* ─── Comments ─── */
.comments-section { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 20px; }
.comments-heading { font-size: .9rem; font-weight: 700; margin-bottom: 14px; }
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 2px;
}
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment-body { flex: 1; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.comment-meta strong { font-size: .83rem; }
.comment-time { font-size: .72rem; color: var(--muted); }
.comment-body p { font-size: .84rem; line-height: 1.5; color: var(--text); }
.no-comments { font-size: .83rem; color: var(--muted); text-align: center; padding: 16px 0; }
.comment-input-row { display: flex; gap: 10px; }
.comment-input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .88rem;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color .18s;
}
.comment-input-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* ─── Avatar ─── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
  background: var(--primary);
}
.avatar-lg { width: 34px; height: 34px; font-size: .8rem; }

/* ─── Date Filter ─── */
.date-filter {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .18s, box-shadow .18s, background-color .18s, color .18s;
}
.date-filter:hover { border-color: #94a3b8; }
.date-filter:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.date-filter.active {
  border-color: var(--primary);
  background-color: #eef2ff;
  color: var(--primary);
  font-weight: 600;
}

.date-filter-wrap { position: relative; }

/* ─── Custom date range card ─── */
.custom-date-row {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 300;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 14px 16px;
  gap: 10px;
  align-items: center;
  font-size: .875rem;
  color: var(--text);
  white-space: nowrap;
  min-width: 340px;
}
.custom-date-row label { display: flex; align-items: center; gap: 6px; font-weight: 500; }

.date-field { position: relative; display: inline-flex; align-items: center; }
.date-field-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 28px 6px 10px;
  font-size: .875rem;
  font-family: 'Poppins', sans-serif;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  min-width: 130px;
  line-height: 1.4;
  user-select: none;
}
.date-field-text::after {
  content: '';
  position: absolute;
  right: 8px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
.date-field input[type="date"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.date-field:focus-within .date-field-text { border-color: var(--primary); box-shadow: 0 0 0 2px #e0e7ff; }

/* ─── Filter bar ─── */
.filter-bar {
  display: none;
  background: #eef2ff;
  border-bottom: 1px solid #c7d2fe;
  padding: 8px 24px;
  font-size: .8rem;
  color: var(--primary);
  font-weight: 600;
  gap: 8px;
  align-items: center;
}
.filter-bar.visible { display: flex; }
.filter-bar-clear {
  background: none;
  border: none;
  color: var(--primary);
  font-size: .75rem;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* ─── Resource Attachments ─── */
.resource-section-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.resource-section-sep::before,
.resource-section-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.resource-link-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.resource-link-row input[type="url"] {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .88rem;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.resource-link-row input[type="url"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.resource-link-remove {
  width: 26px; height: 26px;
  border: none; background: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.resource-link-remove:hover { background: #fee2e2; color: #ef4444; }
.resource-link-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  background: none;
  font-size: .8rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: var(--primary);
  cursor: pointer;
  margin-top: 2px;
  transition: background .15s, border-color .15s;
}
.resource-link-add:hover { background: #eef2ff; border-color: var(--primary); }
.resource-file-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.resource-file-btn {
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .83rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.resource-file-btn:hover { background: var(--border); }
.resource-file-list { display: flex; flex-direction: column; gap: 4px; }
.no-files-label { font-size: .8rem; color: var(--muted); }
.resource-file-item {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border-radius: 6px; padding: 5px 8px; font-size: .8rem;
}
.resource-file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.resource-file-item-size { color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.resource-file-total { font-size: .73rem; color: var(--muted); padding: 2px 4px; margin-top: 2px; }
.resource-hint { font-size: .73rem; color: var(--muted); margin-top: 6px; }
.detail-resources-list { display: flex; flex-direction: column; gap: 8px; }
.resource-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, color .15s;
  cursor: pointer;
  word-break: break-word;
}
.resource-link:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.08);
  color: var(--primary);
  text-decoration: none;
}
.resource-preview-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  font: inherit;
  text-align: left;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e293b;
  color: #fff;
  font-size: .875rem;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── File Preview Overlay ─── */
.file-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.7);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.file-preview-overlay.open { display: flex; }
.file-preview-panel {
  display: flex; flex-direction: column;
  width: min(96vw, 1080px);
  height: min(90vh, 900px);
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
  animation: modalIn .2s ease;
}
.file-preview-header {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.file-preview-name {
  flex: 1; font-size: .88rem; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.file-preview-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.file-preview-body {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; overflow: auto; position: relative;
}
.fp-image { max-width: 100%; max-height: 100%; object-fit: contain; padding: 20px; box-sizing: border-box; }
.fp-embed { width: 100%; height: 100%; border: none; display: block; }
.fp-video { max-width: 100%; max-height: 100%; outline: none; }
.fp-audio { width: min(480px, 80%); }
.fp-text {
  width: 100%; height: 100%; overflow: auto;
  padding: 20px 24px;
  font-family: 'Courier New', monospace;
  font-size: .82rem; line-height: 1.65; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
  align-self: flex-start; margin: 0;
  background: var(--white); box-sizing: border-box;
}
.fp-unsupported {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 52px 28px; color: var(--muted); text-align: center;
}
.fp-unsupported svg { opacity: .35; }
.fp-unsupported p { font-size: .93rem; max-width: 280px; line-height: 1.55; }

/* ════════════════════════════════════════
   RESPONSIVE — tablet (≤ 900px)
   ════════════════════════════════════════ */
@media (max-width: 900px) {
  .board-wrapper { padding: 20px 16px; }
}

/* ════════════════════════════════════════
   RESPONSIVE — mobile (≤ 640px)
   ════════════════════════════════════════ */
@media (max-width: 640px) {
  header { padding: 0 14px; }
  .header-content { height: auto; flex-wrap: wrap; padding: 10px 0; row-gap: 6px; }
  h1 { font-size: 1.15rem; }
  .header-right { width: 100%; flex-direction: column; align-items: stretch; gap: 6px; }
  .header-actions { justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
  .space-display { flex: 1; min-width: 0; max-width: none; }
  .space-display-name { max-width: 100%; }

  .header-filters { width: 100%; }
  .header-filters .date-filter-wrap { flex: 1; }
  .header-filters .date-filter-wrap .date-filter { width: 100%; }

  #addTaskBtn { width: 100%; justify-content: center; padding: 11px; font-size: .9rem; }

  .custom-date-row {
    right: auto; left: 0;
    min-width: 0; width: calc(100vw - 28px);
    flex-wrap: wrap; gap: 8px;
  }

  .filter-bar { padding: 7px 14px; font-size: .74rem; }

  .board-wrapper { padding: 12px 14px 28px; gap: 0; }
  .board {
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    padding-right: 28px;
  }
  .column {
    min-width: calc(100vw - 56px);
    flex-shrink: 0;
    scroll-snap-align: start;
    min-height: auto;
  }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: 20px 20px 0 0;
    max-width: 100%; max-height: 92vh;
    padding: 24px 20px 36px;
    animation: sheetUp .25s ease;
  }
  @keyframes sheetUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .modal-lg { max-width: 100%; }
  .form-row { flex-direction: column; gap: 0; }
  .form-group input, .form-group textarea, .form-group select { font-size: 1rem; min-height: 44px; }
  .notif-panel { position: fixed; left: 14px; right: 14px; width: auto; top: 60px; max-height: calc(100dvh - 80px); overflow-y: auto; }
  .modal-actions { flex-direction: column-reverse; gap: 8px; }
  .modal-actions .btn-primary, .modal-actions .btn-secondary { width: 100%; text-align: center; }
  .space-card { padding: 28px 20px; }
}

/* ─── SEO Features Section ─── */
.seo-features {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 64px 24px 56px;
  margin-top: 48px;
}
.seo-features-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.seo-features h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
  margin-bottom: 10px;
  text-align: center;
}
.seo-features-sub {
  color: var(--muted);
  text-align: center;
  font-size: .95rem;
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}
.seo-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 52px;
}
.seo-feature-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 24px 26px;
  border: 1px solid var(--border);
}
.seo-feature-card h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.seo-feature-card p {
  font-size: .87rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.seo-compare {
  background: var(--bg);
  border-radius: 14px;
  padding: 36px 40px;
  border: 1px solid var(--border);
}
.seo-compare h2 {
  font-size: 1.25rem;
  text-align: left;
  margin-bottom: 12px;
}
.seo-compare p {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 16px;
  line-height: 1.65;
}
.seo-compare-list {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 16px;
}
.seo-compare-list li {
  font-size: .9rem;
  color: var(--text);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.seo-compare-list li:last-child { border-bottom: none; }
.seo-cta-note {
  font-size: .88rem !important;
  color: var(--muted) !important;
  margin: 0 !important;
}
.seo-cta-note a { color: var(--primary); text-decoration: none; }
.seo-cta-note a:hover { text-decoration: underline; }

/* ─── Site Footer ─── */
.site-footer {
  background: var(--text);
  padding: 20px 24px;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-footer-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 3px;
}
.site-footer-brand-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: -.02em;
}
.site-footer-brand-sub {
  font-size: .5rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.site-footer-links {
  display: flex;
  gap: 20px;
}
.site-footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: .83rem;
  transition: color .15s;
}
.site-footer-links a:hover { color: #fff; }
.site-footer-copy {
  color: #64748b;
  font-size: .8rem;
}
@media (max-width: 600px) {
  .seo-features { padding: 40px 16px 40px; }
  .seo-compare { padding: 24px 20px; }
  .seo-features h2 { font-size: 1.2rem; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ─── Dark Mode ─── */
[data-theme="dark"] {
  --bg:           #0f172a;
  --white:        #1e293b;
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --text:         #f1f5f9;
  --muted:        #94a3b8;
  --border:       #334155;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
  --shadow-md:    0 4px 16px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.25);
  --shadow-lg:    0 24px 64px rgba(0,0,0,.55), 0 8px 24px rgba(0,0,0,.35);
}
[data-theme="dark"] body {
  background: radial-gradient(ellipse at 0% 0%, rgba(99,102,241,.15) 0%, transparent 55%), var(--bg);
}
[data-theme="dark"] header { background: #1e293b; }
[data-theme="dark"] .column { background: #1a2744; }
[data-theme="dark"] .task-card { background: #1e293b; }
[data-theme="dark"] .space-overlay { background: rgba(0,0,0,.7); }
[data-theme="dark"] .space-card { background: #1e293b; }
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.7); }
[data-theme="dark"] .modal-card { background: #1e293b; }
[data-theme="dark"] .notif-panel { background: #1e293b; border-color: var(--border); }
[data-theme="dark"] .board-settings-dropdown { background: #1e293b; border-color: var(--border); }
[data-theme="dark"] select,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] textarea { background: #0f172a; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .date-filter {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
[data-theme="dark"] .date-filter.active {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-color: rgba(99,102,241,.18);
  color: #818cf8;
}
[data-theme="dark"] .btn-secondary { background: #334155; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .logo-name { color: var(--text); }
[data-theme="dark"] .site-footer { background: #070e1a; border-top: 1px solid var(--border); }
[data-theme="dark"] .notif-item.unread { background: rgba(99,102,241,.15); }
[data-theme="dark"] .notif-item.unread:hover { background: rgba(99,102,241,.22); }

/* Theme toggle button */
.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.theme-btn:hover { background: var(--border); color: var(--text); }
.theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-moon { display: none; }
[data-theme="dark"] .theme-btn .icon-sun  { display: block; }

/* ─── Demo Banner ─── */
.demo-banner { display: none; }
body.demo-active .demo-banner {
  display: block;
  background: linear-gradient(90deg, rgba(99,102,241,.10) 0%, rgba(99,102,241,.06) 100%);
  border-bottom: 1px solid rgba(99,102,241,.20);
  padding: 9px 16px;
}
.demo-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.demo-banner-inner > svg { flex-shrink: 0; color: var(--primary); }
.demo-banner-inner > span { flex: 1; min-width: 0; }
.demo-banner-cta {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.demo-banner-cta:hover { background: var(--primary-dark); }

[data-theme="dark"] body.demo-active .demo-banner {
  background: linear-gradient(90deg, rgba(99,102,241,.18) 0%, rgba(99,102,241,.10) 100%);
  border-bottom-color: rgba(99,102,241,.30);
}

/* ─── Demo task card tweaks ─── */
.task-card--demo { opacity: .95; }
.demo-avatar-img-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ─── Demo detail view ─── */
.is-demo .detail-header-actions .btn-secondary { display: none; }
.is-demo .comment-input-row { display: none; }
.is-demo .comments-heading::after { content: ' (demo)'; font-size: .7rem; color: var(--muted); font-weight: 400; }
.demo-comments-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: .84rem;
}
.demo-comments-cta svg { opacity: .45; }
.demo-comments-cta p { line-height: 1.5; }
.demo-comments-cta .btn-primary {
  padding: 10px 24px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
  letter-spacing: .01em;
  transition: box-shadow .2s, transform .15s;
}
.demo-comments-cta .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99,102,241,.45);
  transform: translateY(-1px);
}
.demo-created-by-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.demo-avatar-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.demo-avatar-fallback {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.demo-status-text {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text);
}

/* ─── Custom Date Picker ─── */
.cdp-wrap { position: relative; display: block; }
.cdp-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; cursor: pointer; font-family: 'Poppins', sans-serif;
  font-size: .9rem; color: var(--text); min-height: 40px;
  user-select: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.cdp-btn:hover, .cdp-btn:focus-visible {
  border-color: var(--primary); outline: none;
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.cdp-btn.empty { color: var(--muted); }
.cdp-btn-icon { flex-shrink: 0; color: var(--muted); margin-left: 8px; }
.cdp-popup {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 2000;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(15,23,42,.14); padding: 14px; min-width: 268px;
  font-family: 'Poppins', sans-serif;
}
.cdp-popup.open { display: block; }
.cdp-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cdp-nav {
  background: none; border: none; cursor: pointer; padding: 5px 9px;
  border-radius: 7px; color: var(--text); font-size: .95rem; line-height: 1;
  transition: background .13s; font-family: 'Poppins', sans-serif;
}
.cdp-nav:hover { background: #f1f5f9; }
.cdp-mth { font-weight: 600; font-size: .88rem; color: var(--text); font-family: 'Poppins', sans-serif; }
.cdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cdp-dow {
  text-align: center; font-size: .7rem; font-weight: 600; color: var(--muted);
  padding: 4px 0; font-family: 'Poppins', sans-serif;
}
.cdp-day {
  text-align: center; padding: 6px 2px; font-size: .82rem; border-radius: 7px;
  cursor: pointer; color: var(--text); transition: background .1s;
  font-family: 'Poppins', sans-serif; line-height: 1.4;
}
.cdp-day:hover:not(.cdp-other) { background: #f1f5f9; }
.cdp-day.cdp-sel { background: var(--primary); color: #fff; font-weight: 600; }
.cdp-day.cdp-sel:hover { background: var(--primary); }
.cdp-day.cdp-today { font-weight: 700; color: var(--primary); }
.cdp-day.cdp-today.cdp-sel { color: #fff; }
.cdp-day.cdp-other { color: var(--muted); opacity: .35; cursor: default; }
.cdp-ftr {
  display: flex; justify-content: space-between; margin-top: 10px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.cdp-ftr-btn {
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  font-size: .8rem; font-weight: 600; color: var(--primary);
  border-radius: 6px; transition: background .13s; font-family: 'Poppins', sans-serif;
}
.cdp-ftr-btn:hover { background: #f1f5f9; }
[data-theme="dark"] .cdp-btn { background: #0f172a; border-color: var(--border); }
[data-theme="dark"] .cdp-popup { background: #1e293b; border-color: var(--border); }
[data-theme="dark"] .cdp-nav:hover,
[data-theme="dark"] .cdp-day:hover:not(.cdp-other),
[data-theme="dark"] .cdp-ftr-btn:hover { background: #334155; }
