/* ═══════════════════════════════════════════════════════════════
   NESTDEV — styles.css  v3 — "Premium Technical" (ver design.md)
   Sistema de diseño: negro #131313 · dorado #e8c547 · crema #e5e2e1
   Bebas Neue (display) · DM Sans (body) · JetBrains Mono (code)
═══════════════════════════════════════════════════════════════ */

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

:root {
  /* ─ Marca / acento ─ */
  --gold:        #e8c547;  /* primary-container — botones, focus, acentos */
  --gold-hover:  #d4b33c;  /* botones primarios oscurecen ligeramente al hover */
  --gold-light:  #ffe285;  /* primary — texto/iconos dorados sobre superficies oscuras */
  --gold-soft:   rgba(232,197,71,0.10);
  --gold-glow:   rgba(232,197,71,0.20);

  /* ─ Superficies — escala tonal (design.md: colors.surface-*) ─ */
  --bg:          #0b0b0a;  /* Level 0 — canvas */
  --surface0:    #0e0e0c;  /* surface-container-lowest — sidebar, topbar */
  --surface:     #141412;  /* surface-container-low — sidebar/topbar alterno */
  --surface2:    #1a1a17;  /* surface-container — cards, inputs elevados */
  --surface3:    #23221e;  /* surface-container-high — hover, chips */
  --surface4:    #2b2a25;  /* surface-container-highest — modales */
  --border:      #2a2925;  /* outline de elementos elevados (Elevation & Depth) */
  --border2:     #3d3a30;  /* outline-variant — énfasis sutil */

  /* ─ Texto — crema NestDev ─ */
  --text:        #f2efe6;  /* on-surface */
  --text2:       #c9c5b8;  /* on-surface-variant */
  --muted:       #9a968a;  /* outline */

  /* ─ Colores funcionales — solo para indicadores pequeños ─ */
  --yellow:     #d4a843;  --yellow-soft: rgba(212,168,67,0.09);
  --blue:       #5b8dee;  --blue-soft:   rgba(91,141,238,0.09);
  --violet:     #9b72cf;  --violet-soft: rgba(155,114,207,0.09);
  --green:      #52b788;  --green-soft:  rgba(82,183,136,0.09);
  --red:        #ffb4ab;  --red-soft:    rgba(255,180,171,0.10);
  --orange:     #d4845a;

  --radius:    2px;    /* Standard Elements — botones, inputs, contenedores pequeños */
  --radius-lg: 2px;    /* Large Containers — cards y modales */
  --font-title: 'Bebas Neue', sans-serif;
  --font-body:  'DM Sans', system-ui, sans-serif;
  --font-code:  'JetBrains Mono', monospace;
}

body { background: var(--bg); color: var(--text); font-family: var(--font-body); min-height: 100vh; }

input::placeholder, textarea::placeholder { color: var(--text); opacity: 0.4; }

/* ── Marca de agua ── */
.watermark {
  position: fixed; right: -40px; bottom: -60px;
  font-size: 28vw; font-weight: 700; line-height: 1; letter-spacing: -4px;
  color: var(--gold); opacity: 0.03; pointer-events: none; user-select: none;
  z-index: 0; font-family: var(--font-code);
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════════════ */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════════ */
.sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--surface0); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}

/* ── Brand ── */
.sidebar-brand {
  padding: 16px 14px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 11px; flex-shrink: 0;
}
.sidebar-brand-inner { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sidebar-brand-mark {
  font-family: var(--font-code); font-weight: 700; font-size: 1.15rem;
  color: var(--text); letter-spacing: -0.5px; line-height: 1; flex-shrink: 0;
}
.sidebar-brand-pipe { color: var(--gold); font-weight: 400; }
.sidebar-brand-name { font-size: 0.92rem; font-weight: 700; color: var(--text); line-height: 1.2; letter-spacing: -0.2px; }
.sidebar-brand-sub  { font-size: 0.6rem; color: var(--muted); letter-spacing: 0.4px; margin-top: 1px; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Nav ── */
.sidebar-nav {
  padding: 10px 8px; flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border2); border-radius: var(--radius); }

.nav-section-label {
  font-size: 0.6rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.8px; padding: 10px 10px 3px;
  display: flex; align-items: center; gap: 6px;
}
.nav-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.nav-item {
  display: flex; flex-direction: column;
  padding: 8px 10px 7px; border-radius: var(--radius);
  cursor: pointer; transition: background 0.15s, box-shadow 0.15s;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover  { background: var(--surface2); }
.nav-item.active {
  background: var(--gold-soft);
  /* Barra dorada de 4px en el borde izquierdo — indicador de item activo (design.md) */
  box-shadow: inset 4px 0 0 0 var(--gold);
}
.nav-item-row    { display: flex; align-items: center; gap: 8px; }

/* --- AJUSTES DE ICONOS --- */
.nav-icon {
  color: #888888; /* Gris claro por defecto para buen contraste */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

/* Iconos SVG: Forzar que hereden el color del padre y hacer las líneas un poco más sólidas */
.nav-icon svg {
  width: 18px; 
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2; /* Ligeramente más grueso para destacar sobre negro */
}

/* Color dorado cuando el ítem está activo */
.nav-item.active .nav-icon {
  color: var(--gold);
}

/* Color crema/blanco tiza en el hover */
.nav-item:hover:not(.active) .nav-icon {
  color: var(--text);
}
/* ------------------------- */


.nav-label-text  {
  font-size: 0.81rem; color: var(--text2); font-weight: 400; flex: 1;
  transition: color 0.15s; font-family: var(--font-body);
}
.nav-item:hover  .nav-label-text { color: var(--text); }
.nav-item.active .nav-label-text { color: var(--gold); font-weight: 700; }
.nav-count {
  background: var(--surface3); font-size: 0.62rem; font-weight: 700;
  padding: 1px 6px; border-radius: var(--radius); color: var(--text2); min-width: 22px; text-align: center;
}
.nav-item.active .nav-count { background: var(--gold-soft); color: var(--gold); }
.nav-progress-wrap { margin-top: 4px; height: 2px; background: var(--surface3); border-radius: var(--radius); overflow: hidden; }
.nav-progress-bar  { height: 100%; border-radius: var(--radius); transition: width 0.5s ease; }
.bar-all       { background: var(--gold); }
.bar-pendiente { background: var(--yellow); }
.bar-proceso   { background: var(--blue); }
.bar-entregado { background: var(--green); }
.bar-completed { background: var(--green); }
.bar-alta      { background: var(--red); }
.bar-blue      { background: var(--blue); }
.bar-brand     { background: var(--gold); }
.bar-green     { background: var(--green); }

/* ── Perfil usuario en sidebar ── */
.sidebar-user {
  padding: 10px 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px; flex-shrink: 0;
}
.sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: var(--radius); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; color: #0a0a0a; font-family: var(--font-code);
  overflow: hidden;
}

/* ── Foto de perfil real (en vez de iniciales) — cualquier círculo/chip
   de avatar en la app puede contener una <img class="avatar-img"> ── */
.avatar-img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: inherit; display: block;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 0.8rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 0.63rem; color: var(--muted); }
.btn-logout {
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  width: 26px; height: 26px; border-radius: var(--radius); cursor: pointer; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s; flex-shrink: 0; font-family: var(--font-body);
}
.btn-logout:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }

/* ── Sidebar footer ── */
.sidebar-footer { padding: 10px 8px; border-top: 1px solid var(--border); flex-shrink: 0; }
.btn-new-primary {
  width: 100%; background: var(--gold); color: #0a0a0a; border: none;
  padding: 9px 12px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  box-shadow: 0 4px 12px var(--gold-glow);
  font-family: var(--font-title); text-transform: uppercase; letter-spacing: 0.03em;
}
.btn-new-primary:hover { background: var(--gold-hover); }

/* ══════════════════════════════════════════════════════════════
   MAIN / VISTAS
══════════════════════════════════════════════════════════════ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.view { display: none; flex: 1; flex-direction: column; min-width: 0; overflow-y: auto; }
.view.active { display: flex; }

/* ── Topbar ── */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 11px 20px; display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap; flex-shrink: 0;
}
.topbar h1 { font-size: 0.97rem; font-weight: 700; flex: 1; min-width: 100px; }

.search-wrap { position: relative; }
.search-wrap input {
  background: var(--surface0); border: 1px solid var(--border); color: var(--text);
  padding: 8px 12px 8px 32px; border-radius: var(--radius); font-size: 0.81rem; outline: none;
  width: 220px; transition: border-color 0.2s, width 0.25s, box-shadow 0.2s;
  font-family: var(--font-body);
}
.search-wrap input:focus {
  border-color: var(--gold); width: 280px;
}
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: flex; pointer-events: none;
}
.topbar-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-select {
  background: var(--surface0); border: 1px solid var(--border); color: var(--text2);
  padding: 6px 12px; border-radius: var(--radius); font-size: 0.72rem; outline: none;
  cursor: pointer; transition: border-color 0.2s; font-family: var(--font-code);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.filter-select:focus { border-color: var(--gold); }
.toggle-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--surface0); border: 1px solid var(--border);
  color: var(--text2); padding: 6px 13px; border-radius: var(--radius);
  font-size: 0.72rem; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.3px;
  transition: all 0.2s; font-family: var(--font-code);
}
.toggle-btn.active { background: var(--red-soft); border-color: var(--red); color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   STATS STRIP
══════════════════════════════════════════════════════════════ */
.stats-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; flex-shrink: 0; padding: 18px 20px 4px;
}
.stat-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 5px;
  position: relative; overflow: hidden;
}
.stat-top   { display: flex; align-items: flex-end; justify-content: space-between; }
.stat-val   { font-family: var(--font-title); font-size: 2.1rem; font-weight: 400; line-height: 1; color: var(--text); }
.stat-pct   { font-size: 0.65rem; font-weight: 700; color: var(--muted); }
.stat-lbl   { font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-family: var(--font-code); order: -1; }
.stat-bar-wrap { height: 3px; background: var(--surface3); border-radius: var(--radius); overflow: hidden; margin-top: 4px; }
.stat-bar   { height: 100%; border-radius: var(--radius); transition: width 0.6s ease; }

.val-accent { color: var(--text) !important; }
.val-blue   { color: var(--text) !important; }
.val-green  { color: var(--text) !important; }

/* ══════════════════════════════════════════════════════════════
   CONTENT
══════════════════════════════════════════════════════════════ */
/* min-height de seguridad: si las tarjetas tardan en llegar de Supabase, el
   contenedor ya reserva algo de alto y no "salta" al rellenarse (CLS). */
.content { padding: 16px 20px; flex: 1; min-height: 240px; }

/* ══════════════════════════════════════════════════════════════
   PILLS
══════════════════════════════════════════════════════════════ */
.pill {
  font-size: 0.6rem; font-weight: 700; padding: 2px 7px;
  border-radius: var(--radius); text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.pill .icon { width: 10px; height: 10px; }

/* ── Pills neutrales — estilo Notion ─ */
/* ── Pills neutrales — estilo Notion ─ */
.pill-pendiente, .pill-en-proceso, .pill-entregado, .pill-prio-alta, .pill-prio-media, .pill-prio-baja, .pill-admin, .pill-member {
  background: var(--surface3) !important;
  color:      var(--text2)    !important;
  border:     1px solid var(--border2) !important;
}
/* Solo prioridad alta mantiene énfasis sutil */
.pill-prio-alta {
  color: var(--red) !important;
  background: rgba(224,82,82,0.07) !important;
  border-color: rgba(224,82,82,0.2) !important;
}
/* Administrador sigue dorado */
.pill-admin {
  color: var(--gold) !important;
  background: var(--gold-soft) !important;
  border-color: rgba(232,197,71,0.25) !important;
}

/* ══════════════════════════════════════════════════════════════
   PROJECT CARDS
══════════════════════════════════════════════════════════════ */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px; align-items: start;
}
.dot-pendiente  { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.dot-en-proceso { background: var(--blue);   box-shadow: 0 0 6px var(--blue); }
.dot-entregado  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.due-ok   { color: var(--green); }
.due-warn { color: var(--yellow); }
.due-over { color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   TASK CARDS
══════════════════════════════════════════════════════════════ */
.tasks-grid { display: flex; flex-direction: column; gap: 9px; }
.pdot-alta  { background: var(--red);    box-shadow: 0 0 6px var(--red); }
.pdot-media { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.pdot-baja  { background: var(--green);  box-shadow: 0 0 6px var(--green); }

/* ── Anillo de progreso ── */
.progress-ring-wrap {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px;
  min-height: 68px;
}
.progress-ring-wrap svg { flex-shrink: 0; }
.progress-ring-info     { display: flex; flex-direction: column; gap: 2px; }
.progress-ring-pct      { font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.progress-ring-lbl      { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.progress-ring-sub      { font-size: 0.74rem; color: var(--text2); margin-top: 2px; }
.progress-track { fill: none; stroke: var(--surface3); stroke-width: 5; }
.progress-fill  {
  fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.8s ease;
}

/* ══════════════════════════════════════════════════════════════
   TEAM / USERS GRID
══════════════════════════════════════════════════════════════ */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
/* Estado de error al cargar el equipo (red lenta o caída) — antes esta
   vista simplemente se quedaba en blanco sin ningún aviso. */
.team-load-error {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; padding: 40px 20px; color: var(--text2);
}
.team-load-error p { font-size: 0.88rem; max-width: 320px; }
.user-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 11px;
  transition: border-color 0.18s, box-shadow 0.18s; position: relative;
}
.user-card:hover { border-color: rgba(232,197,71,0.25); box-shadow: 0 4px 18px rgba(0,0,0,0.3); }
.user-card.self-card { border-color: rgba(232,197,71,0.3); }
.user-card.self-card::before {
  content: 'Tú'; position: absolute; top: 10px; right: 10px;
  background: var(--gold-soft); color: var(--gold);
  font-size: 0.6rem; font-weight: 800; padding: 2px 8px;
  border-radius: var(--radius); text-transform: uppercase; letter-spacing: 0.3px;
}
.user-card-header { display: flex; align-items: center; gap: 11px; }
.user-card-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 800; color: #0a0a0a; font-family: var(--font-code);
  overflow: hidden; position: relative;
}

/* ── Avatar clicable (solo en la propia tarjeta) para subir foto ── */
.user-card-avatar.avatar-upload { cursor: pointer; }
.user-card-avatar.avatar-upload:hover .avatar-edit-badge { opacity: 1; }
.avatar-edit-badge {
  position: absolute; bottom: -1px; right: -1px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); color: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface); opacity: 0.9;
  transition: opacity 0.15s;
}
.user-card-meta   { flex: 1; min-width: 0; }
.user-card-name   { font-size: 0.93rem; font-weight: 700; }
.user-card-handle { font-size: 0.73rem; color: var(--muted); margin-top: 1px; }
.user-card-body   { display: flex; flex-direction: column; gap: 4px; }
.user-card-dates  { font-size: 0.68rem; color: #909090; line-height: 1.6; }
.user-card-footer {
  display: flex; gap: 7px; align-items: center;
  border-top: 1px solid var(--border); padding-top: 9px; flex-wrap: wrap;
}

/* ── "Eliminados recientemente" (periodo de gracia de 7 días) ── */
.deleted-users-section { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--border2); }
.deleted-users-title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); margin: 0 0 12px;
}
.deleted-user-card { opacity: 0.82; }
.deleted-user-card:hover { opacity: 1; }
.role-select {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text2);
  padding: 4px 7px; border-radius: var(--radius); font-size: 0.74rem; outline: none;
  cursor: pointer; transition: border-color 0.2s; font-family: var(--font-body);
}
.role-select:focus { border-color: var(--gold); }
.role-select:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm {
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  padding: 4px 9px; border-radius: var(--radius); font-size: 0.73rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s; font-family: var(--font-body);
}
.btn-sm.del-user:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.btn-sm.pwd-btn { margin-left: auto; }
.btn-sm.pwd-btn:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--muted); }
.empty-state p { font-size: 0.86rem; }

