/* 
    IEmpresa | Sistema de Gestión Académica
    Design System - Official Brand Edition
*/

:root {
  /* Brand Colors */
  --primary: #f15a24; /* Naranja Instituto */
  --primary-hover: #ff8200; /* Naranja Energía */
  --secondary: #002d56; /* Azul Empresa */
  --prestige: #0a1f44; /* Azul Prestigio */
  --white: #ffffff;
  --gray-light: #f4f4f4; /* Gris Niebla */

  /* Functional Colors */
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --text-main: #0a1f44; /* Using Azul Prestigio for text */
  --text-muted: #5d6d7e;

  /* Layout & UI */
  --bg-app: var(--gray-light);
  --sidebar-bg: var(--secondary);
  --sidebar-text: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --border: #e5e8e8;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
}

/* --- Animations --- */
.loading-dots {
  display: inline-flex;
  align-items: baseline;
  text-align: left;
}

.loading-dots::after {
  content: "";
  display: inline-block;
  width: 1.2em; /* Espacio reservado para los 3 puntos */
  text-align: left;
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: "";
  }
  40% {
    content: ".";
  }
  60% {
    content: "..";
  }
  80%,
  100% {
    content: "...";
  }
}

/* --- Login UI --- */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--secondary) 0%,
    var(--prestige) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  background: var(--white);
  padding: 48px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: modalSlide 0.5s ease-out;
}

.login-header i {
  font-size: 56px;
  color: var(--primary);
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.5px;
}

.login-header p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* --- Layout --- */
.app-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-header {
  margin-bottom: 48px;
}

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

.logo i {
  font-size: 32px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logo span {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex-grow: 1;
}

.nav-section {
  margin-bottom: 32px;
}

.section-title {
  font-size: 13px; /* Aumentado de 11px */
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85); /* Mayor opacidad para mejor contraste */
  letter-spacing: 1px;
  margin-bottom: 16px;
  display: block;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-bottom: 4px;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-link i {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav-link span {
  display: flex;
  align-items: center;
  height: 24px; /* Match icon height for perfect leveling */
  line-height: 1;
}

.filter-group label {
  font-size: 13px; /* Aumentado de 12px */
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9); /* Mayor opacidad */
  margin-bottom: 8px;
  display: block;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  padding: 12px 14px;
  background: white;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--secondary);
  font-weight: 600;
  font-size: 14px;
  appearance: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.select-wrapper select:hover {
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.select-wrapper select option {
  background: white;
  color: var(--secondary);
  padding: 10px;
}

.select-wrapper i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--primary);
  font-size: 18px;
}

/* --- Sidebar Course Buttons --- */
.course-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.course-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
}

.course-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.course-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(241, 90, 36, 0.4);
}

.course-btn i {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- Main Content --- */
.main-content {
  padding: 40px;
  overflow-y: auto;
  background-color: var(--bg-app);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.page-info h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--secondary);
}

.page-info p {
  color: var(--text-muted);
}

.top-bar-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.batch-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  padding: 6px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

.batch-action-bar span {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
}

.admin-select-card {
  width: 28px;
  height: 28px;
  cursor: pointer;
  accent-color: var(--primary);
  margin-right: 4px;
}

.search-bar {
  position: relative;
  background: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
}

.search-bar i {
  color: var(--text-muted);
}
.search-bar input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 240px;
  color: var(--text-main);
}

/* --- Stats --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
}

.stat-card.detail-card {
  border-top-color: var(--secondary);
}

.stat-label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
  line-height: 1.3;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.2;
}

.stat-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-details:empty {
  display: none;
}
.stat-details.active {
  display: flex;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-main);
}

.detail-name {
  font-weight: 500;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.detail-count {
  font-weight: 700;
  background: var(--gray-light);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--primary);
}

/* --- Records Grid --- */
.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.student-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Specific styles for Report Cards */
.report-card {
  min-height: 260px;
}

.report-card .card-body h3 {
  min-height: 3.2em; /* Ensure enough space for 2 lines without jumping */
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
}

.report-card .btn-primary {
  height: 52px; /* Taller buttons */
  font-size: 15px;
}

.student-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  align-items: center;
}

.status-badge {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.status-pendiente {
  background: #fff3e0;
  color: #e67e22;
}
.status-completado {
  background: #e8f5e9;
  color: #2ecc71;
}
.status-enviado {
  background: #e3f2fd;
  color: #3498db;
}

.small-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.card-body {
  flex-grow: 1;
}

.card-footer {
  margin-top: auto;
}

.card-body h3 {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--secondary);
  line-height: 1.3;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-info span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
}

.card-info i {
  color: var(--primary);
}

.select-card-checkbox {
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: var(--primary);
  margin: 0;
  display: inline-block;
  vertical-align: middle;
  border-radius: 4px;
}

/* --- Buttons --- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(241, 90, 36, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--secondary);
}

.btn-outline:hover {
  background: var(--gray-light);
  border-color: var(--secondary);
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 48px;
  height: 48px;
  background: var(--gray-light);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--secondary);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: white;
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

/* Upload & Signature Refinements */
.paste-area:hover {
  border-color: var(--primary) !important;
  background-color: var(--white) !important;
  color: var(--primary);
}

