*, *::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-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;
}

/* ─── User Overlay ─── */
.user-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;
}
.user-overlay.open { display: flex; }

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

/* ─── Workspace overlay: two-section layout ─── */
.ws-section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 10px;
  text-align: left;
}
.ws-section-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.ws-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;
  box-sizing: border-box;
  transition: border-color .18s, box-shadow .18s;
}
.ws-section-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.ws-section-form .btn-primary,
.ws-section-form .btn-secondary { width: 100%; padding: 11px; }
.ws-section-err {
  font-size: .8rem;
  color: var(--danger, #dc2626);
  min-height: 1.1em;
  text-align: left;
}
.ws-divider {
  color: var(--muted);
  font-size: .8rem;
  margin: 18px 0;
  position: relative;
  text-align: center;
}
.ws-divider::before,
.ws-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 44%;
  height: 1px;
  background: var(--border);
}
.ws-divider::before { left: 0; }
.ws-divider::after  { right: 0; }

.user-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.03em;
  margin-bottom: 6px;
}
.user-card-sub {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 24px;
}
.user-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 280px;
  overflow-y: auto;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  text-align: left;
  width: 100%;
  transition: background .15s, box-shadow .15s;
}
.user-chip:hover { background: #eef2ff; box-shadow: var(--shadow-sm); }
.user-chip .chip-name { flex: 1; }
.no-pwd-tag {
  font-size: .68rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
}
.no-users { color: var(--muted); font-size: .85rem; padding: 12px 0; text-align: center; }

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

.user-join-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-join-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;
}
.user-join-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.user-join-form .btn-primary { width: 100%; padding: 11px; }
.user-join-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  font-family: 'Poppins', sans-serif;
  outline: none;
  background: var(--white);
  color: var(--text);
  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 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
}
.user-join-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* ─── 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: 1200px;
  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: 10px;
}
.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;
}

/* ─── Notifications ─── */
.notif-wrapper { position: relative; }
.notif-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
  transition: background .15s;
}
.notif-btn:hover { background: var(--bg); color: var(--text); }
.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; }

/* ─── Current User ─── */
.current-user { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.user-name-display { font-weight: 600; }

/* ─── 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;
}
.avatar-lg { width: 34px; height: 34px; font-size: .8rem; }

/* ─── 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; }

/* ─── 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: 200px;
  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.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;
}

/* ─── Task List ─── */
.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 {
  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 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 (card & detail) ─── */
.created-date  { font-size: .72rem; color: var(--muted); opacity: .8; display: inline-flex; align-items: center; gap: 3px; }
.detail-created { font-size: .875rem; color: var(--text); }

/* ─── Due Date in detail view — same size as created, always red ─── */
.detail-due {
  font-size: .875rem;
  color: var(--high);
  font-weight: 600;
}
.detail-due.overdue { text-decoration: underline; }

/* ─── Assignee Chip ─── */
.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
}

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

/* ─── 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; }
.delete-confirm-body { font-size: .93rem; color: var(--text); margin: 4px 0 20px; line-height: 1.5; }
@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; }

/* ─── 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; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ─── Detail View (Premium) ─── */
#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-due { font-size: .875rem; color: var(--col-overdue, #ef4444); font-weight: 600; }
.detail-due.overdue { text-decoration: underline; }
.detail-created { font-size: .875rem; color: var(--text); font-weight: 600; }
.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-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;
}
.save-status-btn { margin-top: 5px; align-self: flex-start; }

/* ─── Comments (Premium) ─── */
.comments-section { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 20px; }
.comments-heading { font-size: .92rem; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 270px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 2px;
}
.comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .15s;
}
.comment:hover { border-color: var(--primary-light, rgba(79,70,229,.3)); }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; flex-wrap: wrap; }
.comment-meta strong { font-size: .83rem; }
.comment-time { font-size: .7rem; color: var(--muted); }
.comment-edited { font-size: .68rem; color: var(--muted); font-style: normal; }
.comment-edit-btn {
  margin-left: auto;
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 5px;
  border-radius: 5px;
  transition: opacity .15s, background .15s, color .15s;
  line-height: 1;
  flex-shrink: 0;
}
.comment:hover .comment-edit-btn { opacity: 1; }
.comment-edit-btn:hover { background: var(--border); color: var(--text); }
.comment-body p { font-size: .85rem; line-height: 1.55; color: var(--text); margin: 0; }
.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 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .88rem;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  background: var(--white);
  color: var(--text);
}
.comment-input-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
/* Comment inline edit */
.comment-edit-area { display: flex; flex-direction: column; gap: 7px; }
.comment-edit-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  font-size: .85rem;
  font-family: 'Poppins', sans-serif;
  resize: vertical;
  min-height: 52px;
  outline: none;
  background: var(--white);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
  box-sizing: border-box;
}
.comment-edit-actions { display: flex; gap: 7px; }