/* ══════════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 24px; width: 100%; max-width: 540px;
  transform: translateY(14px) scale(0.98); transition: transform 0.2s;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.65);
}
.modal-overlay.open .modal { transform: none; }
.modal::before {
  content: ''; display: block; height: 3px; margin: -24px -24px 20px;
  background: var(--gold); border-radius: var(--radius) var(--radius) 0 0;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-header h2 { font-size: 0.97rem; font-weight: 700; }
.modal-close {
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  width: 26px; height: 26px; border-radius: var(--radius); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center; transition: all 0.18s;
  font-family: var(--font-body);
}
.modal-close:hover { color: var(--text); border-color: var(--gold); }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.modal-group { display: flex; flex-direction: column; gap: 4px; }
.modal-group.full { grid-column: 1/-1; }
.modal-group label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.modal-group input,
.modal-group select,
.modal-group textarea {
  background: var(--surface0); border: 1px solid var(--border); color: var(--text);
  padding: 8px 11px; border-radius: var(--radius); font-size: 0.86rem; outline: none;
  font-family: var(--font-body); transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.modal-group input:focus,
.modal-group select:focus,
.modal-group textarea:focus {
  border-color: var(--gold);
}
.modal-group textarea { resize: none; height: 68px; }
.field-error { font-size: 0.67rem; color: var(--red); display: none; }
.field-error.visible { display: block; }
.field-hint  { font-size: 0.67rem; color: var(--muted); }
.priority-row { display: flex; align-items: center; }
.priority-checkbox {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 0.84rem; color: var(--text2);
}
.priority-checkbox input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--red); cursor: pointer; }
.modal-footer { display: flex; gap: 9px; margin-top: 18px; }
.btn-save {
  flex: 1; background: var(--gold); color: #0a0a0a; border: none;
  padding: 10px; border-radius: var(--radius); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s, opacity 0.2s;
  box-shadow: 0 4px 12px var(--gold-glow);
  font-family: var(--font-title); text-transform: uppercase; letter-spacing: 0.03em;
}
.btn-save:hover    { background: var(--gold-hover); }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-cancel {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text2);
  padding: 10px 16px; border-radius: var(--radius); font-size: 0.86rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
}
.btn-cancel:hover { color: var(--text); border-color: var(--gold); }

/* ══════════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed; top: 22px; right: 22px;
  transform: translateX(calc(100% + 22px));
  display: inline-flex; align-items: center; gap: 9px;
  background: #111111; border: 1px solid var(--border2); border-left: 3px solid var(--gold);
  color: var(--text); font-family: var(--font-code);
  padding: 9px 20px; border-radius: var(--radius); font-size: 0.82rem; font-weight: 600;
  z-index: 100; transition: transform 0.26s ease; pointer-events: none; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-width: calc(100vw - 44px);
}
.toast.show { transform: translateX(0); }
@media (max-width: 480px) {
  .toast {
    left: 12px; right: 12px; top: 12px;
    transform: translateY(-140%); white-space: normal;
  }
  .toast.show { transform: translateY(0); }
}
.toast-icon { display: inline-flex; flex-shrink: 0; }
.toast-icon .icon { display: block; }
.toast.toast-success .toast-icon { color: var(--green); }
.toast.toast-error   .toast-icon { color: var(--red); }
.toast.toast-warning .toast-icon { color: var(--yellow); }
.toast.toast-info     .toast-icon,
.toast.toast-edit     .toast-icon,
.toast.toast-comment  .toast-icon,
.toast.toast-attach   .toast-icon,
.toast.toast-key      .toast-icon,
.toast.toast-undo     .toast-icon { color: var(--gold); }
.toast.toast-muted   .toast-icon { color: var(--muted); }

/* ══════════════════════════════════════════════════════════════
   ICONOS — sistema único (ver icons.js)
══════════════════════════════════════════════════════════════ */
.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.icon-inline { display: inline-flex; align-items: center; gap: 6px; }

/* Colores semánticos reutilizables sobre currentColor */
.icon-danger  { color: var(--red); }
.icon-gold    { color: var(--gold); }

/* Prioridad de tareas/proyectos */
.priority-alta  { color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════════════ */
.login-layout {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: var(--surface0);
}

/* ── Fondo: patrón de rejilla + resplandor dorado central ── */
.login-bg-pattern {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.25;
}
.login-bg-glow {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 600px; height: 600px; max-width: 90vw; max-height: 90vw;
  background: var(--gold); opacity: 0.05; border-radius: 50%;
  filter: blur(100px); pointer-events: none; z-index: 0;
}

/* ── Encabezado de marca, centrado sobre la tarjeta ── */
.login-form-panel {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  width: 100%; padding: 40px 24px;
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-header-mark {
  font-family: var(--font-title); color: var(--gold);
  font-size: 2rem; letter-spacing: 0.18em; line-height: 1;
  text-transform: uppercase;
}
.login-header-sub {
  font-family: var(--font-code); color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.15em;
  font-size: 0.68rem; margin-top: 8px;
}

.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.login-card-title { font-size: 1.45rem; font-weight: 800; margin-bottom: 5px; }
.login-card-sub   { font-size: 0.83rem; color: var(--text2); margin-bottom: 26px; }

/* ── Tabs ── */
.login-tabs {
  display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3px; gap: 3px; margin-bottom: 26px;
}
.login-tab {
  flex: 1; padding: 8px; border-radius: var(--radius); border: none;
  background: none; color: var(--text2); font-size: 0.83rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
}
.login-tab.active { background: var(--gold); color: #0a0a0a; box-shadow: 0 2px 8px var(--gold-glow); }

/* ── Auth forms ── */
.auth-form         { display: none; flex-direction: column; gap: 13px; }
.auth-form.active  { display: flex; }

.form-group        { display: flex; flex-direction: column; gap: 4px; }
.form-group label  {
  font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.form-group input  {
  background: var(--surface0); border: 1px solid var(--border); color: var(--text);
  padding: 10px 13px; border-radius: var(--radius); font-size: 0.88rem; outline: none;
  font-family: var(--font-body); transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.form-group input:focus { border-color: var(--gold); }
.form-group input.error { border-color: var(--red); }

.form-error        { font-size: 0.7rem; color: var(--red); display: none; }
.form-error.show   { display: block; }

.login-alert   {
  background: var(--red-soft); border: 1px solid var(--red);
  color: var(--red); padding: 9px 13px; border-radius: var(--radius);
  font-size: 0.82rem; display: none;
}
.login-alert.show { display: block; }
.login-success {
  background: var(--green-soft); border: 1px solid var(--green);
  color: var(--green); padding: 9px 13px; border-radius: var(--radius);
  font-size: 0.82rem; display: none;
}
.login-success.show { display: block; }

.btn-login {
  width: 100%; background: var(--gold); color: #0a0a0a; border: none;
  padding: 12px; border-radius: var(--radius); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s, opacity 0.2s;
  box-shadow: 0 4px 18px var(--gold-glow);
  font-family: var(--font-title); text-transform: uppercase; letter-spacing: 0.03em;
  margin-top: 3px;
}
.btn-login:hover    { background: var(--gold-hover); }
.btn-login:disabled { opacity: 0.55; cursor: not-allowed; }

.login-footer { text-align: center; margin-top: 18px; font-size: 0.77rem; color: var(--muted); }
.login-footer a { color: var(--gold); text-decoration: none; }


.password-strength { height: 3px; border-radius: var(--radius); margin-top: 5px; transition: all 0.3s; }
.pwd-weak   { background: var(--red);    width: 33%; }
.pwd-medium { background: var(--yellow); width: 66%; }
.pwd-strong { background: var(--green);  width: 100%; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .login-form-panel { padding: 32px 20px; }
}

@media (max-width: 740px) {
  .sidebar { display: none; }
  .topbar  { padding: 10px 14px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); padding: 14px 14px 2px; gap: 10px; }
  .content     { padding: 12px; }
  .search-wrap input { width: 130px; }
  .users-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .modal { padding: 18px; }
  .modal-grid { grid-template-columns: 1fr; }
  .login-form-panel { padding: 24px 14px; }
  .login-header-mark { font-size: 1.6rem; }
}

/* ══════════════════════════════════════════════════════════════
   MODAL: RECORDATORIO
══════════════════════════════════════════════════════════════ */
.reminder-task-name {
  font-size: 0.85rem; font-weight: 700; color: var(--gold);
  margin-bottom: 14px; padding: 8px 12px;
  background: var(--gold-soft); border-radius: var(--radius);
}
.reminder-options    { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.reminder-option-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); padding: 10px 14px; border-radius: var(--radius);
  font-size: 0.86rem; font-weight: 500; cursor: pointer; text-align: left;
  transition: all 0.18s; font-family: var(--font-body);
}
.reminder-option-btn:hover { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.reminder-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.7rem; color: var(--muted); margin: 6px 0;
}
.reminder-divider::before,
.reminder-divider::after { content:''; flex:1; height:1px; background: var(--border); }
.reminder-custom-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.reminder-custom-row input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 8px 11px; border-radius: var(--radius); font-size: 0.86rem; outline: none;
  font-family: var(--font-body); transition: border-color 0.2s;
}
.reminder-custom-row input:focus { border-color: var(--gold); }
.btn-remove-reminder {
  width: 100%; background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 8px; border-radius: var(--radius); font-size: 0.8rem; cursor: pointer;
  transition: all 0.18s; font-family: var(--font-body); margin-top: 4px;
}
.btn-remove-reminder:hover { color: var(--red); border-color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   PANEL DE DETALLE — slide-in desde la derecha
══════════════════════════════════════════════════════════════ */
.detail-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 40; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.detail-overlay.open { opacity: 1; pointer-events: all; }

.detail-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border2);
  z-index: 45; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
}
.detail-panel.open { transform: translateX(0); }

/* ── Header ── */
.detail-header {
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  background: var(--surface2);
}
.detail-header-title {
  flex: 1; font-size: 0.96rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-header-btn {
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text2); padding: 5px 12px; border-radius: var(--radius);
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: all 0.18s; font-family: var(--font-body); flex-shrink: 0;
}
.detail-header-btn:hover    { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.detail-header-btn.close-btn:hover { border-color: var(--border2); color: var(--text); background: var(--surface3); }

/* ── Body ── */
.detail-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 20px;
}
.detail-body::-webkit-scrollbar { width: 3px; }
.detail-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: var(--radius); }

/* ── Info grid ── */
.detail-info-grid { display: flex; flex-direction: column; gap: 6px; }
.detail-info-row  {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 0.82rem; padding: 5px 0; border-bottom: 1px solid var(--border);
}
.detail-info-row.full { flex-direction: column; gap: 4px; }
.di-label { color: var(--muted); font-size: 0.72rem; min-width: 80px; flex-shrink: 0; }
.di-val   { color: var(--text); font-weight: 500; }

