:root {
  color-scheme: light;
  --bg-main: #f4f6f8;
  --card-bg: #ffffff;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --text-main: #334155;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  --border-color: #e2e8f0;
  
  --accent-primary: #475569;
  --accent-active: #3b82f6;
  --btn-bg: #334155;
  --btn-hover: #1e293b;
  
  --status-success-bg: #f0fdf4;
  --status-success-text: #166534;
  --status-warning-bg: #fffbeb;
  --status-warning-text: #92400e;
  --status-danger-bg: #fef2f2;
  --status-danger-text: #991b1b;

  /* Colores semáforo */
  --semaforo-baja-bg: #dcfce7;
  --semaforo-baja-text: #15803d;
  --semaforo-media-bg: #fef9c3;
  --semaforo-media-text: #a16207;
  --semaforo-alta-bg: #fee2e2;
  --semaforo-alta-text: #b91c1c;

  --branch-line-color: #475569;
}

body.dark-mode {
  color-scheme: dark;
  --bg-main: #0f172a;
  --card-bg: #1e293b;
  --bg-hover: #334155;
  --sidebar-bg: #0b1329;
  --sidebar-hover: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --btn-bg: #3b82f6;
  --btn-hover: #2563eb;
  --status-success-bg: #064e3b;
  --status-success-text: #6ee7b7;
  --status-warning-bg: #78350f;
  --status-warning-text: #fde68a;
  --status-danger-bg: #7f1d1d;
  --status-danger-text: #fca5a5;

  --semaforo-baja-bg: #064e3b;
  --semaforo-baja-text: #86efac;
  --semaforo-media-bg: #713f12;
  --semaforo-media-text: #fef08a;
  --semaforo-alta-bg: #7f1d1d;
  --semaforo-alta-text: #fca5a5;

  --branch-line-color: #334155;
}

body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.85;
  cursor: pointer;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif; 
}

body { 
  background-color: var(--bg-main); 
  color: var(--text-main); 
  display: flex; 
  min-height: 100vh; 
  overflow-x: hidden; 
  transition: background-color 0.3s, color 0.3s; 
}

/* ==========================================================================
   PANTALLA DE LOGIN
   ========================================================================== */
/* ==========================================================================
   PANTALLA DE AUTENTICACIÓN: INICIAR SESIÓN Y CREAR CUENTA (SECURECONNECT STYLE)
   ========================================================================== */