.paste-area:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(241, 90, 36, 0.1);
}

.signature-wrapper canvas {
  touch-action: none;
}

#signaturePad {
  image-rendering: auto;
}

/* --- Modals --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 31, 68, 0.8); /* Azul Prestigio with opacity */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  width: 90%;
  max-width: 550px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.3s ease-out;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 32px 0 32px;
  margin-bottom: 24px;
}

.modal-body {
  padding: 0 32px 32px 32px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-footer {
  padding: 0 32px 32px 32px;
}

.modal-header h2 {
  font-size: 24px;
  color: var(--secondary);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
  display: block;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(241, 90, 36, 0.1);
  outline: none;
}

/* --- Suggestions --- */
.user-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  margin-top: 5px;
  border: 1px solid var(--border);
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.suggestion-item:hover {
  background: var(--gray-light);
  color: var(--primary);
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  /* Se cambió translateY(100px) a translateY(200%) para ocultar notificaciones altas */
  transform: translateX(-50%) translateY(200%);
  background: var(--prestige);
  color: white;
  padding: 16px 32px;
  /* Borde menos redondo para que el texto de varias líneas encaje mejor */
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3000;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  /* Soportar textos largos y saltos de línea */
  max-width: 90%;
  width: max-content;
  line-height: 1.5;
}

.toast.active {
  transform: translateX(-50%) translateY(0);
}

/* --- User Profile Sidebar --- */
.sidebar-footer {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 20px;
}

.user-info {
  flex-grow: 1;
}
.user-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.user-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.btn-logout {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 20px;
  transition: var(--transition);
}

.btn-logout:hover {
  color: var(--primary);
}

/* --- User Management View --- */
.user-management-view {
  animation: modalSlide 0.4s ease-out;
}

.user-list-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.user-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.table-responsive {
  overflow-x: auto;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.user-table th {
  padding: 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--gray-light);
  font-weight: 700;
}

.user-table td {
  padding: 16px;
  font-size: 14px;
  color: var(--text-main);
  border-bottom: 1px solid var(--gray-light);
  vertical-align: middle;
}

.user-table tr:hover {
  background-color: rgba(241, 90, 36, 0.02);
}

.user-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-admin {
  background: rgba(241, 90, 36, 0.1);
  color: var(--primary);
}
.badge-docente {
  background: rgba(0, 45, 86, 0.1);
  color: var(--secondary);
}

/* Helpers */
.docente-only,
.admin-only {
  display: none;
}
body.role-docente .docente-only {
  display: block;
}
body.role-docente .nav-link.docente-only {
  display: flex;
}
body.role-admin .admin-only {
  display: block;
}
body.role-admin .nav-link.admin-only {
  display: flex;
}

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

/* Responsive */
@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .main-content {
    padding: 24px;
  }
}

/* Tarjeta seleccionada visualmente */
.student-card.selected-card {
  background-color: rgba(241, 90, 36, 0.05); /* Fondo naranja ultra claro */
  border-color: var(--primary);
  box-shadow: 0 8px 16px rgba(241, 90, 36, 0.15);
  transform: translateY(-2px);
}

.student-card.selected-card .card-header .small-id {
  color: var(--primary);
  font-weight: 700;
}

/* Nuevo Panel Flotante Inferior */
.batch-action-bar-floating {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--prestige);
  padding: 12px 24px;
  border-radius: 50px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 1000;
  border: 2px solid var(--primary);
  animation: popUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.batch-action-bar-floating span#batchCountText {
  color: white;
  font-size: 16px;
  font-weight: 600;
}

.batch-action-bar-floating .btn {
  border-radius: 50px;
  padding: 10px 24px;
  box-shadow: none;
}

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

/* --- Colores Dinamicos para Stats Dashboard --- */

/* 1. Pendientes de Calificar (Naranja) */
.stats-bar .stat-card:nth-child(1) {
  background-color: rgba(241, 90, 36, 0.05); /* Naranja tintado */
  border-top: 4px solid var(--primary);
}
.stats-bar .stat-card:nth-child(1) .stat-value {
  color: var(--primary);
}

/* 2. Revisiones Completadas (Verde) */
.stats-bar .stat-card:nth-child(2) {
  background-color: rgba(46, 204, 113, 0.05); /* Verde tintado */
  border-top: 4px solid #2ecc71;
}
.stats-bar .stat-card:nth-child(2) .stat-value {
  color: #27ae60;
}

/* 3. Total Recibidos (Celeste del Chart) */
.stats-bar .stat-card:nth-child(3) {
  background-color: rgba(52, 152, 219, 0.05); /* Celeste tintado */
  border-top: 4px solid #3498db;
}

.stats-bar .stat-card:nth-child(3) .stat-value {
  color: #3498db;
  font-weight: bold;
}