/* Smaller avatars inside the detail modal */
.detail-meta .avatar,
.detail-meta .avatar-lg,
.detail-meta .avatar-photo,
.detail-chips .avatar,
.detail-chips .avatar-lg,
.detail-chips .avatar-photo { width: 20px; height: 20px; font-size: .58rem; }
.comment .avatar,
.comment .avatar-lg,
.comment .avatar-photo { width: 24px; height: 24px; font-size: .62rem; }

/* ─── Date Filter Select ─── */
.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 wrapper ─── */
.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 (styled text + hidden native input) ─── */
.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;
}

/* ─── Activity Sidebar ─── */
.notif-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: 78px;
  height: calc(100vh - 106px);
  display: flex;
  flex-direction: column;
}
.notif-sidebar-header {
  padding: 13px 16px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}
.notif-sidebar-body { flex: 1; min-height: 0; overflow-y: auto; }
.sidebar-user-section { border-bottom: 1px solid var(--border); padding: 10px 0 6px; }
.sidebar-user-section:last-child { border-bottom: none; }
.sidebar-user-header { display: flex; align-items: center; gap: 7px; padding: 0 12px 6px; }
.sidebar-user-name { font-size: .82rem; font-weight: 600; flex: 1; color: var(--text); }
.sidebar-unread-badge {
  background: var(--high);
  color: #fff;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.sidebar-notif-item {
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 6px;
  margin: 1px 4px;
  transition: background .15s;
}
.sidebar-notif-item:hover { background: var(--bg); }
.sidebar-notif-item.unread { background: #eef2ff; }
.sidebar-notif-item.unread:hover { background: #e0e7ff; }
.sidebar-notif-msg { font-size: .74rem; line-height: 1.4; color: var(--text); margin-bottom: 1px; }
.sidebar-notif-time { font-size: .66rem; color: var(--muted); }
.sidebar-no-notifs { padding: 4px 12px 6px; font-size: .75rem; color: var(--muted); font-style: italic; }
.sidebar-show-more {
  display: block;
  width: calc(100% - 24px);
  margin: 6px 12px 10px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .78rem;
  font-family: 'Poppins', sans-serif;
  color: var(--primary);
  cursor: pointer;
  text-align: center;
  transition: background .15s;
}
.sidebar-show-more:hover { background: #eef2ff; }
.sidebar-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: .83rem; }

/* ─── Sidebar Tabs ─── */
.sidebar-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}
.sidebar-tab {
  flex: 1;
  padding: 9px 4px;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: color .15s;
}
.sidebar-tab:hover { color: var(--primary); }
.sidebar-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.sidebar-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--high);
  color: #fff;
  border-radius: 999px;
  font-size: .55rem;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  margin-left: 3px;
  vertical-align: 1px;
  line-height: 1;
}
.sidebar-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ─── Chat input (shared by DM widget) ─── */
.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .78rem;
  font-family: 'Poppins', sans-serif;
  background: var(--white);
  color: var(--text);
  outline: none;
  min-width: 0;
}
.chat-input:focus { border-color: var(--primary); }
.chat-send-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.chat-send-btn:hover { background: var(--primary-dark); }