.login-container {
  position: fixed; 
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 10% 20%, #dbeafe 0%, #eff6ff 40%, #bfdbfe 100%),
              radial-gradient(circle at 90% 80%, #93c5fd 0%, transparent 60%);
  display: flex; 
  flex-direction: column;
  align-items: center; 
  justify-content: center; 
  z-index: 5000; 
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

body.dark-mode .login-container {
  background: radial-gradient(circle at 10% 20%, #0f172a 0%, #1e293b 50%, #0f172a 100%),
              radial-gradient(circle at 85% 85%, #1e3a8a 0%, transparent 50%);
}

/* Conmutador Superior de 2 Botones (INICIAR SESIÓN / CREAR CUENTA) */
.auth-nav-switcher {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 5px;
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(0, 75, 147, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.6);
  margin-bottom: 1.25rem;
  gap: 4px;
  z-index: 10;
}

body.dark-mode .auth-nav-switcher {
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

.auth-nav-btn {
  background: transparent;
  border: none;
  padding: 0.55rem 1.4rem;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
}

body.dark-mode .auth-nav-btn {
  color: #94a3b8;
}

.auth-nav-btn.active {
  background: #004b93;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 75, 147, 0.35);
}

body.dark-mode .auth-nav-btn.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Tarjeta Principal de Autenticación */
.auth-card-modern {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 15px 35px rgba(0, 50, 120, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.8);
  width: 100%;
  max-width: 440px;
  padding: 2.2rem 2rem;
  position: relative;
  animation: fadeIn 0.35s ease forwards;
  color: #1e293b;
}

body.dark-mode .auth-card-modern {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  color: #f8fafc;
}

.auth-brand-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.auth-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #004b93;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
}

.auth-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #004b93;
  letter-spacing: 0.2px;
}

body.dark-mode .auth-brand-name {
  color: #60a5fa;
}

.auth-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

body.dark-mode .auth-title {
  color: #ffffff;
}

.auth-subtitle {
  font-size: 0.86rem;
  color: #64748b;
  margin-bottom: 1.4rem;
}

body.dark-mode .auth-subtitle {
  color: #94a3b8;
}

/* Campos de Formulario con Iconos Integrados */
.auth-form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.auth-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

body.dark-mode .auth-field-label {
  color: #94a3b8;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-input-icon-left {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.auth-input-modern {
  width: 100%;
  padding: 0.72rem 2.6rem 0.72rem 2.6rem;
  font-size: 0.88rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-input-modern.no-right-icon {
  padding-right: 1rem;
}

.auth-input-modern:focus {
  outline: none;
  border-color: #004b93;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 75, 147, 0.12);
}

body.dark-mode .auth-input-modern {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .auth-input-modern:focus {
  border-color: #3b82f6;
  background: #1e293b;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-password-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.auth-password-toggle-btn:hover {
  color: #475569;
}

body.dark-mode .auth-password-toggle-btn:hover {
  color: #ffffff;
}

/* Fila de Contraseñas Divididas */
.auth-grid-2-pass {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .auth-grid-2-pass {
    grid-template-columns: 1fr;
  }
}

/* Menú Flotante de Autocompletado de Correo al escribir @ */
.email-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  padding: 4px;
}

.email-autocomplete-dropdown.active {
  display: block;
}

.email-autocomplete-item {
  padding: 0.55rem 0.85rem;
  font-size: 0.84rem;
  color: #334155;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.email-autocomplete-item:hover,
.email-autocomplete-item.selected {
  background: #f1f5f9;
  color: #004b93;
}

.email-autocomplete-item .domain-highlight {
  font-weight: 700;
  color: #004b93;
}

.email-autocomplete-item .domain-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 75, 147, 0.08);
  color: #004b93;
}

body.dark-mode .email-autocomplete-dropdown {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

body.dark-mode .email-autocomplete-item {
  color: #cbd5e1;
}

body.dark-mode .email-autocomplete-item:hover,
body.dark-mode .email-autocomplete-item.selected {
  background: #334155;
  color: #60a5fa;
}

body.dark-mode .email-autocomplete-item .domain-highlight {
  color: #60a5fa;
}

body.dark-mode .email-autocomplete-item .domain-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

/* Fila de Opciones: Recordarme / Olvidé Contraseña */
.auth-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #475569;
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
}

body.dark-mode .auth-options-row {
  color: #94a3b8;
}

.auth-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #004b93;
  cursor: pointer;
}

.auth-link {
  color: #004b93;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}

.auth-link:hover {
  text-decoration: underline;
}

body.dark-mode .auth-link {
  color: #60a5fa;
}

/* Botón Principal Azul Pill */
.auth-submit-btn-primary {
  width: 100%;
  padding: 0.78rem;
  background: #004b93;
  background: linear-gradient(180deg, #0056b3 0%, #004b93 100%);
  color: #ffffff;
  border: none;
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 75, 147, 0.3);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-submit-btn-primary:hover {
  background: linear-gradient(180deg, #0066cc 0%, #0056b3 100%);
  box-shadow: 0 6px 16px rgba(0, 75, 147, 0.4);
  transform: translateY(-1px);
}

.auth-submit-btn-primary:active {
  transform: translateY(0);
}

/* Pie de Tarjeta y Redes Sociales */
.auth-card-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: #64748b;
}

body.dark-mode .auth-card-footer {
  color: #94a3b8;
}

.auth-social-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #94a3b8;
  font-size: 0.75rem;
  margin: 1.1rem 0 0.8rem 0;
}

.auth-social-divider::before,
.auth-social-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

body.dark-mode .auth-social-divider::before,
body.dark-mode .auth-social-divider::after {
  border-bottom-color: #334155;
}

.auth-social-divider span {
  padding: 0 0.6rem;
}

.auth-social-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.auth-social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #475569;
}

.auth-social-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

body.dark-mode .auth-social-btn {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-mode .auth-social-btn:hover {
  background: #1e293b;
  color: #ffffff;
}

/* ==========================================================================
   INTERFAZ PRINCIPAL
   ========================================================================== */
.app-layout { 
  display: none; 
  width: 100%; 
  min-height: 100vh; 
}

.app-layout.active { 
  display: flex; 
}

/* Top Header Bar */
.top-header {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  background: var(--card-bg); 
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem; 
  position: fixed; 
  top: 0; left: 250px; right: 0; 
  z-index: 90; 
  height: 60px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.top-header.expanded { left: 72px; }

.connection-pill {
  font-size: 0.75rem; 
  font-weight: 600; 
  padding: 0.3rem 0.65rem; 
  border-radius: 20px;
  display: inline-flex; 
  align-items: center; 
  gap: 0.4rem; 
  border: 1px solid var(--border-color);
}
.connection-pill.online { background: var(--status-success-bg); color: var(--status-success-text); }
.connection-pill.offline { background: var(--status-danger-bg); color: var(--status-danger-text); }

.header-action-btn {
  background: none; 
  border: none; 
  cursor: pointer; 
  color: var(--text-main);
  display: flex; 
  align-items: center; 
  justify-content: center; 
  padding: 6px; 
  border-radius: 6px; 
  transition: background 0.2s;
}
.header-action-btn:hover { background: var(--bg-main); }

.notif-wrapper { position: relative; display: flex; align-items: center; }
.notif-bell-btn {
  background: none; 
  border: none; 
  color: var(--text-main); 
  cursor: pointer;
  padding: 6px; 
  border-radius: 50%; 
  position: relative; 
  display: flex; 
  align-items: center;
}
.notif-bell-btn:hover { background: var(--bg-main); }
.notif-badge {
  position: absolute; 
  top: 2px; right: 2px; 
  background: #ef4444; 
  color: #fff;
  font-size: 0.65rem; 
  font-weight: bold; 
  width: 16px; 
  height: 16px; 
  border-radius: 50%;
  display: flex; 
  align-items: center; 
  justify-content: center;
}

/* ==========================================================================
   NOTIFICACIONES MODERNAS (ESTILO ADAPTADO A IMAGEN 1)
   ========================================================================== */
.notif-dropdown {
  position: absolute; 
  top: 48px; right: 0; 
  width: 380px; 
  max-width: 92vw;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0); 
  border-radius: 12px; 
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
  display: none; 
  flex-direction: column; 
  z-index: 1000;
  overflow: hidden;
}
.notif-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 18px;
  width: 12px;
  height: 12px;
  background: var(--card-bg, #ffffff);
  transform: rotate(45deg);
  border-left: 1px solid var(--border-color, #e2e8f0);
  border-top: 1px solid var(--border-color, #e2e8f0);
}
.notif-dropdown.active { display: flex; animation: fadeInScale 0.2s ease-out; }

.notif-header-new {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: var(--card-bg, #ffffff);
}
.notif-btn-read-all {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.notif-btn-read-all:hover { background: rgba(37, 99, 235, 0.08); }

.notif-btn-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  transition: all 0.15s;
}
.notif-btn-settings:hover { color: var(--text-main); background: var(--bg-hover, #f1f5f9); }

.notif-list-container {
  max-height: 360px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}

.notif-item-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}
.notif-item-card:hover {
  background: var(--bg-hover, #f8fafc);
}
.notif-item-card.unread {
  background: rgba(37, 99, 235, 0.04);
}

/* Modo Oscuro para Notificaciones */
body.dark-mode .notif-dropdown {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
body.dark-mode .notif-dropdown::before {
  background: #1e293b;
  border-color: #334155;
}
body.dark-mode .notif-header-new {
  background: #1e293b;
  border-color: #334155;
}
body.dark-mode .notif-item-card {
  border-color: #334155;
  background: transparent;
}
body.dark-mode .notif-item-card:hover {
  background: #334155 !important;
}
body.dark-mode .notif-item-card.unread {
  background: rgba(59, 130, 246, 0.12);
}
body.dark-mode .notif-item-card.unread:hover {
  background: #3b4c68 !important;
}
body.dark-mode .notif-item-title {
  color: #f8fafc !important;
}
body.dark-mode .notif-item-time {
  color: #94a3b8 !important;
}

.notif-doc-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #52a447;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.notif-doc-icon-box.calif {
  background: #2563eb;
}
.notif-doc-icon-box.viatico {
  background: #0d9488;
}
.notif-doc-icon-box.he {
  background: #f59e0b;
}

.notif-calif-tag {
  display: inline-block;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.notif-item-content {
  flex: 1;
  min-width: 0;
}
.notif-item-title {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-main, #1e293b);
  line-height: 1.35;
  margin-bottom: 0.3rem;
}
.notif-item-time {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
}
.notif-unread-star {
  color: #22c55e;
  font-size: 0.95rem;
  margin-left: 0.35rem;
  flex-shrink: 0;
}

.notif-footer-load-more {
  padding: 0.75rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border-color, #e2e8f0);
  background: var(--card-bg, #ffffff);
}
.notif-load-more-btn {
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.notif-load-more-btn:hover { text-decoration: underline; }

/* ==========================================================================
   MODALES MODERNOS DE VERIFICACIÓN, CALIFICACIÓN Y DETALLE DE TAREAS (DISEÑO REIMAGINADO)
   ========================================================================== */
.swige-modal-verification-modern {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* 1. Hero Header */
.verification-hero-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  position: relative;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.verification-hero-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.verification-hero-icon-box.task-icon {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.verification-hero-text {
  flex: 1;
  min-width: 0;
}

.verification-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  margin-bottom: 0.35rem;
}

.verification-pill-badge.task-pill {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.verification-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.verification-hero-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin: 0;
  line-height: 1.3;
}

.verification-hero-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin: 3px 0 0 0;
}

.verification-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s;
}

.verification-close-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-main, #0f172a);
}

/* 2. Highlight Score / Status Card */
.verification-score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(16, 185, 129, 0.08));
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.1rem 0;
}

.verification-score-card.task-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(14, 165, 233, 0.08));
  border-color: rgba(99, 102, 241, 0.25);
}

.verification-score-left {
  display: flex;
  flex-direction: column;
}

.verification-score-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
}

.verification-score-big {
  font-size: 2rem;
  font-weight: 900;
  color: #10b981;
  line-height: 1.1;
  letter-spacing: -1px;
}

.verification-score-max {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.verification-task-title-big {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin-top: 2px;
}

.verification-score-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.verification-status-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #10b981;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.verification-status-tag-pill.task-pill-priority {
  background: #6366f1;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.verification-status-sub {
  font-size: 0.73rem;
  color: var(--text-muted, #64748b);
}

/* 3. Grid Info Cards (Modern Card Tiles) */
.verification-grid-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

@media (max-width: 540px) {
  .verification-grid-info {
    grid-template-columns: 1fr;
  }
}

.verification-info-card {
  background: var(--bg-hover, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.verification-info-card.full-width {
  grid-column: 1 / -1;
}

.verification-info-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.verification-info-icon {
  font-size: 0.95rem;
}

.verification-info-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted, #64748b);
}

.verification-info-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main, #0f172a);
  line-height: 1.35;
}

.verification-info-val.font-semibold {
  font-weight: 700;
}

.verification-info-val.text-emerald {
  color: #10b981;
}

.verification-info-val.text-blue {
  color: #2563eb;
}

/* 4. Observation & Feedback Box */
.verification-observation-box {
  background: rgba(37, 99, 235, 0.04);
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.1rem;
}

.verification-observation-box.task-obs {
  background: rgba(99, 102, 241, 0.04);
  border-left-color: #6366f1;
}

.verification-obs-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 0.4rem;
}

.verification-observation-box.task-obs .verification-obs-header {
  color: #6366f1;
}

.verification-obs-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main, #334155);
  margin: 0;
  font-style: italic;
}

/* 5. Security & Audit Seal */
.verification-security-seal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: rgba(16, 185, 129, 0.06);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  border-radius: 8px;
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
}

.verification-seal-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #10b981;
}

/* Modo Oscuro para Modales Modernos */
body.dark-mode .swige-modal-verification-modern {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

body.dark-mode .verification-hero-header {
  border-bottom-color: #334155;
}

body.dark-mode .verification-hero-title {
  color: #f8fafc;
}

body.dark-mode .verification-info-card {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .verification-info-val {
  color: #f1f5f9;
}

body.dark-mode .verification-obs-text {
  color: #e2e8f0;
}

body.dark-mode .verification-score-card {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

body.dark-mode .verification-score-card.task-card {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Sidebar Navigation */
.sidebar {
  width: 250px; 
  background: var(--sidebar-bg); 

  color: var(--text-light);
  display: flex; 
  flex-direction: column; 
  justify-content: space-between;
  position: fixed; 
  top: 0; bottom: 0; left: 0; 
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
  height: 60px; 
  display: flex; 
  align-items: center; 
  padding: 0 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.08); 
  gap: 0.75rem;
}

.brand-icon-toggle {
  width: 40px; 
  height: 40px; 
  position: relative; 
  background: none; 
  border: none;
  border-radius: 8px; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: #ffffff; 
  flex-shrink: 0; 
  transition: background 0.2s;
}
.brand-icon-toggle:hover { background: var(--sidebar-hover); }

.brand-icon-toggle .company-icon,
.brand-icon-toggle .hamburger-icon { position: absolute; transition: opacity 0.2s ease, transform 0.2s ease; }
.brand-icon-toggle .hamburger-icon { opacity: 0; transform: scale(0.85); color: #60a5fa; }
.brand-icon-toggle:hover .company-icon { opacity: 0; transform: scale(0.85); }
.brand-icon-toggle:hover .hamburger-icon { opacity: 1; transform: scale(1); }

.sidebar-brand-text {
  font-size: 1.15rem; 
  font-weight: 800; 
  letter-spacing: 1px; 
  color: #ffffff;
  white-space: nowrap; 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  cursor: pointer; 
  user-select: none;
}
.sidebar-brand-text .menu-tag {
  font-size: 0.75rem; 
  color: #94a3b8; 
  font-weight: 500; 
  border-left: 1px solid rgba(255,255,255,0.2); 
  padding-left: 6px;
}

.sidebar-top { padding: 1rem 0.65rem; }
.nav-menu { display: flex; flex-direction: column; gap: 0.35rem; }

.nav-btn {
  position: relative; 
  background: none; 
  border: none; 
  color: #94a3b8; 
  padding: 0.75rem 0.60rem;
  text-align: left; 
  border-radius: 8px; 
  cursor: pointer; 
  font-size: 0.88rem; 
  font-weight: 500;
  display: flex; 
  align-items: center; 
  gap: 0.85rem; 
  transition: all 0.2s ease; 
  width: 100%; 
  white-space: nowrap;
}
.nav-btn:hover { background: var(--sidebar-hover); color: #f1f5f9; }
.nav-btn.active { background: rgba(255, 255, 255, 0.1); color: #ffffff; font-weight: 600; border-left: 3px solid #60a5fa; }
.nav-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.75; fill: none; flex-shrink: 0; margin-left: 5px; }

.nav-btn::after {
  content: attr(data-tooltip); 
  position: absolute; 
  left: calc(100% + 14px); 
  top: 50%;
  transform: translateY(-50%) translateX(-6px); 
  background: #0f172a; 
  color: #f8fafc;
  padding: 6px 12px; 
  border-radius: 6px; 
  font-size: 0.78rem; 
  font-weight: 500;
  white-space: nowrap; 
  pointer-events: none; 
  opacity: 0; 
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255,255,255,0.12); 
  transition: opacity 0.2s ease, transform 0.2s ease; 
  z-index: 1000;
}
.nav-btn:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }

.nav-group-has-sub { position: relative; }
.sub-indicator-arrow { 
  font-size: 0.65rem; 
  margin-left: auto; 
  color: #94a3b8; 
  transition: transform 0.25s ease 0s, color 0.2s ease 0s; 
}
.nav-group-has-sub:hover .sub-indicator-arrow,
.nav-group-has-sub.is-open .sub-indicator-arrow { 
  color: #60a5fa; 
  transform: rotate(180deg);
  transition-delay: 0.75s;
}

.submenu-container {
  display: flex;
  flex-direction: column; 
  position: relative; 
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  margin-top: 0; 
  margin-left: 1.6rem; 
  padding-left: 0.8rem;
  transition: max-height 0.3s ease 0s, opacity 0.2s ease 0s, visibility 0.2s ease 0s, margin 0.2s ease 0s;
}
.submenu-container::before {
  content: ""; 
  position: absolute; 
  top: 0; bottom: 18px; left: 0; 
  width: 2px;
  background-color: var(--branch-line-color); 
  border-radius: 1px;
}
.nav-group-has-sub:hover .submenu-container,
.nav-group-has-sub.is-open .submenu-container { 
  max-height: 250px;
  opacity: 1;
  visibility: visible;
  margin-top: 0.2rem;
  transition: max-height 0.35s ease 0.75s, opacity 0.3s ease 0.75s, visibility 0.3s ease 0.75s, margin 0.3s ease 0.75s;
}

.submenu-container .nav-btn { font-size: 0.82rem; padding: 0.55rem 0.5rem; margin-bottom: 0.15rem; position: relative; }
.submenu-container .nav-btn::before {
  content: ""; 
  position: absolute; 
  top: 50%; left: -0.8rem; 
  width: 0.75rem; height: 2px; 
  background-color: var(--branch-line-color);
}

.nav-btn .approval-tab-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #ef4444;
  color: #ffffff;
  padding: 0.12rem 0.48rem;
  border-radius: 12px;
  margin-left: auto;
  line-height: 1;
  display: inline-block;
}
.nav-btn.active .approval-tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.nav-notif-dot {
  width: 9px;
  height: 9px;
  min-width: 9px;
  min-height: 9px;
  background: #10b981;
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.9);
  animation: pulseDot 2s infinite ease-in-out;
  display: none;
  flex-shrink: 0;
}

.nav-notif-dot.red {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
}

@keyframes pulseDot {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Footer del sidebar */
.sidebar-footer {
  padding: 0.85rem 0.65rem; 
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  background: rgba(15, 23, 42, 0.4); 
  gap: 0.5rem;
}
.profile-info { display: flex; align-items: center; gap: 0.65rem; cursor: pointer; padding: 4px 6px; border-radius: 6px; overflow: hidden; }
.profile-info:hover { background: var(--sidebar-hover); }
.profile-avatar { width: 34px; height: 34px; border-radius: 50%; background: #334155; display: flex; align-items: center; justify-content: center; color: #94a3b8; flex-shrink: 0; }
.profile-text { display: flex; flex-direction: column; white-space: nowrap; }
.profile-name { font-size: 0.82rem; font-weight: 600; color: #f8fafc; line-height: 1.2; }
.profile-role { font-size: 0.7rem; color: #94a3b8; }

.settings-btn { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 6px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.settings-btn:hover { color: #ffffff; background: var(--sidebar-hover); }

.sidebar.collapsed { 
  width: 72px; 
}
.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 0;
}
.sidebar.collapsed .sidebar-brand-text, 
.sidebar.collapsed .nav-text, 
.sidebar.collapsed .profile-text,
.sidebar.collapsed .sub-indicator-arrow,
.sidebar.collapsed .menu-tag { 
  display: none !important; 
}
.sidebar.collapsed .submenu-container { 
  display: none !important; 
}
.sidebar.collapsed .nav-btn {
  justify-content: center;
  padding: 0.75rem 0;
  width: 100%;
}
.sidebar.collapsed .nav-btn svg {
  margin: 0 !important;
  width: 22px;
  height: 22px;
}
.sidebar.collapsed .sidebar-footer { 
  flex-direction: column; 
  align-items: center; 
  padding: 0.75rem 0; 
  gap: 0.75rem; 
  justify-content: center;
}
.sidebar.collapsed .sidebar-footer .settings-btn { 
  order: 1; 
  margin: 0 auto;
}
.sidebar.collapsed .sidebar-footer .profile-info { 
  order: 2; 
  padding: 0; 
  justify-content: center;
  width: 100%;
}
.sidebar.collapsed .sidebar-footer .profile-avatar {
  margin: 0 auto;
}

/* Main Area Layout & Transiciones */
.main-wrapper { 
  flex: 1; 
  margin-top: 60px; 
  margin-left: 250px; 
  padding: 2rem; 
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  min-height: calc(100vh - 60px); 
}
.main-wrapper.expanded { margin-left: 72px; }

.tab-content { 
  display: none; 
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.tab-content.active { 
  display: block; 
  opacity: 1;
  transform: translateY(0);
}

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

.header-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 1.5rem; }

.card { 
  background: var(--card-bg); 
  border-radius: 12px; 
  border: 1px solid var(--border-color); 
  padding: 1.5rem; 
  margin-bottom: 1.5rem; 
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.portal-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 10px; padding: 1.25rem; }
.portal-card h4 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.portal-card .stat-val { font-size: 1.6rem; font-weight: 700; color: var(--text-main); }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.35rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; 
  padding: 0.6rem 0.75rem; 
  border: 1px solid var(--border-color); 
  border-radius: 8px; 
  font-size: 0.88rem;
  color: var(--text-main); 
  background: var(--bg-main); 
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-active);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-group textarea { resize: vertical; height: 80px; }

/* Barra de Búsqueda y Filtros */
.filter-bar { 
  display: flex; 
  gap: 0.75rem; 
  margin-bottom: 1.25rem; 
  flex-wrap: wrap; 
  align-items: center; 
  justify-content: space-between;
}

.filter-group-left {
  display: flex;
  gap: 0.75rem;
  flex: 1;
  min-width: 280px;
  flex-wrap: wrap;
}

.search-input-wrapper { 
  flex: 1; 
  min-width: 220px; 
  position: relative; 
  display: flex; 
  align-items: center; 
}
.search-input-wrapper svg { 
  position: absolute; 
  left: 10px; 
  width: 16px; 
  height: 16px; 
  color: var(--text-muted); 
  pointer-events: none; 
}
.search-input-wrapper input {
  width: 100%; 
  padding: 0.55rem 0.75rem 0.55rem 2.2rem; 
  border: 1px solid var(--border-color);
  border-radius: 8px; 
  font-size: 0.85rem; 
  background: var(--bg-main); 
  color: var(--text-main);
}
.filter-select {
  padding: 0.55rem 0.85rem; 
  border: 1px solid var(--border-color); 
  border-radius: 8px;
  font-size: 0.85rem; 
  background: var(--bg-main); 
  color: var(--text-main); 
  cursor: pointer;
}

.data-table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
.data-table th, .data-table td { padding: 0.75rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 0.85rem; }
.data-table th { background: var(--bg-main); font-weight: 600; }

.badge { padding: 0.25rem 0.6rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
.badge-success { background: var(--status-success-bg); color: var(--status-success-text); }
.badge-warning { background: var(--status-warning-bg); color: var(--status-warning-text); }
.badge-danger { background: var(--status-danger-bg); color: var(--status-danger-text); }
.badge-info { background: var(--bg-main); color: var(--text-muted); border: 1px solid var(--border-color); }

.badge-nivel-baja { background: var(--semaforo-baja-bg); color: var(--semaforo-baja-text); font-weight: 700; border: 1px solid rgba(22, 163, 74, 0.2); }
.badge-nivel-media { background: var(--semaforo-media-bg); color: var(--semaforo-media-text); font-weight: 700; border: 1px solid rgba(202, 138, 4, 0.2); }
.badge-nivel-alta { background: var(--semaforo-alta-bg); color: var(--semaforo-alta-text); font-weight: 700; border: 1px solid rgba(220, 38, 38, 0.2); }

.btn-action {
  padding: 0.65rem 1.25rem; 
  border: none; 
  border-radius: 8px; 
  font-size: 0.88rem; 
  font-weight: 600;
  cursor: pointer; 
  background: var(--btn-bg); 
  color: #ffffff; 
  transition: all 0.2s; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 0.5rem; 
  position: relative;
}
.btn-action:hover { background: var(--btn-hover); transform: translateY(-1px); }
.btn-action:active { transform: translateY(0); }
.btn-action:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-export {
  background: #10b981;
  color: #ffffff;
  padding: 0.55rem 0.95rem;
  font-size: 0.82rem;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s, transform 0.2s;
}
.btn-export:hover { background: #059669; transform: translateY(-1px); }

/* Spinners */
.spinner {
  width: 16px; 
  height: 16px; 
  border: 2px solid rgba(255,255,255,0.3); 
  border-top-color: #ffffff;
  border-radius: 50%; 
  animation: spin 0.7s linear infinite; 
  display: inline-block;
}
.spinner-dark {
  width: 18px; 
  height: 18px; 
  border: 2px solid var(--border-color); 
  border-top-color: var(--accent-active);
  border-radius: 50%; 
  animation: spin 0.7s linear infinite; 
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast Notification */
.toast-container {
  position: fixed; 
  top: 75px; 
  right: 20px; 
  z-index: 6000; 
  display: flex; 
  flex-direction: column; 
  gap: 10px; 
  pointer-events: none;
}
.toast {
  min-width: 280px; 
  max-width: 360px; 
  background: var(--card-bg); 
  border-left: 4px solid var(--accent-active);
  border-radius: 8px; 
  padding: 0.85rem 1rem; 
  box-shadow: 0 6px 18px rgba(0,0,0,0.15); 
  display: flex; 
  align-items: flex-start;
  gap: 0.75rem; 
  pointer-events: auto; 
  animation: slideIn 0.3s ease forwards;
}
.toast.toast-error { border-left-color: #ef4444; }
.toast.toast-success { border-left-color: #10b981; }
.toast-content { flex: 1; }
.toast-title { font-size: 0.85rem; font-weight: 600; color: var(--text-main); margin-bottom: 2px; }
.toast-msg { font-size: 0.78rem; color: var(--text-muted); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Modal y Cámara WebRTC */
.modal-overlay {
  position: fixed; 
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65); 
  display: none; 
  align-items: center; 
  justify-content: center;
  z-index: 2000; 
  backdrop-filter: blur(3px);
}
.modal-overlay.active { display: flex; }
.modal-card {
  background: var(--card-bg); 
  border: 1px solid var(--border-color);
  border-radius: 14px; 
  width: 90%; 
  max-width: 480px; 
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35); 
  text-align: center;
}
.modal-card h3 { font-size: 1.15rem; margin-bottom: 0.4rem; color: var(--text-main); }
.modal-card p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.modal-actions { display: flex; flex-direction: column; gap: 0.75rem; }

/* Contenedor de cámara en vivo */
.camera-viewfinder-container {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
  position: relative;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border-color);
}
.camera-viewfinder-container.active { display: flex; }

#camera-video {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 8px;
}

#camera-canvas {
  display: none;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 8px;
}

.camera-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  width: 100%;
  justify-content: center;
}

/* ESFERAS FLOTANTES */
.floating-container {
  position: fixed; 
  bottom: 20px; 
  right: 20px; 
  z-index: 1000; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 10px;
}
.sub-spheres { display: none; flex-direction: column; gap: 10px; align-items: center; }
.sub-spheres.active { display: flex; }

.floating-ball {
  width: 40px; 
  height: 40px; 
  border-radius: 50%; 
  background: var(--card-bg); 
  color: var(--text-main);
  border: 1px solid var(--border-color); 
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); 
  display: flex;
  align-items: center; 
  justify-content: center; 
  cursor: pointer; 
  transition: all 0.2s ease; 
  position: relative;
}
.floating-ball:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12); border-color: #3b82f6; color: #3b82f6; }
.floating-ball.active { background: #3b82f6; color: #ffffff; border-color: #3b82f6; }
.floating-ball svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Ondas Expansivas tipo Radar para el Icono de Asistencia */
#ball-asistencia {
  position: relative;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

#ball-asistencia svg {
  stroke: #ffffff;
}

#ball-asistencia::before,
#ball-asistencia::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2.5px solid rgba(59, 130, 246, 0.85);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
  pointer-events: none;
  animation: radarWavePulse 2.4s cubic-bezier(0.1, 0.4, 0.2, 1) infinite;
  z-index: -1;
}

#ball-asistencia::after {
  animation-delay: 1.2s;
  border-color: rgba(14, 165, 233, 0.85);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.5);
}

@keyframes radarWavePulse {
  0% {
    width: 100%;
    height: 100%;
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.6;
  }
  100% {
    width: 280%;
    height: 280%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.8);
  }
}