/* Fila clicable en modo Tabla */
.user-table tr.clickable-row {
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.user-table tr.clickable-row:hover {
  background-color: rgba(241, 90, 36, 0.05) !important;
}

/* Fila seleccionada visualmente en modo Tabla */
.user-table tr.clickable-row.selected-row {
  background-color: rgba(241, 90, 36, 0.08) !important;
  border-left: 3px solid var(--primary);
}

/* --- Splash Screen Dinámico --- */
.splash-screen {
  transition:
    opacity 0.5s ease-out,
    visibility 0.5s ease-out;
}

.splash-content {
  text-align: center;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.splash-logo-icon {
  font-size: 80px;
  color: var(--primary);
  margin-bottom: 20px;
  /* Animación de flotación infinita */
  animation: float 3s ease-in-out infinite;
}

.splash-title {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -1px;
  opacity: 0;
  animation: fadeUp 0.6s ease-out 0.2s forwards;
}

.splash-text {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 30px;
  font-size: 15px;
  opacity: 0;
  animation: fadeUp 0.6s ease-out 0.4s forwards;
}

.splash-progress-container {
  width: 600px;
  height: 16px;
  background: rgba(10, 31, 68, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 3px;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.5),
    0 4px 15px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  opacity: 0;
  animation: fadeUp 0.6s ease-out 0.6s forwards;
}

.splash-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #ff8a5c);
  border-radius: 10px;
  /* La barra se llena en casi 3.5 segundos para sincronizar con el JS */
  animation: loadProgress 3.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  box-shadow: 0 0 10px rgba(241, 90, 36, 0.5);
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Keyframes de animación */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

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

@keyframes loadProgress {
  0% {
    width: 0%;
  }
  50% {
    width: 70%;
  }
  100% {
    width: 100%;
  }
}

/* --- Activity Filter Tags --- */
.activity-tag {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.activity-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.activity-tag.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(241, 90, 36, 0.3);
}

/* Fullscreen Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 31, 68, 0.95);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: white;
  text-align: center;
  backdrop-filter: blur(8px);
}

.loading-content {
  max-width: 400px;
  width: 90%;
}

.logo-loader-container {
  margin: 0 auto 32px;
  width: 120px;
  height: 120px;
  padding: 4px; /* Marco más delgado */
  background: white;
  border-radius: 24px; /* Esquinas más redondeadas */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-loader {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px; /* Redondea las esquinas del icono */
  overflow: hidden; /* Corta el icono para aplicar el borde redondeado */
}

.logo-loader img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cambiado a cover para asegurar que el área se llene */
}

.logo-base {
  filter: grayscale(1) opacity(0.2);
}

.logo-reveal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Removed scaleX(-1) to go clockwise */
  -webkit-mask-image: conic-gradient(
    from 0deg,
    black var(--logo-p, 0%),
    transparent 0%
  );
  mask-image: conic-gradient(
    from 0deg,
    black var(--logo-p, 0%),
    transparent 0%
  );
  z-index: 2;
}

.logo-reveal img {
  /* Removed scaleX(-1) */
}

.loading-content h3 {
  font-size: 28px;
  margin-bottom: 12px;
  font-weight: 700;
}

.loading-content p {
  opacity: 0.8;
  margin-bottom: 40px;
  font-size: 16px;
}

.progress-container {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: #f15a24 !important; /* Force IEmpresa Orange */
  background: linear-gradient(90, #f15a24, #ff8a5c) !important;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px rgba(241, 90, 36, 0.5);
}

.progress-text {
  font-weight: 800;
  color: #f15a24;
  font-size: 24px;
  letter-spacing: 1px;
}

/* Compact Report Cards */
.report-card {
  padding: 16px !important;
  min-height: auto !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.report-card h3 {
  font-size: 16px !important;
  margin-bottom: 4px !important;
  color: var(--secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}

.report-card .card-header {
  margin-bottom: 12px !important;
}

.report-card .card-footer {
  margin-top: 12px !important;
}

.status-no-habilitado {
  background: #f4f4f4;
  color: #7f8c8d;
}

/* --- Eye-Catching Sync Buttons --- */
.btn-refresh-striking {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    #ff7e5f 100%
  ) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(241, 90, 36, 0.4) !important;
  position: relative;
  overflow: visible !important; /* Allow the pulse ring to be visible */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  z-index: 1;
}

.btn-refresh-striking:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(241, 90, 36, 0.5) !important;
  background: linear-gradient(
    135deg,
    var(--primary-hover) 0%,
    #feb47b 100%
  ) !important;
}

.btn-refresh-striking:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-refresh-striking i {
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.btn-refresh-striking:hover i {
  transform: rotate(360deg);
}

/* Pulsing effect for attention */
.btn-refresh-striking::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(241, 90, 36, 0.7);
  animation: pulse-ring 2s infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(241, 90, 36, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(241, 90, 36, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(241, 90, 36, 0);
  }
}

.btn-refresh-striking.is-loading i {
  animation: spin-sync 1s linear infinite;
}

@keyframes spin-sync {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
