/* ==========================================================================
   COMPONENTES VISUALES: ESTILO CENTRO INTEGRAL TALENTIA
   ========================================================================== */

/* 1. BARRA DE NAVEGACIÓN SEMANAL */
.calendar-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-nav {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  color: var(--secondary-color);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-nav:hover {
  background: #e2e8f0;
  color: var(--primary-dark);
}

.btn-today {
  background: rgba(0, 168, 204, 0.1);
  border-color: rgba(0, 168, 204, 0.35);
  color: var(--primary-dark);
}

.btn-today:hover {
  background: var(--primary-color);
  color: #fff;
}

.week-title-display {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary-color);
}

.week-title-display i {
  color: var(--primary-color);
}

.date-input-custom {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
}

/* 2. CALENDARIO SEMANAL / GRID */
.calendar-container {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  overflow-x: auto;
}

.calendar-loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.calendar-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 1rem;
}

/* Columna de Día */
.calendar-day-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.calendar-day-col.is-today {
  border-color: var(--primary-color);
  background: rgba(0, 168, 204, 0.03);
  box-shadow: 0 0 0 2px rgba(0, 168, 204, 0.15);
}

.day-header {
  text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.day-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary-color);
}

.day-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.calendar-day-col.is-today .day-name {
  color: var(--primary-color);
}

.calendar-day-col.is-today .day-date {
  color: var(--secondary-color);
  font-weight: 700;
}

/* Slots Horarios */
.slots-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.time-slot-card {
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: var(--transition);
  position: relative;
}

.slot-time-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.slot-status-label {
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ESTADO 1: DISPONIBLE (VERDE TALENTIA) */
.time-slot-card.available {
  background: #f0fdf4;
  border: 1px solid #86efac;
  cursor: pointer;
}

.time-slot-card.available .slot-time-label {
  color: #166534;
}

.time-slot-card.available .slot-status-label {
  color: #15803d;
}

.time-slot-card.available:hover {
  background: #dcfce7;
  border-color: #22c55e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.time-slot-card.available .btn-slot-book {
  margin-top: 0.35rem;
  background: var(--pastel-turquoise);
  color: #064e3b;
  border: 1px solid rgba(6, 78, 59, 0.15);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.time-slot-card.available:hover .btn-slot-book {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-dark);
}

/* ESTADO 2: OCUPADO (ROJO - PLAZA FIJA ASIGNADA) */
.time-slot-card.occupied {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  cursor: not-allowed;
}

.time-slot-card.occupied .slot-time-label {
  color: #991b1b;
}

.time-slot-card.occupied .slot-status-label {
  color: #b91c1c;
}

/* ESTADO 3: FESTIVO / NO LECTIVO (DORADO / ÁMBAR) */
.time-slot-card.holiday-slot {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  cursor: not-allowed;
}

.time-slot-card.holiday-slot .slot-time-label {
  color: #92400e;
}

.time-slot-card.holiday-slot .slot-status-label {
  color: #b45309;
  font-weight: 700;
}

/* ESTADO 4: CLASE ANULADA PUNTUAL */
.time-slot-card.cancelled-slot {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  cursor: not-allowed;
}

.time-slot-card.cancelled-slot .slot-time-label {
  color: var(--text-muted);
}

.time-slot-card.cancelled-slot .slot-status-label {
  color: #64748b;
  font-size: 0.74rem;
}

/* ESTADO 5: VIERNES NO LABORABLE (ASUNTOS PROPIOS) */
.time-slot-card.friday-locked {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  cursor: not-allowed;
}

.time-slot-card.friday-locked .slot-time-label {
  color: var(--text-muted);
}

.time-slot-card.friday-locked .slot-status-label {
  color: #d97706;
  font-size: 0.72rem;
}

/* ESTADO 6: TRAMO PASADO */
.time-slot-card.past-slot {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  cursor: not-allowed;
  opacity: 0.65;
}

.time-slot-card.past-slot .slot-time-label,
.time-slot-card.past-slot .slot-status-label {
  color: var(--text-dim);
}

/* 3. TARJETAS INFORMATIVAS PÚBLICAS */
.public-footer-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.info-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.info-card i {
  font-size: 1.4rem;
  color: var(--primary-color);
  background: rgba(0, 168, 204, 0.1);
  padding: 0.75rem;
  border-radius: var(--radius-md);
}

.info-card h4 {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.25rem;
}

.info-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   4. PANEL DE ADMINISTRACIÓN - CABECERA
   ========================================================================== */
.admin-topbar {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
}

.admin-status-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.admin-status-line h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--secondary-color);
}

.badge-encryption {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

#adminSessionSubtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-action {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  color: var(--secondary-color);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-action:hover {
  background: #e2e8f0;
  color: var(--primary-dark);
}

.btn-action.btn-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.btn-action.btn-success:hover {
  background: #d1fae5;
}

/* ==========================================================================
   5. MODO CLASE (ESCUDO DE PRIVACIDAD VISUAL TALENTIA)
   ========================================================================== */
.class-mode-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.class-mode-shield-banner {
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  border: 1px solid #fecaca;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.shield-icon {
  width: 50px;
  height: 50px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #dc2626;
  flex-shrink: 0;
}

.shield-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.shield-title-row h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #991b1b;
}

.tag-live-slot {
  background: #dc2626;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.shield-content p {
  color: #7f1d1d;
  font-size: 0.88rem;
  line-height: 1.45;
}

/* Tarjeta del Alumno en Clase Actual */
.current-class-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.student-live-profile {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.live-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.student-main-identity {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.student-badge-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  box-shadow: var(--shadow-glow-primary);
}

.student-name-group h2 {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--secondary-color);
  margin-bottom: 0.25rem;
}

.student-badges-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.badge-course {
  background: #f1f5f9;
  color: var(--secondary-color);
  border: 1px solid #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-subject {
  background: rgba(0, 168, 204, 0.12);
  color: var(--primary-dark);
  border: 1px solid rgba(0, 168, 204, 0.3);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-phone {
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.live-notes-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.editor-header-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-header-line h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-notes-area {
  width: 100%;
  min-height: 180px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
}

.live-notes-area:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 168, 204, 0.18);
  background: #ffffff;
}

.live-notes-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-save-status {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.empty-slot-card {
  text-align: center;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-slot-card i {
  font-size: 3rem;
  color: var(--text-dim);
}

.empty-slot-card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--secondary-color);
}

.empty-slot-card p {
  color: var(--text-muted);
  max-width: 500px;
  font-size: 0.9rem;
}