/* ── Sección ── */
.detail-section-title {
  font-size: 0.68rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.6px; display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.detail-section-title::after { content:''; flex:1; height:1px; background:var(--border); }

/* ── Documento (editor por bloques) ── */
.doc-save-status { font-size: 0.62rem; color: var(--muted); font-style: italic; text-transform: none; letter-spacing: 0; }

.doc-toolbar {
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 5px; margin-bottom: 8px;
}
.doc-tb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }
.doc-tb-btn {
  width: 26px; height: 26px; border-radius: var(--radius); flex-shrink: 0;
  background: none; border: none; color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
}
.doc-tb-btn:hover { background: var(--surface3); color: var(--gold); }

.doc-blocks { display: flex; flex-direction: column; gap: 1px; margin-bottom: 14px; }
.doc-block {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 4px 4px 4px 2px; border-radius: var(--radius); position: relative;
}
.doc-block:hover { background: var(--surface2); }
.doc-block-text {
  flex: 1; min-width: 0; outline: none; font-size: 0.84rem; color: var(--text);
  line-height: 1.55; font-family: var(--font-body); padding: 2px 0; word-wrap: break-word;
}
.doc-block-text:empty::before { content: attr(data-placeholder); color: var(--muted); }
.doc-block-text strong { font-weight: 700; color: var(--text); }
.doc-block-text em { font-style: italic; }

.doc-block-heading .doc-block-text { font-size: 1.05rem; font-weight: 700; color: var(--text); padding: 4px 0; }

.doc-block-bullet .doc-bullet-mark,
.doc-block-checklist .doc-check-mark {
  flex-shrink: 0; margin-top: 6px;
}
.doc-bullet-mark { color: var(--gold); font-size: 1rem; line-height: 1; width: 14px; text-align: center; }
.doc-check-mark { width: 15px; height: 15px; accent-color: var(--gold); cursor: pointer; }
.doc-block-checked .doc-block-text { color: var(--muted); text-decoration: line-through; }

.doc-block-divider { align-items: center; padding: 8px 2px; }
.doc-divider-line { flex: 1; border: none; height: 1px; background: var(--border); margin: 0; }

.doc-block-del {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: var(--radius); margin-top: 2px;
  background: none; border: none; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.doc-block:hover .doc-block-del { opacity: 1; }
.doc-block-del:hover { background: var(--red-soft); color: var(--red); }

/* ── Observaciones ── */
.notes-empty { font-size: 0.8rem; color: var(--muted); text-align: center; padding: 12px 0; }

.note-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 13px; margin-bottom: 8px;
}
.note-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 7px;
}
.note-avatar {
  width: 26px; height: 26px; border-radius: var(--radius); flex-shrink: 0;
  background: var(--gold); color: #0a0a0a; font-size: 0.6rem;
  font-weight: 800; font-family: var(--font-code);
  display: flex; align-items: center; justify-content: center;
}
.note-meta   { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.note-author { font-size: 0.78rem; font-weight: 700; }
.note-time   { font-size: 0.68rem; color: var(--muted); }
.note-del    {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.75rem; padding: 2px 5px; border-radius: var(--radius);
  transition: color 0.18s, background 0.18s;
}
.note-del:hover { color: var(--red); background: var(--red-soft); }
.note-content { font-size: 0.82rem; color: var(--text2); line-height: 1.55; }

/* ── Add note form ── */
.add-note-wrap { display: flex; flex-direction: column; gap: 7px; }
.add-note-wrap textarea {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: var(--radius); font-size: 0.84rem; outline: none;
  font-family: var(--font-body); resize: none; height: 72px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.add-note-wrap textarea:focus { border-color: var(--gold); }
.add-note-wrap textarea::placeholder { color: var(--muted); }
.btn-add-note {
  align-self: flex-end; background: var(--gold); color: #0a0a0a;
  border: none; padding: 7px 18px; border-radius: var(--radius);
  font-size: 0.84rem; font-weight: 700; cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font-title); text-transform: uppercase; letter-spacing: 0.03em;
}
.btn-add-note:hover    { background: var(--gold-hover); }
.btn-add-note:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Archivos ── */
.files-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.file-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column;
  gap: 5px; align-items: center; position: relative; transition: border-color 0.18s;
}
.file-item:hover { border-color: var(--gold-soft); }
.file-preview { cursor: pointer; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 56px; }
.file-thumb   { width: 100%; height: 56px; object-fit: cover; border-radius: var(--radius); }
.file-icon-wrap { font-size: 2rem; }
.file-info    { width: 100%; text-align: center; }
.file-name    { font-size: 0.65rem; color: var(--text2); word-break: break-all; line-height: 1.3; }
.file-meta    { font-size: 0.6rem; color: var(--muted); }
.file-del     {
  position: absolute; top: 3px; right: 3px;
  background: var(--red-soft); border: none; color: var(--red);
  width: 18px; height: 18px; border-radius: var(--radius); font-size: 0.6rem;
  cursor: pointer; display: none; align-items: center; justify-content: center;
}
.file-item:hover .file-del { display: flex; }
.file-add-btn {
  background: var(--surface3); border: 1px dashed var(--border2);
  border-radius: var(--radius); padding: 8px; cursor: pointer; min-height: 90px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--muted); transition: all 0.18s;
}
.file-add-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }

.upload-status {
  font-size: 0.75rem; color: var(--text2); text-align: center;
  min-height: 18px; margin-top: 2px;
}

@media (max-width: 480px) {
  .detail-panel { width: 100vw; }
}

/* ══════════════════════════════════════════════════════════════
   MÓVIL — Navegación inferior + FAB
   Breakpoint: max-width 740px
══════════════════════════════════════════════════════════════ */

/* ── Esconder cosas de escritorio en móvil ── */
@media (max-width: 740px) {
  .sidebar           { display: none !important; }

  /* Los <select> de filtro (cliente/tipo/categoría/prioridad) ya tienen su
     propio cajón de filtros móvil — se ocultan aquí para no duplicarlos.
     Pero los BOTONES de acción (Importar, Añadir enlace/imagen, vista de
     tabla, columnas) no tienen ningún otro sitio desde el que activarse en
     móvil, así que el contenedor se muestra y solo se ocultan los <select>
     y el botón de prioridad (que sí tiene equivalente en el cajón). */
  .topbar-filters    { display: flex; flex-wrap: wrap; width: 100%; gap: 6px; margin-top: 2px; }
  .topbar-filters .filter-select { display: none; }
  #priorityToggle    { display: none; }           /* duplicado del botón del cajón de filtros móvil */

  /* Ya no hay barra inferior fija (ahora es un menú hamburguesa), pero
     dejamos algo de aire para que el FAB flotante no tape el último
     elemento de cada lista. */
  .main              { padding-bottom: 0; }
  .view              { padding-bottom: 84px; }

  /* Topbar compacto */
  .topbar {
    padding: 10px 14px; gap: 8px;
    flex-wrap: wrap;
  }
  .topbar h1         { font-size: 0.9rem; }
  .search-wrap input { width: 100%; font-size: 0.8rem; }
  .search-wrap       { flex: 1; }

  /* Content */
  .content           { padding: 12px 14px; }

  /* Users grid: 1 columna */
  .users-grid        { grid-template-columns: 1fr; }

  /* Modal más ajustado */
  .modal             { padding: 18px; }
  .modal-grid        { grid-template-columns: 1fr; }

  /* Panel detalle: ancho completo */
  .detail-panel      { width: 100vw; }
}

/* ── Menú hamburguesa (móvil) ──────────────────────────────────
   Sustituye a la antigua barra inferior de 5 iconos + botón "Más": un
   único botón fijo abre un panel lateral con todas las secciones. Más
   minimalista (un solo punto de navegación en vez de dos) y deja toda
   la pantalla libre para el contenido. */
.mnav-badge {
  background: var(--red); color: #fff;
  font-size: 0.55rem; font-weight: 800;
  min-width: 15px; height: 15px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.mobile-hamburger-btn {
  display: none;
}
@media (max-width: 740px) {
  .mobile-hamburger-btn {
    display: flex; position: fixed; top: 12px; left: 12px; z-index: 40;
    align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    -webkit-tap-highlight-color: transparent;
  }
  /* Espacio en el topbar de cada vista para que el título no quede
     debajo del botón hamburguesa fijo. */
  .topbar { padding-left: 60px; }
}
.hamburger-icon {
  position: relative; width: 18px; height: 13px;
}
.hamburger-icon span {
  position: absolute; left: 0; width: 100%; height: 2px; border-radius: var(--radius);
  background: currentColor; transition: transform 0.2s, opacity 0.2s;
}
.hamburger-icon span:nth-child(1) { top: 0; }
.hamburger-icon span:nth-child(2) { top: 50%; margin-top: -1px; }
.hamburger-icon span:nth-child(3) { bottom: 0; }
.mobile-hamburger-btn[aria-expanded="true"] .hamburger-icon span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.mobile-hamburger-btn[aria-expanded="true"] .hamburger-icon span:nth-child(2) { opacity: 0; }
.mobile-hamburger-btn[aria-expanded="true"] .hamburger-icon span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.hamburger-badge { position: absolute; top: 2px; right: 2px; }

.mobile-nav-backdrop {
  display: none;
}
@media (max-width: 740px) {
  .mobile-nav-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 41; opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
  }
  .mobile-nav-backdrop.open { opacity: 1; pointer-events: all; }
}

