/**
 * assets/css/app.css — Estilos globales UBI ISTB
 * Modern UI, CSS Vanilla, Custom Properties, Animations
 */

:root {
  /* Paleta de colores - Estilo Premium */
  --primary: #1a4f8a;
  --primary-light: #2d7dd2;
  --primary-dark: #0f3057;
  
  --secondary: #f5a623;
  --secondary-light: #f7b731;
  
  --accent: #4fb3e8;
  --accent-light: #e6f4fc;
  
  --success: #38a169;
  --success-bg: #f0fff4;
  --warning: #dd6b20;
  --warning-bg: #fffaf0;
  --danger: #e53e3e;
  --danger-bg: #fff5f5;
  --info: #3182ce;
  --info-bg: #ebf8ff;
  
  --text-main: #2d3748;
  --text-muted: #718096;
  --text-light: #a0aec0;
  
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  
  --border-color: #e2e8f0;
  
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-float: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ─── RESET Y TIPOGRAFÍA ─── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-body);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; color: var(--primary-dark); }
a { color: var(--primary); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; height: auto; }

/* ─── COMPONENTES BÁSICOS ─── */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-normal);
  text-align: center;
  font-size: 0.95rem;
  gap: 0.5rem;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 6px rgba(26, 79, 138, 0.2);
}
.btn-primary:hover { background: var(--primary-light); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 12px rgba(26, 79, 138, 0.3); }

.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }

.btn-white { background: #fff; color: var(--primary); box-shadow: var(--shadow-md); }
.btn-white:hover { background: var(--bg-hover); transform: translateY(-2px); }

.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; border-radius: 4px; }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; display: block; }

/* Formularios */
.form-group { margin-bottom: 1.2rem; display: flex; flex-direction: column; }
.form-group label { margin-bottom: 0.4rem; font-weight: 600; color: var(--text-main); font-size: 0.9rem; }
.form-group small { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.2rem; }
.required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  transition: var(--transition-fast);
}
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.15); }
.form-control:disabled { background: var(--bg-hover); cursor: not-allowed; }

.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > .form-group { flex: 1; min-width: 250px; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}
.checkbox-label input[type="checkbox"], .radio-option input[type="radio"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }

.form-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  border: 1px solid rgba(0,0,0,0.03);
}
.form-section-title {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-hover);
  color: var(--primary-dark);
  font-size: 1.1rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger, .badge-error { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--border-color); color: var(--text-muted); }

