/* =====================================================
   VARIABLE DE COLOR PRINCIPAL
   ===================================================== */
:root {
  --color-principal: #6b46c1;
}

/* =====================================================
   CALENDARIO OVERLAY + EDITOR DE NOTA (COMPLETO)
   ===================================================== */

/* ---------- OVERLAY PRINCIPAL ---------- */
.calendario-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  width: 100vw;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  /* ocupa el alto real en móvil, sin la barra del navegador */
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 8%, white);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* soporte para notch / isla dinámica */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  box-sizing: border-box;
}

/* ---------- HEADER ---------- */
.calendario-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  gap: 10px;
}

.calendario-header-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendario-mes-titulo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-principal, #6b46c1);
  margin: 0 8px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.calendario-mes-titulo::after {
  content: " ▾";
  font-size: 0.65em;
  vertical-align: middle;
  color: var(--color-principal, #6b46c1);
  opacity: 0.7;
}

.calendario-btn-menu,
.calendario-btn-notas,
.calendario-btn-buscar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  color: var(--color-principal, #6b46c1);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.calendario-btn-menu:hover,
.calendario-btn-notas:hover,
.calendario-btn-buscar:hover {
  background: var(--color-principal, #6b46c1);
  color: white;
}

.calendario-btn-config {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  color: var(--color-principal, #6b46c1);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.calendario-btn-config:hover {
  background: var(--color-principal, #6b46c1);
  color: white;
}

.calendario-btn-config:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.calendario-dia-box {
  width: 40px;
  height: 40px;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  color: var(--color-principal, #6b46c1);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(8px 0%, calc(100% - 8px) 0%, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0% calc(100% - 8px), 0% 8px);
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.calendario-dia-box:hover {
  background: var(--color-principal, #6b46c1);
  color: white;
}

/* ---------- SELECTOR DE MES/AÑO ---------- */
.cal-selector-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-selector-box {
  background: white;
  border-radius: 20px;
  padding: 25px;
  width: 300px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  clip-path: polygon(12px 0%, calc(100% - 12px) 0%, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0% calc(100% - 12px), 0% 12px);
}

.cal-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.cal-selector-ano {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-principal);
}

.cal-selector-ano-btn {
  background: var(--color-principal);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.cal-selector-ano-btn:hover {
  filter: brightness(1.2);
}

.cal-selector-mes-actual {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-principal);
  margin-bottom: 10px;
  padding: 8px;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  border-radius: 10px;
}

.cal-selector-meses {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 15px;
}

.cal-selector-mes {
  padding: 6px 2px;
  border-radius: 8px;
  background: white;
  font-size: 0.7rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  border: 1px solid var(--color-principal);
  color: black;
}

.cal-selector-mes:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  border-color: var(--color-principal);
}

.cal-selector-mes.activo {
  background: var(--color-principal);
  color: white;
}

.cal-selector-cerrar {
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  border: none;
  background: var(--color-principal);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

  .cal-selector-cerrar:hover {
  background: white;
  color: var(--color-principal);
  border: 1px solid var(--color-principal);

}

/* ---------- BARRA LATERAL ---------- */
.calendario-sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 3100;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
}

.calendario-sidebar.open {
  left: 0;
}

.calendario-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 3050;
  display: none;
}

.calendario-sidebar-overlay.show {
  display: block;
}

.calendario-sidebar-header {
  padding: 20px;
  background: var(--color-principal, #6b46c1);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendario-sidebar-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.calendario-sidebar-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
}

.calendario-sidebar-body {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.calendario-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: #f8f9fa;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  color: #333;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.calendario-sidebar-btn i {
  width: 24px;
  font-size: 1.2rem;
  color: var(--color-principal, #6b46c1);
}

.calendario-sidebar-btn:hover {
  background: var(--color-principal, #6b46c1);
  color: white;
  transform: translateX(5px);
}

.calendario-sidebar-btn:hover i {
  color: white;
}

.calendario-sidebar-divider {
  height: 1px;
  background: #dee2e6;
  margin: 10px 0;
}

/* ---------- NAVEGACIÓN ---------- */
.calendario-nav {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--color-principal, #6b46c1);
  flex-shrink: 0;
  gap: 8px;
}

.calendario-nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  flex-shrink: 0;
}

.calendario-nav-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.cal-nav-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  gap: 12px;
}

.calendario-btn-utils {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  flex-shrink: 0;
}

.calendario-btn-utils:hover {
  background: rgba(255, 255, 255, 0.35);
}

.cal-utils-inline {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  flex: 0;
  max-width: 0;
  opacity: 0;
  transition: opacity 0.5s ease, max-width 0.5s ease, flex 0.5s ease;
}

.cal-nav-center.expanded .cal-utils-inline {
  flex: 1;
  max-width: 1000px;
  opacity: 1;
  justify-content: space-evenly;
}

.util-inline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: white;
  padding: 4px 12px;
  border-radius: 8px;
  transition: background 0.3s;
  flex-shrink: 1;
  flex-grow: 1;
  min-width: 50px;
}

.util-inline-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.util-inline-emoji {
  font-size: 1.3rem;
}

.util-inline-titulo {
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- FAB ETIQUETAS ---------- */
.cal-etiquetas-fab {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-principal, #6b46c1);
  color: white;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(107, 70, 193, 0.4);
  cursor: pointer;
  border: none;
  z-index: 3200;
  transition: transform 0.3s, box-shadow 0.3s;
}

.cal-etiquetas-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 28px rgba(107, 70, 193, 0.5);
}

/* ---------- POPUP ETIQUETAS ---------- */
.cal-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  z-index: 3400;
}

.cal-etiquetas-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  z-index: 3500;
  width: 250px;
  max-height: 300px;
  overflow-y: auto;
}

.cal-etiquetas-popup h4 {
  margin: 0 0 12px;
  color: var(--color-principal, #6b46c1);
  text-align: center;
}

.cal-etiquetas-popup .grupo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.cal-etiquetas-popup .grupo-item:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
}

.cal-etiquetas-popup .grupo-emoji {
  font-size: 1.2rem;
}

.cal-etiquetas-popup .grupo-nombre {
  font-weight: 500;
  color: var(--color-principal, #6b46c1);
}

/* ---------- GRID CALENDARIO ---------- */
.calendario-grid {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  transition: opacity 0.3s;
  opacity: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ========== VISTAS DEL CALENDARIO ========== */
.cal-semana-dias {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  text-align: center;
  font-weight: 600;
  color: var(--color-principal, #6b46c1);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* =====================================================
   FIX: CUADROS DEL MES QUE NO SE MUEVEN Y LLENAN EL ALTO
   - grid-auto-rows: 1fr  → cada fila ocupa el espacio disponible
   - flex: 1              → el grid se estira para ocupar todo el alto
   ===================================================== */
.cal-mes-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.cal-dia {
  background: white;
  border-radius: 12px;
  padding: 8px;
  overflow: hidden;
  /* ← los eventos no empujan el cuadro */
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
  min-height: 0;
}

.cal-dia:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.15);
  background: var(--color-principal, #6b46c1);
  color: white;
}

.cal-dia:hover .cal-dia-num {
  color: white;
}

.cal-dia.hoy {
  background: var(--color-principal, #6b46c1);
  color: white;
}

.cal-dia.hoy .cal-dia-num {
  color: white;
}

.cal-dia-num {
  font-weight: 700;
  font-size: 1rem;
  color: #333;
  flex-shrink: 0;
}

.cal-dia-eventos {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  /* ← los chips no desborden el cuadro */
  flex: 1;
  min-height: 0;
}

.cal-mini-event {
  font-size: 0.65rem;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s;
  display: block;
  /* ← ocupa todo el ancho disponible */
  width: 100%;
  box-sizing: border-box;
}

.cal-mini-event:hover {
  opacity: 0.8;
}

.cal-dia-vacio {
  background: #fafafa;
  border-radius: 12px;
  min-height: 0;
  box-sizing: border-box;
}

/* Vista DÍA */
.cal-vista-dia {
  padding-bottom: 20px;
}

.cal-dia-header {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 2px;
  margin-bottom: 2px;
}

.cal-dia-header-dia {
  text-align: center;
  font-weight: 600;
  padding: 8px;
  border-radius: 8px 8px 0 0;
  font-size: 0.85rem;
  background: white;
  border: 1px solid #d0d0d0;
  border-bottom: 2px solid var(--color-principal, #6b46c1);
}

.cal-dia-header-dia.hoy {
  background: var(--color-principal, #6b46c1);
  color: white;
  border-color: var(--color-principal, #6b46c1);
}

.cal-dia-cuerpo {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 0;
  background: #d0d0d0;
}

.cal-dia-cuerpo .cal-semana-hora {
  font-size: 0.7rem;
  color: #555;
  padding: 6px 4px;
  text-align: right;
  background: #f9f9f9;
  border-bottom: 1px solid #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 50px;
  box-sizing: border-box;
}

.cal-dia-cuerpo .cal-semana-celda {
  border-bottom: 1px solid #d0d0d0;
  height: 50px;
  background: white;
  padding: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: flex-start;
  cursor: pointer;
  transition: background 0.15s;
  box-sizing: border-box;
  overflow: hidden;
}

.cal-dia-cuerpo .cal-semana-celda:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 10%, white);
}

/* Línea de hora actual */
.cal-ahora-contenedor {
  position: absolute;
  left: 0;
  right: 10px;
  height: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  padding-left: 85px;
  box-sizing: border-box;
}

.cal-ahora-punto {
  width: 14px;
  height: 14px;
  background: #e74c3c;
  border: 3px solid white;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #e74c3c;
  z-index: 2;
  align-self: center;
}

.cal-ahora-linea {
  flex: 1;
  height: 2px;
  background: #e74c3c;
  align-self: center;
}

.cal-ahora-caja {
  background: #e74c3c;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  margin-left: 4px;
  flex-shrink: 0;
  align-self: center;
}

/* Vista SEMANA */
.cal-semana-header {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}

.cal-semana-header::before {
  content: "";
  display: block;
}

.cal-semana-dia {
  text-align: center;
  font-weight: 600;
  padding: 8px;
  border-radius: 8px 8px 0 0;
  font-size: 0.85rem;
  background: white;
  border: 1px solid #d0d0d0;
  border-bottom: 2px solid var(--color-principal, #6b46c1);
}

.cal-semana-dia.hoy {
  background: var(--color-principal, #6b46c1);
  color: white;
  border-color: var(--color-principal, #6b46c1);
}

.cal-semana-cuerpo {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 0;
  background: #d0d0d0;
}

.cal-semana-cuerpo .cal-semana-hora {
  font-size: 0.7rem;
  color: #555;
  padding: 6px 4px;
  text-align: right;
  background: #f9f9f9;
  border-bottom: 1px solid #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 50px;
  box-sizing: border-box;
}

.cal-semana-cuerpo .cal-semana-celda {
  height: 50px;
  border-bottom: 1px solid #d0d0d0;
  border-right: 1px solid #d0d0d0;
  padding: 2px;
  background: white;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: flex-start;
  cursor: pointer;
  transition: background 0.15s;
  box-sizing: border-box;
  overflow: hidden;
}

.cal-semana-cuerpo .cal-semana-celda:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 10%, white);
}

.cal-semana-cuerpo .cal-semana-celda:nth-child(8n) {
  border-right: none;
}

/* Vista 3 DÍAS */
.cal-3dias .cal-3dias-header {
  display: grid;
  grid-template-columns: 60px repeat(3, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}

.cal-3dias .cal-3dias-header::before {
  content: "";
  display: block;
}

.cal-3dias-dia {
  text-align: center;
  font-weight: 600;
  padding: 8px;
  border-radius: 8px 8px 0 0;
  font-size: 0.85rem;
  background: white;
  border: 1px solid #d0d0d0;
  border-bottom: 2px solid var(--color-principal, #6b46c1);
}

.cal-3dias-dia.hoy {
  background: var(--color-principal, #6b46c1);
  color: white;
  border-color: var(--color-principal, #6b46c1);
}

.cal-3dias-cuerpo {
  display: grid;
  grid-template-columns: 60px repeat(3, 1fr);
  gap: 0;
  background: #d0d0d0;
}

.cal-3dias-cuerpo .cal-semana-hora {
  font-size: 0.7rem;
  color: #555;
  padding: 6px 4px;
  text-align: right;
  background: #f9f9f9;
  border-bottom: 1px solid #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 50px;
  box-sizing: border-box;
}

.cal-3dias-cuerpo .cal-semana-celda {
  height: 50px;
  border-bottom: 1px solid #d0d0d0;
  border-right: 1px solid #d0d0d0;
  cursor: pointer;
  transition: background 0.15s;
  box-sizing: border-box;
  overflow: hidden;
  padding: 2px;
  background: white;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: flex-start;
}

.cal-3dias-cuerpo .cal-semana-celda:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 10%, white);
}

.cal-3dias-cuerpo .cal-semana-celda:nth-child(4n) {
  border-right: none;
}

/* Vistas múltiples meses */
.cal-multi-mes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.cal-mini-mes {
  background: white;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cal-mini-mes-titulo {
  font-weight: 700;
  color: var(--color-principal);
  text-align: center;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.cal-mini-mes-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 0.65rem;
}

.cal-mini-dia {
  padding: 4px 2px;
  border-radius: 4px;
  cursor: pointer;
}

.cal-mini-dia.tiene-eventos {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  font-weight: bold;
}

/* Vista AGENDA */
.cal-agenda-lista {
  display: flex;
  flex-direction: column;
}

.cal-agenda-mes-header {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-principal, #6b46c1);
  padding: 16px;
  background: white;
  border-bottom: 2px solid color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  position: sticky;
  top: 0;
  z-index: 5;
}

.cal-agenda-dia {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 60px;
}

.cal-agenda-dia:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 5%, white);
}

.cal-agenda-dia.hoy {
  background: linear-gradient(90deg, color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white), color-mix(in srgb, var(--color-principal, #6b46c1) 5%, white));
  border-left: 4px solid #6b46c1;
}

.cal-agenda-dia-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 80px;
  flex-shrink: 0;
}

.cal-agenda-dia-numero {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-principal, #6b46c1);
  width: 40px;
  text-align: center;
}

.cal-agenda-dia-info {
  display: flex;
  flex-direction: column;
}

.cal-agenda-dia-nombre {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-principal, #6b46c1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-agenda-dia-semana {
  font-size: 0.7rem;
  color: #999;
  font-weight: 500;
}

.cal-agenda-dia-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-agenda-noevents {
  font-size: 0.75rem;
  color: #ccc;
  font-weight: 600;
  letter-spacing: 1px;
  font-style: italic;
}

.cal-agenda-evento-chip {
  display: inline-block;
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  cursor: pointer;
  transition: opacity 0.2s;
}

.cal-agenda-evento-chip:hover {
  opacity: 0.85;
}

.cal-chip {
  display: inline-block;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.cal-chip:hover {
  opacity: 0.85;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
  .calendario-mes-titulo {
    font-size: 1rem;
    margin: 0 4px;
  }

  .cal-selector-box {
    width: 270px;
    padding: 20px;
  }

  /* Los cuadros se estiran para llenar el alto — sin altura fija */
  .cal-mes-grid {
    gap: 4px;
  }

  .cal-dia {
    padding: 5px;
  }

  .cal-dia-num {
    font-size: 0.75rem;
  }

  .cal-semana-dias {
    font-size: 0.7rem;
  }

  .calendario-sidebar {
    width: 260px;
    left: -260px;
  }

  .cal-ahora-contenedor {
    padding-left: 58px;
    right: 8px;
  }

  .cal-utils-inline {
    gap: 12px;
  }

  .util-inline-item {
    min-width: 40px;
    padding: 4px 6px;
  }

  .cal-semana-header,
  .cal-semana-cuerpo {
    grid-template-columns: 45px repeat(7, 1fr);
  }

  .cal-semana-cuerpo .cal-semana-celda:nth-child(8n) {
    border-right: none;
  }

  .cal-3dias .cal-3dias-header,
  .cal-3dias-cuerpo {
    grid-template-columns: 45px repeat(3, 1fr);
  }

  .cal-3dias-cuerpo .cal-semana-celda:nth-child(4n) {
    border-right: none;
  }

  .cal-dia-header,
  .cal-dia-cuerpo {
    grid-template-columns: 45px 1fr;
  }

  .cal-dia-cuerpo .cal-semana-hora,
  .cal-semana-cuerpo .cal-semana-hora,
  .cal-3dias-cuerpo .cal-semana-hora {
    height: 45px;
    font-size: 0.65rem;
  }

  .cal-dia-cuerpo .cal-semana-celda,
  .cal-semana-cuerpo .cal-semana-celda,
  .cal-3dias-cuerpo .cal-semana-celda {
    height: 45px;
  }

  .cal-agenda-dia {
    padding: 10px 12px;
    gap: 10px;
    min-height: 50px;
  }

  .cal-agenda-dia-numero {
    font-size: 1.3rem;
    width: 32px;
  }

  .cal-agenda-dia-nombre {
    font-size: 0.75rem;
  }

  .cal-agenda-dia-semana {
    font-size: 0.6rem;
  }

  .cal-agenda-evento-chip {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .cal-agenda-noevents {
    font-size: 0.65rem;
  }

  .cal-agenda-mes-header {
    font-size: 0.95rem;
    padding: 12px;
  }

  .calendario-header {
    padding: 8px 10px;
    gap: 6px;
  }

  .calendario-btn-menu,
  .calendario-btn-notas,
  .calendario-btn-buscar,
  .calendario-btn-config,
  .calendario-dia-box {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .calendario-nav {
    padding: 4px 8px;
  }

  .calendario-nav-btn,
  .calendario-btn-utils {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  .calendario-mes-titulo {
    font-size: 0.85rem;
  }

  .cal-agenda-dia {
    padding: 8px 10px;
  }

  .cal-agenda-dia-left {
    min-width: 60px;
    gap: 8px;
  }

  .cal-agenda-dia-numero {
    font-size: 1.1rem;
    width: 28px;
  }

  .calendario-header-center {
    gap: 6px;
  }
}


/* ================================================================
   ESTILOS DEL EDITOR DE NOTA (OVERLAY)
   ================================================================ */
.nota-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nota-editor-container {
  background: white;
  width: 100%;
  max-width: 600px;
  height: 90vh;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

/* Div1 - Header */
.nota-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.nota-editor-volver {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--color-principal, #6b46c1);
  cursor: pointer;
}

.nota-editor-titulo {
  flex: 1;
  margin: 0 12px;
  font-size: 1.1rem;
  border: none;
  outline: none;
  background: transparent;
  font-weight: 600;
  color: #333;
}

.nota-editor-titulo::placeholder {
  color: #aaa;
  font-weight: 400;
}

.nota-editor-acciones {
  display: flex;
  gap: 8px;
}

.nota-editor-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  color: var(--color-principal, #6b46c1);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.nota-editor-btn:hover {
  background: var(--color-principal, #6b46c1);
  color: white;
}

/* Div2 - Ajustes */
.nota-editor-ajustes {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #eee;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.nota-fecha-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #000000;
  transition: background 0.2s;
}

.nota-fecha-btn:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 20%, white);
}

.nota-agenda-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #000000;
  transition: background 0.2s;
}

.nota-agenda-btn:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 20%, white);
}

/* Hoja de selección de grupo */
.nota-grupo-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #eee;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding: 16px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 10;
  border-radius: 16px 16px 0 0;
}

.nota-grupo-sheet.open {
  transform: translateY(0);
}

.nota-grupo-sheet h4 {
  margin: 0 0 12px;
  text-align: center;
  color: var(--color-principal, #6b46c1);
  font-size: 0.95rem;
}

.nota-grupo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.nota-grupo-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid #e0d8f0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-principal, #6b46c1);
}

.nota-grupo-option:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  border-color: var(--color-principal, #6b46c1);
}

.nota-grupo-option.seleccionado {
  background: var(--color-principal, #6b46c1);
  color: white;
  border-color: var(--color-principal, #6b46c1);
}

.nota-grupo-option .grupo-icono {
  font-size: 1.5rem;
}

/* Div3 - Herramientas */
.nota-editor-herramientas {
  padding: 10px 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.herramientas-inicio {
  display: flex;
  align-items: center;
}

.nota-rating {
  display: flex;
  gap: 2px;
  font-size: 1.2rem;
  color: #ffc107;
}

.nota-rating .estrella {
  cursor: pointer;
  color: #ddd;
  transition: color 0.2s;
}

.nota-rating .estrella.activa {
  color: #ffc107;
}

.herramientas-centro {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nota-paleta-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #6b46c1;
  padding: 4px;
  position: relative;
}

.paleta-popup {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  gap: 8px;
  z-index: 20;
}

.paleta-color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s, border 0.2s;
}

.paleta-color:hover {
  transform: scale(1.2);
  border-color: #ccc;
}

.herramientas-final {
  display: flex;
  align-items: center;
}

.nota-frases-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #6b46c1;
  padding: 4px;
  position: relative;
}

.frases-popup {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: white;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
  min-width: 260px;
}

.frases-popup .frase-chip {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  border: 1px solid #e0d8f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--color-principal);  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: normal;
}

.frases-popup .frase-chip:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 20%, white);
  border-color: #6b46c1;
}

/* Div4 - Contenido principal */
.nota-editor-contenido {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.nota-tipo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.nota-tipo-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-principal, #6b46c1);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #e0d8f0;
  transition: all 0.2s;
}

.nota-tipo-option:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
}

.nota-tipo-option.seleccionado {
  background: var(--color-principal, #6b46c1);
  color: white;
  border-color: var(--color-principal, #6b46c1);
}

.nota-tipo-option input {
  display: none;
}

.nota-descripcion-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nota-descripcion-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-principal, #6b46c1);
}

.nota-descripcion-label i {
  color: var(--color-principal, #6b46c1);
}

.nota-descripcion-textarea {
  width: 100%;
  border: 1px solid #e0d8f0;
  border-radius: 10px;
  padding: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.nota-descripcion-textarea:focus {
  border-color: #6b46c1;
}

.nota-descripcion-textarea::placeholder {
  color: #aaa;
}

.nota-fechas-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nota-fecha-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
}

.nota-fecha-inicio i {
  color: #3498db;
}

.nota-fecha-fin i {
  color: #e74c3c;
}

.nota-fecha-item input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.8rem;
  color: var(--color-principal, #6b46c1);
  width: auto;
}

.nota-cumple-repeat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #e67e22;
}

.nota-alarma-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nota-alarma-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-principal, #6b46c1);
}

.nota-alarma-label i {
  color: #f39c12;
}

.nota-alarma-opciones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nota-alarma-chip {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #e0d8f0;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: var(--color-principal, #6b46c1);
}

.nota-alarma-chip:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
}

.nota-alarma-chip.seleccionado {
  background: var(--color-principal, #6b46c1);
  color: white;
  border-color: var(--color-principal, #6b46c1);
}

.nota-repetir-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-principal, #6b46c1);
}

.nota-repetir-row input {
  border: 1px solid #e0d8f0;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.8rem;
  outline: none;
  width: 180px;
}

.nota-modulos-externos {
  border-top: 1px solid #eee;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.nota-modulos-externos h4 {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-principal, #6b46c1);
  font-weight: 600;
  flex-shrink: 0;
}

.nota-modulo-item {
  background: #fafafa;
  border-radius: 10px;
  padding: 10px;
  font-size: 0.85rem;
  color: #333;
  border: 1px solid #eee;
}

.nota-datetime-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nota-orden-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #aaa;
  padding: 4px;
}

.nota-orden-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== MENÚ DE ADJUNTOS ========== */
.adjuntos-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 5100;
  display: none;
}

.adjuntos-menu-overlay.show {
  display: block;
}

.adjuntos-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  z-index: 5200;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}

.adjuntos-menu.open {
  transform: translateY(0);
}

.adjuntos-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.adjuntos-menu-header h3 {
  margin: 0;
  color: var(--color-principal, #6b46c1);
  font-size: 1.1rem;
}

.adjuntos-menu-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
}

.adjuntos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.adjunto-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 15px 10px;
  border-radius: 12px;
  border: 1px solid #e0d8f0;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}

.adjunto-item:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  border-color: #6b46c1;
  transform: translateY(-2px);
}

.adjunto-item .adjunto-icono {
  font-size: 1.8rem;
}

.adjunto-item .adjunto-label {
  font-size: 0.75rem;
  color: var(--color-principal, #6b46c1);
  text-align: center;
  font-weight: 500;
}

/* ========== MÓDULOS DE CONTENIDO ADICIONAL ========== */
.modulo-adicional {
  background: #fafafa;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  position: relative;
  margin-bottom: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.modulo-adicional:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.modulo-adicional.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.modulo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.modulo-header-icono {
  font-size: 1.2rem;
}

.modulo-header-titulo {
  font-weight: 600;
  color: var(--color-principal, #6b46c1);
  font-size: 0.85rem;
  flex: 1;
}

.modulo-controles {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.modulo-adicional:hover .modulo-controles {
  opacity: 1;
}

.modulo-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  color: #6b46c1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.modulo-btn:hover {
  background: #6b46c1;
  color: white;
}

.modulo-btn.eliminar {
  background: #fee;
  color: #e74c3c;
}

.modulo-btn.eliminar:hover {
  background: #e74c3c;
  color: white;
}

/* 1. Mi Diario */
.diario-clima {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.diario-clima select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: white;
  font-size: 1.2rem;
  cursor: pointer;
}

.diario-temperatura {
  display: flex;
  align-items: center;
  gap: 4px;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  padding: 4px 10px;
  border-radius: 8px;
}

.diario-temperatura input {
  width: 50px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-principal);
  outline: none;
}

.diario-animo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.diario-animo select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: white;
  font-size: 1.3rem;
  cursor: pointer;
}

/* 2. Fotos */
.modulo-foto-container {
  position: relative;
  display: inline-block;
}

.modulo-foto-container img {
  max-width: 100%;
  border-radius: 8px;
  max-height: 200px;
  object-fit: cover;
}

.modulo-foto-input {
  display: none;
}

.modulo-foto-btn {
  padding: 8px 16px;
  background: #6b46c1;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

/* 3. Lista de Tareas */
.tareas-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--color-principal, #6b46c1);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.tarea-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}

.tarea-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #6b46c1;
}

.tarea-item input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  color: #333;
  outline: none;
  border-bottom: 1px solid transparent;
  padding: 2px;
}

.tarea-item input[type="text"]:focus {
  border-bottom-color: #6b46c1;
}

.tarea-item input[type="text"].tachado {
  text-decoration: line-through;
  color: #999;
}

.tarea-eliminar {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.tarea-item:hover .tarea-eliminar {
  opacity: 1;
}

.tarea-add-btn {
  margin-top: 8px;
  padding: 6px 12px;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  color: #6b46c1;
  border: 1px solid #e0d8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tarea-add-btn:hover {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 20%, white);
}

/* 4. Economía */
.economia-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--color-principal, #6b46c1);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.economia-balance {
  background: #f0fff4;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: #2ecc71;
  margin-bottom: 12px;
}

.economia-fila {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: white;
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid #eee;
}

.economia-tipo-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.economia-tipo-btn.gasto {
  background: #fee;
  color: #e74c3c;
}

.economia-tipo-btn.ingreso {
  background: #f0fff4;
  color: #2ecc71;
}

.economia-monto {
  flex: 1;
  border: none;
  background: #f9f9f9;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: right;
}

.economia-monto:focus {
  outline: none;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
}

.economia-add-btn {
  margin-top: 8px;
  padding: 6px 12px;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  color: #6b46c1;
  border: 1px solid #e0d8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  width: 100%;
}

/* 5. GPS */
.gps-container {
  background: #f0f8ff;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.gps-mapa-placeholder {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  padding: 40px 20px;
  color: white;
  margin-bottom: 10px;
  cursor: grab;
  position: relative;
  overflow: hidden;
}

.gps-mapa-placeholder::before {
  content: "📍";
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.gps-instrucciones {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 10px;
}

.gps-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.gps-btn {
  padding: 6px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.gps-btn.cancelar {
  background: #fee;
  color: #e74c3c;
}

.gps-btn.aceptar {
  background: #f0fff4;
  color: #2ecc71;
}

.gps-coords {
  font-family: monospace;
  font-size: 0.75rem;
  color: #6b46c1;
  margin-top: 6px;
}

/* 6. Hoja de Cálculo */
.calc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--color-principal, #6b46c1);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.calc-tabla {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.8rem;
}

.calc-tabla th,
.calc-tabla td {
  border: 1px solid #ddd;
  padding: 6px;
  text-align: center;
  min-width: 60px;
}

.calc-tabla th {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  color: #6b46c1;
  font-weight: 600;
}

.calc-tabla td input {
  width: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 0.8rem;
  outline: none;
}

.calc-tabla td input:focus {
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 10%, white);
}

.calc-btns {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.calc-btn {
  padding: 4px 10px;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  color: #6b46c1;
  border: 1px solid #e0d8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
}

.calc-instrucciones {
  font-size: 0.7rem;
  color: #999;
  margin-top: 6px;
  font-style: italic;
}

/* 7. Grabadora */
.grabador-container {
  background: #fff5f5;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.grabador-icono {
  font-size: 2rem;
  margin-bottom: 8px;
}

.grabador-desc {
  border: none;
  background: transparent;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-principal, #6b46c1);
  width: 100%;
  outline: none;
  margin-bottom: 8px;
}

.grabador-duracion {
  font-family: monospace;
  font-size: 1rem;
  color: #e74c3c;
  margin-bottom: 8px;
}

.grabador-btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.grabador-btn.grabar {
  background: #e74c3c;
  color: white;
}

.grabador-btn.grabar:hover {
  background: #c0392b;
}

.grabador-btn.detener {
  background: #2ecc71;
  color: white;
}

.grabador-btn.detener:hover {
  background: #27ae60;
}

/* 8. Dibujo */
.dibujo-container {
  text-align: center;
}

.dibujo-btn {
  padding: 10px 20px;
  background: var(--color-principal);
  /* <-- Cambio aquí */
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.dibujo-preview {
  margin-top: 8px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #eee;
}

/* 9. Archivos */
.archivo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: white;
  border-radius: 8px;
  border: 1px solid #eee;
}

.archivo-icono {
  font-size: 1.5rem;
}

.archivo-info {
  flex: 1;
}

.archivo-nombre {
  font-size: 0.8rem;
  color: var(--color-principal, #6b46c1);
  font-weight: 500;
}

.archivo-tipo {
  font-size: 0.7rem;
  color: #999;
}

.archivo-input {
  display: none;
}

.archivo-btn {
  padding: 6px 12px;
  background: color-mix(in srgb, var(--color-principal, #6b46c1) 12%, white);
  color: #6b46c1;
  border: 1px solid #e0d8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
}

/* ========== RESPONSIVE EDITOR ========== */
@media (max-width: 480px) {
  .nota-editor-container {
    max-width: 100%;
    height: auto;
    max-height: 90vh;
    border-radius: 0;
    overflow: hidden;
  }

  .nota-grupo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nota-tipo-row {
    flex-wrap: wrap;
  }

  .nota-fechas-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .nota-alarma-opciones {
    justify-content: flex-start;
  }
}