.mobile-nav-drawer {
  display: none;
}
@media (max-width: 740px) {
  .mobile-nav-drawer {
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 82vw; max-width: 300px;
    background: var(--surface); border-right: 1px solid var(--border);
    z-index: 42; transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,0.4);
  }
  .mobile-nav-drawer.open { transform: translateX(0); }
}
.mobile-nav-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  /* safe area para iPhone con notch */
  padding-top: max(16px, env(safe-area-inset-top));
}
.mobile-nav-drawer-brand { display: flex; align-items: center; gap: 8px; }
.mobile-nav-drawer-brand-name { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.mobile-nav-close-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-drawer-body {
  flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.mobile-nav-drawer-body .mobile-more-item.active {
  background: var(--gold-soft); border-color: var(--gold); color: var(--gold);
}
.mobile-nav-drawer-body .mobile-more-item.active svg { color: var(--gold); }
/* Bloquea el scroll del fondo mientras el panel está abierto */
body.mobile-nav-open { overflow: hidden; }

/* ── FAB — Botón flotante de acción ── */
.mobile-fab {
  display: none;
}
@media (max-width: 740px) {
  .mobile-fab {
    display: flex;
    position: fixed; bottom: 18px; right: 18px;
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--gold); color: #0a0a0a;
    border: none; font-size: 1.8rem; font-weight: 300; line-height: 1;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 20px var(--gold-glow), 0 2px 8px rgba(0,0,0,0.4);
    cursor: pointer; z-index: 34;
    transition: transform 0.18s, box-shadow 0.18s;
    -webkit-tap-highlight-color: transparent;
    /* safe area para iPhone con home indicator */
    margin-bottom: env(safe-area-inset-bottom, 0);
  }
  .mobile-fab:active { transform: scale(0.93); box-shadow: 0 2px 10px var(--gold-glow); }
}

/* ── Botón de filtros móvil ── */
.mobile-filter-btn {
  display: none;
}
@media (max-width: 740px) {
  .mobile-filter-btn {
    display: flex; align-items: center; gap: 5px;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text2); padding: 6px 12px; border-radius: var(--radius);
    font-size: 0.79rem; font-weight: 600; cursor: pointer;
    font-family: var(--font-body); flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-filter-btn.active {
    background: var(--gold-soft); border-color: var(--gold); color: var(--gold);
  }
}

/* ── Cajón de filtros móvil ── */
.mobile-filter-drawer {
  display: none;
  position: fixed; bottom: 64px; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border2);
  padding: 14px; z-index: 33;
  flex-direction: column; gap: 10px;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
  animation: slideUp 0.2s ease;
}
.mobile-filter-drawer.open { display: flex; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.mobile-filter-drawer select {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: var(--radius); font-size: 0.85rem; outline: none;
  font-family: var(--font-body); width: 100%;
}
.mobile-filter-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

/* ── Menú "Más" móvil (secciones sin hueco en la barra inferior) ── */
.mobile-more-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 12px 14px; border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 600; font-family: var(--font-body);
  cursor: pointer; text-align: left; width: 100%;
  min-height: 44px; /* objetivo táctil mínimo */
}
.mobile-more-item:active { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.mobile-more-item svg { flex-shrink: 0; color: var(--gold); }

/* Variante de peligro — cerrar sesión en el menú móvil */
.mobile-more-item-danger { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.mobile-more-item-danger svg { color: var(--red); }
.mobile-more-item-danger:active { background: var(--red-soft); border-color: var(--red); color: var(--red); opacity: 0.8; }

/* Encabezados de grupo dentro del menú "Más" — "Funciones con IA" / "Archivo" */
.mobile-more-group-label {
  font-size: 0.7rem; color: var(--gold); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.mobile-more-group-label-2 { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); }

/* Badge inline (no absoluto) para el contador dentro de un .mobile-more-item */
.mobile-more-badge { position: static; margin-left: auto; }

.mobile-more-labels-block { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }
.mobile-more-labels-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.7rem; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.mobile-more-labels-head .nav-label-add-btn { width: 26px; height: 26px; font-size: 0.9rem; }
.mobile-more-labels-list { display: flex; flex-direction: column; gap: 6px; max-height: 30vh; overflow-y: auto; }
.mobile-more-label-item {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 12px; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600; font-family: var(--font-body);
  cursor: pointer; text-align: left; width: 100%; min-height: 40px;
}
.mobile-more-label-item:active { background: var(--gold-soft); border-color: var(--gold); }
.mobile-more-label-item .nav-label-dot { flex-shrink: 0; }
.mobile-more-label-item .nav-count { margin-left: auto; color: var(--muted); font-size: 0.75rem; }
.mobile-more-labels-empty { font-size: 0.78rem; color: var(--muted); padding: 4px 2px; }

/* ══════════════════════════════════════════════════════════════
   TASK GROUPS — Acordeón colapsable
══════════════════════════════════════════════════════════════ */

/* ── Reescribir header para que sea interactivo ── */
.task-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; margin-top: 6px;
  border-radius: var(--radius); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.18s;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.task-group-header:first-child { margin-top: 0; }
.task-group-header:hover   { background: var(--surface2); border-color: var(--gold-soft); }
.task-group-header:active  { background: var(--gold-soft); }

.task-group-icon  { display: inline-flex; color: var(--gold); flex-shrink: 0; }
.task-group-name  {
  font-size: 0.88rem; font-weight: 700; color: var(--gold); flex: 1;
  font-family: var(--font-code);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-group-meta  { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Chevron ── */
.task-group-chevron {
  font-size: 1.1rem; color: var(--muted); flex-shrink: 0;
  display: inline-block;
  transform: rotate(90deg);  /* › apunta abajo = expandido */
  transition: transform 0.22s ease, color 0.15s;
  line-height: 1;
}
.task-group-chevron.rotated {
  transform: rotate(0deg);   /* › apunta derecha = colapsado */
  color: var(--muted);
}
.task-group-header:hover .task-group-chevron { color: var(--gold); }

/* ── Contenido del grupo — misma cuadrícula que Proyectos ── */
.task-group-cards {
  display: none; /* colapsado por defecto si no tiene .expanded */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 6px 0 14px 0;
  overflow: hidden;
}
.task-group-cards.expanded {
  display: grid;
  animation: groupFadeIn 0.2s ease;
}
@keyframes groupFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Badges ── */
.task-group-badge {
  font-size: 0.6rem; font-weight: 700; padding: 2px 7px;
  border-radius: var(--radius); text-transform: uppercase; letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-pending { background: var(--yellow-soft); color: var(--yellow); }
.badge-done    { background: var(--green-soft);  color: var(--green); }
.badge-deleted { background: var(--red-soft);    color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   ARCHIVO — Carpeta "Finalizados" (proyectos + tareas archivados)
══════════════════════════════════════════════════════════════ */

.archive-group { margin-bottom: 8px; }

/* La cabecera de grupo no es interactiva aquí (no colapsa) */
.archive-group-header { cursor: default; flex-wrap: wrap; }
.archive-group-header:hover  { background: var(--surface); border-color: var(--border); }
.archive-group-header:active { background: var(--surface); }
.archive-group-client { font-weight: 400; color: var(--muted); font-family: var(--font-body); }

.archive-section-label {
  font-size: 0.8rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px;
  margin: 18px 0 10px; padding-top: 6px; border-top: 1px solid var(--border);
}
.archive-section-label:first-child { border-top: none; margin-top: 0; }

/* ══════════════════════════════════════════════════════════════
   ETIQUETAS — Agrupar proyectos en el sidebar
══════════════════════════════════════════════════════════════ */

/* ── Botón "+" junto al título de sección ── */
.nav-label-add-btn {
  width: 16px; height: 16px; border-radius: var(--radius); flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; line-height: 1; cursor: pointer; padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-label-add-btn:hover { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-soft); }

.labels-nav-list { display: flex; flex-direction: column; gap: 2px; }
.labels-empty {
  font-size: 0.72rem; color: var(--muted); padding: 6px 10px 10px;
  font-family: var(--font-body);
}

/* ── Fila de una etiqueta en el sidebar (reutiliza .nav-item) ── */
.nav-item-label .nav-item-row { position: relative; }
.nav-label-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--surface0);
}
.label-del-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: var(--radius); color: var(--muted);
  opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.nav-item-label:hover .label-del-btn { opacity: 1; }
.label-del-btn:hover { background: var(--red-soft); color: var(--red); }

/* ── Chips de etiquetas en la tarjeta de proyecto ── */
.pc-label-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.label-chip {
  --label-color: var(--gold);
  font-size: 0.63rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius);
  color: var(--label-color); background: color-mix(in srgb, var(--label-color) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--label-color) 40%, transparent);
  white-space: nowrap;
}

/* ── Modal: elegir etiquetas para un proyecto ── */
.label-picker-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; margin-bottom: 12px; }
.label-picker-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 6px;
  border-radius: var(--radius); cursor: pointer; transition: background 0.15s;
}
.label-picker-row:hover { background: var(--surface2); }
.label-picker-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--gold); flex-shrink: 0; }
.label-picker-name { font-size: 0.83rem; color: var(--text); flex: 1; }
.label-picker-new { display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.label-picker-new input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: var(--radius); font-size: 0.83rem; outline: none; font-family: var(--font-body);
}
.label-picker-new input:focus { border-color: var(--gold-soft); }