.privacy-override-box {
  background: #ffffff;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.btn-link-override {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--secondary-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-link-override:hover {
  background: #f1f5f9;
  color: var(--primary-dark);
}

/* ==========================================================================
   6. GESTIÓN COMPLETA (FUERA DE HORAS CLASE)
   ========================================================================== */
.admin-full-management {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.management-header-banner {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.banner-title h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--secondary-color);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.banner-title p {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.banner-badge {
  background: rgba(0, 168, 204, 0.1);
  border: 1px solid rgba(0, 168, 204, 0.3);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Tarjetas de Métricas */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  flex-shrink: 0;
}

.bg-blue { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); }

.stat-data {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--secondary-color);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Filtros y Buscador */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 260px;
}

.search-input-wrap i {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.86rem;
  outline: none;
}

.search-input-wrap input:focus {
  border-color: var(--primary-color);
  background: #fff;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.form-select-filter {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--secondary-color);
  font-weight: 500;
  padding: 0.55rem 0.85rem;
  font-size: 0.84rem;
  outline: none;
}

.btn-refresh {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-refresh:hover {
  color: var(--primary-color);
  background: #fff;
}

/* Tabla */
.admin-table-container {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.admin-table th {
  background: #f8fafc;
  padding: 0.95rem 1.15rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--secondary-color);
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

.text-right {
  text-align: right;
}

.cell-datetime {
  display: flex;
  flex-direction: column;
}

.cell-date {
  font-weight: 700;
  color: var(--secondary-color);
}

.cell-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary-dark);
  font-weight: 600;
}

.cell-student-name {
  font-weight: 700;
  color: var(--secondary-color);
}

.cell-student-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.cell-notes-preview {
  max-width: 320px;
  max-height: 90px;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 4px 6px 4px 0;
}

.cell-notes-preview::-webkit-scrollbar {
  width: 5px;
}

.cell-notes-preview::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.cell-notes-preview::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.cell-notes-preview::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.table-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.btn-table-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #f8fafc;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-table-action:hover {
  background: #ffffff;
}

