/* css/style.css - Estilos modernos y responsivos */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-dark: #1e40af;
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f3f4f6;
  color: var(--slate-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Header */
.main-header {
  margin-bottom: 24px;
}

.header-content {
  text-align: center;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e0e7ff;
  color: #3730a3;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #4f46e5;
  box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(79, 70, 229, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

.main-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--slate-500);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto;
}

/* Global Stats Bar */
.global-stats-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  background: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
}

.stat-pill {
  font-size: 0.9rem;
  color: var(--slate-600);
}

.stat-pill .pill-val {
  font-weight: 700;
  color: var(--slate-900);
  margin-left: 4px;
}

.highlight-green {
  color: var(--success) !important;
}

/* Card */
.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

/* Search Section */
.search-section {
  position: relative;
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .search-grid {
    grid-template-columns: 1fr;
  }
}

.search-input-group, .specialty-selector-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

label {
  font-size: 0.95rem;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

input[type="text"], select {
  width: 100%;
  padding: 12px 16px;
  font-size: 1.05rem;
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: #fff;
  font-family: inherit;
}

input[type="text"]:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--slate-400);
  cursor: pointer;
  padding: 4px;
  display: none;
}

.btn-clear:hover {
  color: var(--slate-700);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 350px;
  overflow-y: auto;
  z-index: 100;
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--slate-100);
  transition: background-color 0.15s;
}

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

.autocomplete-item:hover, .autocomplete-item.selected {
  background-color: var(--primary-light);
}

.item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-name {
  font-weight: 600;
  color: var(--slate-900);
}

.item-meta {
  font-size: 0.8rem;
  color: var(--slate-500);
}

.item-specs {
  display: flex;
  gap: 4px;
}

.spec-badge-xs {
  background: var(--slate-100);
  color: var(--slate-700);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Specialty Pills */
.specialty-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-btn {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.spec-btn:hover {
  background: var(--slate-200);
  color: var(--slate-900);
}

.spec-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.spec-btn.active .spec-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.spec-count {
  background: var(--slate-200);
  color: var(--slate-600);
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 9999px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.3rem;
  color: var(--slate-800);
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--slate-500);
  margin-bottom: 20px;
}

.example-searches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--slate-600);
}