/* ─── DM Chat Widget ─── */
.dm-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.dm-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(79,110,245,.45);
  position: relative;
  transition: background .15s, transform .15s;
  flex-shrink: 0;
}
.dm-fab:hover { background: var(--primary-dark); transform: scale(1.06); }
.dm-fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--high);
  color: #fff;
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--white);
}
.dm-popup {
  width: 300px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 8px 36px rgba(0,0,0,.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 420px;
}
.dm-popup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--white);
}
.dm-popup-title { flex: 1; font-size: .82rem; font-weight: 700; color: var(--text); }
.dm-popup-close { flex-shrink: 0; }
.dm-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 4px;
  transition: color .15s;
}
.dm-back-btn:hover { color: var(--primary); }
.dm-contacts-view, .dm-chat-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.dm-contacts-list { overflow-y: auto; flex: 1; }
.dm-contact-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background .15s;
}
.dm-contact-item:hover { background: var(--bg); }
.dm-contact-name { font-size: .82rem; font-weight: 500; color: var(--text); flex: 1; }
.dm-contact-unread {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.dm-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dm-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2px 12px;
}
.dm-msg.dm-msg-me { align-items: flex-end; }
.dm-msg-bubble {
  background: #f0f0f5;
  color: var(--text);
  border-radius: 14px 14px 14px 3px;
  padding: 7px 11px;
  font-size: .78rem;
  line-height: 1.45;
  max-width: 82%;
  word-break: break-word;
}
.dm-msg-me .dm-msg-bubble {
  background: var(--primary);
  color: #fff;
  border-radius: 14px 14px 3px 14px;
}
.dm-msg-time { font-size: .6rem; color: var(--muted); margin-top: 2px; padding: 0 2px; }
.dm-chat-input-row {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
[data-theme="dark"] .dm-msg-bubble { background: #2a2a3e; }
[data-theme="dark"] .dm-fab-badge { border-color: var(--bg); }

/* ─── Announcements Panel ─── */
.anno-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
}
.anno-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.anno-item:last-child { border-bottom: none; }
.anno-item-header { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.anno-item-author { font-size: .7rem; font-weight: 600; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anno-item-time { font-size: .61rem; color: var(--muted); white-space: nowrap; }
.anno-item-actions { display: flex; gap: 2px; flex-shrink: 0; }
.anno-item-text { font-size: .77rem; color: var(--text); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.anno-edited-tag { font-size: .62rem; color: var(--muted); font-style: italic; margin-left: 4px; }
.anno-footer {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.anno-new-btn { width: 100%; justify-content: center; display: block; text-align: center; }
.anno-modal-err { color: var(--high); font-size: .75rem; margin-top: 4px; min-height: 1.2em; }

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

/* ════════════════════════════════════════
   RESPONSIVE — mobile (≤ 640px)
   ════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Header ── */
  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;
  }
  .user-name-display { display: none; }

  /* Filters: stretch full width side-by-side */
  .header-filters { width: 100%; }
  .header-filters .date-filter { flex: 1; font-size: .8rem; padding: 8px 24px 8px 10px; }
  .header-filters .date-filter-wrap { flex: 1; }
  .header-filters .date-filter-wrap .date-filter { width: 100%; }

  /* + New Task: full width */
  #addTaskBtn { width: 100%; justify-content: center; padding: 11px; font-size: .9rem; }

  /* Date picker dropdown: full viewport width, left-anchored */
  .custom-date-row {
    right: auto;
    left: 0;
    min-width: 0;
    width: calc(100vw - 28px);
    flex-wrap: wrap;
    gap: 8px;
  }

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

  /* ── Board: horizontal swipe with snap ── */
  .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; /* peek at next column */
  }
  .column {
    min-width: calc(100vw - 56px);
    flex-shrink: 0;
    scroll-snap-align: start;
    min-height: auto;
  }

  /* ── Modals: slide-up bottom sheet ── */
  .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 rows stack ── */
  .form-row { flex-direction: column; gap: 0; }

  /* ── Prevent iOS auto-zoom on input focus (requires font-size >= 16px) ── */
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 1rem;
    min-height: 44px; /* minimum tap target */
  }

  /* ── Notification panel ── */
  .notif-panel { position: fixed; left: 14px; right: 14px; width: auto; top: 60px; max-height: calc(100dvh - 80px); overflow-y: auto; }

  /* ── Modal actions: stack on very small screens ── */
  .modal-actions { flex-direction: column-reverse; gap: 8px; }
  .modal-actions .btn-primary,
  .modal-actions .btn-secondary { width: 100%; text-align: center; }

  /* ── User overlay ── */
  .user-card { padding: 28px 20px; }
}

/* ════════════════════════════════════════
   NEW FEATURES
   ════════════════════════════════════════ */

/* ─── Avatar photo (image instead of colored initials) ─── */
.avatar-photo {
  object-fit: cover;
  border-radius: 50%;
}

/* ─── Password prompt step ─── */
.pwd-prompt-avatar {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.login-error {
  color: var(--high);
  font-size: .82rem;
  margin-top: 8px;
  text-align: center;
  min-height: 1.2em;
}

/* ─── Current user header — clickable ─── */
.current-user { cursor: pointer; }
.current-user:hover .user-name-display { text-decoration: underline; }

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

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

/* ─── Btn danger ─── */
.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; }

/* ─── Profile Settings Modal ─── */
.profile-body { padding-top: 4px; }

.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 8px;
}
.profile-photo-wrap {
  position: relative;
  flex-shrink: 0;
}
.profile-photo-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-photo-preview .avatar,
.profile-photo-preview img {
  width: 72px !important;
  height: 72px !important;
  font-size: 1.6rem !important;
  border-radius: 50%;
}
.profile-photo-edit-btn {
  position: absolute;
  bottom: 0;
  right: -2px;
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--white);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  padding: 0;
}
.profile-photo-edit-btn:hover { background: var(--primary-dark); }