.btn-table-action.edit:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-table-action.delete:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.table-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.table-empty-state i {
  font-size: 2.5rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

/* Snippets */
.label-with-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-snippets {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-snippet {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--secondary-color);
}

.btn-snippet:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-snippet-exam {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.btn-snippet-exam:hover {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.btn-snippet-homework {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.btn-snippet-homework:hover {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.btn-snippet-progress {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.btn-snippet-progress:hover {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.btn-snippet-grade {
  background: #fdf2f8;
  color: #be185d;
  border-color: #fbcfe8;
}
.btn-snippet-grade:hover {
  background: #fce7f3;
  color: #9d174d;
  border-color: #f9a8d4;
}


/* Pestañas de Backup */
.backup-tabs-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.backup-section-card {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.backup-section-card h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--secondary-color);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.backup-section-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.file-upload-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.file-input-hidden {
  display: none;
}

.file-chosen-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.firebase-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.status-badge-local {
  font-size: 0.8rem;
  color: #047857;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.firebase-config-fields {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.config-instructions {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   7. MATRÍCULA SEMANAL Y SELECTOR DE HORARIOS MÚLTIPLES
   ========================================================================== */
.modal-card.modal-lg {
  max-width: 820px;
}

.field-help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.weekly-slot-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.slot-day-col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
}

.day-selector-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--secondary-color);
  text-align: center;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.2rem;
}

.slot-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-family: var(--font-mono);
  color: var(--text-main);
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  background: #f8fafc;
}

.slot-checkbox-label:hover {
  background: #e0f2fe;
}

.slot-checkbox-label input[type="checkbox"] {
  cursor: pointer;
}

.slot-checkbox-label input[type="checkbox"]:checked + span {
  font-weight: 700;
  color: var(--primary-dark);
}

.slot-checkbox-label.slot-occupied {
  background: #fef2f2 !important;
  border: 1px dashed #fca5a5 !important;
  color: #991b1b !important;
  cursor: not-allowed !important;
  opacity: 0.75;
}

.slot-checkbox-label.slot-occupied input[type="checkbox"] {
  cursor: not-allowed !important;
}

.slot-checkbox-label.slot-occupied:hover {
  background: #fee2e2 !important;
}

.badge-slot-occupied-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: auto;
  white-space: nowrap;
}

/* Badges de Estado Alta / Baja del Alumno */
.badge-status-active {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-status-active .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.badge-status-inactive {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-status-inactive .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.badge-enrollment-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
}

/* Chips de Horarios Semanales en la Tabla */
.cell-schedule-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 280px;
}

.badge-schedule-chip {
  background: rgba(0, 168, 204, 0.1);
  color: var(--primary-dark);
  border: 1px solid rgba(0, 168, 204, 0.25);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Lista de Festivos */
.holidays-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
}

.holiday-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
}

.holiday-item-info strong {
  display: block;
  font-size: 0.86rem;
  color: var(--secondary-color);
}

.holiday-item-info span {
  font-size: 0.78rem;
  color: #b45309;
}

.legend-dot.gold {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

/* ==========================================================================
   SELECTOR TÁCTIL DE DÍAS PARA MÓVIL (MOBILE DAY TABS)
   ========================================================================== */
.mobile-day-tabs {
  display: none;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.4rem 0.2rem 0.75rem;
  margin-bottom: 0.75rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mobile-day-tabs::-webkit-scrollbar {
  display: none;
}

.mobile-day-tab {
  flex: 1 0 auto;
  min-width: 62px;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.55rem 0.45rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  user-select: none;
}

.mobile-day-tab .tab-day-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mobile-day-tab .tab-day-date {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-heading);
}

.mobile-day-tab:hover {
  border-color: var(--primary-color);
  background: rgba(0, 168, 204, 0.05);
}

.mobile-day-tab.active {
  background: var(--primary-color);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 168, 204, 0.35);
  transform: translateY(-1px);
}

.mobile-day-tab.active .tab-day-name,
.mobile-day-tab.active .tab-day-date {
  color: #fff;
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 768px) {
  .mobile-day-tabs {
    display: flex;
  }

  .calendar-grid-wrapper {
    display: block;
  }

  .calendar-day-col {
    display: none;
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }

  .calendar-day-col.mobile-active {
    display: flex;
    animation: fadeInDay 0.25s ease-out;
  }

  .calendar-nav-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .nav-controls {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr 1fr;
    gap: 0.35rem;
  }

  .btn-nav {
    padding: 0.55rem 0.35rem;
    font-size: 0.76rem;
    justify-content: center;
  }

  .week-title-display {
    text-align: center;
    justify-content: center;
    font-size: 0.92rem;
  }

  .date-picker-shortcut {
    width: 100%;
  }

  .date-picker-shortcut input {
    width: 100%;
  }

  .time-slot-card {
    padding: 0.95rem 1.05rem;
    min-height: 58px;
  }

  .time-slot-card .slot-time-label {
    font-size: 0.9rem;
  }

  .time-slot-card .slot-status-label {
    font-size: 0.82rem;
  }

  .btn-slot-book {
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    margin-top: 0.3rem;
  }

  .talentia-hero {
    padding: 1.15rem;
    gap: 0.85rem;
  }

  .hero-text-block h2 {
    font-size: 1.35rem;
  }

  .hero-quote {
    font-size: 0.86rem;
  }

  .legend-card {
    padding: 0.75rem;
  }

  .public-footer-info {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .weekly-slot-selector-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .nav-controls {
    grid-template-columns: 1fr 1fr;
  }
  .weekly-slot-selector-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes fadeInDay {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   ENLACES LEGALES Y MODAL DE POLÍTICAS (TALENTIA)
   ========================================================================== */
.footer-legal-links {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.82rem;
}

.footer-legal-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: var(--transition);
}

.footer-legal-links a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

.footer-legal-links .sep {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.7rem;
}

/* Modal Legal Tabs */
.legal-modal-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  padding: 0 1.5rem;
  background: #f8fafc;
  overflow-x: auto;
}

.legal-tab-btn {
  padding: 0.85rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  margin-bottom: -2px;
}

.legal-tab-btn:hover {
  color: var(--secondary-color);
}

.legal-tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: #fff;
}

.legal-tab-pane {
  display: none;
  padding: 1.5rem;
  color: var(--text-main);
  font-size: 0.88rem;
  line-height: 1.65;
}

.legal-tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.legal-tab-pane h3 {
  color: var(--secondary-color);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-top: 1.25rem;
  margin-bottom: 0.6rem;
}

.legal-tab-pane h3:first-child {
  margin-top: 0;
}

.legal-tab-pane p {
  margin-bottom: 0.85rem;
  color: #334155;
}

.legal-tab-pane ul {
  padding-left: 1.35rem;
  margin-bottom: 1rem;
}

.legal-tab-pane li {
  margin-bottom: 0.4rem;
}

.legal-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.1rem;
}

/* ==========================================================================
   BANNER DE CONSENTIMIENTO DE COOKIES (TALENTIA)
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2.5rem);
  max-width: 860px;
  background: rgba(29, 53, 87, 0.96);
  backdrop-filter: blur(10px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.5rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  animation: slideUpBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.hidden {
  display: none !important;
}

.cookie-banner-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.cookie-banner-text strong {
  color: #fff;
}

.cookie-banner-text a {
  color: var(--primary-light);
  text-decoration: underline;
  cursor: pointer;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.btn-cookie-accept {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-cookie-accept:hover {
  background: var(--primary-dark);
}

.btn-cookie-reject {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.95rem;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-cookie-reject:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 640px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    bottom: 0.75rem;
    width: calc(100% - 1.5rem);
    padding: 1rem;
  }
  .cookie-banner-actions {
    flex-direction: column;
    width: 100%;
  }
  .btn-cookie-accept, .btn-cookie-reject {
    width: 100%;
    text-align: center;
  }
}

@keyframes slideUpBanner {
  from { opacity: 0; transform: translate(-50%, 25px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   INTEGRACIÓN GOOGLE DRIVE Y ACCESO POR PIN DE ALUMNO
   ========================================================================== */

/* Botón de acceso en la cabecera */
.btn-student-drive-nav {
  background: #f0fdf4 !important;
  color: #166534 !important;
  border-color: #86efac !important;
  margin-right: 0.5rem;
}
.btn-student-drive-nav:hover {
  background: #dcfce7 !important;
  color: #14532d !important;
  border-color: #4ade80 !important;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

/* Casilla ocupada con acceso interactivo a Drive */
.time-slot-card.occupied {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  cursor: pointer;
  position: relative;
}

.time-slot-card.occupied:hover {
  background: #fee2e2;
  border-color: #f87171;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.time-slot-card.friday-occupied {
  cursor: not-allowed !important;
}
.time-slot-card.friday-occupied:hover {
  transform: none !important;
  box-shadow: none !important;
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}

.slot-pin-indicator {
  float: right;
  font-size: 0.76rem;
  color: #b91c1c;
  opacity: 0.6;
  transition: var(--transition);
}

.time-slot-card.occupied:hover .slot-pin-indicator {
  opacity: 1;
  color: #991b1b;
  transform: scale(1.15);
}

/* Botón de Drive en Modo Clase */
.btn-drive-access {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-drive-access:hover {
  background: #059669;
  color: #ffffff;
  border-color: #047857;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.btn-drive-access.btn-drive-missing {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #64748b;
}
.btn-drive-access.btn-drive-missing:hover {
  background: #e2e8f0;
  color: #334155;
  border-color: #94a3b8;
}

/* Input con botón integrado para probar enlace */
.input-with-action-wrap {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.btn-test-drive {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--secondary-color);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-test-drive:hover {
  background: #e2e8f0;
  color: var(--primary-dark);
}

/* Badges y chips de PIN y Drive en tablas */
.badge-pin {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}
.link-drive-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  margin-right: 0.3rem;
  transition: var(--transition);
}
.link-drive-chip:hover {
  background: #059669;
  color: #ffffff;
}
.chip-pin {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Modal de PIN de alumno */
.drive-slot-info-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 1rem;
}

.pin-input-group {
  position: relative;
  max-width: 220px;
  margin: 0 auto 1rem auto;
}

.pin-large-input {
  width: 100%;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 8px;
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  background: #f8fafc;
  color: var(--secondary-color);
  transition: var(--transition);
}

.pin-large-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 168, 204, 0.2);
}

.btn-toggle-pin-eye {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
}
.btn-toggle-pin-eye:hover {
  color: var(--text-main);
}

.pin-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ==========================================================================
   MÓDULO DE FACTURACIÓN MENSUAL — TALENTIA APOYO ESCOLAR
   ========================================================================== */

/* Botón "Facturación" en el topbar */
.btn-billing {
  background: linear-gradient(135deg, var(--primary-color), #7c3aed) !important;
  color: #fff !important;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}
.btn-billing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-billing:hover::before { opacity: 1; }

/* === SECCIÓN DE FACTURACIÓN === */
.billing-section-wrapper {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cabecera de facturación */
.billing-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #2563eb 100%);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  color: #fff;
  gap: 1rem;
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.25);
}
.billing-header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.billing-header-icon {
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  backdrop-filter: blur(4px);
  flex-shrink: 0;
}
.billing-header-title h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: #fff;
}
.billing-header-title p {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.7);
  max-width: 480px;
}
.billing-header-badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* === GENERADOR DE FACTURA === */
.billing-generator-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.billing-generator-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin-bottom: 0.3rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.billing-generator-header p {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 1.25rem;
}
.billing-generator-controls {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.billing-month-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.billing-picker-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
}
.billing-select {
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--input-bg, #f8fafc);
  color: var(--text-primary, #1e293b);
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s;
  min-width: 120px;
}
.billing-select:focus {
  outline: none;
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.billing-generate-btn {
  padding: 0.62rem 1.5rem !important;
  font-size: 0.92rem !important;
}
.billing-info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.billing-tag {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 0.35rem;
}
.billing-tag-legal {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
.billing-tag-irpf {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* === FACTURAS GUARDADAS === */
.billing-saved-section {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.billing-saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.billing-saved-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  display: flex; align-items: center; gap: 0.5rem;
}
.billing-saved-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 0.35rem;
}
.billing-saved-badge::before { content: '🔒'; }

/* Tarjetas de facturas guardadas */
.inv-saved-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.inv-saved-card:hover {
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}
.inv-saved-icon {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #2563eb;
  flex-shrink: 0;
}
.inv-saved-info { flex: 1; }
.inv-saved-number {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary, #1e293b);
}
.inv-saved-period {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  margin-top: 1px;
}
.inv-saved-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  flex-wrap: wrap;
}
.inv-saved-meta i { margin-right: 0.25rem; }
.inv-saved-total {
  font-weight: 700;
  color: var(--primary-color, #2563eb);
  font-size: 0.9rem;
}
.inv-saved-irpf-badge {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.inv-saved-sub {
  font-size: 0.75rem;
  color: var(--text-dim, #94a3b8);
  margin-top: 2px;
}
.inv-saved-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Loading / empty states */
.inv-list-loading, .inv-list-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted, #64748b);
}
.inv-list-loading i, .inv-list-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-dim, #94a3b8);
}
.inv-list-empty p { font-size: 0.9rem; }
.inv-list-empty-hint { font-size: 0.8rem; margin-top: 0.4rem; color: var(--text-dim, #94a3b8); }

/* === MODAL DE FACTURA === */
.modal-invoice-xl {
  max-width: 1100px;
  width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.bg-billing {
  background: linear-gradient(135deg, #1e3a5f, #2563eb) !important;
  color: #fff !important;
}
.invoice-modal-body {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  overflow: hidden;
  flex: 1;
  padding: 1.25rem 1.5rem;
}
.invoice-controls-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding-right: 0.35rem;
}
.invoice-preview-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.invoice-preview-header {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.invoice-preview-scroll {
  flex: 1;
  overflow-y: auto;
  background: #f8fafc;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 1rem;
}
.invoice-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.invoice-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  display: flex; align-items: center; gap: 0.35rem;
}
.invoice-text-input {
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--input-bg, #fff);
  color: var(--text-primary, #1e293b);
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.invoice-text-input:focus {
  outline: none;
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.invoice-text-input:disabled {
  background: var(--bg-subtle, #f1f5f9);
  color: var(--text-muted, #64748b);
  cursor: not-allowed;
}
.invoice-field-hint {
  font-size: 0.74rem;
  color: var(--text-dim, #94a3b8);
}
.invoice-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.invoice-footer-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* === EDITOR DE CONCEPTOS E IMPORTES PARCIALES === */
.price-editor-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin-bottom: 0.2rem;
  display: flex; align-items: center; gap: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
}
.price-editor-sub {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.price-editor-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.concept-editor-card {
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.concept-editor-card:hover {
  border-color: #cbd5e1;
}
.concept-editor-card:focus-within {
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.concept-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.concept-name-input {
  flex: 1;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-primary, #1e293b);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  background: var(--input-bg, #f8fafc);
  transition: border-color 0.2s, background-color 0.2s;
}
.concept-name-input:focus {
  outline: none;
  border-color: var(--primary-color, #2563eb);
  background: #fff;
}
.btn-remove-concept {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-remove-concept:hover {
  color: #ef4444;
  background-color: #fee2e2;
}
.concept-card-detail {
  display: flex;
  flex-direction: column;
}
.concept-detail-textarea {
  width: 100%;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  resize: vertical;
  background: var(--input-bg, #f8fafc);
  min-height: 44px;
}
.concept-detail-textarea:focus {
  outline: none;
  border-color: var(--primary-color, #2563eb);
  background: #fff;
}
.concept-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.35rem;
  border-top: 1px dashed #e2e8f0;
}
.concept-subtotal-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}
.concept-subtotal-wrap label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}
.concept-subtotal-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.concept-subtotal-input {
  width: 90px;
  text-align: right;
  padding: 0.3rem 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e3a5f;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.2s;
}
.concept-subtotal-input:focus {
  outline: none;
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.currency-symbol {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
}
.btn-add-concept-line {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  background: #f0fdf4;
  color: #166534;
  border: 1.5px dashed #86efac;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn-add-concept-line:hover {
  background: #dcfce7;
  border-color: #4ade80;
  color: #15803d;
}
.concept-editor-summary {
  margin-top: 0.9rem;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.concept-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  padding: 0.25rem 0;
  color: var(--text-muted, #64748b);
}
.concept-sum-row.irpf-row {
  color: #991b1b;
  font-weight: 600;
}
.concept-sum-row.irpf-row strong {
  color: #dc2626;
}
.concept-sum-row.total-row {
  border-top: 1px dashed var(--border-color, #cbd5e1);
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
}
.concept-sum-row.total-row strong {
  color: var(--primary-color, #2563eb);
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
}


/* === DOCUMENTO FACTURA (PREVIEW MODAL) === */
.invoice-document {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 9pt;
  color: #1a1a2e;
  line-height: 1.55;
}
.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.inv-brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inv-brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem;
  flex-shrink: 0;
}
.inv-brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e3a5f;
}
.inv-brand-subtitle { font-size: 0.72rem; color: #64748b; margin-top: 1px; }
.inv-title-block { text-align: right; }
.inv-title-label {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: #1e3a5f;
  letter-spacing: 2px;
}
.inv-number { font-size: 0.88rem; font-weight: 700; color: #2563eb; margin-top: 3px; }
.inv-date-label, .inv-period { font-size: 0.76rem; color: #475569; margin-top: 2px; }
.inv-separator {
  height: 2px;
  background: linear-gradient(90deg, #1e3a5f, #2563eb, #7c3aed);
  border-radius: 2px;
  margin: 10px 0;
}
.inv-parties {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.inv-party-block { flex: 1; }
.inv-party-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 3px;
}
.inv-party-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 2px;
}
.inv-party-detail { font-size: 0.76rem; color: #475569; line-height: 1.6; }
.inv-arrow-divider {
  display: flex;
  align-items: center;
  padding-top: 18px;
  color: #2563eb;
  font-size: 1.1rem;
}
.inv-concept-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.77rem;
}
.inv-concept-table th {
  background: #1e3a5f;
  color: #fff;
  padding: 6px 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.inv-th-left { text-align: left; }
.inv-th-right { text-align: right; width: 90px; }
.inv-concept-row td {
  padding: 7px 10px;
  vertical-align: top;
  border-bottom: 1px solid #e2e8f0;
}
.inv-row-even { background: #f8fafc; }
.inv-td-left { text-align: left; }
.inv-td-right { text-align: right; white-space: nowrap; }
.inv-subtotal { font-weight: 700; font-size: 0.84rem; color: #1e3a5f; }
.inv-course-badge {
  background: #dbeafe;
  color: #1e40af;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  margin-left: 5px;
}
.inv-days-list {
  margin-top: 3px;
  color: #475569;
  font-size: 0.72rem;
  line-height: 1.7;
}
.inv-hours-info {
  margin-top: 2px;
  color: #64748b;
  font-size: 0.68rem;
  font-style: italic;
}
.inv-empty-concept {
  text-align: center;
  color: #94a3b8;
  padding: 16px;
  font-style: italic;
}
.inv-totals-block {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0;
}
.inv-totals-table {
  width: 270px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.inv-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 0.78rem;
  border-bottom: 1px solid #e2e8f0;
}
.inv-totals-row:last-child { border-bottom: none; }
.inv-iva-row { color: #64748b; }
.inv-iva-exempt { color: #059669; font-weight: 700; font-size: 0.66rem; letter-spacing: 0.5px; }
.inv-irpf-row { color: #991b1b; background: #fff5f5; }
.inv-irpf-value { font-weight: 700; color: #dc2626; }
.inv-total-final { background: #1e3a5f; color: #fff; padding: 8px 12px; }
.inv-totals-label-big { font-family: 'Outfit', sans-serif; font-size: 0.85rem; font-weight: 700; }
.inv-totals-value-big { font-family: 'Outfit', sans-serif; font-size: 1.05rem; font-weight: 800; }
.inv-legal-footer {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 7px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 0.72rem;
  color: #0c4a6e;
  line-height: 1.65;
}
.inv-legal-icon { font-size: 1rem; color: #0284c7; margin-top: 1px; flex-shrink: 0; }
.inv-sign-area { display: flex; justify-content: flex-end; margin-top: 20px; }
.inv-sign-block { text-align: center; }
.inv-sign-line { width: 180px; height: 1px; background: #94a3b8; margin-bottom: 4px; }
.inv-sign-name { font-weight: 700; font-size: 0.78rem; color: #1e3a5f; }
.inv-sign-dni { font-size: 0.72rem; color: #64748b; }

/* Responsive */
@media (max-width: 768px) {
  .invoice-modal-body { grid-template-columns: 1fr; }
  .billing-generator-controls { flex-direction: column; align-items: stretch; }
  .inv-parties { flex-direction: column; }
  .inv-arrow-divider { display: none; }
  .billing-header-banner { flex-direction: column; align-items: flex-start; }
}

/* ========================================================
   ESTILOS DE INTEGRACIÓN DE WHATSAPP (WA.ME)
   ======================================================== */
.bg-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
  color: #ffffff !important;
}

.bg-whatsapp-header {
  border-bottom: 2px solid rgba(37, 211, 102, 0.2);
}

.cell-phone-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.link-phone-direct {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

.link-phone-direct:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.btn-table-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(37, 211, 102, 0.12);
  color: #0b7d3b;
  border: 1px solid rgba(37, 211, 102, 0.35);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-table-whatsapp:hover {
  background: #25D366;
  color: #ffffff;
  border-color: #25D366;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  transform: translateY(-1px);
}

.btn-table-whatsapp i {
  font-size: 0.95em;
}

.btn-table-action.btn-wa-action {
  color: #0b7d3b;
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.25);
}

.btn-table-action.btn-wa-action:hover {
  background: #25D366;
  color: #ffffff;
  border-color: #25D366;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.35);
}

/* Badge interactivo en Modo Clase */
.badge-phone-interactive {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(37, 211, 102, 0.12);
  color: #0b7d3b;
  border: 1px solid rgba(37, 211, 102, 0.35);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.badge-phone-interactive:hover {
  background: #25D366;
  color: #ffffff;
  border-color: #25D366;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transform: translateY(-1px);
}

.btn-whatsapp-action {
  background: rgba(37, 211, 102, 0.15) !important;
  color: #0b7d3b !important;
  border: 1px solid rgba(37, 211, 102, 0.4) !important;
  font-weight: 700 !important;
}

.btn-whatsapp-action:hover {
  background: #25D366 !important;
  color: #ffffff !important;
  border-color: #25D366 !important;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4) !important;
  transform: translateY(-1px);
}

/* Modal WhatsApp */
.wa-modal-card {
  max-width: 620px;
}

.wa-recipient-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.wa-recipient-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.wa-recipient-info strong {
  color: var(--secondary-color);
}

.wa-phone-edit-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wa-phone-input {
  width: 150px;
  padding: 0.35rem 0.6rem;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.wa-templates-section {
  margin-bottom: 1rem;
}

.wa-template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.wa-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--text-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.wa-chip:hover {
  background: #e2e8f0;
  border-color: var(--border-color);
  transform: translateY(-1px);
}

.wa-chip.active {
  background: #128C7E;
  color: #ffffff;
  border-color: #128C7E;
  box-shadow: 0 2px 8px rgba(18, 140, 126, 0.3);
}

.wa-textarea {
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  min-height: 190px;
  resize: vertical;
  padding: 0.75rem;
  background: #fdfdfd;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 100%;
}

.wa-textarea:focus {
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
  outline: none;
}

.wa-tip-box {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 168, 204, 0.08);
  border-left: 3px solid var(--primary-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wa-tip-box i {
  color: var(--primary-color);
  margin-top: 0.15rem;
}

.btn-whatsapp-send {
  background: #25D366 !important;
  border-color: #25D366 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-whatsapp-send:hover {
  background: #1eb954 !important;
  border-color: #1eb954 !important;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45) !important;
  transform: translateY(-1px);
}

.btn-copy-wa {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-copy-wa:hover {
  background: #f1f5f9;
  color: var(--primary-dark);
}

/* ==========================================================================
   14. MODO MAESTRO (PIN 0014 Y VISTA DOCENTE EN CALENDARIO)
   ========================================================================== */

/* Reloj interactivo */
.live-clock-card {
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.live-clock-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.15);
}

.live-clock-card:active {
  transform: scale(0.97);
}

/* Banner superior de Modo Maestro Activo */
.master-mode-banner {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(147, 51, 234, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
  animation: fadeIn 0.3s ease-out;
}

.master-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.master-banner-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.master-badge {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.master-desc {
  font-size: 0.86rem;
  color: var(--secondary-color);
  font-weight: 500;
}

.master-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-master-action {
  background: #ffffff;
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #dc2626;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-master-action:hover {
  background: #fef2f2;
  border-color: #dc2626;
  transform: translateY(-1px);
}

/* ==========================================================================
   MODO PRIVACIDAD DE CLASE (ANTI-MIRADAS) EN EL CALENDARIO DESBLOQUEADO
   ========================================================================== */
.btn-master-privacy-toggle {
  background: #ffffff;
  border: 1.5px solid #6366f1;
  color: #4f46e5;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.12);
}

.btn-master-privacy-toggle:hover {
  background: #eef2ff;
  border-color: #4338ca;
  transform: translateY(-1px);
}

.btn-master-privacy-toggle.active {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-color: #047857;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-master-privacy-toggle.active:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

/* Casilla Destacada: Clase Actual en Directo */
.time-slot-card.master-occupied.current-class-live {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%) !important;
  border: 2px solid #10b981 !important;
  border-left: 5px solid #059669 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 4px 14px rgba(16, 185, 129, 0.15) !important;
  animation: pulseLiveBorder 2.5s infinite ease-in-out;
}

@keyframes pulseLiveBorder {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25), 0 4px 14px rgba(16, 185, 129, 0.15); }
  50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.45), 0 6px 18px rgba(16, 185, 129, 0.25); }
}

.badge-live-session-now {
  background: #059669;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 1px 4px rgba(5, 150, 105, 0.3);
}

.badge-live-session-now .live-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  animation: blinkLiveDot 1.2s infinite ease-in-out;
}

@keyframes blinkLiveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

/* Casillas Protegidas / Ocultas por Modo Privacidad Anti-Miradas */
.time-slot-card.master-occupied.privacy-masked {
  background: #f8fafc !important;
  border: 1.5px dashed #cbd5e1 !important;
  border-left: 3.5px solid #94a3b8 !important;
  opacity: 0.88;
}

.time-slot-card.master-occupied.privacy-masked:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  opacity: 1;
}

.badge-privacy-lock {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.privacy-masked-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0;
}

.privacy-click-hint {
  font-size: 0.68rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
}

/* Tarjetas de Casillas en Modo Maestro */
.time-slot-card.master-occupied {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1.5px solid rgba(99, 102, 241, 0.35) !important;
  border-left: 4px solid #4f46e5 !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.time-slot-card.master-occupied:hover {
  transform: translateY(-2px);
  border-color: #4f46e5 !important;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.15) !important;
}

.master-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.master-student-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--secondary-color);
  line-height: 1.25;
  margin-top: 0.1rem;
}

.master-student-course-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(79, 70, 229, 0.09);
  color: #4338ca;
  font-weight: 600;
  font-size: 0.74rem;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.master-student-subject-tag {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-click-hint {
  font-size: 0.7rem;
  color: #4f46e5;
  font-weight: 600;
  margin-top: auto;
  padding-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Casilla Liberada por Ausencia Comunicada */
.time-slot-card.master-liberated {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%) !important;
  border: 1.5px dashed #f59e0b !important;
  border-left: 4px solid #f59e0b !important;
  cursor: pointer !important;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
}

.time-slot-card.master-liberated:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.2) !important;
}

.master-liberated-badge {
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
}

.master-original-student {
  font-size: 0.78rem;
  color: #92400e;
  font-weight: 600;
}

.master-recovery-available-tag {
  font-size: 0.72rem;
  color: #059669;
  font-weight: 700;
  background: #d1fae5;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Casilla Ocupada por Alumno en Recuperación */
.time-slot-card.master-recovery-occupied {
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%) !important;
  border: 1.5px solid #10b981 !important;
  border-left: 4px solid #059669 !important;
  cursor: pointer !important;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.time-slot-card.master-recovery-occupied:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.2) !important;
}

.master-recovery-badge {
  background: #059669;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
}

/* Modal PIN Maestro */
.modal-pin-card {
  max-width: 440px !important;
  text-align: center;
}

.pin-display-input {
  width: 180px;
  margin: 1.25rem auto;
  font-size: 2.2rem;
  letter-spacing: 12px;
  text-align: center;
  padding: 0.6rem 1rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #f8fafc;
  color: var(--secondary-color);
  transition: var(--transition);
}

.pin-display-input:focus {
  outline: none;
  border-color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

/* Modal Acciones de Casilla en Modo Maestro */
.modal-slot-action-card {
  max-width: 580px !important;
}

.slot-action-student-summary {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.slot-action-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.slot-action-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.slot-action-name-group h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--secondary-color);
  margin-bottom: 0.2rem;
}

.slot-action-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.slot-action-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.slot-action-btn-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-align: left;
  width: 100%;
}

.slot-action-btn-card:hover {
  transform: translateY(-2px);
  border-color: #4f46e5;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.1);
  background: #fafafa;
}

.slot-action-btn-card.action-dossier {
  border-left: 4px solid #4f46e5;
}

.slot-action-btn-card.action-liberate {
  border-left: 4px solid #f59e0b;
}

.slot-action-btn-card.action-liberate:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
}

.slot-action-btn-card.action-restore {
  border-left: 4px solid #10b981;
}

.slot-action-btn-card.action-restore:hover {
  border-color: #10b981;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
}

.slot-action-btn-card.action-assign-recovery {
  border-left: 4px solid #06b6d4;
}

.slot-action-btn-card.action-assign-recovery:hover {
  border-color: #06b6d4;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.15);
}

.slot-action-btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.action-dossier .slot-action-btn-icon {
  background: rgba(79, 70, 229, 0.12);
  color: #4f46e5;
}

.action-liberate .slot-action-btn-icon {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.action-restore .slot-action-btn-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.action-assign-recovery .slot-action-btn-icon {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
}

.slot-action-btn-content {
  flex: 1;
}

.slot-action-btn-content strong {
  display: block;
  font-size: 0.95rem;
  color: var(--secondary-color);
  margin-bottom: 0.2rem;
}

.slot-action-btn-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

.recovery-select-wrapper {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.select-recovery-student {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: #ffffff;
}

/* ==========================================================================
   MODAL EXPEDIENTE FLOTANTE Y FICHA COMPLETA DOCENTE
   ========================================================================== */
.modal-dossier-card {
  max-width: 820px !important;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-xl, 16px);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  animation: modalDossierSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalDossierSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-dossier-card .modal-body {
  padding: 1.25rem 1.5rem 1.5rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Tarjeta Principal de Identidad */
.dossier-identity-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg, 12px);
  padding: 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dossier-identity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dossier-avatar-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dossier-avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-color, #00a8cc) 0%, var(--secondary-color, #1a2a3a) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 168, 204, 0.3);
  flex-shrink: 0;
}

.dossier-name-group h3 {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--secondary-color, #0f172a);
  margin: 0 0 0.3rem 0;
  line-height: 1.2;
}

.dossier-badges-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dossier-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Desglose de Horarios Semanales */
.dossier-schedules-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md, 8px);
  padding: 0.75rem 1rem;
}

.dossier-schedules-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dossier-schedules-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dossier-slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.82rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  transition: all 0.2s ease;
}

.dossier-slot-badge.current-session-badge {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  color: #1e40af;
  border-color: #93c5fd;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

/* Sección de Google Drive */
.dossier-drive-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius-lg, 12px);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.dossier-drive-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dossier-drive-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #6ee7b7;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.15);
  flex-shrink: 0;
}

.dossier-drive-texts h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #065f46;
  margin: 0 0 0.15rem 0;
}

.dossier-drive-texts p {
  font-size: 0.82rem;
  color: #047857;
  margin: 0;
}

.btn-dossier-drive-open {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md, 8px);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border: 1px solid #065f46;
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-dossier-drive-open:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(5, 150, 105, 0.4);
}

.dossier-drive-edit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.6rem;
}

.dossier-drive-edit-row input {
  flex: 1;
  font-size: 0.84rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md, 8px);
}

/* Área de Cuaderno de Notas */
.dossier-notes-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg, 12px);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dossier-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dossier-notes-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary-color, #0f172a);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dossier-snippets-wrap {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dossier-notes-area {
  width: 100%;
  min-height: 160px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md, 8px);
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-main, #1e293b);
  resize: vertical;
  transition: all 0.2s ease;
}

.dossier-notes-area:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary-color, #00a8cc);
  box-shadow: 0 0 0 3px rgba(0, 168, 204, 0.15);
}

.dossier-notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Tarjeta de Acciones de Sesión Puntual */
.dossier-session-actions-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: var(--radius-md, 8px);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dossier-session-actions-box p {
  margin: 0;
  font-size: 0.84rem;
  color: #92400e;
}

/* Barra de Pie de la Ficha Flotante */
.dossier-footer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

/* ESTADO: PLAZA DISPONIBLE PARA RECUPERACIÓN (VISTA PÚBLICA BLOQUEADA) */
.time-slot-card.recovery-available {
  background: linear-gradient(135deg, #fffdfa 0%, #fef3c7 100%);
  border: 1.5px solid #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.16);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.time-slot-card.recovery-available:hover {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #d97706;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.25);
}

.time-slot-card.recovery-available .recovery-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.time-slot-card.recovery-available .slot-time-label {
  color: #92400e;
  font-weight: 800;
  font-size: 0.88rem;
}

.time-slot-card.recovery-available .badge-recovery-pill {
  background: #d97706;
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.time-slot-card.recovery-available .slot-status-label.recovery-status-label {
  color: #b45309;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.time-slot-card.recovery-available .btn-slot-recovery-whatsapp {
  margin-top: 0.35rem;
  background: #25D366;
  color: #ffffff !important;
  border: 1px solid #1eb954;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
}

.time-slot-card.recovery-available .btn-slot-recovery-whatsapp:hover {
  background: #1eb954;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.5);
  color: #ffffff !important;
}

/* ==========================================================================
   MEJORAS EN SEGUIMIENTO Y NOTAS / CALIFICACIONES DE ALUMNOS
   ========================================================================== */
.student-notes-card-section {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-lg, 12px);
  padding: 1.15rem 1.25rem;
  margin-top: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.notes-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.notes-card-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--secondary-color, #0f172a);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.notes-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}

.notes-quick-snippets-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  background: #ffffff;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid #e2e8f0;
}

.notes-quick-snippets-bar .snippets-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.2rem;
}

.form-textarea.enriched-notes {
  font-size: 0.9rem;
  line-height: 1.6;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md, 8px);
  padding: 0.85rem 1rem;
  transition: all 0.2s ease;
}

.form-textarea.enriched-notes:focus {
  border-color: var(--primary-color, #00a8cc);
  box-shadow: 0 0 0 3px rgba(0, 168, 204, 0.15);
}

/* Celdas Interactivas de Notas en la Tabla de Alumnos */
.cell-notes-preview.clickable-notes {
  cursor: pointer;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: #334155;
  transition: all 0.2s ease;
}

.cell-notes-preview.clickable-notes:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.cell-notes-preview.clickable-notes.has-notes {
  border-left: 3px solid #00a8cc;
  font-weight: 600;
}

.cell-notes-preview.clickable-notes.empty-notes {
  color: #94a3b8;
  font-style: italic;
  border-style: dashed;
}

.btn-action.dossier-action-btn {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.btn-action.dossier-action-btn:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

/* Resumen visual de Badges / Píldoras de Notas y Calificaciones */
.dossier-notes-badges-summary {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.badge-note-exam,
.badge-note-grade,
.badge-note-homework,
.badge-note-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  line-height: 1.35;
  word-break: break-word;
}

.badge-note-exam {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-note-grade {
  background: #fdf2f8;
  color: #9d174d;
  border: 1px solid #fbcfe8;
  font-weight: 700;
}

.badge-note-homework {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-note-progress {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* ==========================================================================
   SISTEMA DE NOTIFICACIONES EN DIRECTO DE GOOGLE DRIVE (BANNER & CAMPANA)
   ========================================================================== */

/* 1. BOTÓN CAMPANA EN CABECERA */
.drive-notif-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-drive-notif {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-drive-notif:hover {
  transform: translateY(-2px);
}

/* Estado Verde: Todo al día / Sin entregas nuevas */
.btn-drive-notif.status-green {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}
.btn-drive-notif.status-green:hover {
  background: #d1fae5;
  border-color: #059669;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.25);
}

/* Estado Rojo: Hay subidas pendientes de revisar */
.btn-drive-notif.status-red {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
  animation: pulseRedButton 2.5s infinite;
}
.btn-drive-notif.status-red:hover {
  background: #fee2e2;
  border-color: #dc2626;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}

@keyframes pulseRedButton {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.drive-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  animation: pulseNotifBadge 2s infinite;
}

.drive-notif-badge.hidden {
  display: none !important;
}

@keyframes pulseNotifBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* 2. DROPDOWN DE NOTIFICACIONES RECIENTES */
.drive-notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(29, 53, 87, 0.16), 0 0 0 1px rgba(0,0,0,0.04);
  z-index: 10000;
  overflow: hidden;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.drive-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.drive-notif-header h4 {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.drive-notif-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-notif-action-mini {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: var(--transition);
}

.btn-notif-action-mini:hover {
  background: #e2e8f0;
  color: var(--secondary-color);
}

.btn-notif-action-mini.active {
  color: var(--primary-color);
  background: rgba(0, 168, 204, 0.1);
}

.drive-notif-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.35rem 0;
}

.drive-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
  color: inherit;
}

.drive-notif-item:last-child {
  border-bottom: none;
}

.drive-notif-item:hover {
  background: #f8fafc;
}

.drive-notif-item.unread {
  background: #f0fdfa;
}

.drive-notif-item.unread::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 24px;
  background: var(--primary-color);
  border-radius: 999px;
}

.notif-student-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 168, 204, 0.25);
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-student-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-time-ago {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
}

.notif-file-info {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--primary-dark);
  font-weight: 600;
  background: #ffffff;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin-top: 0.25rem;
  word-break: break-all;
}

.notif-file-info i {
  color: #ea4335;
  font-size: 0.85rem;
}

.notif-file-info i.fa-file-image { color: #8b5cf6; }
.notif-file-info i.fa-file-word  { color: #2563eb; }
.notif-file-info i.fa-file-lines { color: #059669; }

.drive-notif-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
}

.drive-notif-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.drive-notif-empty i {
  font-size: 2.2rem;
  color: #cbd5e1;
  margin-bottom: 0.6rem;
}

.drive-notif-empty p {
  font-size: 0.84rem;
  margin: 0;
}

/* 3. BANNER FLOTANTE EN DIRECTO (POPUP DESTACADO AL RECIBIR ARCHIVO) */
.drive-live-banner-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.drive-live-banner {
  pointer-events: auto;
  width: 400px;
  max-width: calc(100vw - 32px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(0, 168, 204, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px -10px rgba(29, 53, 87, 0.28), 0 0 0 1px rgba(0, 168, 204, 0.2), 0 0 30px rgba(0, 168, 204, 0.22);
  overflow: hidden;
  animation: driveBannerSlideIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.drive-live-banner.hiding {
  animation: driveBannerSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes driveBannerSlideIn {
  0% { transform: translateY(-40px) scale(0.92); opacity: 0; }
  70% { transform: translateY(6px) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes driveBannerSlideOut {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-30px) scale(0.92); opacity: 0; }
}

.drive-live-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.1rem;
  background: linear-gradient(135deg, rgba(0, 168, 204, 0.12) 0%, rgba(29, 53, 87, 0.06) 100%);
  border-bottom: 1px solid rgba(0, 168, 204, 0.15);
}

.drive-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #008ba3;
  background: #ffffff;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 168, 204, 0.3);
  box-shadow: 0 2px 6px rgba(0, 168, 204, 0.15);
}

.drive-live-badge i {
  color: #00a8cc;
  animation: spinSlow 4s linear infinite;
}

@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn-banner-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-banner-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--secondary-color);
}

.drive-live-banner-body {
  padding: 1.1rem;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.banner-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #00a8cc 0%, #1d3557 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(0, 168, 204, 0.35);
}

.banner-info {
  flex: 1;
  min-width: 0;
}

.banner-student-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--secondary-color);
  margin-bottom: 0.2rem;
  line-height: 1.25;
}

.banner-action-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.banner-file-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.75rem;
}

.banner-file-icon {
  font-size: 1.25rem;
  color: #ea4335;
  flex-shrink: 0;
}

.banner-file-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn-banner-open {
  flex: 1;
  background: linear-gradient(135deg, #00a8cc 0%, #008ba3 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 168, 204, 0.3);
}

.btn-banner-open:hover {
  background: linear-gradient(135deg, #00bfe8 0%, #00a8cc 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 168, 204, 0.4);
  color: #ffffff;
}

.btn-banner-dismiss {
  background: #f1f5f9;
  color: var(--secondary-color);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-banner-dismiss:hover {
  background: #e2e8f0;
}

.banner-progress-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  width: 100%;
  transform-origin: left;
  animation: bannerProgress linear forwards;
}

@keyframes bannerProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* 4. MODAL DE CONFIGURACIÓN DE GOOGLE DRIVE Y WEBHOOKS */
.drive-config-code-box {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  max-height: 280px;
  overflow-y: auto;
  position: relative;
  border: 1px solid #334155;
}

.drive-steps-list {
  counter-reset: drive-step;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.drive-steps-list li {
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-main);
}

.drive-steps-list li::before {
  counter-increment: drive-step;
  content: counter(drive-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   5. REGISTRO DE AUDITORÍA Y ACCESOS (SEGURIDAD RGPD)
   ========================================================================== */
.audit-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}

.audit-stat-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.audit-stat-card .stat-icon {
  font-size: 1.5rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audit-stat-card.card-success .stat-icon {
  background: #ecfdf5;
  color: #059669;
}

.audit-stat-card.card-failed .stat-icon {
  background: #fef2f2;
  color: #dc2626;
}

.audit-stat-card.card-total .stat-icon {
  background: #eff6ff;
  color: #2563eb;
}

.audit-stat-card .stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--secondary-color);
}

.audit-stat-card .stat-label {
  display: block;
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.audit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.audit-filters {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-filter-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-filter-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-filter-chip.active {
  background: var(--secondary-color);
  color: #ffffff;
  border-color: var(--secondary-color);
}

.btn-filter-chip.filter-failed.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.btn-filter-chip.filter-success.active {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

.audit-logs-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.audit-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.audit-logs-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: var(--secondary-color);
  font-weight: 700;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  z-index: 2;
}

.audit-logs-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
}

.audit-logs-table tr:hover {
  background: #f8fafc;
}

.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.audit-badge.badge-success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.audit-badge.badge-failed {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  animation: pulseRedBadge 2s infinite;
}

@keyframes pulseRedBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.audit-logs-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-dim);
}

.audit-logs-empty i {
  font-size: 2.5rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

.audit-logs-empty p {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