.btn-tag {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-tag:hover {
  background: #dbeafe;
}

/* User Card */
.user-card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

@media (max-width: 640px) {
  .user-card-main {
    flex-direction: column-reverse;
  }
}

.user-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.tag-bolsa {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}

.tag-services {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.tag-status {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.85rem;
}

.status-adjudicat {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.status-desactivat {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-no-participat {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.status-ha-participat, .status-no-adjudicat {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.status-no-convocat {
  background: var(--slate-100);
  color: var(--slate-600);
}

.user-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 8px;
}

.user-specs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.specs-select-prompt {
  font-size: 0.85rem;
  color: var(--primary-dark);
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  width: fit-content;
}

.specs-buttons-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-specs-list .spec-btn {
  background: #ffffff;
  border: 1.5px solid var(--slate-300);
  color: var(--slate-700);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.user-specs-list .spec-btn:hover {
  background: var(--slate-100);
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.user-specs-list .spec-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.user-specs-list .spec-code {
  font-weight: 800;
  letter-spacing: 0.03em;
}

.tag-deact-sm {
  font-size: 0.75rem;
  color: var(--warning);
  font-weight: normal;
}

.btn-spec-pick {
  cursor: pointer;
  border: 1px solid var(--slate-300);
  transition: all 0.15s;
}

.btn-spec-pick:hover, .btn-spec-pick.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.user-pos-badge {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #ffffff;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 170px;
  box-shadow: var(--shadow-md);
}

.pos-badge-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

.pos-badge-number {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.1;
  margin: 4px 0;
}

.pos-badge-total {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Adjudicado Banner */
.adjudicado-banner {
  margin-top: 18px;
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.adj-icon {
  font-size: 2.2rem;
}

.adj-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 6px;
}

.adj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 16px;
  font-size: 0.9rem;
  color: #047857;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.highlight-kpi {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
}

.kpi-icon {
  font-size: 2rem;
  line-height: 1;
}

.kpi-content {
  flex: 1;
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--slate-500);
  margin-bottom: 4px;
}

.highlight-kpi .kpi-title {
  color: var(--primary-dark);
}

.kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.1;
  margin-bottom: 4px;
}

.highlight-kpi .kpi-value {
  color: var(--primary-dark);
}

.kpi-desc {
  font-size: 0.8rem;
  color: var(--slate-500);
}

/* Cutoff Card */
.cutoff-card {
  background: #fff;
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
}

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

.cutoff-title {
  font-size: 1rem;
  color: var(--slate-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cutoff-badge {
  background: #f1f5f9;
  color: var(--slate-700);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
}

.cutoff-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  font-size: 0.9rem;
  color: var(--slate-600);
}

/* Distribution Progress Bar */
.dist-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 12px;
}

.progress-bar-container {
  height: 24px;
  background: var(--slate-100);
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  margin-bottom: 12px;
}

.progress-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.seg-adjudicados { background-color: #10b981; }
.seg-activos { background-color: #3b82f6; }
.seg-desactivados { background-color: #f59e0b; }
.seg-no-participat { background-color: #ef4444; }
.seg-no-convocats { background-color: #94a3b8; }

.dist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--slate-600);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-adjudicados { background-color: #10b981; }
.dot-activos { background-color: #3b82f6; }
.dot-desactivados { background-color: #f59e0b; }
.dot-no-participat { background-color: #ef4444; }
.dot-no-convocats { background-color: #94a3b8; }

/* Table Section */
.table-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.table-title-wrap h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--slate-900);
}

.table-subtitle {
  font-size: 0.85rem;
  color: var(--slate-500);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.table-filter-tabs {
  display: flex;
  background: var(--slate-100);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.btn-tab {
  border: none;
  background: none;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-tab.active {
  background: #ffffff;
  color: var(--slate-900);
  box-shadow: var(--shadow-sm);
}

.input-table-search {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  outline: none;
}

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

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

.interinos-table th {
  background: var(--slate-50);
  padding: 10px 14px;
  font-weight: 600;
  color: var(--slate-600);
  border-bottom: 1.5px solid var(--slate-200);
}

.interinos-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
}

.interinos-table tr:hover td {
  background-color: var(--slate-50);
}

.row-current-user td {
  background-color: #eff6ff !important;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Pagination */
.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--slate-600);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-outline {
  border: 1px solid var(--slate-300);
  background: #ffffff;
  color: var(--slate-700);
}

.btn-outline:hover:not(:disabled) {
  background: var(--slate-50);
  border-color: var(--slate-400);
}

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

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal-card {
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--slate-200);
  padding-bottom: 12px;
}

.modal-header h2 {
  font-size: 1.3rem;
  color: var(--slate-900);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--slate-400);
  cursor: pointer;
}

.btn-close:hover {
  color: var(--slate-800);
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.summary-table th {
  background: var(--slate-100);
  padding: 8px 12px;
  text-align: left;
}

.summary-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--slate-100);
}

/* Footer */
.main-footer {
  text-align: center;
  padding: 24px 0 16px;
  color: var(--slate-500);
  font-size: 0.85rem;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--slate-400);
  margin-top: 4px;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Estilos para Adjudicados por Detrás */
.highlight-behind {
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  border-color: #d8b4fe;
}

.highlight-behind:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #c084fc;
}

.highlight-behind .kpi-title {
  color: #7e22ce;
}

.highlight-behind .kpi-value {
  color: #6b21a8;
}

.icon-purple {
  color: #9333ea;
}

.table-view-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 2px solid var(--slate-200);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.view-switch-btn {
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--slate-100);
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.view-switch-btn:hover:not(.active) {
  background: var(--slate-200);
  color: var(--slate-900);
}

.view-switch-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

#btnViewBehind.active {
  background: #7e22ce;
  border-color: #7e22ce;
}

.tag-dist-behind {
  background: #f3e8ff;
  color: #7e22ce;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Badges de Tipo de Jornada (Entera vs Parcial) */
.badge-jornada {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

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

.badge-jornada-parcial {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.tag-vacante-sm {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--slate-600);
  background: var(--slate-100);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--slate-200);
}

/* ===================================================
   PANEL 5 DATOS CLAVE DE ADJUDICACIÓN
   =================================================== */
.panel-5-datos {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-top: 5px solid var(--primary);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.panel-5-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--slate-200);
  padding-bottom: 14px;
}

.panel-5-badge {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.panel-5-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--slate-900);
}

.grid-5-datos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.dato-card {
  background: #f8fafc;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s, box-shadow 0.15s;
}

.dato-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  background: #ffffff;
}

.dato-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.badge-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--slate-700);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dato-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-600);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

.dato-num {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--slate-900);
  line-height: 1.15;
  margin: 4px 0 6px;
}

.dato-num-medium {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.25;
  margin: 4px 0 6px;
}

.dato-sub {
  font-size: 0.82rem;
  color: var(--slate-500);
}

/* Resaltado Dato 3: Posición Depurada */
.highlight-depurada {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #86efac;
}

.highlight-depurada .badge-num {
  background: #15803d;
}

.highlight-depurada .dato-title {
  color: #166534;
}

.highlight-depurada .dato-num {
  color: #14532d;
}

.highlight-depurada .dato-sub {
  color: #15803d;
  font-weight: 500;
}

/* Resaltado Dato 5: Puestos de Diferencia */
.highlight-diff {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
}

.highlight-diff .badge-num {
  background: #1e40af;
}

.highlight-diff .dato-title {
  color: #1e40af;
}

.diff-tag-ahead {
  display: inline-block;
  color: #15803d;
  font-size: 1.5rem;
  font-weight: 900;
}

.diff-tag-behind {
  display: inline-block;
  color: #c2410c;
  font-size: 1.5rem;
  font-weight: 900;
}

.diff-tag-same {
  display: inline-block;
  color: #2563eb;
  font-size: 1.4rem;
  font-weight: 900;
}

/* ===================================================
   BOTÓN Y MODAL DE CONEXIÓN MULTIDISPOSITIVO (MÓVIL)
   =================================================== */
.btn-device {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
  border: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}

.btn-device:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  transform: translateY(-1px);
}

.device-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.device-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content strong {
  display: block;
  font-size: 0.95rem;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.85rem;
  color: var(--slate-600);
  line-height: 1.4;
}

.wifi-url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.wifi-url-box code {
  font-family: monospace;
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary-dark);
  flex: 1;
  word-break: break-all;
}

.btn-copy {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-copy:hover {
  background: var(--primary-hover);
}

.cloud-info-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.cloud-info-box h4 {
  font-size: 0.92rem;
  color: #166534;
  font-weight: 800;
  margin-bottom: 6px;
}

.cloud-info-box p {
  font-size: 0.82rem;
  color: #15803d;
  line-height: 1.4;
}

/* ===================================================
   RESPONSIVIDAD AVANZADA (MÓVIL, TABLET Y PANTALLAS TÁCTILES)
   =================================================== */

/* Tablets y pantallas medianas (<= 992px) */
@media (max-width: 992px) {
  .app-container {
    padding: 16px 12px;
  }
  
  .user-card-main {
    flex-direction: column;
    gap: 16px;
  }
  
  .user-pos-badge {
    align-self: flex-start;
    width: 100%;
    text-align: left;
  }
  
  .grid-5-datos {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Smartphones y pantallas pequeñas (<= 768px) */
@media (max-width: 768px) {
  .main-header h1 {
    font-size: 1.7rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
  }
  
  .header-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
  }
  
  .global-stats-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }
  
  .stat-pill {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
  }
  
  .global-stats-bar button {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }
  
  .search-section {
    padding: 16px 14px;
  }
  
  .search-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  /* Inputs táctiles seguros contra zoom automático en iOS */
  input[type="text"], select {
    font-size: 16px !important; /* Evita que Safari en iPhone haga zoom al pulsar */
    padding: 12px 14px;
    min-height: 48px;
  }
  
  /* Píldoras con scroll táctil horizontal suave */
  .specialty-pills {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .specialty-pills::-webkit-scrollbar {
    display: none;
  }
  
  .spec-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 0.85rem;
    min-height: 42px;
  }
  
  /* 5 Datos Clave apilados limpiamente en móvil */
  .grid-5-datos {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .dato-card {
    padding: 14px 16px;
  }
  
  .dato-num {
    font-size: 1.6rem;
  }
  
  .dato-num-medium {
    font-size: 1.05rem;
  }
  
  /* KPIs en móvil */
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .kpi-card {
    padding: 14px;
  }
  
  .kpi-value {
    font-size: 1.6rem;
  }
  
  /* Conmutador de tabla táctil */
  .table-view-switcher {
    flex-direction: column;
    gap: 8px;
  }
  
  .view-switch-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 12px;
    font-size: 0.95rem;
  }
  
  .table-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  
  .btn-tab {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 40px;
  }
  
  /* Tablas con scroll táctil garantizado */
  .table-responsive {
    border-radius: var(--radius-sm);
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
  }
  
  .interinos-table {
    font-size: 0.82rem;
    min-width: 650px; /* Asegura que las columnas respiren y se deslice suavemente */
  }
  
  .interinos-table th, .interinos-table td {
    padding: 10px 8px;
  }
  
  .pagination-controls {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    text-align: center;
  }
  
  .pagination-controls button {
    min-height: 44px;
  }
}

/* Pantallas muy pequeñas (<= 480px, ej. iPhone SE / Mini) */
@media (max-width: 480px) {
  .app-container {
    padding: 12px 6px;
  }
  
  .card {
    padding: 14px 12px;
    border-radius: var(--radius-md);
  }
  
  .panel-5-title {
    font-size: 1.15rem;
  }
  
  .dato-title {
    font-size: 0.72rem;
  }
  
  .dato-num {
    font-size: 1.45rem;
  }
  
  .diff-tag-ahead, .diff-tag-behind {
    font-size: 1.25rem;
  }
}

/* ===================================================
   ESPACIOS PUBLICITARIOS GOOGLE ADSENSE
   =================================================== */
.ad-banner-container {
  margin: 20px 0;
  background: #ffffff;
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.ad-banner-container:hover {
  border-color: var(--slate-400);
}

.ad-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--slate-400);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.ad-slot-box {
  min-height: 85px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  position: relative;
}

.ad-placeholder-text {
  font-size: 0.85rem;
  color: var(--slate-400);
  font-weight: 500;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Ocultar el placeholder cuando AdSense carga un anuncio real */
.ad-slot-box ins[data-ad-status="filled"] + .ad-placeholder-text,
.ad-slot-box ins[data-adsbygoogle-status="done"] + .ad-placeholder-text {
  display: none !important;
}

/* Enlaces legales del footer */
.footer-legal-links {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--slate-400);
}

.footer-legal-links a {
  color: var(--slate-600);
  text-decoration: none;
  transition: color 0.15s;
}

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

.btn-cookie-link {
  background: none;
  border: none;
  color: var(--slate-600);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s;
}

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

/* ===================================================
   BANNER DE CONSENTIMIENTO DE COOKIES (RGPD / GOOGLE)
   =================================================== */
.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 900px;
  background: #1e293b;
  color: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  border: 1px solid #334155;
  animation: slideUp 0.3s ease-out;
}

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

.cookie-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e2e8f0;
  flex: 1;
  min-width: 260px;
}

.cookie-text a {
  color: #93c5fd;
  text-decoration: underline;
}

.cookie-text a:hover {
  color: #bfdbfe;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn-cookie {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-cookie-accept {
  background: var(--primary);
  color: #ffffff;
  border: none;
}

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

.btn-cookie-reject {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #475569;
}

.btn-cookie-reject:hover {
  background: #334155;
  color: #ffffff;
}

@media (max-width: 640px) {
  .cookie-banner {
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 16px 14px;
  }
  .cookie-actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  .btn-cookie {
    width: 100%;
    text-align: center;
    padding: 10px;
  }
}

/* ==========================================================================
   Buscador Ampliado de la Tabla (Persona, Puesto, Centro, Localidad)
   ========================================================================== */
.table-search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 280px;
  flex: 1;
  max-width: 420px;
}