/* Alertas y Mensajes Flash */
.alert {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  animation: slideInDown 0.4s ease-out;
}
@keyframes slideInDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.alert-success { background: var(--success-bg); border-left: 4px solid var(--success); color: #22543d; }
.alert-error { background: var(--danger-bg); border-left: 4px solid var(--danger); color: #742a2a; }
.alert-warning { background: var(--warning-bg); border-left: 4px solid var(--warning); color: #7b341e; }
.alert-info { background: var(--info-bg); border-left: 4px solid var(--info); color: #2a4365; }

/* ─── LAYOUT GLOBAL ─── */
.topbar {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
  height: 70px;
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}
.topbar-brand { display: flex; align-items: center; }
.brand-link { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.brand-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
  box-shadow: var(--shadow-md);
}
.brand-name { font-weight: 800; color: var(--primary-dark); font-size: 1.2rem; display: block; line-height: 1.1; }
.brand-sub { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

.brand-logo-img {
  max-height: 45px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.brand-link:hover .brand-logo-img {
  transform: scale(1.05);
}

.topbar-nav { display: flex; gap: 1.2rem; align-items: center; flex-shrink: 1; min-width: 0; }
.nav-link { color: var(--text-main); font-weight: 500; position: relative; padding: 0.5rem 0; }
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--primary); transition: var(--transition-normal); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--primary); }

.topbar-actions { display: flex; align-items: center; gap: 0.8rem; flex-shrink: 0; }
.periodo-badge { background: var(--bg-hover); padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--primary-dark); border: 1px solid var(--border-color); }

.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 0.5rem; background: transparent; border: none; cursor: pointer; padding: 0.3rem; border-radius: 999px; transition: var(--transition-fast); }
.user-btn:hover { background: var(--bg-hover); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: var(--shadow-sm); }
.user-avatar-placeholder { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.user-name { font-weight: 600; color: var(--text-main); }
.chevron { font-size: 0.8rem; color: var(--text-muted); transition: transform 0.2s; }
.user-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s;
  border: 1px solid var(--border-color);
  padding: 0.5rem;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header { padding: 0.8rem; border-bottom: 1px solid var(--border-color); margin-bottom: 0.5rem; }
.dropdown-header strong { display: block; color: var(--primary-dark); }
.dropdown-header small { color: var(--text-muted); display: block; margin-bottom: 0.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item { display: block; padding: 0.6rem 0.8rem; color: var(--text-main); border-radius: var(--radius-sm); font-weight: 500; }
.dropdown-item:hover { background: var(--bg-hover); color: var(--primary); }
.dropdown-item-danger:hover { background: var(--danger-bg); color: var(--danger); }

.hamburger { display: none; background: transparent; border: none; cursor: pointer; padding: 0.5rem; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text-main); margin-bottom: 5px; transition: 0.3s; }
.hamburger span:last-child { margin-bottom: 0; }

.main-content { min-height: calc(100vh - 70px - 200px); }

.site-footer {
  background: #0f172a;
  color: #fff;
  padding: 3rem 2rem;
  margin-top: 4rem;
}
.footer-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 3rem; justify-content: space-between; padding: 0 40px; }
.footer-logo { font-size: 2rem; font-weight: 900; background: linear-gradient(to right, var(--primary-light), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.footer-links { display: flex; flex-direction: column; gap: 0.8rem; }
.footer-links a { color: #cbd5e1; }
.footer-links a:hover { color: #fff; padding-left: 5px; }
.footer-copy { color: #94a3b8; font-size: 0.9rem; text-align: right; }

/* ─── HERO SECTION ─── */
.hero {
  position: relative;
  padding: 6rem 2rem;
  overflow: hidden;
  width: 100%;
}
.hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  position: relative;
  z-index: 2;
  padding: 0 40px;
}
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(45,125,210,0.08) 0%, rgba(255,255,255,0) 60%);
  z-index: 1;
  pointer-events: none;
}
.hero-content { flex: 1; max-width: 600px; }
.hero-badge { display: inline-block; background: var(--info-bg); color: var(--primary); padding: 0.4rem 1rem; border-radius: 999px; font-weight: 700; font-size: 0.85rem; margin-bottom: 1.5rem; border: 1px solid rgba(49, 130, 206, 0.2); }
.hero-title { font-size: 3.5rem; letter-spacing: -1px; margin-bottom: 1.5rem; color: var(--primary-dark); }
.gradient-text { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 2rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-visual { flex: 1; position: relative; height: 450px; display: none; }
@media(min-width: 768px){ .hero-visual { display: block; } }
.hero-card-float {
  position: absolute;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(255,255,255,0.5);
  animation: float 6s ease-in-out infinite;
}
.hcf-icon { font-size: 2rem; background: var(--bg-hover); width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.card-1 { top: 10%; right: 10%; animation-delay: 0s; }
.card-2 { top: 45%; left: 0; animation-delay: 2s; z-index: 2; }
.card-3 { bottom: 10%; right: 20%; animation-delay: 4s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

/* ─── SECCIONES Y GRIDS ─── */
.section { padding: 5rem 0; }
.section-alt { background: #fff; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.section-header { text-align: center; margin-bottom: 3.5rem; max-width: 700px; margin-inline: auto; }
.section-header h2 { font-size: 2.2rem; margin-bottom: 1rem; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}
.service-card {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.service-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-float); border-color: var(--primary-light); }
.service-icon {
  width: 64px; height: 64px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fff;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
.service-card h3 { font-size: 1.4rem; margin-bottom: 1rem; }
.service-card p { color: var(--text-muted); margin-bottom: 1.5rem; flex-grow: 1; }
.service-features { list-style: none; margin-bottom: 2rem; }
.service-features li { padding-left: 1.5rem; position: relative; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-main); }
.service-features li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: bold; }
.service-locked::after {
  content: ''; position: absolute; top:0;left:0;right:0;bottom:0;
  background: rgba(255,255,255,0.6); backdrop-filter: blur(2px); z-index: 10;
  pointer-events: none; opacity: 0; transition: 0.3s;
}
.service-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; text-align: center; }

.service-highlight { border: 2px solid var(--secondary); background: linear-gradient(to bottom right, #fff, #fffcf5); }
.service-badge { position: absolute; top: 1.5rem; right: -2rem; background: var(--secondary); color: #fff; font-size: 0.75rem; font-weight: bold; padding: 0.3rem 3rem; transform: rotate(45deg); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* ─── DASHBOARDS Y PANELES ─── */
.page-container { padding-top: 3rem; padding-bottom: 4rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }

.dashboard-welcome {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.welcome-avatar { width: 80px; height: 80px; border-radius: 50%; box-shadow: var(--shadow-md); }
.welcome-avatar-ph { width: 80px; height: 80px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: bold; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.dash-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  gap: 1.2rem;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.dash-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.dash-card-icon { font-size: 2.5rem; line-height: 1; }
.dash-card-body h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.dash-card-body p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }

.dash-card-active { border-left: 4px solid var(--warning); background: #fffdfa; }
.dash-card-done { border-left: 4px solid var(--success); opacity: 0.8; }

/* ─── TABLAS Y LISTAS ─── */
.table-wrapper { overflow-x: auto; background: #fff; border-radius: var(--radius-md); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { background: var(--bg-hover); padding: 1rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid var(--border-color); white-space: nowrap; }
.data-table td { padding: 1rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #fbfdff; }
.row-muted { opacity: 0.6; background: #f9f9f9; }

.mini-list { list-style: none; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid var(--border-color); }
.mini-list li:last-child { border-bottom: none; padding-bottom: 0; }

/* ─── BOLSA DE EMPLEO ─── */
.filters-bar { display: flex; gap: 1rem; background: #fff; padding: 1rem; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); margin-bottom: 2rem; flex-wrap: wrap; align-items: center; }
.jobs-grid, .jobs-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem; }
.job-card { background: #fff; padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: var(--transition-fast); }
.job-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.job-header { display: flex; gap: 1rem; margin-bottom: 1rem; align-items: center; }
.job-company-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; font-weight: bold; color: var(--primary); font-size: 1.2rem; }
.job-company-icon.lg { width: 64px; height: 64px; font-size: 1.5rem; border-radius: 16px; }
.job-company { color: var(--text-muted); font-size: 0.9rem; }
.job-excerpt { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; flex-grow: 1; }
.job-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tag { background: var(--bg-hover); color: var(--text-main); font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 4px; font-weight: 500; }
.tag-blue { background: var(--info-bg); color: var(--info); }
.tag-green { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }

.job-detail-wrapper { background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-md); border: 1px solid var(--border-color); overflow: hidden; }
.job-detail-header { background: var(--bg-hover); padding: 2rem; display: flex; gap: 1.5rem; align-items: center; border-bottom: 1px solid var(--border-color); }
.job-detail-body { padding: 2rem; }
.job-detail-body h3 { margin-bottom: 1rem; margin-top: 1.5rem; }
.job-detail-body h3:first-child { margin-top: 0; }
.prose { color: var(--text-main); line-height: 1.8; }
.job-detail-actions { padding: 2rem; background: #fcfcfc; border-top: 1px solid var(--border-color); }

/* ─── ENCUESTAS ─── */
.survey-form { max-width: 800px; margin: 0 auto; }
.survey-question { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border-color); margin-bottom: 1.5rem; padding: 2rem; display: flex; gap: 1.5rem; box-shadow: var(--shadow-sm); transition: 0.3s; }
.survey-question:focus-within { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.1); }
.sq-number { width: 36px; height: 36px; background: var(--bg-hover); color: var(--primary); display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: bold; flex-shrink: 0; }
.sq-body { flex-grow: 1; }
.sq-text { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.5rem; color: var(--text-main); }

.likert-scale { display: flex; flex-direction: column; gap: 0.5rem; }
.likert-option { display: flex; align-items: center; padding: 0.8rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; transition: 0.2s; }
.likert-option:hover { background: var(--bg-hover); }
.likert-option input { margin-right: 1rem; }
.likert-value { font-weight: bold; margin-right: 1rem; color: var(--primary); }

.likert-scale { flex-direction: row; justify-content: space-between; flex-wrap: wrap; background: #f9fafb; padding: 1.5rem; border-radius: var(--radius-md); }
.likert-scale .likert-option { flex-direction: column; border: none; background: transparent; padding: 0.5rem; }
.likert-scale .likert-option input { margin: 0 0 0.5rem 0; width: 24px; height: 24px; }
.likert-labels { width: 100%; display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.85rem; margin-top: 0.5rem; padding: 0 10px; font-weight: 500;}

.options-list { display: flex; flex-direction: column; gap: 0.8rem; }
.options-inline { flex-direction: row; gap: 2rem; }
.radio-option { display: flex; align-items: center; padding: 0.8rem 1.2rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; transition: 0.2s; }
.radio-option:hover { background: var(--bg-hover); border-color: var(--primary-light); }
.radio-option input { margin-right: 0.8rem; }

.survey-submit { background: #fff; padding: 2rem; border-radius: var(--radius-lg); text-align: center; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }

/* ─── TABS Y PILLS ─── */
.tabs { display: flex; gap: 2rem; border-bottom: 1px solid var(--border-color); margin-bottom: 2rem; }
.tab-link { padding: 1rem 0; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: 0.2s; }
.tab-link:hover { color: var(--primary); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-badge { background: var(--warning); color: #fff; padding: 0.1rem 0.4rem; border-radius: 999px; font-size: 0.7rem; margin-left: 0.5rem; }

.pills-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.pill { padding: 0.4rem 1rem; background: #fff; border: 1px solid var(--border-color); border-radius: 999px; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: 0.2s; }
.pill:hover, .pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── ADMIN LAYOUT ─── */
.admin-layout { display: flex; min-height: calc(100vh - 70px); background: #f1f5f9; }
.admin-sidebar { width: 260px; background: #1e293b; color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand { padding: 1.5rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo { background: var(--primary-light); color: #fff; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: bold; }
.sidebar-brand strong { color: #fff; display: block; line-height: 1.2; }
.sidebar-nav { padding: 1rem 0; flex-grow: 1; display: flex; flex-direction: column; }
.sidebar-section { padding: 1rem 1.5rem 0.5rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: #64748b; font-weight: bold; }
.sidebar-link { padding: 0.8rem 1.5rem; display: flex; align-items: center; gap: 1rem; color: #cbd5e1; transition: 0.2s; }
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,0.05); color: #fff; border-left: 3px solid var(--primary-light); padding-left: calc(1.5rem - 3px); }
.sidebar-link-danger:hover { background: rgba(229, 62, 62, 0.1); color: #fc8181; border-left-color: #fc8181; }

.admin-main { flex-grow: 1; padding: 2rem; overflow-y: auto; max-width: 100%; }
.admin-header { margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.admin-section { background: #fff; padding: 1.5rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 2rem; border: 1px solid var(--border-color); }
.admin-two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.kpi-card { background: #fff; padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border-color); display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow-sm); position: relative; }
.kpi-card-alert { border-color: var(--warning); border-left: 4px solid var(--warning); }
.kpi-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.kpi-value { display: block; font-size: 1.8rem; font-weight: 800; color: var(--text-main); line-height: 1; margin-bottom: 0.3rem; }
.kpi-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.kpi-action { position: absolute; top: 10px; right: 10px; font-size: 0.75rem; font-weight: bold; color: var(--warning); }

.enc-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.enc-status-card { padding: 1.2rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: flex-start; gap: 0.8rem; }
.enc-activa { border-left: 4px solid var(--success); background: #fafffa; }
.enc-inactiva { border-left: 4px solid var(--border-color); }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-top: 1rem; }
.quick-btn { background: #fff; border: 1px solid var(--border-color); padding: 1rem; border-radius: var(--radius-md); text-align: center; font-weight: 600; color: var(--text-main); transition: 0.2s; box-shadow: var(--shadow-sm); }
.quick-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* UTILIDADES */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }

/* LOADING OVERLAY */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.8); backdrop-filter: blur(2px); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; }
.loading-overlay.active { opacity: 1; visibility: visible; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border-color); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero-visual { display: none; }
  .hero-inner { flex-direction: column; text-align: center; justify-content: center; padding: 0 20px; }
  .hero-content { max-width: 100%; }
  .hero-actions { justify-content: center; }
}

@media (max-width: 768px) {
  .topbar { padding: 0.5rem 1rem; }
  .topbar-nav { 
    position: fixed; 
    top: 70px; 
    left: 0; 
    width: 100%; 
    height: calc(100vh - 70px);
    background: var(--bg-card); 
    flex-direction: column; 
    padding: 2rem; 
    gap: 1.5rem; 
    box-shadow: var(--shadow-lg); 
    clip-path: circle(0% at 100% 0%);
    transition: clip-path 0.5s ease-in-out; 
    z-index: 1000;
    overflow-y: auto;
  }
  .topbar-nav.active { clip-path: circle(150% at 100% 0%); }
  .hamburger { display: block; }
  
  .hero { padding: 4rem 1.5rem; }
  .hero-title { font-size: 2.5rem; }
  .hero-actions { justify-content: center; }
  
  .admin-layout { flex-direction: column; }
  .admin-sidebar { 
    width: 100%; 
    height: auto; 
    position: relative;
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }
  .admin-sidebar.expanded { max-height: 1000px; }
  .sidebar-brand { cursor: pointer; }
  
  .admin-main { padding: 1.5rem 1rem; }
  .admin-two-cols { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  
  .dashboard-welcome { text-align: center; justify-content: center; }
  .kpi-grid { grid-template-columns: 1fr; }
  
  .brand-text { display: none; } /* Hide text on very small screens if logo exists */
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .topbar-actions .periodo-badge { display: none; }
  .user-name { display: none; }
}
