/* ================================================================
   NOTAS Y ALARMAS 📝⏰ — Reskin con paleta Vitrina
   Mismos selectores/IDs que el original: notas.js no se toca.
   ================================================================ */
 
#panel-notas { width: 100%; height: 100%; display: flex; flex-direction: column; background: transparent; overflow: hidden; }
 
/* ── MURO / GRID ── */
#muro-notas { flex: 1; overflow-y: auto; padding: 20px 24px; padding-bottom: 80px; background: transparent; }
.grid-notas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; align-items: start; }
 
/* ── STICKY NOTE (colapsada) ── */
.sticky-note {
  position: relative;
  padding: 14px;
  border-radius: var(--rl);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  min-height: 110px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: apareceNota 0.3s var(--ease-apple) both;
  animation-delay: min(calc(var(--i, 0) * 40ms), 320ms);
}
@keyframes apareceNota { from { opacity: 0; } to { opacity: 1; } }
.sticky-note:hover { transform: translateY(-4px) scale(1.015) !important; box-shadow: 0 10px 26px rgba(0,0,0,0.5); z-index: 10; }
 
.sticky-note.expandida {
  grid-column: span 2;
  grid-row: span 1;
  min-height: auto;
  z-index: 30;
  transform: scale(1) !important;
  box-shadow: 0 0 0 2px var(--vbor2), 0 10px 28px rgba(0,0,0,0.5);
  cursor: default;
}
@media (max-width: 700px) { .sticky-note.expandida { grid-column: span 1; } }
 
.sticky-note.realizada { opacity: 0.4; }
.sticky-note.realizada .sticky-note-texto { text-decoration: line-through; }
 
/* Colores por tipo */
.sticky-nota   { background: var(--vs); color: var(--vtx); border: 1px solid var(--vbor); border-left: 3px solid var(--va); }
.sticky-alarma { background: var(--vs); color: var(--vtx); border: 1px solid var(--vbor); border-left: 3px solid var(--vred); }
 
.sticky-tape {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 48px; height: 16px; background: var(--vag2); border: 1px solid var(--vbor); border-radius: 2px; pointer-events: none;
}
.sticky-alarma .sticky-tape { background: rgba(248,113,113,0.14); }
 
.sticky-note-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--vtx3); border-bottom: 1px solid var(--vbor); padding-bottom: 4px;
}
.sticky-note-tipo { display: flex; align-items: center; gap: 4px; }
 
.sticky-note-texto {
  flex: 1; font-size: 13px; line-height: 1.45; word-break: break-word; overflow-wrap: break-word;
  margin-bottom: 6px; white-space: pre-wrap;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden;
  color: var(--vtx);
}
.sticky-note.expandida .sticky-note-texto { -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; font-size: 14px; line-height: 1.5; }
 
.sticky-note-footer { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--vtx3); margin-top: auto; padding-top: 4px; border-top: 1px solid var(--vbor); }
.sticky-note-badges { display: flex; gap: 3px; }
.badge-icon { font-size: 12px; }
 
/* ── CONTENIDO EXPANDIDO ── */
.sticky-expand-content { display: none; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--vbor); animation: fadeInUp 0.25s ease; }
.sticky-note.expandida .sticky-expand-content { display: flex; flex-direction: row; gap: 12px; flex-wrap: wrap; }
/* .sticky-expand-content y .sticky-edit-form viven dentro de una tarjeta
   que se reconstruye entera (grid.innerHTML) cada vez que cambia el
   estado expandido/editando: el nodo viejo se destruye antes de que
   cualquier transición CSS alcance a jugar. Por eso el JS, antes de
   reconstruir, le agrega esta clase al nodo TODAVÍA VIVO y espera a que
   termine de desvanecerse (160ms) recién ahí llama a renderizarNotas(). */