/* ══════════════════════════════════════════════════════════════
   NOTAS DE REUNIÓN (IA)
══════════════════════════════════════════════════════════════ */
.meetings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px; align-items: start;
}
.meeting-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer; transition: border-color 0.15s, transform 0.15s;
}
.meeting-card:hover { border-color: var(--gold); }
.meeting-card:active { transform: scale(0.99); }
.meeting-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.meeting-card-header { display: flex; align-items: center; gap: 8px; }
.meeting-card-header h3 { font-size: 0.92rem; font-weight: 700; color: var(--text); margin: 0; }
.meeting-card-icon { color: var(--gold); flex-shrink: 0; }
.meeting-card-date { font-size: 0.68rem; color: var(--muted); }
.meeting-card-project {
  align-self: flex-start; font-size: 0.68rem; font-weight: 600; color: var(--gold);
  background: var(--gold-soft); border-radius: var(--radius); padding: 2px 9px;
}
.meeting-card-summary {
  font-size: 0.8rem; color: var(--text2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.meeting-card-footer {
  font-size: 0.7rem; color: var(--muted); margin-top: 2px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.meeting-card-reminder { color: var(--gold); font-weight: 600; }

/* Estado completada/pendiente (ND | Notes) — mismo patrón visual que las tareas */
.meeting-card.tc-done { opacity: 0.55; }
.meeting-card.tc-done .meeting-card-header h3 { text-decoration: line-through; }
.meeting-card .tc-bottom { margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--border); }
.meeting-card-status { font-size: 0.68rem; color: var(--muted); font-weight: 600; margin-left: auto; }

/* ── Nota tipo Audio: reproductor dentro de la tarjeta/detalle ── */
.meeting-card-audio { width: 100%; height: 34px; margin: 2px 0; }
.meeting-card-audio, #meetingDetailAudio { border-radius: var(--radius); }

/* ── Nota tipo Lista: checklist como cuerpo de la tarjeta/detalle ── */
.checklist-preview { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.checklist-preview li { font-size: 0.8rem; color: var(--text2); }
.checklist-preview li label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.checklist-preview li.done label span { text-decoration: line-through; color: var(--muted); }
.checklist-preview li.checklist-more { color: var(--muted); font-size: 0.72rem; padding-left: 24px; }
.checklist-preview input[type="checkbox"] { margin-top: 2px; accent-color: var(--gold); width: 16px; height: 16px; flex-shrink: 0; }

/* ── Editor de checklist (modal de creación y detalle) ── */
.checklist-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.checklist-editor-row { display: flex; align-items: center; gap: 8px; }
.checklist-editor-row input[type="text"] {
  flex: 1; background: var(--surface0); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 9px 10px; font-size: 0.85rem; font-family: var(--font-body);
}
.checklist-editor-row input[type="text"]:focus { border-color: var(--gold); }
#meetingDetailChecklist.checklist-editor { gap: 6px; }
#meetingDetailChecklist .checklist-editor-row, #meetingDetailChecklist label.checklist-editor-row {
  display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text2); cursor: pointer;
}
#meetingDetailChecklist input[type="checkbox"] { accent-color: var(--gold); width: 16px; height: 16px; flex-shrink: 0; }

/* Fila de un elemento en el detalle: la etiqueta (check + texto) ocupa el
   espacio disponible, el botón de eliminar queda pegado a la derecha. */
.checklist-detail-row { display: flex; align-items: center; gap: 8px; }
.checklist-detail-row .checklist-editor-row { flex: 1; min-width: 0; }
.checklist-empty-hint { font-size: 0.8rem; color: var(--muted); margin: 2px 0 4px; }
.checklist-add-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.checklist-add-row input[type="text"] {
  flex: 1; background: var(--surface0); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 9px 10px; font-size: 0.85rem; font-family: var(--font-body);
}
.checklist-add-row input[type="text"]:focus { border-color: var(--gold); }

/* ── Nota tipo Dibujo: lienzo libre ── */
.drawing-canvas-wrap {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: #fff; touch-action: none; line-height: 0;
}
#drawingCanvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }

/* ── Nota tipo Audio: grabador ── */
.audio-recorder { display: flex; align-items: center; gap: 12px; }
.btn-record {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 16px; min-height: 44px; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600; cursor: pointer; font-family: var(--font-body);
  transition: border-color 0.15s, color 0.15s;
}
.btn-record:hover { border-color: var(--gold); }
.audio-record-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex-shrink: 0; }
.btn-record.recording { border-color: var(--red); color: var(--red); }
.btn-record.recording .audio-record-dot { animation: audio-record-pulse 1.1s ease-in-out infinite; }
@keyframes audio-record-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.audio-record-timer { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ══════════════════════════════════════════════════════════════
   CITAS (solicitudes recibidas desde NEXO Web)
══════════════════════════════════════════════════════════════ */
.citas-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px; align-items: start;
}
.cita-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.cita-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cita-fecha { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.cita-card-body { display: flex; flex-direction: column; gap: 3px; }
.cita-nombre { font-size: 0.92rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cita-contacto { font-size: 0.78rem; color: var(--text2); }
.cita-notas { font-size: 0.78rem; color: var(--muted); line-height: 1.4; margin-top: 4px; }
.cita-card-actions { display: flex; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.cita-btn-confirm:hover { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.cita-btn-reject:hover  { color: var(--red);   border-color: var(--red);   background: var(--red-soft); }

.pill.cita-estado-nueva      { color: var(--gold);  background: var(--gold-soft);  border: 1px solid rgba(232,197,71,0.25); }
.pill.cita-estado-confirmada { color: var(--green); background: var(--green-soft); border: 1px solid rgba(82,183,136,0.25); }
.pill.cita-estado-rechazada  { color: var(--red);   background: var(--red-soft);   border: 1px solid rgba(255,180,171,0.25); }
.pill.cita-estado-completada { color: var(--muted); background: var(--surface3);   border: 1px solid var(--border2); }

/* ── Modal de detalle: reabrir / seguir anotando / recordatorio ── */
.meeting-detail-meta { font-size: 0.72rem; color: var(--muted); margin: -6px 0 12px; }
.meeting-detail-rawtext {
  max-height: 220px; overflow-y: auto; white-space: pre-wrap;
  font-size: 0.8rem; line-height: 1.55; color: var(--text2);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}

/* ── FAB — Botón flotante "Nueva nota de reunión" (visible solo dentro de esta vista, escritorio y móvil) ── */
.meeting-fab-wrap {
  position: fixed; bottom: 28px; right: 28px; z-index: 34;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.meeting-fab {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: var(--gold); color: #0a0a0a; border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px var(--gold-glow), 0 2px 8px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.meeting-fab:hover  { transform: scale(1.06); }
.meeting-fab:active { transform: scale(0.93); box-shadow: 0 2px 10px var(--gold-glow); }
.meeting-fab svg { transition: transform 0.18s; }
.meeting-fab-wrap.open .meeting-fab svg { transform: rotate(45deg); }

/* Menú de opciones (Imagen, Dibujo, Audio, Lista, Texto) — oculto hasta
   que se pulsa el FAB, aparece apilado justo encima con una transición
   corta. Objetivo táctil de 44px mínimo, mobile-first. */
.meeting-fab-menu {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  opacity: 0; transform: translateY(8px) scale(0.98);
  pointer-events: none; transition: opacity 0.15s, transform 0.15s;
}
.meeting-fab-wrap.open .meeting-fab-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.meeting-fab-option {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 14px 9px 10px; min-height: 44px; border-radius: var(--radius);
  font-size: 0.78rem; font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.28);
  transition: border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.meeting-fab-option:hover { border-color: var(--gold); color: var(--gold-light); }
.meeting-fab-option-icon { display: flex; color: var(--gold); flex-shrink: 0; }
@media (max-width: 740px) {
  /* En móvil ya existe el FAB único de la barra inferior (mobile-fab), que
     abre este mismo menú de captura rápida — se oculta el botón redondo
     propio para no duplicarlo, pero el menú de opciones se reposiciona
     para desplegarse justo encima del FAB móvil real. */
  .meeting-fab { display: none; }
  .meeting-fab-wrap { bottom: 18px; right: 18px; }
}

/* ── Modal: revisión de tareas propuestas (paso 2) ── */
.meeting-tasks-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.meeting-tasks-empty { font-size: 0.8rem; color: var(--muted); padding: 10px 2px; }
.meeting-task-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; transition: opacity 0.15s;
}
.meeting-task-row.is-off { opacity: 0.5; }
.meeting-task-toggle { display: flex; align-items: center; padding-top: 3px; }
.meeting-task-toggle input { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }
.meeting-task-fields { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.meeting-task-title {
  width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 7px 9px; border-radius: var(--radius); font-size: 0.82rem; outline: none; font-family: var(--font-body);
}
.meeting-task-title:focus { border-color: var(--gold-soft); }
.meeting-task-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.meeting-task-meta select, .meeting-task-meta input[type="date"] {
  background: var(--surface); border: 1px solid var(--border); color: var(--text2);
  padding: 5px 7px; border-radius: var(--radius); font-size: 0.72rem; outline: none; font-family: var(--font-body);
}

/* ── "¿Qué debo anotar?" — asistente NEXO en el paso 1 ── */
.meeting-assist-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px;
}
.btn-assist-nexo {
  background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  color: var(--gold); padding: 6px 12px; border-radius: var(--radius);
  font-size: 0.76rem; font-weight: 700; cursor: pointer;
  transition: background 0.18s, transform 0.12s; font-family: var(--font-body);
  flex-shrink: 0;
}
.btn-assist-nexo:hover     { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.btn-assist-nexo:active    { transform: scale(0.97); }
.btn-assist-nexo:disabled  { opacity: 0.6; cursor: default; transform: none; }

.meeting-assist-panel {
  margin-top: 10px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 12px;
}
.meeting-assist-block:not(:last-child) { padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.meeting-assist-title {
  font-size: 0.72rem; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 7px;
}
.meeting-assist-list { display: flex; flex-direction: column; gap: 6px; list-style: none; }
.meeting-assist-list li {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  font-size: 0.8rem; color: var(--text2); line-height: 1.4;
}
.assist-insert-btn {
  flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); color: var(--text2);
  padding: 3px 9px; border-radius: var(--radius); font-size: 0.68rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; font-family: var(--font-body);
}
.assist-insert-btn:hover { border-color: var(--gold-soft); color: var(--gold); }
.meeting-assist-empty, .meeting-assist-error { font-size: 0.8rem; color: var(--muted); margin: 0; }
.meeting-assist-error { color: var(--red); }

/* ── Panel de análisis de NEXO en el detalle de una nota (FAB) ──
   Se rellena dinámicamente: botón "Analizar con NEXO" si aún no se ha
   analizado, estado de carga mientras se llama a Gemini, o el resultado
   (resumen, ideas clave, siguientes pasos, tareas sugeridas y una mejora
   opcional) una vez listo. Mismo lenguaje visual que .meeting-assist-*. */
.meeting-nexo-panel:empty { display: none; }
.meeting-nexo-panel {
  margin: -4px 0 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 12px;
}
.meeting-nexo-loading { font-size: 0.8rem; color: var(--muted); margin: 0; }
.meeting-nexo-analyze-btn {
  align-self: flex-start; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  color: var(--gold); padding: 7px 13px; border-radius: var(--radius);
  font-size: 0.78rem; font-weight: 700; cursor: pointer;
  transition: background 0.18s, transform 0.12s; font-family: var(--font-body);
}
.meeting-nexo-analyze-btn:hover { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.meeting-nexo-analyze-btn:active { transform: scale(0.97); }
.meeting-nexo-block:not(:last-of-type) { padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.meeting-nexo-title {
  font-size: 0.72rem; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 7px;
}
.meeting-nexo-summary, .meeting-nexo-improvement { font-size: 0.82rem; color: var(--text2); line-height: 1.5; margin: 0; }
.meeting-nexo-list { display: flex; flex-direction: column; gap: 5px; list-style: none; margin: 0; padding: 0; }
.meeting-nexo-list li {
  font-size: 0.8rem; color: var(--text2); line-height: 1.4; padding-left: 14px; position: relative;
}
.meeting-nexo-list li::before {
  content: ''; position: absolute; left: 0; top: 0.55em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold);
}
.meeting-nexo-task-list { display: flex; flex-direction: column; gap: 6px; list-style: none; margin: 0; padding: 0; }
.meeting-nexo-task-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  font-size: 0.8rem; color: var(--text2); line-height: 1.4;
}
.meeting-nexo-task-row.is-added { opacity: 0.6; }
.meeting-nexo-task-meta { display: block; font-size: 0.68rem; color: var(--muted); margin-top: 1px; }
.meeting-nexo-reanalyze-btn {
  align-self: flex-start; background: none; border: none; color: var(--muted);
  font-size: 0.72rem; text-decoration: underline; cursor: pointer; padding: 0; font-family: var(--font-body);
}
.meeting-nexo-reanalyze-btn:hover { color: var(--gold); }

/* ══════════════════════════════════════════════════════════════
   IMPORTACIONES (CSV / Excel)
══════════════════════════════════════════════════════════════ */
.import-file-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.import-file-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  color: var(--gold); padding: 8px 14px; border-radius: var(--radius);
  font-size: 0.83rem; font-weight: 700; cursor: pointer;
  transition: background 0.18s; font-family: var(--font-body); flex-shrink: 0;
}
.import-file-btn:hover { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.import-file-name { font-size: 0.78rem; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.import-mapping-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px; margin: 12px 0;
}
.import-mapping-row { display: flex; flex-direction: column; gap: 4px; }
.import-mapping-row label { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.import-mapping-row select {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 7px 8px; border-radius: var(--radius); font-size: 0.78rem; outline: none; font-family: var(--font-body);
}
.import-mapping-row select:focus { border-color: var(--gold-soft); }

.import-preview-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); max-height: 240px; overflow-y: auto; }
.import-preview-table { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
.import-preview-table th, .import-preview-table td {
  padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.import-preview-table th { background: var(--surface2); color: var(--muted); font-weight: 700; position: sticky; top: 0; }
.import-preview-table td { color: var(--text2); }

.import-results { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.import-results-errors { max-height: 220px; overflow-y: auto; }
.import-error-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.import-error-list li {
  font-size: 0.76rem; color: var(--red); background: var(--red-soft);
  border-radius: var(--radius); padding: 6px 9px;
}

/* ══════════════════════════════════════════════════════════════
   BASES DE DATOS FLEXIBLES — toggle tarjetas/tabla, columnas, tabla
══════════════════════════════════════════════════════════════ */
.view-toggle {
  display: flex; background: var(--surface0); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2px; gap: 2px; flex-shrink: 0;
}
.view-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 26px; border: none; background: none; border-radius: var(--radius);
  color: var(--muted); cursor: pointer; transition: all 0.18s;
}
.view-toggle-btn:hover  { color: var(--text2); }
.view-toggle-btn.active { background: var(--gold-soft); color: var(--gold); }

.columns-dropdown-wrap { position: relative; flex-shrink: 0; }
.columns-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; min-width: 180px; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  flex-direction: column; gap: 2px;
}
.columns-dropdown.open { display: flex; }
.columns-dropdown-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 7px; border-radius: var(--radius);
  font-size: 0.8rem; color: var(--text2); cursor: pointer; transition: background 0.15s;
}
.columns-dropdown-row:hover { background: var(--surface2); }
.columns-dropdown-row input { width: 14px; height: 14px; accent-color: var(--gold); }

.table-scroll-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-table th, .data-table td {
  padding: 10px 14px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--surface2); color: var(--muted); font-weight: 700;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.3px;
  cursor: pointer; user-select: none; position: sticky; top: 0;
}
.data-table th:hover { color: var(--gold); }
.data-table tbody tr { cursor: pointer; transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--surface2); }
.data-table tbody tr.row-done { opacity: 0.6; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════
   RECORTADOR WEB (Web Clipper)
══════════════════════════════════════════════════════════════ */
.clip-howto {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px;
}
.clip-howto-title { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.clip-howto-text { font-size: 0.82rem; color: var(--text2); line-height: 1.5; margin: 0; }
.clip-bookmarklet {
  align-self: flex-start; cursor: grab; font-weight: 700;
}
.clip-bookmarklet:active { cursor: grabbing; }
.clip-source { font-size: 0.72rem; color: var(--muted); word-break: break-all; }
.clip-source a { color: var(--gold); text-decoration: none; }
.clip-source a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   ACCESIBILIDAD — Fixes Lighthouse
   Objetivo: pasar de 78 → 95+
══════════════════════════════════════════════════════════════ */

/* ── Foco visible (keyboard navigation) ──
   design.md — "2px solid border, no glow or outer shadow, crisp and technical".
   El outline sigue el radius propio de cada elemento (no se fuerza uno fijo). */
:focus-visible {
  outline: 2px solid var(--gold) !important;
  outline-offset: 2px !important;
}
/* Quitar outline por defecto solo cuando se usa ratón */
:focus:not(:focus-visible) { outline: none; }

/* ── Skip to content (accesibilidad teclado) ── */
.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 9999;
  background: var(--gold); color: #0a0a0a;
  padding: 8px 16px; border-radius: 0 0 var(--radius) var(--radius);
  font-size: 0.9rem; font-weight: 700;
  text-decoration: none; transition: top 0.15s;
}
.skip-link:focus { top: 0; }

/* ── Contraste suficiente para texto pequeño ── */
/* ── Contraste suficiente para texto pequeño ── */
.stat-lbl, .stat-pct, .nav-section-label, .note-time, .file-meta, .user-card-dates, .di-label { color: #909090; }

/* ══════════════════════════════════════════════════════════════
   GOOGLE CALENDAR — Botón y toast de acción
══════════════════════════════════════════════════════════════ */

/* ── Botón calendario en panel de detalle ── */
.btn-calendar {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); padding: 10px 14px; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: var(--font-body);
}
.btn-calendar:hover {
  background: var(--gold-soft);
  border-color: var(--gold); color: var(--gold-light);
}
.btn-calendar .cal-btn-icon { display: inline-flex; vertical-align: -3px; }
.detail-calendar-section {
  padding-top: 4px;
}

/* ── Toast con acción clickable ── */
.toast-action {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(110px);
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); padding: 10px 14px 10px 18px;
  border-radius: var(--radius); font-size: 0.83rem; font-weight: 500;
  z-index: 101; transition: transform 0.28s ease;
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
  display: flex; align-items: center; gap: 10px;
}
.toast-action.show {
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}
.toast-action-btn {
  background: var(--gold); color: #0a0a0a;
  border: none; padding: 5px 13px; border-radius: var(--radius);
  font-size: 0.78rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; font-family: var(--font-body);
  transition: background 0.18s;
  display: inline-flex; align-items: center; gap: 6px;
}
.toast-action-btn:hover { background: var(--gold-hover); }

/* En móvil, bien por encima de la bottom nav */
@media (max-width: 740px) {
  .toast-action {
    bottom: 80px;
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
    font-size: 0.8rem;
  }
  /* Estado oculto más pronunciado en móvil */
  .toast-action:not(.show) {
    transform: translateX(-50%) translateY(140px);
    pointer-events: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   CHAT IA — Asistente integrado
══════════════════════════════════════════════════════════════ */

/* ── Botón flotante del chat ──
   Separado del FAB de ND | Notes con un hueco fijo de 12px (94-82=12,
   meeting-fab ocupa right:28-82) para que nunca queden "acoplados". Se
   centra verticalmente con el FAB principal y es algo más pequeño/discreto
   (46px vs 54px) para marcar que es la acción secundaria — más minimalista. */
.chat-fab {
  position: fixed; bottom: 32px; right: 94px;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--border2);
  font-size: 1.2rem; cursor: pointer; z-index: 33;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.chat-fab:hover  { transform: scale(1.08); border-color: var(--gold); box-shadow: 0 6px 18px rgba(0,0,0,0.48); }
.chat-fab:active { transform: scale(0.94); }
/* Mientras el menú rápido de ND | Notes está abierto, el chat se atenúa y
   deja de ser interactivo — evita que el menú (más ancho que el FAB) quede
   visualmente montado sobre la burbuja de Nexo en cualquier resolución. */
.chat-fab.fab-dim { opacity: 0; pointer-events: none; transform: scale(0.85); }

@media (max-width: 740px) {
  /* En móvil, Nexo ya no es un botón flotante propio — vive dentro del
     menú hamburguesa (grupo "Funciones con IA"), para no acumular varios
     botones flotantes sueltos sobre el contenido. */
  .chat-fab { display: none; }
}

/* ── Overlay ── */
.chat-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 44; opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.chat-overlay.open { opacity: 1; pointer-events: all; }

/* ── Panel ── */
.chat-panel {
  position: fixed; bottom: 0; right: 0;
  width: 380px; height: 580px; max-height: 80vh; max-width: 100vw;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius) var(--radius) 0 0; z-index: 45;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}
.chat-panel.open { transform: translateY(0); }

@media (max-width: 740px) {
  .chat-panel { width: 100vw; height: 70vh; border-radius: var(--radius) var(--radius) 0 0; }
}

/* ── Header ── */
.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface2); flex-shrink: 0;
}
.chat-header-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.chat-avatar {
  width: 36px; height: 36px; border-radius: var(--radius);
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 1px solid var(--border2); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-title    { font-size: 0.88rem; font-weight: 700; }
.chat-subtitle { font-size: 0.65rem; color: var(--muted); }

.chat-header-actions { display: flex; gap: 6px; }
.chat-clear-btn,
.chat-close-btn {
  background: var(--surface3); border: 1px solid var(--border);
  color: var(--muted); width: 28px; height: 28px; border-radius: var(--radius);
  cursor: pointer; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s; font-family: var(--font-body);
}
.chat-clear-btn:hover { color: var(--yellow); border-color: var(--yellow); }
.chat-close-btn:hover { color: var(--text); border-color: var(--gold); }

/* ── Mensajes ── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border2); border-radius: var(--radius); }

.chat-msg           { display: flex; flex-direction: column; max-width: 88%; }
.chat-msg-user      { align-self: flex-end; align-items: flex-end; }
.chat-msg-assistant { align-self: flex-start; align-items: flex-start; }

.chat-bubble {
  padding: 9px 13px; border-radius: var(--radius);
  font-size: 0.83rem; line-height: 1.55;
}
.chat-msg-user      .chat-bubble { background: var(--gold); color: #0a0a0a; border-radius: var(--radius) var(--radius) var(--radius) var(--radius); }
.chat-msg-assistant .chat-bubble { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) var(--radius) var(--radius); }

.chat-time { font-size: 0.62rem; color: var(--muted); margin-top: 3px; padding: 0 4px; }

/* ── Typing indicator ── */
.chat-typing { display: flex; gap: 4px; align-items: center; padding: 10px 14px; }
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); display: block;
  animation: chatBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatBounce {
  0%,60%,100% { transform: translateY(0);    opacity: 0.4; }
  30%          { transform: translateY(-5px); opacity: 1; }
}

/* ── Input ── */
.chat-input-wrap {
  padding: 10px 12px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0;
  background: var(--surface2);
}
.chat-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 9px 12px; border-radius: var(--radius);
  font-size: 0.85rem; outline: none; resize: none; max-height: 120px;
  font-family: var(--font-body); line-height: 1.4;
  transition: border-color 0.2s;
}
.chat-input:focus       { border-color: var(--gold); }
.chat-input::placeholder{ color: var(--muted); }

.chat-send-btn {
  width: 38px; height: 38px; border-radius: var(--radius); flex-shrink: 0;
  background: var(--gold); color: #0a0a0a; border: none;
  font-size: 1.1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s, opacity 0.18s;
  font-family: var(--font-body);
}
.chat-send-btn:hover    { background: var(--gold-hover); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════
   TARJETAS MINIMALISTAS v2 — Sin pills de color, Notion-like
══════════════════════════════════════════════════════════════ */

/* ── Task Card — misma estructura que Project Card (tarjeta grande de cuadrícula) ── */

.task-card-min {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: background 0.15s, border-color 0.15s;
}
.task-card-min:hover         { background: var(--surface2); border-color: var(--border2); }
.task-card-min.tc-done       { opacity: 0.55; }
.task-card-min .tc-body      { padding: 18px; cursor: pointer; position: relative; }

.tc-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.tc-cat {
  font-size: 0.68rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; font-family: var(--font-code);
}
.tc-star { color: var(--gold); display: inline-flex; }

.task-card-min .tc-title {
  font-family: var(--font-title); font-size: 1.2rem; line-height: 1.2;
  color: var(--text); margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.task-card-min.tc-done .tc-title { text-decoration: line-through; color: var(--text2); }

.tc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tc-tag {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1px 8px; font-size: 0.66rem;
  color: var(--muted); letter-spacing: 0.2px; font-family: var(--font-code);
}

.tc-status-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  margin-bottom: 14px;
}
/* ── Pill de prioridad ── */
.tc-pill {
  border: 1px solid var(--border2); border-radius: var(--radius);
  padding: 1px 9px; font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px; font-family: var(--font-code);
}
.tc-pill.pill-prio-alta  { color: var(--red);   border-color: rgba(224,82,82,0.4); }
.tc-pill.pill-prio-media { color: var(--gold);  border-color: rgba(232,197,71,0.4); }
.tc-pill.pill-prio-baja  { color: var(--muted); border-color: var(--border2); }
.tc-due { font-size: 0.72rem; color: var(--muted); margin-left: auto; }

/* ── Badge de priorización dinámica (NEXO / IA) ── */
.tc-ai-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.62rem; font-weight: 700; color: var(--gold);
  background: var(--gold-soft); border: 1px solid rgba(232,197,71,0.4);
  border-radius: var(--radius); padding: 1px 8px 1px 6px;
  letter-spacing: 0.3px; font-family: var(--font-code);
  cursor: help;
}

.tc-bottom { display: flex; align-items: center; gap: 8px; }
.tc-actions {
  display: flex; gap: 4px; opacity: 0; transition: opacity 0.18s;
  margin-left: auto;
}
.task-card-min:hover .tc-actions { opacity: 1; }

/* ── Checkbox de completado, siempre visible ── */
.tc-check { display: flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.tc-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tc-check-box {
  width: 20px; height: 20px; border-radius: var(--radius); flex-shrink: 0;
  border: 1px solid var(--border2); background: var(--surface0);
  display: flex; align-items: center; justify-content: center;
  color: transparent; transition: all 0.15s;
}
.tc-check:hover .tc-check-box { border-color: var(--gold); }
.tc-check input:checked ~ .tc-check-box {
  background: var(--gold); border-color: var(--gold); color: #0a0a0a;
}
.tc-check input:focus-visible ~ .tc-check-box { outline: 2px solid var(--gold); outline-offset: 2px; }

.tc-btn {
  width: 26px; height: 26px; border-radius: var(--radius);
  background: none; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-family: var(--font-body); flex-shrink: 0;
}
.tc-btn:hover            { background: var(--surface3); color: var(--text); border-color: var(--border2); }
.tc-btn.tc-del:hover     { color: var(--red);  border-color: rgba(224,82,82,0.4); }
.tc-btn.tc-bell-set      { color: var(--gold); border-color: rgba(232,197,71,0.3); }

/* En móvil siempre visibles (no hay hover) */
@media (max-width: 740px) {
  .tc-actions { opacity: 1; }
  .tc-btn { width: 30px; height: 30px; }
}

/* ── Skeleton de carga (placeholder estático en el HTML) ────────────
   Reserva, desde el primer pintado, un alto muy parecido al de una
   tarjeta real (.task-card-min / .proj-card-min). Así: (1) hay contenido
   grande que pintar de inmediato -> mejor LCP/Speed Index, y (2) cuando
   Supabase responde y el render real sustituye este bloque, la diferencia
   de alto es mínima -> mucho menos salto de layout (CLS). Se retira solo
   (Projects.renderCards / Tasks.renderCards hacen grid.innerHTML = ''). */
/* Contraste reforzado a propósito: con --surface (#1c1b1b) sobre --bg
   (#131313) la tarjeta era casi invisible en pantallas de móvil — durante
   una carga lenta (red móvil), el panel parecía "roto" o congelado en negro
   en vez de mostrar que estaba cargando. --surface3 + un tono más claro en
   las líneas hacen que el esqueleto se note de verdad mientras llegan los datos. */
.skeleton-card {
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; min-height: 176px;
}
.skeleton-line {
  background: #3a3939; border-radius: var(--radius); height: 12px; margin-bottom: 12px;
}
.skeleton-line.w-40 { width: 40%; height: 9px; }
.skeleton-line.w-70 { width: 70%; height: 16px; }
.skeleton-line.w-90 { width: 90%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-pill { display:inline-block; width: 64px; height: 20px; border-radius: var(--radius); background: #3a3939; margin-right: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton-card { position: relative; overflow: hidden; }
  .skeleton-card::after {
    content: ''; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(232,197,71,0.22), transparent);
    animation: skeletonShimmer 1.4s ease-in-out infinite;
  }
}
@keyframes skeletonShimmer { 100% { transform: translateX(100%); } }

/* ── Project Card minimal (tarjeta grande de cuadrícula) ── */
.proj-card-min {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: background 0.15s, border-color 0.15s;
}
.proj-card-min:hover       { background: var(--surface2); border-color: var(--border2); }
.proj-card-min .pc-body    { padding: 18px; cursor: pointer; position: relative; }

.proj-card-min .pc-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.proj-card-min .pc-client {
  font-size: 0.68rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; font-family: var(--font-code);
}
.proj-card-min .pc-star { color: var(--gold); display: inline-flex; }

.proj-card-min .pc-title {
  font-family: var(--font-title); font-size: 1.35rem; line-height: 1.15;
  color: var(--text); margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.proj-card-min .pc-notes {
  font-size: 0.78rem; color: var(--text2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 12px;
}

.proj-card-min .pc-status-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 14px;
}
.proj-card-min .pc-status-pill {
  font-size: 0.68rem; font-weight: 700; padding: 3px 10px;
  border-radius: var(--radius); text-transform: uppercase; letter-spacing: 0.3px;
  border: 1px solid var(--border2);
}
.pc-status-pill.st-pendiente { color: var(--text2); }
.pc-status-pill.st-proceso   { color: var(--gold); border-color: rgba(232,197,71,0.4); }
.pc-status-pill.st-entregado { color: var(--green); border-color: rgba(74,222,128,0.35); }
.proj-card-min .pc-due { font-size: 0.72rem; color: var(--muted); }

.proj-card-min .pc-divider { height: 1px; background: var(--border); margin-bottom: 12px; }

.proj-card-min .pc-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.proj-card-min .pc-bottom-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.proj-card-min .pc-status-sel {
  background: var(--surface3); border: 1px solid var(--border);
  color: var(--text2); border-radius: var(--radius); font-size: 0.72rem;
  padding: 3px 8px; cursor: pointer; font-family: var(--font-body); outline: none;
}
.proj-card-min .pc-actions {
  display: flex; gap: 4px; opacity: 0; transition: opacity 0.18s;
}
.proj-card-min:hover .pc-actions { opacity: 1; }

@media (max-width: 740px) {
  .proj-card-min .pc-actions { opacity: 1; }
}

/* ── Tarjeta de proyecto/tarea protegida por PIN ── */
.proj-card-min.card-locked .pc-title,
.proj-card-min.card-locked .pc-client,
.task-card-min.card-locked .tc-title,
.task-card-min.card-locked .tc-cat {
  filter: blur(4px); user-select: none;
}
.pc-locked-overlay {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 0 18px; margin-bottom: 12px;
  border: 1px dashed var(--border2); border-radius: var(--radius);
  background: var(--surface0);
}
.pc-lock-icon { color: var(--gold); }
.pc-locked-label {
  font-size: 0.72rem; color: var(--text2); text-transform: uppercase;
  letter-spacing: 0.5px; font-family: var(--font-code);
}
.pc-pin-dots { display: flex; gap: 6px; }
.pc-pin-dots span {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--border2); background: var(--surface2);
}
/* ══════════════════════════════════════════════════════════════
   RESPONSABLE Y COLABORADORES — Avatares y selectores
══════════════════════════════════════════════════════════════ */

/* ── Avatar chip pequeño (tarjetas) — es un <button>, clic = filtrar por
   esa persona (App.setPersonFilter), así que se resetean los estilos de
   botón nativos para que se vea igual que el <span> de antes. ── */
.avatar-chip {
  position: relative;
  width: 22px; height: 22px; border-radius: var(--radius); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 800; color: #0a0a0a;
  font-family: var(--font-code); letter-spacing: -0.5px;
  border: 1.5px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  padding: 0; cursor: pointer; transition: transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.avatar-chip:hover { transform: scale(1.08); }
.avatar-chip:active { transform: scale(0.94); }
.avatar-chip.avatar-owner {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Fila de avatares en tarjetas ── */
.assignee-row {
  display: flex; align-items: center; gap: -4px;
}
.assignee-row .avatar-chip { margin-left: -6px; }
.assignee-row .avatar-chip:first-child { margin-left: 0; }

.assignee-row-tc { margin: 0; }

/* ── Chips de equipo en panel de detalle ── */
.team-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.team-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3px 10px 3px 3px;
  font-size: 0.78rem; color: var(--text2);
}
.team-chip-owner { border-color: rgba(232,197,71,0.3); color: var(--text); }

/* ── Lista de colaboradores (checkboxes) en modal ── */
.collab-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 160px; overflow-y: auto;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px;
}
.collab-list::-webkit-scrollbar { width: 3px; }
.collab-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: var(--radius); }

.collab-check {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: var(--radius); cursor: pointer;
  transition: background 0.15s;
}
.collab-check:hover { background: var(--surface3); }
.collab-check input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--gold); cursor: pointer; flex-shrink: 0;
}
.collab-name { font-size: 0.85rem; color: var(--text2); }
.collab-check:has(input:checked) .collab-name { color: var(--text); font-weight: 600; }