.main-ball { width: 44px; height: 44px; background: #3b82f6; color: #ffffff; border: none; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35); }
.main-ball:hover { background: #2563eb; transform: scale(1.05); color: #ffffff; }
.main-ball svg { width: 20px; height: 20px; stroke: #ffffff; stroke-width: 2; transition: transform 0.25s ease; }
.main-ball.opened svg { transform: rotate(45deg); }

.ball-tooltip {
  position: absolute; 
  right: 50px; 
  background: #0f172a; 
  color: #fff; 
  padding: 4px 8px;
  border-radius: 6px; 
  font-size: 0.72rem; 
  white-space: nowrap; 
  opacity: 0; 
  pointer-events: none; 
  transition: opacity 0.2s; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.floating-ball:hover .ball-tooltip { opacity: 1; }

.floating-panel {
  position: fixed; 
  bottom: 80px; 
  right: 20px; 
  width: 340px; 
  max-width: calc(100vw - 40px);
  background: var(--card-bg); 
  border: 1px solid var(--border-color); 
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15); 
  z-index: 999; 
  display: none; 
  flex-direction: column; 
  overflow: hidden;
}
.floating-panel.active { display: flex; }
.panel-header { background: #1e293b; color: #ffffff; padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.panel-header h4 { font-size: 0.88rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.panel-close-btn { background: none; border: none; color: #94a3b8; cursor: pointer; display: flex; align-items: center; }
.panel-body { padding: 1rem; max-height: 440px; overflow-y: auto; }

/* Onda de Ubicación GPS Radar */
.radar-location-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0.5rem auto 0.75rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radar-core-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}
.radar-core-circle svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}
.radar-wave-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #3b82f6;
  opacity: 0;
  pointer-events: none;
  animation: radarRippleWave 2.4s cubic-bezier(0.1, 0.4, 0.8, 1) infinite;
}
.radar-wave-ring.w2 { animation-delay: 0.8s; }
.radar-wave-ring.w3 { animation-delay: 1.6s; }

@keyframes radarRippleWave {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: scale(1.75);
    opacity: 0;
  }
}