.sticky-expand-content.colapsando,
.sticky-edit-form.colapsando {
  animation: colapsarContenidoNota 0.16s var(--ease-apple) forwards;
}
@keyframes colapsarContenidoNota { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
 
.sticky-info-line { font-size: 10px; color: var(--vtx3); display: flex; align-items: center; gap: 4px; }
.sticky-meta-line  { font-size: 10px; color: var(--vtx3); margin-bottom: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
 
.alarma-input-row { display: flex; gap: 6px; align-items: center; }
.alarma-input-row input[type="time"],
.alarma-input-row input.fx-hora-24 { flex: 1; }
.alarma-input-row .sticky-btn { flex: 0 0 auto; margin: 0; padding: 5px 10px; font-size: 12px; }
 
.sticky-timer-box { background: var(--vag); border-radius: var(--r); padding: 8px; text-align: center; border: 1px solid var(--vbor); }
.sticky-timer-display { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; color: var(--vtx); }
.sticky-timer-label { font-size: 10px; color: var(--vtx3); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
 
/* ── BOTONES ── */
.sticky-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.sticky-btn { padding: 5px 10px; border: 1px solid; border-radius: var(--r); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s var(--ease-apple); flex: 1; min-width: 70px; background: transparent; }
 
.sticky-btn-verde     { border-color: rgba(74,222,128,0.5);  color: var(--vgrn); }
.sticky-btn-verde:hover     { background: rgba(74,222,128,0.15);  border-color: rgba(74,222,128,0.7); }
.sticky-btn-rojo       { border-color: rgba(248,113,113,0.5); color: var(--vred); }
.sticky-btn-rojo:hover      { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.7); }
.sticky-btn-amarillo   { border-color: rgba(255,213,79,0.5);  color: #ffd54f; }
.sticky-btn-amarillo:hover  { background: rgba(255,213,79,0.12);  border-color: rgba(255,213,79,0.7); }
 
/* ── EDICIÓN DENTRO DE TARJETA ── */
.sticky-edit-form { display: none; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--vbor); animation: fadeInUp 0.25s ease; }
.sticky-note.editando .sticky-edit-form { display: flex; flex-direction: column; gap: 4px; }
.sticky-note.editando .sticky-note-texto,
.sticky-note.editando .sticky-expand-content { display: none !important; }
 
.form-group-inline label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--vtx3); display: block; margin-bottom: 2px; }
.form-group-inline textarea,
.form-group-inline input {
  width: 100%; padding: 6px 8px; border: 1px solid var(--vbor); border-radius: var(--r);
  background: var(--vs2); color: var(--vtx); font-size: var(--fs-input); outline: none; resize: none; overflow: hidden; font-family: inherit;
  transition: border-color 0.2s var(--ease-apple), background 0.2s var(--ease-apple);
}
.form-group-inline textarea:focus,
.form-group-inline input:focus { border-color: var(--va); background: var(--vs3); }
 
.tipo-selector-mini { display: flex; gap: 4px; flex-wrap: wrap; }
.tipo-chip { padding: 4px 10px; border-radius: var(--r); font-size: 12px; cursor: pointer; border: 1px solid transparent; transition: all 0.2s var(--ease-apple); background: var(--vag); color: var(--vtx3); }
.tipo-chip:hover { background: var(--vag2); }
.tipo-chip.activo { border-color: var(--va); background: rgba(206,147,216,0.14); color: var(--va); font-weight: 700; }
 
/* ── SIN NOTAS ── */
#sin-notas { text-align: center; padding: 60px 20px; color: var(--vtx3); }
.sin-notas-emoji { font-size: 44px; margin-bottom: 8px; }
.sin-notas-texto { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--vtx2); }
.sin-notas-hint { font-size: 12px; }
 
/* ── MODAL ALARMA ACTIVA ── */
#alarma-modal { display: none; }
#alarma-modal.cerrando { animation: alarmaDespedida 0.15s ease forwards; }
@keyframes alarmaDespedida { from { opacity: 1; } to { opacity: 0; } }
.alarma-activa {
  background: var(--vs2); color: var(--vtx); border: 1px solid rgba(248,113,113,0.4);
  padding: 28px 36px; border-radius: var(--rxl); text-align: center;
  box-shadow: 0 0 40px rgba(248,113,113,0.2), 0 16px 48px rgba(0,0,0,0.4);
  animation: asomarse 0.2s var(--ease-apple), alarmaPulse 1s ease 0.2s infinite; max-width: 340px; width: 90%; position: relative; z-index: 99999;
}
@keyframes alarmaPulse { 0%,100% { transform: scale(1); box-shadow: 0 0 40px rgba(248,113,113,0.2); } 50% { transform: scale(1.02); box-shadow: 0 0 60px rgba(248,113,113,0.35); } }
 