.collab-empty { font-size: 0.8rem; color: var(--muted); padding: 6px 4px; }

/* ── Fila de avatares del equipo en el sidebar — filtro global por persona ──
   Vive dentro de la sección "Equipo" del sidebar, justo encima del botón
   "Gestión de equipo" (antes flotaba aparte, arriba del todo, y en el menú
   móvil vivía duplicada junto a Etiquetas — unificado en un solo sitio). */
.sidebar-people-bar { padding: 2px 10px 10px; }
.sidebar-people-bar:empty { display: none; }
.people-bar-label {
  font-size: 0.62rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px;
}
.people-bar-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.people-bar-avatar {
  position: relative;
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 800; color: #0a0a0a;
  font-family: var(--font-code); border: 1.5px solid transparent;
  padding: 0; cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.people-bar-avatar:hover { transform: scale(1.1); }
.people-bar-avatar.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.people-bar-clear {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.people-bar-clear:hover { color: var(--red); border-color: rgba(224,82,82,0.35); }

/* ── Punto de presencia — verde si esa persona tiene una sesión abierta
   ahora mismo, rojo si no. Se pinta solo (App.paintPresenceDots) en
   cualquier avatar de la app: chips de responsable/colaborador, cluster
   del sidebar y tarjetas de Gestión de equipo — cada uno solo tiene que
   incluir un <span class="presence-dot" data-presence-for="ID">. ── */
.presence-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 1.5px solid var(--surface);
  pointer-events: none;
}
.presence-dot.online { background: var(--green); }
.people-bar-avatar .presence-dot { width: 9px; height: 9px; }
.user-card-avatar .presence-dot {
  bottom: auto; top: -1px; right: -1px; width: 12px; height: 12px; border-width: 2px;
}
/* Los avatares mini del calendario (celda del mes) apenas tienen sitio —
   el color propio del avatar ya distingue quién es sin el punto. */
.avatar-chip.avatar-chip-mini .presence-dot { display: none; }

/* ══════════════════════════════════════════════════════════════
   PROTECCIÓN POR PIN — Candados, campos y modal de desbloqueo
══════════════════════════════════════════════════════════════ */

/* ── Badge de candado en título de tarjeta ── */
.lock-badge { display: inline-flex; vertical-align: -2px; opacity: 0.85; color: var(--text2); }

/* ── Tarjeta bloqueada: aspecto sutilmente distinto ── */
.proj-card-min.card-locked,
.task-card-min.card-locked {
  background: var(--surface2);
}

/* ── Campo de PIN dentro de los modales de proyecto/tarea ── */
.pin-field-wrap {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px; padding: 10px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pin-field-wrap input {
  background: var(--surface); border: 1px solid var(--border2); color: var(--text);
  padding: 8px 12px; border-radius: var(--radius); font-size: 1rem; outline: none;
  font-family: var(--font-code); letter-spacing: 6px; text-align: center;
  width: 120px; transition: border-color 0.2s, box-shadow 0.2s;
}
.pin-field-wrap input:focus { border-color: var(--gold); }
.pin-field-hint { font-size: 0.7rem; color: var(--muted); }

/* ── Modal de desbloqueo por PIN ── */
.pin-modal-subtitle {
  font-size: 0.85rem; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.pin-modal-hint {
  font-size: 0.74rem; color: var(--muted); margin-bottom: 16px; line-height: 1.5;
}
.pin-input-big {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); padding: 14px; border-radius: var(--radius);
  font-size: 1.8rem; font-family: var(--font-code); text-align: center;
  letter-spacing: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.pin-input-big:focus { border-color: var(--gold); }
.pin-input-big::placeholder { color: var(--border2); letter-spacing: 14px; }

/* ══════════════════════════════════════════════════════════════
   NOTIFICACIONES — Campana, badge y buzón
══════════════════════════════════════════════════════════════ */

/* ── Campana en sidebar (desktop) ── */
.notif-bell-btn {
  position: relative;
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  width: 30px; height: 30px; border-radius: var(--radius); cursor: pointer; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s; flex-shrink: 0; font-family: var(--font-body);
}
.notif-bell-btn:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }

/* ── Badge contador ── */
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: 0.55rem; font-weight: 800;
  min-width: 15px; height: 15px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1; border: 1.5px solid var(--surface);
}

/* ── Pulso al recibir una notificación en tiempo real ── */
@keyframes notifPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.25); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.notif-bell-btn.notif-pulse,
.mobile-hamburger-btn.notif-pulse { animation: notifPulse 0.5s ease; }
.notif-bell-btn.notif-pulse::after,
.mobile-hamburger-btn.notif-pulse::after {
  content: ''; position: absolute; inset: -4px; border-radius: var(--radius);
  border: 2px solid var(--gold); animation: notifRing 0.6s ease-out;
  pointer-events: none;
}
@keyframes notifRing {
  from { opacity: 1; transform: scale(0.8); }
  to   { opacity: 0; transform: scale(1.3); }
}