.radar-location-wrapper.active-tracking .radar-core-circle {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.6);
  transform: scale(1.08);
}
.radar-location-wrapper.active-tracking .radar-wave-ring {
  border-color: #22c55e;
}

.clock-display { font-size: 1.8rem; font-weight: 700; text-align: center; margin: 0.25rem 0 0.5rem 0; }
.gps-status { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 0.5rem; 
  font-size: 0.78rem; 
  padding: 0.4rem 0.7rem; 
  border-radius: 20px; 
  background: var(--status-success-bg); 
  color: var(--status-success-text); 
  margin-bottom: 0.5rem; 
  text-align: center;
}
.gps-status.error { background: var(--status-danger-bg); color: var(--status-danger-text); }
.gps-status.warning { background: var(--status-warning-bg); color: var(--status-warning-text); }

.gps-coords-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
  word-break: break-all;
}

.btn-fichar { 
  width: 100%; 
  padding: 0.75rem; 
  border: none; 
  border-radius: 8px; 
  font-size: 0.9rem; 
  font-weight: 600; 
  cursor: pointer; 
  background: var(--btn-bg); 
  color: #ffffff; 
  transition: background 0.2s;
}
.btn-fichar:hover { background: var(--btn-hover); }

/* Ventana de Chatbot Ampliada */
#panel-chatbot.floating-panel {
  width: 460px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 100px);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

