/* ===== dashboard.css — Sidebar, topbar, tablero Kanban, lista, equipo y banner de cumpleaños ===== */

/* ============================================================
   APP SHELL (DASHBOARD)
   ============================================================ */

.app-body { background: var(--paper); }
.app-shell { display: flex; min-height: 100vh; }

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--navy-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
/* Logo/nombre clickeable: lleva al sitio de Márkora */
.sidebar-brand-link {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; border-radius: var(--radius-sm);
  transition: opacity var(--transition), transform var(--transition);
}
.sidebar-brand-link:hover { opacity: 0.82; transform: translateY(-1px); }
/* Botón cerrar sesión anclado arriba a la derecha del navbar */
.sidebar-brand .btn-logout { position: absolute; top: 14px; right: 14px; }
.sidebar-logo { width: 30px; height: 30px; object-fit: contain; }
.sidebar-brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.3px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 22px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; transform: translateX(2px); }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; display: block; }

.sidebar-section { padding: 0 8px; margin-bottom: 20px; }
.sidebar-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; font-weight: 700; }
.priority-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.chip {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover { background: rgba(255,255,255,0.1); }
.chip.active { background: #fff; color: var(--navy-900); }
.chip-baja.active { background: var(--green); color: #fff; }
.chip-media.active { background: var(--blue); color: #fff; }
.chip-alta.active { background: var(--yellow); color: #1f2937; }
.chip-urgente.active { background: var(--red); color: #fff; }

.new-task-btn {
  margin-top: auto;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 12px 18px;
}
.new-task-btn:hover { transform: translateY(-2px); }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

/* Botón de cerrar sesión: sutil, rojo, arriba a la derecha del navbar */
.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.btn-logout svg { width: 16px; height: 16px; display: block; }
.btn-logout-icon { font-size: 14px; line-height: 1; }
.btn-logout:hover {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
  transform: translateY(-2px);
}
.btn-logout:active { transform: translateY(0) scale(0.96); }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
  /* IMAGEN: si se desea foto de perfil real, reemplazar este div por <img class="avatar-img"> */
}
.user-name-block { min-width: 0; }
.user-name-block .u-name { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-name-block .u-role { font-size: 11px; color: #94a3b8; }

/* ---------- TOPBAR ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 32px 16px;
  gap: 20px;
  flex-wrap: wrap;
}
/* Columna derecha: utilidad (reloj + tema) arriba, controles debajo */
.topbar-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.topbar-utility { display: flex; align-items: center; gap: 14px; }
.topbar-title h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.4px; }
.topbar-title p { margin: 2px 0 0; color: var(--navy-500); font-size: 13.5px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* Reloj en vivo */
.topbar-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.clock-time { font-size: 16px; font-weight: 800; color: var(--navy-900); font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.clock-date { font-size: 11px; color: var(--navy-500); }

/* Botón día / noche — badge circular navy con ícono */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: var(--navy-900); color: #fff;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,0.35); }
.theme-toggle:active { transform: scale(0.94); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  width: 230px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-box input { border: none; outline: none; font-size: 13.5px; width: 100%; background: transparent; }
.search-icon { font-size: 13px; opacity: 0.6; }

.view-toggle { display: flex; background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle-btn { border: none; background: transparent; padding: 8px 12px; cursor: pointer; font-size: 15px; color: var(--navy-500); transition: background var(--transition), color var(--transition); }
.view-toggle-btn.active { background: var(--primary); color: #fff; }

.avatar-btn { border: none; background: none; padding: 0; cursor: pointer; border-radius: 50%; transition: transform var(--transition); }
.avatar-btn:hover { transform: scale(1.06); }

/* ============================================================
   TABLERO KANBAN
   ============================================================ */

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 18px;
  padding: 8px 32px 32px;
  overflow-x: auto;
}

.board-column {
  background: #eef0f5;
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  transition: background var(--transition);
}
.board-column.drag-over { background: var(--primary-light); }

.column-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 0 4px; }
.column-header h3 { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--navy-700); flex: 1; }
.column-count { font-size: 11.5px; font-weight: 700; background: #fff; color: var(--navy-500); padding: 2px 8px; border-radius: 999px; }
.column-dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-status-pendiente { background: var(--navy-500); }
.dot-status-en-progreso { background: var(--blue); }
.dot-status-revision { background: var(--purple); }
.dot-status-completado { background: var(--green); }

.column-body { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }

/* ---------- TARJETA DE TAREA ---------- */
.task-card {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  border: 1px solid transparent;
  animation: card-in 280ms cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.task-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border); }
.task-card.dragging { opacity: 0.4; }
.task-card.completed-card { opacity: 0.7; }
.task-card.completed-card .task-card-title { text-decoration: line-through; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.task-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.priority-badge {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.priority-baja { background: var(--green-bg); color: var(--green); }
.priority-media { background: var(--blue-bg); color: var(--blue); }
.priority-alta { background: var(--yellow-bg); color: #b45309; }
.priority-urgente { background: var(--red-bg); color: var(--red); animation: pulse-urgent 1.6s infinite; }

@keyframes pulse-urgent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}

.task-card-title { font-size: 14px; font-weight: 700; color: var(--navy-900); margin: 0 0 6px; line-height: 1.35; }
.task-card-desc { font-size: 12px; color: var(--navy-500); margin: 0 0 10px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.task-card-progress { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.progress-bar { flex: 1; height: 5px; background: #eef0f5; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width 400ms ease; }
.task-card-progress-label { font-size: 10.5px; color: var(--navy-500); font-weight: 600; white-space: nowrap; }

.task-card-bottom { display: flex; align-items: center; justify-content: space-between; }

.due-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.due-ok { background: var(--green-bg); color: var(--green); }
.due-soon { background: var(--yellow-bg); color: #b45309; }
.due-urgent { background: var(--red-bg); color: var(--red); animation: pulse-urgent 1.6s infinite; }
.due-overdue { background: var(--navy-900); color: #fff; }
.due-done { background: #eef0f5; color: var(--navy-500); }

.mini-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff;
}

.comment-count { font-size: 11px; color: var(--navy-500); display: flex; align-items: center; gap: 3px; }

.empty-column { text-align: center; padding: 24px 8px; color: var(--navy-500); font-size: 12.5px; }

/* ============================================================
   VISTA LISTA
   ============================================================ */

.list-view { padding: 8px 32px 32px; }
.task-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.task-table thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy-500);
  padding: 0 14px 6px;
  font-weight: 700;
}
.task-table tbody tr {
  background: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: card-in 250ms ease;
}
.task-table tbody tr:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.task-table td { padding: 12px 14px; font-size: 13.5px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.task-table td:first-child { border-left: 1px solid var(--border); border-radius: 10px 0 0 10px; font-weight: 600; }
.task-table td:last-child { border-right: 1px solid var(--border); border-radius: 0 10px 10px 0; }

.status-pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-block; }
.status-pendiente { background: #eef0f5; color: var(--navy-700); }
.status-en-progreso { background: var(--blue-bg); color: var(--blue); }
.status-revision { background: var(--purple-bg); color: var(--purple); }
.status-completado { background: var(--green-bg); color: var(--green); }

/* ============================================================
   VISTA EQUIPO
   ============================================================ */

.team-view { padding: 8px 32px 32px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.team-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: card-in 300ms ease;
}
.team-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.team-avatar-lg { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 20px; }
.team-card h4 { margin: 0; font-size: 15px; }
.team-card span { font-size: 12.5px; color: var(--navy-500); }
.team-card-stats { display: flex; gap: 14px; margin-top: 6px; font-size: 12px; color: var(--navy-700); }
.team-card-stats b { display: block; font-size: 16px; color: var(--navy-900); }
.team-card { cursor: pointer; }

/* ---- Modal de perfil de miembro del equipo ---- */
.member-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 22px; }
.member-avatar-xl {
  width: 92px; height: 92px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 32px;
  background-size: cover; background-position: center;
  box-shadow: var(--shadow-md);
}
.member-name { margin: 8px 0 0; font-size: 22px; font-weight: 800; }
.member-role { color: var(--navy-500); font-size: 14px; font-weight: 600; }
.member-bday-pill {
  margin-top: 4px; font-size: 12.5px; font-weight: 700;
  color: #b45309; background: var(--yellow-bg);
  padding: 4px 12px; border-radius: 999px;
}
.member-sections { display: flex; flex-direction: column; gap: 12px; }
.member-section {
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.member-section-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--navy-700); margin-bottom: 6px;
}
.member-section-text { font-size: 13.5px; color: var(--navy-700); line-height: 1.5; }
.member-empty { color: var(--navy-500); font-style: italic; }


/* ============================================================
   BANNER DE CUMPLEAÑOS
   ============================================================ */
.birthday-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 32px 4px;
  padding: 12px 18px;
  background: linear-gradient(90deg, #fdf2f8, #eef2ff);
  border: 1px solid #f3d9f7;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  animation: fade-in 350ms ease;
}
.birthday-emoji { font-size: 22px; animation: bday-bounce 1.5s ease-in-out infinite; }
@keyframes bday-bounce { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(4deg); } }
.birthday-text { font-size: 13.5px; color: var(--navy-700); flex: 1; line-height: 1.4; }
.birthday-text strong { color: var(--primary); }
.birthday-close {
  background: none; border: none; cursor: pointer; color: var(--navy-500);
  font-size: 14px; flex-shrink: 0; transition: color var(--transition);
}
.birthday-close:hover { color: var(--red); }

/* El bloque de usuario del sidebar es clickeable (abre el perfil) */
.sidebar-user { cursor: pointer; border-radius: var(--radius-sm); transition: background var(--transition); }
.sidebar-user:hover { background: rgba(255,255,255,0.06); }

/* Fecha de cumpleaños en la tarjeta de equipo */
.team-bday { font-size: 11.5px; color: var(--navy-500); background: var(--paper); padding: 2px 8px; border-radius: 999px; }


/* ===== Notificaciones (campanita) — Etapa 10 ===== */
.notif-wrap { position: relative; display: flex; }
/* La campanita usa el MISMO estilo que el botón día/noche (círculo navy) */
.notif-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: var(--navy-900); color: #fff;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.notif-btn svg { width: 18px; height: 18px; display: block; }
.notif-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,0.35); }
.notif-btn:active { transform: scale(0.94); }
[data-theme="dark"] .notif-btn { background: #334155; color: #fff; }
.notif-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  border-radius: 999px; box-shadow: 0 0 0 2px var(--paper);
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; max-width: 88vw;
  background: var(--paper-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  z-index: 200; overflow: hidden;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-weight: 700; color: var(--navy-900);
}
.notif-markall {
  border: none; background: none; cursor: pointer;
  color: var(--primary); font-size: 12px; font-weight: 600;
}
.notif-markall:hover { text-decoration: underline; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-empty { padding: 28px 14px; text-align: center; color: var(--navy-500); font-size: 14px; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--primary-light); }
.notif-item:hover { background: var(--primary-light); filter: brightness(0.97); }
.notif-item-icon { font-size: 18px; line-height: 1.4; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-text { color: var(--navy-900); font-size: 14px; line-height: 1.35; }
.notif-item-time { color: var(--navy-500); font-size: 12px; margin-top: 3px; }