/* ── Overlay + Panel deslizante (igual patrón que detail-panel) ── */
.notif-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 46; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.notif-overlay.open { opacity: 1; pointer-events: all; }

.notif-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border2);
  z-index: 47; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
}
.notif-panel.open { transform: translateX(0); }

.notif-header {
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface2); flex-shrink: 0;
}
.notif-header-title { font-size: 0.96rem; font-weight: 700; }
.notif-header-actions { display: flex; align-items: center; gap: 8px; }
.notif-header-btn {
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text2); padding: 5px 10px; border-radius: var(--radius);
  font-size: 0.73rem; font-weight: 600; cursor: pointer;
  transition: all 0.18s; font-family: var(--font-body); white-space: nowrap;
}
.notif-header-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.notif-header-btn.close-btn { width: 26px; height: 26px; padding: 0; display: flex; align-items: center; justify-content: center; }
.notif-header-btn.close-btn:hover { border-color: var(--border2); color: var(--text); background: var(--surface3); }

/* ── Pestañas de carpeta: Bandeja / Archivados / Eliminados ── */
.notif-folder-tabs {
  display: flex; flex-shrink: 0;
  background: var(--surface2); border-bottom: 1px solid var(--border);
}
.notif-folder-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 6px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 0.76rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s; font-family: var(--font-body); white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.notif-folder-tab:hover  { color: var(--text2); }
.notif-folder-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.notif-folder-count {
  display: none; align-items: center; justify-content: center;
  background: var(--surface3); color: var(--text2);
  font-size: 0.66rem; font-weight: 700; min-width: 17px; height: 17px;
  border-radius: var(--radius); padding: 0 4px;
}
.notif-folder-tab.active .notif-folder-count { background: var(--gold-soft); color: var(--gold); }

.notif-list { flex: 1; overflow-y: auto; padding: 8px; }
.notif-list::-webkit-scrollbar { width: 3px; }
.notif-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: var(--radius); }

.notif-empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.notif-empty .icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--muted); }
.notif-empty p { font-size: 0.84rem; }

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 10px; border-radius: var(--radius); cursor: pointer;
  transition: background 0.15s; position: relative;
}
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: var(--gold-soft); }
.notif-item.unread:hover { background: rgba(232,197,71,0.16); }
.notif-item.is-selected { box-shadow: inset 0 0 0 1.5px var(--gold); }

.notif-select-box {
  flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px;
  accent-color: var(--gold); cursor: pointer;
}
.notif-icon { display: inline-flex; color: var(--gold); flex-shrink: 0; margin-top: 1px; }
.notif-body { flex: 1; min-width: 0; }
.notif-msg  { font-size: 0.83rem; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
.notif-dot  {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  flex-shrink: 0; margin-top: 6px;
}

/* Acciones por notificación (marcar leída/no leída, eliminar) — visibles
   siempre en móvil (sin :hover fiable en touch) y al pasar el cursor en
   escritorio, para no saturar la lista con iconos permanentes. */
.notif-item-actions {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  opacity: 0; transition: opacity 0.15s;
}
.notif-item:hover .notif-item-actions,
.notif-item:focus-within .notif-item-actions { opacity: 1; }
.notif-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--radius);
  background: none; border: 1px solid transparent; color: var(--muted);
  cursor: pointer; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.notif-action-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.notif-action-delete:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

/* Barra de acciones masivas — aparece cuando hay avisos seleccionados */
.notif-bulk-bar {
  display: none; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--border);
  background: var(--surface2); flex-shrink: 0;
  font-size: 0.78rem; color: var(--text2); font-weight: 600;
}
.notif-bulk-actions { display: flex; align-items: center; gap: 8px; }
.notif-bulk-delete { display: flex; align-items: center; gap: 5px; color: var(--red); border-color: var(--red-soft); }
.notif-bulk-delete:hover { border-color: var(--red); background: var(--red-soft); color: var(--red); }

@media (max-width: 740px) {
  .notif-panel { width: 100vw; }
  /* En móvil no hay hover — las acciones se muestran siempre */
  .notif-item-actions { opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   CALENDARIO DE TRABAJO — vista propia (sustituye a Google Calendar)
══════════════════════════════════════════════════════════════ */

.cal-toolbar {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.cal-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cal-nav-btn:hover { border-color: var(--gold); color: var(--gold); }
.cal-month-label {
  font-family: var(--font-code); font-weight: 700; font-size: 0.82rem;
  color: var(--text); min-width: 130px; text-align: center;
  text-transform: capitalize;
}
.cal-today-btn {
  background: var(--gold-soft); border: 1px solid var(--gold);
  color: var(--gold); font-size: 0.76rem; font-weight: 700;
  padding: 6px 12px; border-radius: var(--radius); cursor: pointer;
  font-family: var(--font-body); margin-left: 4px;
  -webkit-tap-highlight-color: transparent;
}
.cal-today-btn:hover { background: rgba(232,197,71,0.18); }

/* ── Layout: grid de mes + panel del día ── */
.cal-layout { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 1080px) {
  .cal-layout { flex-direction: row; align-items: flex-start; }
  .cal-card      { flex: 1; min-width: 0; }
  .cal-day-panel { width: 300px; flex-shrink: 0; position: sticky; top: 0; }
}

.cal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}

/* ── Toggle Mes / Agenda ── */
.cal-view-toggle {
  display: flex; gap: 2px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2px; margin-left: 6px;
}
.cal-view-btn {
  background: none; border: none; color: var(--muted); font-size: 0.74rem; font-weight: 700;
  padding: 5px 11px; border-radius: var(--radius); cursor: pointer; font-family: var(--font-body);
  transition: background 0.15s, color 0.15s; -webkit-tap-highlight-color: transparent;
}
.cal-view-btn.active { background: var(--gold); color: #0a0a0a; }
.cal-view-btn:not(.active):hover { color: var(--text); }

/* ── Vista Agenda: reuniones pasadas y próximas ── */
.cal-agenda { display: flex; flex-direction: column; gap: 20px; }
.cal-agenda-section-title {
  font-size: 0.74rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px;
}
.cal-agenda-list { display: flex; flex-direction: column; gap: 8px; }
.cal-agenda-item {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px 14px;
}
.cal-agenda-item.is-past { opacity: 0.68; }
.cal-agenda-item-date {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-width: 128px; flex-shrink: 0;
}
.cal-agenda-item-day { font-size: 0.76rem; font-weight: 700; color: var(--text); text-transform: capitalize; }
.cal-agenda-item-time { font-size: 0.7rem; color: var(--gold); font-family: var(--font-code); }
.cal-agenda-item-body { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 3px; }
.cal-agenda-item-title { font-size: 0.88rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-agenda-item-meta { font-size: 0.76rem; color: var(--text2); }
.cal-agenda-note-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--gold-soft); color: var(--gold); font-size: 0.62rem; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius);
}
.cal-agenda-item-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: auto; }
@media (max-width: 640px) {
  .cal-agenda-item { flex-direction: column; align-items: flex-start; }
  .cal-agenda-item-actions { margin-left: 0; width: 100%; }
}

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.cal-weekdays span {
  padding: 10px 4px; text-align: center;
  font-size: 0.66rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px;
}

/* Filas de altura FIJA (grid-auto-rows, no "auto"): así ningún día con muchas
   tareas puede estirar su semana y descuadrar el resto del calendario. El
   contenido que no entra se recorta (overflow: hidden en .cal-day) — por
   eso las tareas ya vienen limitadas a 3 chips + "+N más" desde Calendar.js. */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 104px;
}

.cal-day {
  min-height: 104px; min-width: 0; padding: 6px; border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.15s; display: flex; flex-direction: column; gap: 4px;
  overflow: hidden; -webkit-tap-highlight-color: transparent;
}
.cal-day:nth-child(7n)   { border-right: none; }
.cal-day:hover           { background: var(--surface2); }
.cal-day:focus-visible   { outline: 2px solid var(--gold); outline-offset: -2px; }
.cal-day.is-other-month  { opacity: 0.35; }
.cal-day.is-selected     {
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1.5px var(--gold);
}
.cal-day.is-today .cal-day-num {
  background: var(--gold); color: #0a0a0a; border-radius: 50%;
}
.cal-day.has-overdue     { box-shadow: inset 0 0 0 1px rgba(255,180,171,0.4); }
/* Pista visual de que el día es "accionable" (tiene tareas/proyectos) sin
   competir con el aviso de vencidas ni con el estado seleccionado. */
.cal-day.has-items:not(.has-overdue):not(.is-selected) { box-shadow: inset 0 -2px 0 0 var(--gold); }
.cal-day.has-items:hover { background: var(--surface2); }

/* Resalte temporal al navegar a una fecha exacta desde "Ver en calendario" */
@keyframes calDayFlash {
  0%, 100% { box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 0 4px var(--gold-glow); }
  50%      { box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 0 0 transparent; }
}
.cal-day-flash { animation: calDayFlash 0.5s ease-in-out 3; }