.profile-info { flex: 1; }
.profile-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.profile-since {
  font-size: .8rem;
  color: var(--muted);
}
.profile-error {
  color: var(--high);
  font-size: .82rem;
  min-height: 1.2em;
  margin-top: 4px;
}
.profile-actions {
  justify-content: space-between !important;
  align-items: center;
}

/* Small danger link used in profile footer */
.btn-danger-sm {
  background: none;
  border: none;
  color: var(--danger, #dc2626);
  font-size: .78rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: .75;
  transition: opacity .15s, color .15s;
}
.btn-danger-sm:hover { opacity: 1; }

/* Log out button in header */
.btn-logout-header {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .78rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-logout-header:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* Selected user chip in login step */
.user-chip.selected {
  background: #eef2ff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79,70,229,.15);
}

/* ─── Detail view: Save Status button ─── */
.save-status-btn {
  margin-left: 8px;
}

/* ─── Mobile tweaks for new elements ─── */
@media (max-width: 640px) {
  .profile-actions { flex-direction: row !important; }
  .profile-actions .btn-danger,
  .profile-actions .btn-primary { flex: 1; text-align: center; }
}

/* ════════════════════════════════════════
   ADDITIONAL FEATURES v9
   ════════════════════════════════════════ */

/* ─── Notif button SVG alignment ─── */
.notif-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-btn svg { display: block; }

/* ─── Lock icon on user chips ─── */
.chip-lock {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  opacity: .7;
}

/* ─── Step 2 bottom links row ─── */
.step2-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

/* ─── Empty state SVG icon ─── */
.empty-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  opacity: .35;
  color: var(--muted);
}

/* ─── Resource Attachment Section ─── */
.resource-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.resource-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--white);
  border: none;
  font-size: .83rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.resource-tab + .resource-tab { border-left: 1px solid var(--border); }
.resource-tab.active {
  background: #eef2ff;
  color: var(--primary);
}
.resource-tab svg { flex-shrink: 0; }

/* ── Resource section separator ── */
.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);
}

/* ── Multi-link rows ── */
.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); }

/* ── Multi-file section ── */
.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;
}

/* ─── Resource link in detail view ─── */
.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;
  transition: border-color .15s, box-shadow .15s, color .15s;
  font-size: .84rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  word-break: break-word;
  cursor: pointer;
}
.resource-link:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.08);
  color: var(--primary);
  text-decoration: none;
}

/* ─── Toast notification ─── */
.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;
}

/* Per-type content */
.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; }
.fp-ext-badge {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--bg);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Preview button in detail view (replaces direct download link for files) */
.resource-preview-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

/* ─── 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; }
}

/* ─── Guest Banner ─── */
.guest-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}
.guest-banner-inner {
  text-align: center;
  background: var(--white);
  border-radius: 16px;
  padding: 40px 48px;
  box-shadow: var(--shadow-md);
  max-width: 460px;
}
.guest-banner-inner p {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: .95rem;
  line-height: 1.6;
}