.alarma-icono { font-size: 48px; margin-bottom: 8px; }
.alarma-titulo { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.alarma-mensaje { font-size: 13px; margin-bottom: 12px; color: var(--vtx2); }
.alarma-tiempo { font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 16px; color: var(--vred); }
 
.alarma-cerrar {
  padding: 8px 20px; background: rgba(248,113,113,0.14); color: var(--vred);
  border: 1px solid rgba(248,113,113,0.5); border-radius: var(--r); font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s var(--ease-apple);
}
.alarma-cerrar:hover { background: rgba(248,113,113,0.28); transform: scale(1.05); }
 
/* ── INDICADOR DE ALARMA ACTIVA ── */
.alarma-indicador { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; background: var(--vred); border-radius: 50%; animation: alarmaBlink 1s ease infinite; box-shadow: 0 0 6px var(--vred); }
@keyframes alarmaBlink { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }
 
/* ── FAB ── */
.fab-notas {
  position: absolute; bottom: 20px; right: 20px; width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--va), var(--va2)); color: #1b1b1b; border: none; font-size: 24px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(206,147,216,0.35), 0 0 0 1px var(--vbor2);
  z-index: 100; display: none; align-items: center; justify-content: center; transition: all 0.2s var(--ease-apple); padding: 0; line-height: 1;
}
#panel-notas.activo .fab-notas { display: flex; }
.fab-notas:hover { transform: scale(1.08) translateY(-2px); box-shadow: 0 6px 20px rgba(206,147,216,0.5); }
.fab-notas:active { transform: scale(0.95); }
 
/* ── "NUEVA NOTA" — ocupa TODO el panel (como un cambio de pestaña) en
   vez de flotar como un popup chico junto al FAB.
   OJO: no puede ser position:absolute — eso dependía de que #notas-panel
   tuviera una altura ya resuelta, cosa que pasa en la página completa
   (el CSS de .tab-panel le da una altura fija) pero NO en el dropdown
   compacto del navbar (vitrina.js mueve este mismo panel adentro de
   #vit-notas-drop-body, que se ajusta al contenido — sin altura fija).
   Ahí, con #muro-notas oculto y el dropdown fuera del flujo normal
   (absolute), no quedaba nada que le diera altura a #notas-panel, y
   todo colapsaba a 0 (se veía vacío). Por eso ahora .nm-fab-wrapper
   pasa a ocupar el espacio de #muro-notas dentro del flex normal
   (mismo mecanismo con el que #muro-notas ya funcionaba en los dos
   contextos), y .nm-crear-dropdown crece adentro con flex:1. */
.nm-fab-wrapper.creando-nota {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.nm-crear-dropdown.oculto { display: none; }
.nm-crear-dropdown {
  flex: 1;
  min-height: 0;
  background: var(--vs2);
  border: 1px solid var(--vbor2);
  border-radius: var(--rl);
  z-index: 200;
  box-shadow: 0 0 0 1px rgba(206,147,216,0.35), 0 0 22px rgba(206,147,216,0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInUp 0.2s ease;
}
/* Mismo conflicto que .vit-carrito-dropdown: esta clase y ".cerrando"
   (utilidades.css) empatan en especificidad, y como notas.css se carga
   después, la animación de entrada le ganaba a "despedirse" y el modal
   se cerraba sin transición. */
.nm-crear-dropdown.cerrando {
  animation: despedirse 0.14s var(--ease-apple) forwards;
}
 
.notas-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--vbor);
  font-size: 14px; font-weight: 700; color: var(--vtx);
  flex-shrink: 0;
}
.notas-modal-body {
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; min-height: 0; flex: 1;
}
.notas-modal-footer {
  display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--vbor);
  flex-shrink: 0;
}
.notas-modal-footer .sticky-btn { flex: 1; }
 
.nm-compartir-wrap { position: relative; }
.nm-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.nm-chips:empty { display: none; }
.nm-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--vag); color: var(--vtx2); border: 1px solid var(--vbor);
  border-radius: 999px; padding: 3px 8px; font-size: 11px;
}
.nm-chip .ti-x { cursor: pointer; font-size: 12px; color: var(--vtx3); transition: color 0.15s var(--ease-apple); }
.nm-chip .ti-x:hover { color: var(--vred); }
 
#panel-notas:not(.activo) #sin-notas,
#panel-notas:not(.activo) #grid-notas,
#panel-notas:not(.activo) #muro-notas { display: none !important; }
 
/* Scrollbar de #muro-notas: ver la regla canónica en utilidades.css */
 
@media (max-width: 900px) { .grid-notas { grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); } }
@media (max-width: 600px) { .grid-notas { grid-template-columns: 1fr; } .sticky-note.expandida { grid-column: span 1; } }