/* ============================================================
   SENTINELA360 - Design System v2.0
   assets/css/style.css
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --c-primary:    #1e3a5f;
  --c-secondary:  #f59e0b;
  --c-accent:     #3b82f6;
  --c-danger:     #ef4444;
  --c-warning:    #f59e0b;
  --c-success:    #10b981;
  --c-info:       #06b6d4;

  --bg-body:      #f0f4f8;
  --bg-sidebar:   #0f1f38;
  --bg-card:      #ffffff;
  --bg-overlay:   rgba(0,0,0,0.5);

  --text-primary:   #1a2640;
  --text-secondary: #64748b;
  --text-light:     #94a3b8;

  --border-color:   #e2e8f0;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:      0 10px 40px rgba(0,0,0,0.14);
  --shadow-xl:      0 20px 60px rgba(0,0,0,0.18);

  --radius-sm:  6px;
  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --sidebar-w:     260px;
  --topbar-h:       64px;
  --font:          'Sora', sans-serif;
  --font-body:     'DM Sans', sans-serif;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-body);
  margin: 0;
  min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 { font-family: var(--font); font-weight: 700; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ── =====================================================
   LANDING PAGE
   ===================================================== */

/* Hero */
.hero-section {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d1b2e 0%, #1e3a5f 40%, #1a4f8a 70%, #0e2d5e 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* Navbar Landing */
.landing-nav {
  background: rgba(15, 31, 56, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
}

.landing-nav .nav-link {
  color: rgba(255,255,255,0.8) !important;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.landing-nav .nav-link:hover { color: var(--c-secondary) !important; text-decoration: none; }

/* Hero text */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 50px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}

.hero-title .highlight {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  max-width: 540px;
  margin-bottom: 2.5rem;
}

/* Feature cards */
.feature-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: all 0.3s ease;
  height: 100%;
}
.feature-card:hover {
  background: rgba(255,255,255,0.09);
  transform: translateY(-4px);
  border-color: rgba(245,158,11,0.3);
}
.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

/* Stats */
.stat-item { text-align: center; }
.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--c-secondary);
  display: block;
}
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.6); }

/* Sections */
.section-light {
  background: #f8fafc;
  padding: 80px 0;
}
.section-dark {
  background: linear-gradient(135deg, #0f1f38, #1e3a5f);
  padding: 80px 0;
  color: white;
}

/* Empresa card en directorio */
.empresa-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.empresa-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--c-accent);
  text-decoration: none;
}
.empresa-logo {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: contain;
  background: #f1f5f9;
  padding: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}
.empresa-avatar {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: white;
  margin-bottom: 1rem;
}

/* ── =====================================================
   MODAL DE LOGIN
   ===================================================== */