#panel-chatbot .panel-header {
  padding: 0.9rem 1.25rem;
}

#panel-chatbot .panel-body {
  height: calc(100% - 54px);
  max-height: none;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

#panel-chatbot .chat-messages {
  flex: 1;
  max-height: none;
  min-height: 280px;
  overflow-y: auto;
  padding-right: 0.4rem;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

#panel-chatbot .chat-bubble {
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 0.7rem 1rem;
  border-radius: 12px;
}

#panel-chatbot .chat-input-box {
  padding-top: 0.75rem;
  gap: 0.6rem;
}

#panel-chatbot .chat-input-box input {
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  border-radius: 8px;
}

.chat-messages { display: flex; flex-direction: column; gap: 0.75rem; min-height: 200px; max-height: 280px; overflow-y: auto; margin-bottom: 1rem; }
.chat-bubble { max-width: 82%; padding: 0.55rem 0.8rem; border-radius: 10px; font-size: 0.8rem; }
.chat-bubble.bot { background: var(--bg-main); align-self: flex-start; }
.chat-bubble.user { background: #3b82f6; color: #ffffff; align-self: flex-end; }
.chat-input-box { display: flex; gap: 0.5rem; border-top: 1px solid var(--border-color); padding-top: 0.75rem; }
.chat-input-box input { flex: 1; padding: 0.45rem 0.65rem; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.8rem; background: var(--bg-main); color: var(--text-main); }
.chat-send-btn { background: var(--btn-bg); color: #fff; border: none; border-radius: 6px; padding: 0 0.75rem; cursor: pointer; }

/* ==========================================================================
   AGENDA DIARIA Y TIMELINE (MATERIAS + TAREAS)
   ========================================================================== */
.agenda-hero-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.agenda-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.agenda-date-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.agenda-progress-container {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  border-radius: 10px;
}
.agenda-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}
.agenda-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}
.agenda-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.agenda-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.agenda-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.agenda-pill-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.agenda-pill-btn:hover {
  background: var(--bg-main);
  color: var(--text-main);
}
.agenda-pill-btn.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