.cal-day-num {
  font-family: var(--font-code); font-size: 0.75rem; font-weight: 700;
  color: var(--text2); width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}

.cal-day-chips {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0; overflow: hidden; flex: 1 1 auto;
}
.cal-chip {
  display: flex; align-items: center; gap: 3px;
  width: 100%; min-width: 0; max-width: 100%; flex-shrink: 0;
  font-size: 0.63rem; padding: 1px 6px; border-radius: var(--radius); box-sizing: border-box;
  font-family: var(--font-body); font-weight: 600;
}
.cal-chip-label {
  min-width: 0; flex: 1 1 auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Quién organiza/asiste una reunión o cita, directamente en la celda del
   día — miniatura del cluster de avatares, sin abrir el evento. */
.cal-chip-avatars { display: flex; align-items: center; flex-shrink: 0; gap: 0; }
.cal-chip-avatars .avatar-chip-mini { margin-left: -4px; }
.cal-chip-avatars .avatar-chip-mini:first-child { margin-left: 0; }
.avatar-chip.avatar-chip-mini {
  width: 13px; height: 13px; border-radius: var(--radius); font-size: 0; border-width: 1px;
  box-shadow: none; flex-shrink: 0;
}
.cal-chip-normal  { background: var(--surface3); color: var(--text2); }
.cal-chip-alta    { background: rgba(232,197,71,0.16); color: var(--gold); }
.cal-chip-overdue { background: var(--red-soft); color: var(--red); }
.cal-chip-done    { background: var(--surface2); color: var(--muted); text-decoration: line-through; }
.cal-day-more     { font-size: 0.6rem; color: var(--muted); padding-left: 2px; }

/* ── Panel del día seleccionado ── */
.cal-day-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
}
.cal-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.cal-panel-date {
  font-family: var(--font-code); font-weight: 700; font-size: 0.82rem;
  color: var(--text); text-transform: capitalize;
}
.cal-panel-empty { font-size: 0.8rem; color: var(--muted); padding: 8px 0; }

.cal-panel-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.cal-quick-btn {
  flex: 1; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); font-size: 0.76rem; font-weight: 700;
  padding: 7px 10px; border-radius: var(--radius); cursor: pointer;
  font-family: var(--font-body); transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cal-quick-btn:hover { border-color: var(--gold); color: var(--gold); }

.cal-panel-item {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 6px; border-radius: var(--radius); cursor: pointer;
  transition: background 0.15s;
}
.cal-panel-item:hover { background: var(--surface2); }
.cal-panel-item:hover .cal-panel-edit { opacity: 1; }
.cal-panel-item.is-done .cal-panel-title { color: var(--muted); text-decoration: line-through; }
.cal-panel-icon  { flex-shrink: 0; font-size: 0.9rem; }
.cal-panel-title { flex: 1; min-width: 0; font-size: 0.83rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-panel-edit {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--radius); margin-left: auto;
  background: none; border: 1px solid transparent; color: var(--muted);
  cursor: pointer; opacity: 0.6; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cal-panel-edit:hover { opacity: 1; border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
@media (max-width: 740px) {
  .cal-panel-edit { opacity: 1; } /* sin :hover fiable en touch, siempre visible */
}

@media (max-width: 740px) {
  .cal-toolbar     { gap: 5px; }
  .cal-month-label { min-width: 110px; font-size: 0.76rem; }
  .cal-today-btn   { padding: 5px 10px; font-size: 0.7rem; }
  .cal-grid        { grid-auto-rows: 64px; }
  .cal-day         { min-height: 64px; padding: 4px; }
  .cal-day-num     { font-size: 0.68rem; width: 18px; height: 18px; }
  .cal-chip        { font-size: 0.58rem; padding: 1px 4px; }
  .avatar-chip.avatar-chip-mini { width: 11px; height: 11px; }
  .cal-weekdays span { font-size: 0.58rem; padding: 7px 2px; }
}
@media (max-width: 480px) {
  /* En pantallas muy estrechas, ocultar el texto de las tarjetas y dejar
     solo puntos de color — el detalle completo vive en el panel del día,
     así que los avatares mini (que no caben en un punto de 8px) también
     se ocultan aquí y reaparecen en el panel/Agenda. */
  .cal-grid      { grid-auto-rows: 56px; }
  .cal-day       { min-height: 56px; }
  .cal-chip      { text-indent: -999px; padding: 2px; width: 8px; height: 8px; min-width: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
  .cal-chip-avatars { display: none; }
  .cal-day-chips { flex-direction: row; flex-wrap: wrap; gap: 3px; max-height: 26px; }
  .cal-day-more  { text-indent: 0; }
}

/* ══════════════════════════════════════════════════════════════
   ND | CHAT — chat interno del equipo (canal general + mensajes
   directos). No confundir con el asistente NEXO (chat-fab/chat-panel
   flotantes, definidos más arriba) — comparte algunas clases con él
   (.chat-input-wrap, .chat-input, .chat-send-btn) a propósito, para que
   ambos chats se vean consistentes sin duplicar CSS.
══════════════════════════════════════════════════════════════ */

.chat-app-layout {
  flex: 1; display: flex; min-height: 0; overflow: hidden;
  border-top: 1px solid var(--border);
}

/* ── Columna izquierda: lista de conversaciones ── */
.chat-conv-list {
  width: 280px; flex-shrink: 0; overflow-y: auto;
  border-right: 1px solid var(--border); background: var(--surface0);
}
.chat-conv-list::-webkit-scrollbar { width: 3px; }
.chat-conv-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: var(--radius); }

.chat-conv-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: none; border: none; border-bottom: 1px solid var(--border);
  cursor: pointer; text-align: left; transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.chat-conv-item:hover { background: var(--surface2); }
.chat-conv-item.active { background: var(--gold-soft); box-shadow: inset 2px 0 0 var(--gold); }

.chat-conv-avatar {
  /* Sin overflow:hidden a propósito: el punto de presencia se posiciona a
     caballo del borde del círculo (bottom/right en negativo) y quedaría
     recortado por la máscara circular si el contenedor lo ocultara. La
     imagen de perfil (.avatar-img) ya se recorta sola vía border-radius:
     inherit, así que no hace falta. */
  position: relative; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; color: #0a0a0a; font-family: var(--font-code);
}
.chat-conv-avatar-team { background: var(--surface3); color: var(--text2); }
.chat-conv-avatar-nexo { background: var(--gold-soft); color: var(--gold-light); box-shadow: inset 0 0 0 1px var(--gold-soft); }

.chat-conv-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-conv-name {
  font-size: 0.85rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-conv-preview {
  font-size: 0.74rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-conv-badge {
  flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius); background: var(--gold); color: #0a0a0a;
  font-size: 0.66rem; font-weight: 800; font-family: var(--font-code);
  display: flex; align-items: center; justify-content: center;
}

/* ── Columna derecha: hilo de mensajes ── */
.chat-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.chat-thread-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0; min-height: 30px;
}
.chat-thread-header-meta { min-width: 0; flex: 1; }
.chat-thread-header-name,
.chat-thread-header-sub {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-thread-header-name { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.chat-thread-header-sub  { font-size: 0.72rem; color: var(--muted); }

.chat-thread-messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
}
.chat-thread-messages::-webkit-scrollbar { width: 3px; }
.chat-thread-messages::-webkit-scrollbar-thumb { background: var(--border2); border-radius: var(--radius); }

.chat-msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 80%; }
.chat-msg-row.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar { width: 26px; height: 26px; font-size: 0.6rem; flex-shrink: 0; }

.chat-bubble-wrap { display: flex; flex-direction: column; min-width: 0; }
.chat-msg-row.is-mine .chat-bubble-wrap { align-items: flex-end; }
.chat-msg-sender { font-size: 0.68rem; font-weight: 700; color: var(--muted); margin: 0 4px 2px; }

.chat-msg-row .chat-bubble {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) var(--radius) var(--radius); word-break: break-word;
}
.chat-msg-row.is-mine .chat-bubble {
  background: var(--gold); color: #0a0a0a; border: none; border-radius: var(--radius) var(--radius) var(--radius) var(--radius);
}

@media (max-width: 900px) {
  .chat-conv-list { width: 220px; }
}
@media (max-width: 740px) {
  /* En móvil no hay sitio para dos columnas — se prioriza el hilo activo;
     la lista de conversaciones queda como una franja horizontal scrollable
     arriba, y al tocar una conversación el foco pasa al hilo debajo. */
  .chat-app-layout { flex-direction: column; }
  .chat-conv-list {
    width: auto; max-height: 96px; display: flex; overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .chat-conv-item { flex-direction: column; width: auto; min-width: 76px; text-align: center; gap: 4px; border-bottom: none; border-right: 1px solid var(--border); }
  .chat-conv-item.active { box-shadow: inset 0 -2px 0 var(--gold); }
  .chat-conv-meta { align-items: center; }
  .chat-conv-name { max-width: 68px; font-size: 0.72rem; }
  .chat-conv-preview { display: none; }
  .chat-msg-row { max-width: 92%; }
}
/* ══════════════════════════════════════════════════════════════
   REDISEÑO ND|FOCUS — capa de estilo "Pendientes"
   Superficies planas, bordes de 1px, esquinas rectas (--radius),
   etiquetas en mono con contorno y títulos de grupo en Bebas.
   Solo estilo: no cambia estructura ni comportamiento.
══════════════════════════════════════════════════════════════ */
:root {
  --prio-alta:  #ff7a59;
  --prio-media: #e8c547;
  --prio-baja:  #7fa7c9;
  --ok:         #5cc28a;
}

/* Sin brillos decorativos: el panel se lee por líneas y contraste */
.btn-new-primary { box-shadow: none; }
.dot-pendiente, .dot-en-proceso, .dot-entregado { box-shadow: none !important; }
.user-card:hover { box-shadow: none; border-color: var(--border2); }
.watermark { font-family: var(--font-title); letter-spacing: 0; opacity: 0.025; }

/* Cabecera de cada vista: título en Bebas */
.topbar h1 {
  font-family: var(--font-title); font-weight: 400;
  font-size: 1.75rem; line-height: 1; letter-spacing: 0.02em;
}

/* Resumen superior: recuadros planos, el número manda */
.stat-cell { background: var(--surface); transition: border-color 0.15s; }
.stat-cell:hover { border-color: var(--border2); }
.stat-val { font-size: 2.4rem; font-variant-numeric: tabular-nums; }

/* Grupos de tareas: título de sección + línea, no una caja */
.task-group-header {
  background: transparent; border: 0; border-bottom: 1px solid var(--border);
  padding: 14px 2px 8px; margin-top: 14px;
}
.task-group-header:hover  { background: transparent; border-bottom-color: var(--border2); }
.task-group-header:active { background: transparent; }
.task-group-name {
  font-family: var(--font-title); font-weight: 400; font-size: 1.6rem;
  letter-spacing: 0.02em; color: var(--text); line-height: 1;
}
.task-group-icon { color: var(--gold); }

/* Badges y pills: mono, contorno, sin relleno */
.task-group-badge, .pill, .tc-pill, .proj-card-min .pc-status-pill {
  font-family: var(--font-code); font-weight: 500;
  letter-spacing: 0.06em; background: transparent !important;
  border: 1px solid var(--border2);
}
.badge-pending { color: var(--prio-media); border-color: var(--prio-media); }
.badge-done    { color: var(--ok);         border-color: var(--ok); }
.badge-deleted { color: var(--prio-alta);  border-color: var(--prio-alta); }

.pill-prio-alta,  .tc-pill.pill-prio-alta  { color: var(--prio-alta)  !important; border-color: var(--prio-alta)  !important; }
.pill-prio-media, .tc-pill.pill-prio-media { color: var(--prio-media) !important; border-color: var(--prio-media) !important; }
.pill-prio-baja,  .tc-pill.pill-prio-baja  { color: var(--prio-baja)  !important; border-color: var(--prio-baja)  !important; }
.pc-status-pill.st-proceso   { color: var(--gold); border-color: var(--gold); }
.pc-status-pill.st-entregado { color: var(--ok);   border-color: var(--ok); }

/* Tarjetas de tarea: título en negrita legible, detalle atenuado */
.task-card-min .tc-title {
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.98rem; line-height: 1.35;
}
.task-card-min.tc-done .tc-title { color: var(--muted); }
.task-card-min:hover, .proj-card-min:hover { background: var(--surface); border-color: var(--border2); }

/* Foco visible en dorado en todo el panel */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Títulos de cabecera y de grupo: una línea, y más contenidos en móvil */
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 768px) {
  .topbar h1       { font-size: 1.35rem; }
  .task-group-name { font-size: 1.3rem; }
}

/* ── Modo demo y miembro ── */
.demo-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 12px 20px 0; padding: 10px 14px;
  border: 1px solid var(--gold); background: var(--gold-soft);
  color: var(--text); font-size: 0.82rem; line-height: 1.45;
}
.demo-banner-tag {
  font-family: var(--font-code); font-size: 0.66rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--bg); background: var(--gold);
  padding: 2px 8px;
}
@media (max-width: 768px) { .demo-banner { margin: 10px 14px 0; } }
/* Los miembros solo consultan y marcan sus tareas: sin botones de crear */
body[data-role="member"] #mobileFab { display: none !important; }