.modal-login .modal-content {
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.modal-login .modal-header {
  background: linear-gradient(135deg, var(--c-primary), #2563eb);
  color: white;
  border: none;
  padding: 1.5rem 2rem;
}
.modal-login .modal-body { padding: 2rem; }

/* ── =====================================================
   PANEL INTERNO - LAYOUT
   ===================================================== */

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  z-index: 900;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.sidebar-header {
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
}

.sidebar-logo-text {
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.3px;
}
.sidebar-logo-text span { color: var(--c-secondary); }

.sidebar-empresa {
  padding: 0.8rem 1.4rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-empresa-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}
.sidebar-empresa-val {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav { padding: 0.8rem 0; flex: 1; overflow-y: auto; }

.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  padding: 0.8rem 1.4rem 0.3rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 1.4rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  position: relative;
  text-decoration: none !important;
}
.sidebar-link i { width: 18px; text-align: center; font-size: 0.95rem; }
.sidebar-link:hover {
  color: white;
  background: rgba(255,255,255,0.06);
  border-left-color: rgba(245,158,11,0.5);
}
.sidebar-link.active {
  color: white;
  background: rgba(245,158,11,0.12);
  border-left-color: var(--c-secondary);
}
.sidebar-link.active i { color: var(--c-secondary); }

.sidebar-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid var(--border-color);
  z-index: 800;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 1.8rem;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── =====================================================
   CARDS
   ===================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-title {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.card-body { padding: 1.4rem; }

/* KPI Cards */
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.4rem;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.25s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.kpi-value {
  font-family: var(--font);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.kpi-change {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 4px;
}

/* Score gauge */
.score-gauge {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto;
}
.score-gauge-ring {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s ease;
}
.score-gauge-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-big {
  font-family: var(--font);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}
.score-label { font-size: 0.72rem; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }

/* ── =====================================================
   TABLES
   ===================================================== */
.table-custom {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table-custom thead th {
  background: #f8fafc;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.table-custom tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  vertical-align: middle;
}
.table-custom tbody tr:hover { background: #f8faff; }
.table-custom tbody tr:last-child td { border-bottom: none; }

/* ── =====================================================
   BADGES
   ===================================================== */
.badge-nivel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── =====================================================
   FORMS
   ===================================================== */
.form-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.form-control, .form-select {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  outline: none;
}

/* ── =====================================================
   BUTTONS
   ===================================================== */
.btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--c-primary);
  color: white;
}
.btn-primary:hover { background: #162d4e; color: white; }

.btn-secondary {
  background: var(--c-secondary);
  color: #1a1a1a;
}
.btn-secondary:hover { background: #e08f00; }

.btn-accent {
  background: var(--c-accent);
  color: white;
}
.btn-accent:hover { background: #2563eb; color: white; }

.btn-success {
  background: var(--c-success);
  color: white;
}
.btn-danger {
  background: var(--c-danger);
  color: white;
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover { background: #f1f5f9; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.8rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2.4rem; font-size: 1.1rem; border-radius: 10px; }

/* ── =====================================================
   EVALUACIÓN / CUESTIONARIO
   ===================================================== */
.question-card {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.6rem;
  margin-bottom: 1.2rem;
  transition: border-color 0.2s;
}
.question-card.answered { border-color: var(--c-success); }
.question-number {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.question-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.likert-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.likert-option input[type="radio"] { display: none; }
.likert-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  padding: 0.6rem 0.4rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
}
.likert-option label .val-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  margin-bottom: 3px;
}
.likert-option input:checked + label {
  border-color: var(--c-accent);
  background: #eff6ff;
  color: var(--c-accent);
}
.likert-option input:checked + label .val-num { color: var(--c-accent); }

/* Progress bar evaluación */
.eval-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 50px;
  overflow: hidden;
}
.eval-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--c-accent), var(--c-secondary));
  border-radius: 50px;
  transition: width 0.4s ease;
}

/* ── =====================================================
   REPORTE PDF
   ===================================================== */
.report-page {
  background: white;
  width: 210mm;
  margin: 0 auto;
  font-family: var(--font-body);
}
.report-header {
  background: linear-gradient(135deg, #0d1b2e, #1e3a5f);
  color: white;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.report-title-block h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 4px;
}
.report-title-block p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.7;
}
.report-meta {
  font-size: 0.8rem;
  opacity: 0.7;
  text-align: right;
}

.report-section {
  padding: 1.5rem 2.5rem;
  border-bottom: 1px solid #f1f5f9;
}
.report-section-title {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--c-secondary);
  display: inline-block;
}

@media print {
  .no-print { display: none !important; }
  .report-page { width: 100%; }
  body { background: white; }
  .main-content { margin: 0; padding: 0; }
}

/* ── =====================================================
   ALERTS
   ===================================================== */
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ── =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; padding: 1rem; }

  .topbar {
    left: 0;
    padding: 0 1rem;
  }

  .kpi-value { font-size: 1.5rem; }

  .likert-options { gap: 5px; }
  .likert-option label { width: 60px; font-size: 0.65rem; }
}

/* ── =====================================================
   MISC UTILITIES
   ===================================================== */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cursor-pointer { cursor: pointer; }
.transition { transition: all 0.25s ease; }
.hover-lift:hover { transform: translateY(-3px); }
.divider { border: none; border-top: 1px solid var(--border-color); margin: 1.2rem 0; }

/* Login empresa */
.empresa-login-hero {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--empresa-primary, #1e3a5f) 0%, rgba(0,0,0,0.2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.empresa-login-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}


/* ════════════════════════════════════════════════════════════
   SENTINELA360 - RESPONSIVE MÓVIL (Mobile-First)
   ════════════════════════════════════════════════════════════ */

/* ── Base fixes ─────────────────────────────────────────────── */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
}

/* ── Navbar móvil ───────────────────────────────────────────── */
.lp-nav .container {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ── Hero section ───────────────────────────────────────────── */
@media (max-width: 991px) {
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem) !important;
    letter-spacing: -0.5px;
  }
  .hero-sub {
    font-size: 0.95rem !important;
    max-width: 100%;
  }
  .hero-section .container {
    padding-top: 1rem !important;
    padding-bottom: 2rem !important;
  }
}