.table-search-box .input-table-search {
  width: 100%;
  padding-right: 32px;
}

.btn-clear-table-search {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--slate-400);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.btn-clear-table-search:hover {
  color: var(--slate-700);
}

/* ==========================================================================
   Chat de Análisis Inteligente de la Bolsa (Floating Widget & Drawer)
   ========================================================================== */
.chat-floating-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: inherit;
}

/* Botón flotante para abrir el chat */
.btn-chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.45), 0 8px 10px -6px rgba(37, 99, 235, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-chat-toggle:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 28px -5px rgba(37, 99, 235, 0.55), 0 10px 12px -6px rgba(37, 99, 235, 0.35);
}

.btn-chat-toggle.active {
  background: #1e293b;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.4);
}

.chat-btn-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.chat-pulse-badge {
  background: #10b981;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Ventana Principal del Chat */
.chat-widget {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  animation: chat-appear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chat-appear {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cabecera del Chat */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar-header {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.chat-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.chat-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: #94a3b8;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-chat-action {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.btn-chat-action:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Barra de Chips Rápidos Fijos */
.chat-quick-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--slate-200);
  overflow-x: auto;
  white-space: nowrap;
}

.chat-quick-chip-btn {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chat-quick-chip-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

/* Mensajes del Chat */
.chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  gap: 8px;
  max-width: 92%;
}

.chat-msg-user {
  align-self: flex-end;
}

.chat-msg-assistant {
  align-self: flex-start;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0e7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.chat-bubble-user {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

.chat-bubble-assistant {
  background: #ffffff;
  color: var(--slate-800);
  border: 1px solid var(--slate-200);
  border-bottom-left-radius: 3px;
  overflow-wrap: break-word;
}

/* Elementos visuales dentro de respuestas */
.chat-card-answer h4 {
  color: #1e293b;
  font-size: 0.95rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.chat-kpi {
  background: #f1f5f9;
  padding: 8px 6px;
  border-radius: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--slate-200);
}

.chat-kpi.highlight-blue {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.chat-kpi.highlight-blue .kpi-num {
  color: #1d4ed8;
}

.chat-kpi .kpi-num {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.chat-kpi .kpi-lbl {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 2px;
}

.chat-table-wrap {
  overflow-x: auto;
  margin: 10px 0;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
}

.chat-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.chat-data-table th, .chat-data-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--slate-100);
}

.chat-data-table th {
  background: #f8fafc;
  color: var(--slate-600);
  font-weight: 700;
}

.chat-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.chat-badge-green { background: #dcfce7; color: #166534; }
.chat-badge-blue  { background: #dbeafe; color: #1e40af; }
.chat-badge-amber { background: #fef3c7; color: #92400e; }
.chat-badge-red   { background: #fee2e2; color: #991b1b; }
.chat-badge-gray  { background: #f1f5f9; color: #64748b; }

.chat-tag-spec {
  font-weight: 700;
  color: #1e293b;
  font-size: 0.85rem;
}

.chat-cut-item {
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.cut-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.cut-item-body {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--slate-700);
}

.chat-center-card {
  background: #f8fafc;
  border-left: 3px solid #3b82f6;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
}

.chat-center-card .center-title {
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.center-teachers-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.78rem;
}

.center-teachers-list li {
  padding: 2px 0;
}

.chat-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-chip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 4px 9px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.chat-chip:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.chat-tip {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--slate-500);
}

.chat-select-person-link {
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}

/* Formulario de Envío */
.chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid var(--slate-200);
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--slate-300);
  border-radius: 20px;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.chat-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.btn-chat-send {
  background: #2563eb;
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.btn-chat-send:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

/* Responsividad Móvil */
@media (max-width: 640px) {
  .chat-floating-container {
    bottom: 16px;
    right: 16px;
  }

  .btn-chat-toggle {
    padding: 10px 16px;
    font-size: 0.88rem;
  }

  .chat-widget {
    width: calc(100vw - 24px);
    right: -4px;
    height: 72vh;
    max-height: 520px;
    bottom: calc(100% + 10px);
  }

  .chat-kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Sección Informativa: Guía Docente y Preguntas Frecuentes (FAQ / AdSense)
   ========================================================================== */
.guide-section {
  margin-top: 36px;
  margin-bottom: 24px;
  padding: 32px 28px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
}

.guide-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 28px auto;
}

.guide-badge {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.guide-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 8px;
  line-height: 1.25;
}

.guide-subtitle {
  font-size: 0.95rem;
  color: var(--slate-600);
  line-height: 1.5;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.guide-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.guide-card-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.guide-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 8px;
}

.guide-card p {
  font-size: 0.9rem;
  color: var(--slate-700);
  margin-bottom: 10px;
  line-height: 1.5;
}

.guide-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.86rem;
  color: var(--slate-600);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-card ul li {
  position: relative;
  padding-left: 18px;
  line-height: 1.45;
}

.guide-card ul li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--primary);
  font-weight: bold;
  font-size: 1.1rem;
}

/* Preguntas Frecuentes Acordeón */
.faq-container {
  border-top: 1px solid var(--slate-200);
  padding-top: 24px;
}

.faq-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 16px;
  text-align: center;
}

.faq-item {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  transition: background 0.15s;
}

.faq-item[open] {
  background: #ffffff;
  border-color: #bfdbfe;
}

.faq-item summary {
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-800);
  cursor: pointer;
  user-select: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "＋";
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--primary);
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: "－";
}

.faq-content {
  padding: 0 18px 16px 18px;
  font-size: 0.88rem;
  color: var(--slate-700);
  line-height: 1.55;
  border-top: 1px solid var(--slate-100);
}

.faq-content p {
  margin-top: 10px;
}

.faq-content ol {
  margin: 8px 0 8px 20px;
}

.faq-content ol li {
  margin-bottom: 4px;
}

@media (max-width: 768px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .guide-section {
    padding: 22px 16px;
  }
  .guide-header h2 {
    font-size: 1.35rem;
  }
}