/* ─── Admin Team Panel (inside Profile modal) ─── */
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.admin-section-title {
  font-size: .9rem;
  color: var(--text);
}
.seat-usage {
  font-size: .78rem;
  color: var(--muted);
  background: var(--bg);
  border-radius: 20px;
  padding: 2px 10px;
}
.members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--bg);
}
.member-row:hover { background: #e8ecf2; }
.member-name {
  flex: 1;
  font-size: .85rem;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-tag {
  display: inline-block;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #ede9fe;
  color: #7c3aed;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}
.its-you-tag {
  font-size: .72rem;
  color: var(--muted);
  font-style: italic;
  margin-left: auto;
  flex-shrink: 0;
}

/* ─── Add Member Modal ─── */
#addMemberOverlay .form-group {
  margin-bottom: 12px;
  text-align: left;
}
#addMemberOverlay .form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
#addMemberOverlay .form-group input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .88rem;
  font-family: inherit;
  transition: border-color .15s;
  outline: none;
}
#addMemberOverlay .form-group input:focus { border-color: var(--primary); }
.required { color: #ef4444; }

/* ─── 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"] .user-overlay { background: rgba(0,0,0,.7); }
[data-theme="dark"] .user-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"] 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;
}
/* ─── Pricing Single Card Layout ─── */
.pricing-single-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 32px 0 24px;
}
.pricing-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}
.pricing-selector-label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
}
.pricing-selector select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: .92rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  transition: border-color .15s, box-shadow .15s;
}
.pricing-selector select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.pricing-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 26px 22px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.pricing-single-card {
  width: 100%;
  max-width: 420px;
  border-color: var(--primary);
  border-width: 2px;
}
.pricing-plan-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.pricing-plan-tagline {
  font-size: .77rem;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.45;
}
.pricing-price-block {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 5px;
}
.pricing-price-amount {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.pricing-price-period { font-size: .8rem; color: var(--muted); }
.pricing-plan-seats {
  font-size: .77rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 18px;
}
.pricing-cta-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px 0;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: transparent;
  transition: background .15s, color .15s, border-color .15s;
  margin-bottom: 20px;
}
.pricing-cta-btn:hover { background: rgba(79,70,229,.08); }
.pricing-cta-btn--popular {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pricing-cta-btn--popular:hover { background: #4338ca; border-color: #4338ca; }
.pricing-divider { height: 1px; background: var(--border); margin-bottom: 16px; }
.pricing-what-label {
  font-size: .77rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 11px;
}
.pricing-feat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.pricing-feat-list li {
  font-size: .8rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}
.feat-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary);
}
@media (max-width: 680px) {
  .pricing-single-card { max-width: none; }
  .pricing-selector { max-width: none; }
}

/* ─── Payment Step ─── */
.payment-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
}
.payment-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.payment-features-list li {
  font-size: .82rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.payment-features-list li::before {
  content: '✓';
  color: var(--col-done);
  font-weight: 700;
  flex-shrink: 0;
}
.payment-note {
  font-size: .76rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
  margin-top: 12px;
  padding: 0 4px;
}

/* ─── Plan info badge (under team size select) ─── */
.plan-info { display: flex; align-items: center; gap: 8px; font-size: .79rem; color: var(--muted); margin-top: 4px; margin-bottom: 4px; }
.plan-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.plan-badge--free { background: rgba(16,185,129,.12); color: #059669; }
.plan-badge--paid { background: rgba(99,102,241,.12); color: var(--primary); }

/* ─── Upgrade tiers (in upgrade modal) ─── */
.upgrade-tiers { display: flex; flex-direction: column; gap: 8px; }
.upgrade-tier { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }
.upgrade-tier-name { font-weight: 700; font-size: .88rem; flex: 1; }
.upgrade-tier-users { font-size: .8rem; color: var(--muted); flex: 2; }
.upgrade-tier-price { font-weight: 800; font-size: 1rem; color: var(--primary); }
.upgrade-tier-price em { font-style: normal; font-size: .72rem; color: var(--muted); font-weight: 400; }

[data-theme="dark"] .btn-secondary { background: #334155; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .user-overlay-close:hover { background: #334155; }
[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); }
[data-theme="dark"] .sidebar-notif-item.unread { background: rgba(99,102,241,.15); }
[data-theme="dark"] .sidebar-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; }

/* ─── 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; }