@media (max-width: 767px) {
  /* Navbar */
  .lp-nav {
    height: auto !important;
    padding: 0.6rem 0;
  }
  .lp-nav .container {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .lp-logo-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
  }
  .lp-nav span[style*="font-size:1.12rem"] {
    font-size: 1rem !important;
  }
  .lp-btn-ghost, .lp-btn-primary {
    padding: 0.4rem 0.85rem !important;
    font-size: 0.78rem !important;
  }

  /* Hero */
  .hero-section {
    padding-top: 56px !important;
    background-attachment: scroll !important;
  }
  .hero-content {
    padding-top: 1.5rem !important;
    padding-bottom: 3rem !important;
  }
  .hero-title {
    font-size: clamp(1.9rem, 9vw, 2.6rem) !important;
    line-height: 1.12 !important;
    margin-bottom: 1rem !important;
  }
  .hero-sub {
    font-size: 0.9rem !important;
    line-height: 1.7 !important;
    margin-bottom: 1.5rem !important;
  }
  .hero-badge {
    font-size: 0.68rem !important;
    padding: 4px 12px !important;
  }

  /* Pills */
  .hero-pill {
    font-size: 0.72rem !important;
    padding: 3px 10px !important;
  }

  /* Botones hero */
  .hero-content .d-flex.flex-wrap.gap-3.mb-5 a,
  .hero-content .d-flex.flex-wrap.gap-3.mb-5 button {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.9rem !important;
    padding: 0.85rem 1.5rem !important;
    border-radius: 10px !important;
  }

  /* Stats hero */
  .hero-content .d-flex.gap-5 {
    gap: 1.5rem !important;
  }
  .stat-num {
    font-size: 1.7rem !important;
  }
  .stat-lbl {
    font-size: 0.68rem !important;
  }

  /* Mockup - ocultar en móvil pequeño, mostrar simplificado */
  .mockup-box {
    border-radius: 14px !important;
  }
  .mockup-inner {
    padding: 0.9rem !important;
  }

  /* Secciones */
  .s-light, .s-dark, .s-black, .s-slate {
    padding: 60px 0 !important;
  }
  .sec-h {
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
  }

  /* Feature cards */
  .feat-card {
    padding: 1.2rem !important;
  }

  /* Dimensiones */
  .dim-card {
    padding: 1rem !important;
  }

  /* ── Escala IPES (el más problemático) ── */
  .nivel-row {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    padding: 0.8rem 0.9rem !important;
  }
  .nivel-score {
    width: auto !important;
    min-width: 60px !important;
    font-size: 0.88rem !important;
  }
  .nivel-label {
    font-size: 0.85rem !important;
  }
  .nivel-desc {
    font-size: 0.74rem !important;
  }
  .nivel-row > div:last-child {
    width: 100% !important;
  }
  .nivel-row > div:last-child span {
    font-size: 0.68rem !important;
    padding: 3px 8px !important;
    white-space: normal !important;
  }

  /* Proceso steps */
  .step-num {
    width: 42px !important;
    height: 42px !important;
    font-size: 1rem !important;
  }
  .step-conn {
    margin-left: 20px !important;
  }
  .step-h {
    font-size: 0.93rem !important;
  }
  .step-p {
    font-size: 0.82rem !important;
  }

  /* Empresa cards */
  .emp-card {
    padding: 1.1rem !important;
  }
  .emp-av, .emp-lg {
    width: 54px !important;
    height: 54px !important;
  }

  /* Autor section */
  .autor-photo {
    max-width: 260px !important;
    margin: 0 auto 2rem !important;
  }
  .autor-frame::before {
    display: none !important;
  }
  .stat-box {
    padding: 0.9rem 1rem !important;
  }
  .astat-n {
    font-size: 1.5rem !important;
  }
  .astat-l {
    font-size: 0.62rem !important;
  }
  .ct-btn {
    font-size: 0.78rem !important;
    padding: 7px 14px !important;
  }

  /* CTA */
  .cta-section {
    padding: 60px 0 !important;
  }
  .cta-section h2 {
    font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
  }
  .cta-section .d-flex button,
  .cta-section .d-flex a {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Footer */
  .footer-dark {
    padding: 2.5rem 0 1.2rem !important;
  }

  /* Modal */
  .modal-login .modal-body {
    padding: 1.5rem !important;
  }
}

/* ── Extra small (< 400px) ──────────────────────────────────── */
@media (max-width: 399px) {
  .hero-title {
    font-size: 1.75rem !important;
  }
  .lp-btn-ghost span,
  .lp-btn-primary span {
    display: none;
  }
  .hero-content .d-flex.gap-5 {
    gap: 1rem !important;
  }
  .nivel-row {
    padding: 0.65rem 0.75rem !important;
  }
}

/* ── Tablet (768-991px) ─────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 991px) {
  .hero-title {
    font-size: 2.8rem !important;
  }
  .s-light, .s-dark, .s-black, .s-slate {
    padding: 70px 0 !important;
  }
  .nivel-row > div:last-child span {
    font-size: 0.72rem !important;
    white-space: nowrap !important;
  }
}

/* ── Sidebar responsive override ───────────────────────────── */
@media (max-width: 991px) {
  :root { --sidebar-w: 0px !important; }
  .sidebar {
    transform: translateX(-260px) !important;
    width: 260px !important;
  }
  .sidebar.open { transform: translateX(0) !important; }
  .main-content {
    margin-left: 0 !important;
    padding: 1rem !important;
  }
  .topbar { left: 0 !important; }
}

/* ── Overflow fix para todas las secciones ──────────────────── */
section, .container {
  overflow-x: hidden;
}
.row {
  --bs-gutter-x: 1rem;
}

/* ── Nivel row base (column layout for all screens) ─────────── */
.nivel-row {
  flex-direction: column !important;
}
.nivel-row > div:first-child {
  display: flex !important;
  align-items: center !important;
  gap: 0.6rem !important;
  width: 100% !important;
}

/* ── Better container padding on mobile ─────────────────────── */
@media (max-width: 575px) {
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  /* Prevent sidebar from affecting body width */
  body {
    overflow-x: hidden !important;
  }
  /* Admin panel table - horizontal scroll */
  .card .card-body {
    padding: 0 !important;
  }
  .table-custom {
    min-width: 600px;
  }
  /* KPI cards stack */
  .kpi-card {
    padding: 1rem !important;
  }
  .kpi-value {
    font-size: 1.5rem !important;
  }
  /* Main content padding */
  .main-content {
    padding: 0.75rem !important;
  }
  /* Report pages on mobile */
  .report-header {
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 1.2rem !important;
  }
  .report-section {
    padding: 1rem !important;
  }
  .report-meta {
    text-align: left !important;
  }
}


/* ════════════════════════════════════════════════════════════
   SENTINELA360 - SPACING & PADDING FIXES
   ════════════════════════════════════════════════════════════ */

/* ── Container con más respiro lateral en todas las pantallas ── */
.container {
  padding-left: max(1.5rem, env(safe-area-inset-left)) !important;
  padding-right: max(1.5rem, env(safe-area-inset-right)) !important;
}

@media (min-width: 576px) {
  .container {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

@media (min-width: 992px) {
  .container {
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
  }
}

@media (min-width: 1200px) {
  .container {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }
}

/* ── Hero section - más aire arriba y abajo ─────────────────── */
.hero-section .hero-content {
  padding-top: 4rem !important;
  padding-bottom: 4rem !important;
}

@media (max-width: 767px) {
  .hero-section .hero-content {
    padding-top: 2.5rem !important;
    padding-bottom: 3rem !important;
  }
}

/* ── Secciones con más padding vertical ─────────────────────── */
.s-light, .s-dark, .s-black, .s-slate,
section[class*="section"] {
  padding-top: 90px !important;
  padding-bottom: 90px !important;
}

@media (max-width: 767px) {
  .s-light, .s-dark, .s-black, .s-slate {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }
}

/* ── Navbar container padding ───────────────────────────────── */
.lp-nav .container {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

@media (min-width: 992px) {
  .lp-nav .container {
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
  }
}

/* ── Admin panel main content ───────────────────────────────── */
.main-content {
  padding: 2rem 2.5rem !important;
}

@media (max-width: 991px) {
  .main-content {
    padding: 1.5rem !important;
  }
}

@media (max-width: 575px) {
  .main-content {
    padding: 1rem !important;
  }
}

/* ── Cards con más padding interno ─────────────────────────── */
.card-body {
  padding: 1.5rem !important;
}

/* ── Prevenir que el texto toque los bordes en tablas ───────── */
.table-custom thead th,
.table-custom tbody td {
  padding-left: 1.2rem !important;
  padding-right: 1.2rem !important;
}

/* ── Row gaps ────────────────────────────────────────────────── */
.row.g-3 {
  --bs-gutter-x: 1.2rem;
  --bs-gutter-y: 1.2rem;
}
.row.g-4 {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 1.5rem;
}
.row.g-5 {
  --bs-gutter-x: 2rem;
  --bs-gutter-y: 2rem;
}


/* ============================================================
   SENTINELA360 - MOBILE FIXES FOR ADMIN PANEL
   Append to assets/css/style.css
   ============================================================ */

/* ── Global overflow fix ─────────────────────────────────────── */
html, body { overflow-x: hidden !important; }
*, *::before, *::after { box-sizing: border-box; }

/* ── Admin layout responsive ─────────────────────────────────── */
@media (max-width: 991px) {
  /* Sidebar hidden by default */
  .sidebar {
    width: 260px !important;
    transform: translateX(-260px);
    transition: transform 0.3s ease;
    z-index: 1050;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  /* Topbar full width */
  .topbar {
    left: 0 !important;
    right: 0 !important;
    padding: 0 1rem !important;
  }
  /* Main content full width */
  .main-content {
    margin-left: 0 !important;
    padding: 1rem !important;
  }
  /* Overlay visible when sidebar open */
  #sidebarOverlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
  }
}

@media (max-width: 575px) {
  /* Topbar smaller */
  .topbar { height: 58px !important; }
  .main-content { margin-top: 58px !important; padding: 0.85rem !important; }

  /* Page titles */
  .main-content h2 { font-size: 1.2rem !important; }

  /* KPI cards - 2 per row */
  .kpi-card {
    padding: 1rem !important;
    gap: 0.75rem !important;
  }
  .kpi-icon { width: 44px !important; height: 44px !important; font-size: 1.1rem !important; }
  .kpi-value { font-size: 1.5rem !important; }
  .kpi-label { font-size: 0.75rem !important; }

  /* Tables - horizontal scroll */
  .card .card-body:has(.table-custom) {
    padding: 0 !important;
    overflow-x: auto !important;
  }
  .table-custom {
    min-width: 580px;
    font-size: 0.8rem !important;
  }
  .table-custom thead th { padding: 0.65rem 0.75rem !important; font-size: 0.7rem !important; }
  .table-custom tbody td { padding: 0.75rem 0.75rem !important; }

  /* Action buttons in tables */
  .table-custom .btn { padding: 0.25rem 0.5rem !important; font-size: 0.72rem !important; }

  /* Cards */
  .card { border-radius: 12px !important; }
  .card-body { padding: 1rem !important; }
  .card-header { padding: 0.85rem 1rem !important; }

  /* Forms */
  .form-control, .form-select {
    font-size: 0.875rem !important;
    padding: 0.6rem 0.85rem !important;
  }

  /* Buttons */
  .btn { font-size: 0.82rem !important; padding: 0.5rem 0.9rem !important; }
  .btn-lg { padding: 0.7rem 1.4rem !important; font-size: 0.9rem !important; }

  /* Row gutters */
  .row { --bs-gutter-x: 0.75rem; --bs-gutter-y: 0.75rem; }
}

/* ── Mi Resultado - mobile ───────────────────────────────────── */
@media (max-width: 767px) {
  /* Report page */
  .report-page { width: 100% !important; }
  .report-header {
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 1.2rem !important;
  }
  .report-header h1 { font-size: 1rem !important; }
  .report-meta { text-align: left !important; }
  .report-section { padding: 1rem !important; }
  .report-section-title { font-size: 0.72rem !important; }

  /* Score gauge */
  .score-gauge, svg[viewBox="0 0 140 140"] {
    width: 130px !important;
    height: 130px !important;
  }

  /* Dimension cards in results */
  .col-md-6 .card, .col-md-6 > div {
    margin-bottom: 0.5rem;
  }

  /* Print/PDF button */
  .no-print.d-flex.flex-wrap {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  .no-print .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ── Dashboard admin - mobile ────────────────────────────────── */
@media (max-width: 575px) {
  /* Quick actions buttons */
  .card-body .d-flex.flex-wrap.gap-2 {
    flex-direction: column !important;
  }
  .card-body .d-flex.flex-wrap.gap-2 .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Charts */
  canvas { max-height: 200px !important; }

  /* Asignaciones select multiple */
  select[multiple] { height: 120px !important; }

  /* Worker form */
  .row.g-3 .col-md-6,
  .row.g-3 .col-md-4,
  .row.g-3 .col-md-8 {
    /* Let Bootstrap handle with col-12 fallback */
  }
}

/* ── Evaluación/Cuestionario - CRITICAL para móvil ───────────── */
@media (max-width: 575px) {
  /* Question cards */
  .question-card {
    padding: 1.1rem !important;
    margin-bottom: 1rem !important;
    border-radius: 12px !important;
  }
  .question-text { font-size: 0.88rem !important; }

  /* Likert options - 5 opciones en row */
  .likert-options {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 5px !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
  }
  .likert-option label {
    width: 58px !important;
    min-width: 58px !important;
    padding: 0.5rem 0.3rem !important;
    font-size: 0.65rem !important;
    border-radius: 8px !important;
  }
  .likert-option label .val-num {
    font-size: 1.1rem !important;
  }

  /* Progress bar */
  .eval-progress { height: 5px !important; }

  /* Submit area */
  .question-submit-area {
    flex-direction: column !important;
  }
  .question-submit-area button {
    width: 100% !important;
  }
}

/* ── Topbar user info - hide name on very small screens ──────── */
@media (max-width: 399px) {
  .topbar-user .d-none.d-sm-block { display: none !important; }
  .topbar-title { font-size: 0.88rem !important; }
}

/* ── Alert section styles - global ──────────────────────────── */
.tipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

@media (max-width: 399px) {
  .tipo-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ── Scrollable tables wrapper ───────────────────────────────── */
.table-responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 12px 12px;
}

/* ── Sidebar link active state fix ──────────────────────────── */
.sidebar-link:active {
  background: rgba(245,158,11,0.15) !important;
}

/* ── Modal mobile ────────────────────────────────────────────── */
@media (max-width: 575px) {
  .modal-dialog { margin: 0.75rem !important; }
  .modal-body { padding: 1.2rem !important; }
}

/* ── Eval progress sticky on mobile ─────────────────────────── */
@media (max-width: 767px) {
  .eval-progress-sticky {
    position: sticky;
    top: 58px;
    z-index: 100;
    background: white;
    padding: 0.75rem 1rem;
    margin: -1rem -0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
}

/* ── Fix report print button layout ─────────────────────────── */
.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 575px) {
  .report-toolbar { flex-direction: column; align-items: stretch; }
  .report-toolbar .btn { text-align: center; justify-content: center; }
}