/* Timeline Vertical */
.timeline-wrapper {
  position: relative;
  padding: 0.5rem 0 1.5rem 0;
}
.timeline-wrapper::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 90px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  gap: 1.25rem;
}

.timeline-time-col {
  width: 80px;
  text-align: right;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-top: 0.75rem;
}
.timeline-time-col span.time-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: normal;
  color: var(--text-muted);
  opacity: 0.8;
}

.timeline-node {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 3px solid #3b82f6;
  flex-shrink: 0;
  margin-top: 0.65rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline-node.node-completed {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}
.timeline-node.node-materia {
  border-color: #8b5cf6;
  background: #f3e8ff;
}
body.dark-mode .timeline-node.node-materia {
  background: #3b0764;
}
.timeline-node.node-break {
  border-color: #f59e0b;
}

.timeline-card {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.15s, box-shadow 0.15s;
}
.timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.timeline-card.card-task {
  border-left: 4px solid #3b82f6;
}
.timeline-card.card-task.task-alta {
  border-left: 4px solid #ef4444;
}
.timeline-card.card-task.task-media {
  border-left: 4px solid #f59e0b;
}
.timeline-card.card-task.task-baja {
  border-left: 4px solid #10b981;
}
.timeline-card.card-task.is-completed {
  opacity: 0.7;
  background: var(--bg-main);
}
.timeline-card.card-task.is-completed .task-heading {
  text-decoration: line-through;
  color: var(--text-muted);
}

.timeline-card.card-materia {
  border-left: 4px solid #8b5cf6;
  background: linear-gradient(135deg, var(--card-bg) 70%, rgba(139, 92, 246, 0.04));
}
.timeline-card.card-break {
  border-left: 4px solid #f59e0b;
  background: var(--bg-main);
  padding: 0.65rem 1rem;
}
.timeline-card.card-checkin {
  border-left: 4px solid #10b981;
}

.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.timeline-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.timeline-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.6rem;
}
.timeline-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.timeline-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.timeline-card-actions {
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--border-color);
  padding-top: 0.6rem;
}
.btn-timeline-action {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}
.btn-timeline-action:hover {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

@media (max-width: 768px) {
  .timeline-wrapper::before { left: 15px; }
  .timeline-item { flex-direction: column; gap: 0.4rem; padding-left: 30px; }
  .timeline-time-col { width: 100%; text-align: left; padding-top: 0; }
  .timeline-node { position: absolute; left: 4px; top: 0; }
  .timeline-card { width: 100%; }
}

/* ==========================================================================
   PLANIFICADOR SEMANAL INTERACTIVO (DRAG AND DROP)
   ========================================================================== */
.planner-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: start;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.planner-layout.sidebar-hidden {
  grid-template-columns: 1fr;
}

.planner-layout.sidebar-hidden .planner-sidebar {
  display: none;
}

.btn-collapse-planner-tasks {
  background: var(--bg-hover, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-main, #334155);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-collapse-planner-tasks:hover {
  background: var(--primary, #3b82f6);
  color: #ffffff;
  border-color: var(--primary, #3b82f6);
}

.btn-expand-planner-tasks {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
  transition: all 0.2s ease;
}

.btn-expand-planner-tasks:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* ==========================================================================
   DROPDOWN DE EXPORTACIÓN (PDF / EXCEL)
   ========================================================================== */
.export-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.btn-export-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg, #ffffff);
  color: var(--text-main, #334155);
  border: 1px solid var(--border-color, #cbd5e1);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.btn-export-dropdown:hover {
  background: var(--bg-hover, #f1f5f9);
  border-color: var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
}

.export-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  display: none;
  flex-direction: column;
  padding: 4px;
  z-index: 1000;
  animation: fadeInScale 0.15s ease-out;
}

.export-dropdown-menu.active {
  display: flex;
}

.export-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-main, #334155);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.export-dropdown-item:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--primary, #3b82f6);
}

body.dark-mode .export-dropdown-menu {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .export-dropdown-item {
  color: #e2e8f0;
}

body.dark-mode .export-dropdown-item:hover {
  background: #334155;
  color: #60a5fa;
}

/* ==========================================================================
   BOTÓN DE ACCIÓN / VISTO EN TABLA DE TAREAS ASIGNADAS
   ========================================================================== */
.btn-visto-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
}

.btn-visto-check.pending,
.btn-visto-check.visto-pendiente {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.35);
}

.btn-visto-check.pending:hover,
.btn-visto-check.visto-pendiente:hover {
  background: #f59e0b;
  color: #ffffff;
  transform: scale(1.04);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.btn-visto-check.completed,
.btn-visto-check.visto-completada {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.4);
}

.btn-visto-check.completed:hover,
.btn-visto-check.visto-completada:hover {
  background: #10b981;
  color: #ffffff;
  transform: scale(1.04);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.visto-circle-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: inline-block;
}

@media (max-width: 1024px) {
  .planner-layout {
    grid-template-columns: 1fr;
  }
}

.planner-sidebar {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.planner-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.planner-sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.planner-help-box {
  background: #f8fafc;
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1rem;
}

body.dark-mode .planner-help-box {
  background: #1e293b;
  border-left-color: #60a5fa;
  color: #94a3b8;
}

.draggable-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 150px;
}

/* Píldoras de tareas arrastrables */
.draggable-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.draggable-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.draggable-pill:active,
.draggable-pill.dragging {
  cursor: grabbing;
  opacity: 0.6;
  transform: scale(0.98);
}

.pill-grip {
  opacity: 0.5;
  font-size: 0.9rem;
  margin-right: 0.35rem;
}

/* Colores Sutiles para las píldoras */
.pill-amber {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.pill-teal {
  background: #ccfbf1;
  color: #115e59;
  border-color: #99f6e4;
}
.pill-orange {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fed7aa;
}
.pill-blue {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}
.pill-purple {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}
.pill-emerald {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}
.pill-rose {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fecdd3;
}

body.dark-mode .pill-amber { background: #451a03; color: #fde68a; border-color: #78350f; }
body.dark-mode .pill-teal { background: #042f2e; color: #99f6e4; border-color: #115e59; }
body.dark-mode .pill-orange { background: #431407; color: #fed7aa; border-color: #7c2d12; }
body.dark-mode .pill-blue { background: #172554; color: #bfdbfe; border-color: #1e40af; }
body.dark-mode .pill-purple { background: #3b0764; color: #e9d5ff; border-color: #6b21a8; }
body.dark-mode .pill-emerald { background: #022c22; color: #a7f3d0; border-color: #065f46; }
body.dark-mode .pill-rose { background: #4c0519; color: #fecdd3; border-color: #9f1239; }

/* Contenedor de la Tabla de Horario */
.planner-main {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow-x: auto;
}

.planner-table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.planner-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.planner-table th {
  background: #1e293b; /* Azul pizarra oscuro sutil como en la imagen */
  color: #ffffff;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.planner-table th:first-child {
  width: 130px;
  text-align: center;
}

.planner-table td {
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  vertical-align: top;
  background: var(--card-bg);
  transition: background 0.15s, border-color 0.15s;
}

.planner-table td.time-cell {
  background: var(--bg-main);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-main);
  text-align: center;
  vertical-align: middle;
  width: 130px;
}

/* Celdas Dropzone */
.planner-table td.dropzone {
  min-width: 130px;
  min-height: 120px;
  height: 130px;
  position: relative;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 100px;
  height: 100%;
}

.planner-table td.dropzone.drag-hover {
  background: #eff6ff !important;
  outline: 2px dashed #3b82f6;
  outline-offset: -2px;
}

body.dark-mode .planner-table td.dropzone.drag-hover {
  background: #1e3a8a !important;
  outline: 2px dashed #60a5fa;
}

/* Fila de Receso */
.receso-row td {
  background: #f1f5f9;
  text-align: center;
  font-weight: 700;
  font-size: 0.84rem;
  color: #475569;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-top: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
}

body.dark-mode .receso-row td {
  background: #0f172a;
  color: #94a3b8;
}

/* Tareas colocadas dentro de las celdas */
.placed-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  animation: fadeIn 0.2s ease forwards;
  position: relative;
  user-select: none;
  margin-bottom: 0.25rem;
}

.placed-task:hover {
  filter: brightness(0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.placed-task .btn-delete-task {
  background: none;
  border: none;
  color: currentColor;
  opacity: 0.4;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0 0.2rem;
  border-radius: 3px;
  line-height: 1;
  transition: opacity 0.15s;
}

.placed-task:hover .btn-delete-task {
  opacity: 1;
}

/* Mini formulario para añadir tareas al panel */
.add-task-form-inline {
  display: flex;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-color);
}

.add-task-form-inline input {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.8rem;
  background: var(--bg-main);
  color: var(--text-main);
}

/* ==========================================================================
   DISEÑO MODERNO DE PERFIL Y AJUSTES (INSPIRADO EN JIBBLE / REF UI)
   ========================================================================== */
.profile-clean-card {
  max-width: 650px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2.2rem 2.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.profile-clean-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.profile-clean-user {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.profile-avatar-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  background: #334155;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  border: 2px solid var(--card-bg);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 1.1rem;
}

.profile-avatar-wrapper:hover .profile-avatar-overlay {
  opacity: 1;
}

.profile-clean-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.profile-clean-name {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0;
}

.profile-clean-role {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 400;
}

.profile-schedule-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.badge-schedule-default {
  background: #94a3b8;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn-circle-edit {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-circle-edit:hover {
  background: var(--border-color);
  color: var(--text-main);
  transform: scale(1.05);
}

.profile-card-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 1.75rem 0;
  opacity: 0.75;
}

.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.profile-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

.profile-field-group {
  margin-bottom: 1.25rem;
}

.profile-field-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.profile-field-value {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 600;
}

.profile-field-value.placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
  cursor: pointer;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
}

.info-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 0.65rem;
  color: var(--text-muted);
  cursor: help;
  opacity: 0.7;
}

.profile-pin-text {
  font-size: 1.2rem;
  letter-spacing: 3px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.profile-pin-action {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.profile-pin-action a {
  color: #ea580c;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.profile-pin-action a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   SWITCHES INTERACTIVOS Y FILAS DE AJUSTES DE CUENTA
   ========================================================================== */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.settings-row:last-child {
  border-bottom: none;
  padding-bottom: 0.5rem;
}

.settings-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.settings-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.settings-icon {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Modern Toggle Switch (iOS / Material style) */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #3b82f6;
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 1px #3b82f6;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.settings-actions-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   ELEMENTOS MÓVILES Y BACKDROP
   ========================================================================== */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--bg-main);
}

.mobile-brand-title {
  display: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   MEDIA QUERIES RESPONSIVAS (MÓVILES Y TABLETS)
   ========================================================================== */
@media (max-width: 1024px) {
  .planner-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
  
  .mobile-brand-title {
    display: inline-block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: none;
  }

  .sidebar.sidebar-mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.4);
  }

  .sidebar .sidebar-brand-text,
  .sidebar .nav-text,
  .sidebar .profile-text {
    display: inline-flex !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
    padding: 1rem 0.85rem;
    width: 100%;
  }

  .top-header {
    left: 0 !important;
    padding: 0 0.85rem;
  }

  .profile-clean-card {
    padding: 1.35rem;
    border-radius: 10px;
  }

  .profile-clean-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-info-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .profile-clean-name {
    font-size: 1.25rem;
  }

  .settings-row {
    flex-direction: row;
    gap: 1rem;
  }

  .settings-desc {
    font-size: 0.76rem;
  }

  /* Planificador Semanal Responsive */
  .planner-table-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .planner-main {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }

  .planner-table {
    min-width: 620px;
  }

  /* Tablas de Datos con Scroll Horizontal */
  .card {
    padding: 1.15rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 480px;
  }

  /* Agenda Diaria */
  .agenda-hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .timeline-wrapper::before { left: 15px; }
  .timeline-item { flex-direction: column; gap: 0.4rem; padding-left: 30px; }
  .timeline-time-col { width: 100%; text-align: left; padding-top: 0; }
  .timeline-node { position: absolute; left: 4px; top: 0; }
  .timeline-card { width: 100%; }

  .filter-group-left { min-width: 100%; }

  /* Modales en Móviles */
  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-card {
    max-width: 95vw !important;
    max-height: 88vh;
    overflow-y: auto;
    padding: 1.25rem;
  }

  /* Paneles Flotantes */
  .floating-panel {
    right: 12px;
    bottom: 75px;
    width: calc(100vw - 24px);
    max-height: 80vh;
  }
}

@media (max-width: 480px) {
  #header-date {
    display: none;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .portal-card .stat-val {
    font-size: 1.35rem;
  }

  .agenda-filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   MEJORAS PROFESIONALES: TURNOS, FORMULARIOS Y CÁMARA DE FACTURAS EN VIVO
   ========================================================================== */

/* Tarjetas de Resumen Métrico */
.metrics-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metric-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.metric-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #3b82f6;
}

.metric-box-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.metric-box-icon.green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.metric-box-icon.amber {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.metric-box-icon.purple {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.metric-box-data {
  display: flex;
  flex-direction: column;
}

.metric-box-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.metric-box-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Selector de Días de Turnos */
.turnos-days-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.turnos-day-pill {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 105px;
  transition: all 0.2s ease;
}

.turnos-day-pill.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.turnos-day-pill .day-hours {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.85;
}

/* Captura de Facturas y Comprobantes */
.factura-upload-section {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  background: rgba(59, 130, 246, 0.02);
  margin-top: 0.5rem;
  transition: border-color 0.2s;
}

.factura-upload-section:hover {
  border-color: #3b82f6;
}

.factura-btn-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.factura-btn-action {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.factura-btn-action.cam {
  background: #2563eb;
  color: #fff;
}

.factura-btn-action.cam:hover {
  background: #1d4ed8;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

.factura-btn-action.file {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-color);
}

.factura-btn-action.file:hover {
  background: var(--border-color);
}

/* Vista Previa de Factura */
.factura-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  margin-top: 0.75rem;
  gap: 0.75rem;
}

.factura-preview-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.factura-preview-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: #000;
  cursor: pointer;
}

.factura-preview-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.factura-preview-meta .name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.factura-preview-meta .size {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.factura-preview-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.factura-preview-remove:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Visor de Documento / Escáner */
.doc-scanner-overlay {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0f172a;
}

.doc-scanner-frame {
  position: absolute;
  top: 8%;
  left: 8%;
  right: 8%;
  bottom: 8%;
  border: 2px dashed rgba(59, 130, 246, 0.8);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.doc-scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
  animation: scanLaser 2.2s infinite ease-in-out;
}

@keyframes scanLaser {
  0% { top: 0; opacity: 0.8; }
  50% { top: 100%; opacity: 1; }
  100% { top: 0; opacity: 0.8; }
}

/* Widget de Cronómetro y Temporizador de Actividades con Alarma */
.stopwatch-widget {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.stopwatch-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 250px;
}

.stopwatch-task-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.stopwatch-presets-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.preset-time-btn {
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-time-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.preset-time-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 600;
}

.stopwatch-timer-display {
  font-family: monospace;
  font-size: 1.95rem;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.stopwatch-timer-display.finished {
  color: #ef4444 !important;
  animation: pulseTimer 0.8s infinite alternate;
}

@keyframes pulseTimer {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.08); opacity: 0.7; }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
  100% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.6); }
}

@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

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

/* Visor Modal de Imagen / Factura Grande */
.img-viewer-card {
  max-width: 600px !important;
  text-align: center;
}

.img-viewer-photo {
  max-width: 100%;
  max-height: 65vh;
  border-radius: var(--radius-md);
  object-fit: contain;
  margin: 1rem 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   ACCESIBILIDAD (A11Y) Y SEMÁNTICA WCAG 2.1
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Enlace para saltar al contenido principal con teclado */
.skip-link {
  position: absolute;
  top: -60px;
  left: 15px;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 18px;
  z-index: 10000;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: top 0.2s ease;
  text-decoration: none;
}
.skip-link:focus {
  top: 15px;
}

/* Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Preferencias de Movimiento Reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   TEMA SUPERVISOR / ADMINISTRADOR DE ÁREA (supervisor.html)
   Paleta Ejecutiva: Índigo (#4f46e5), Deep Navy (#1e1b4b), Púrpura y Pizarra
   ========================================================================== */
body.theme-supervisor {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --primary-hover: #4338ca;
  --accent-color: #6366f1;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #4f46e5;
  --top-header-bg: #1e1b4b;
  --badge-supervisor: #4f46e5;
}

body.theme-supervisor.dark-mode {
  --bg-main: #0b0f19;
  --card-bg: #131b2e;
  --sidebar-bg: #090d16;
  --border-color: #1e293b;
  --primary: #6366f1;
  --primary-light: #1e1b4b;
}

.supervisor-brand-badge {
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
}

/* Tarjetas de Monitor de Personal */
.employee-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.employee-live-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.employee-live-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.08);
}

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

.employee-info-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.employee-avatar-sm {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.employee-status-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-on-duty {
  background: #dcfce7;
  color: #15803d;
}
body.dark-mode .status-on-duty {
  background: #052e16;
  color: #4ade80;
}

.status-off-duty {
  background: #f1f5f9;
  color: #64748b;
}
body.dark-mode .status-off-duty {
  background: #1e293b;
  color: #94a3b8;
}

.employee-live-details {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  background: var(--bg-hover);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Bandeja de Aprobaciones */
.approval-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.15s ease;
}

.approval-card:hover {
  border-color: var(--primary);
}

.btn-approve {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-approve:hover {
  background: #059669;
}

.btn-reject {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-reject:hover {
  background: #dc2626;
}

.btn-view-evidence {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-view-evidence:hover {
  background: var(--primary);
  color: #ffffff;
}

/* ==========================================================================
   TEMA GERENCIA GENERAL / C-SUITE (gerente.html)
   Paleta Ejecutiva: Corporate Emerald (#059669), Deep Forest (#064e3b) y Dorado
   ========================================================================== */
body.theme-gerente {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #d1fae5;
  --primary-hover: #065f46;
  --accent-color: #10b981;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #059669;
  --top-header-bg: #064e3b;
  --badge-gerente: #059669;
}

body.theme-gerente.dark-mode {
  --bg-main: #06110d;
  --card-bg: #0d201a;
  --sidebar-bg: #060e0a;
  --border-color: #1b382e;
  --primary: #10b981;
  --primary-light: #064e3b;
}

.gerente-brand-badge {
  background: #059669;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
}

.kpi-trend-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.kpi-trend-up {
  background: #dcfce7;
  color: #15803d;
}
body.dark-mode .kpi-trend-up {
  background: #052e16;
  color: #4ade80;
}

.dept-overview-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.dept-overview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.1);
  border-color: var(--primary);
}


