@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --sidebar-bg:   #111827;
  --sidebar-w:    200px;
  --accent:       #1860A1;
  --accent-2:     #0D89C9;
  --accent-gold:  #f59e0b;
  --header-h:     62px;
  --text-main:    #0f172a;
  --text-muted:   #374151;
  --border:       #e2e8f0;
  --bg-page:      #f1f5f9;
}

*, *::before, *::after { font-family: 'Inter', system-ui, sans-serif; }

/* ── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #fff;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.05);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1860A1, #0D89C9);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(24,96,161,.50);
  color: #fff;
}
.logo-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: .02em;
  color: #fff;
}
.logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,.40);
  letter-spacing: .05em;
  font-weight: 500;
  text-transform: uppercase;
}

.sidebar-section-label {
  padding: 20px 14px 5px;
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255,255,255,.28);
  letter-spacing: .1em;
  text-transform: uppercase;
  list-style: none;
}

.sidebar-nav { list-style: none; padding: 8px 8px; margin: 0; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  color: rgba(255,255,255,.56);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  transition: background .12s, color .12s;
  margin-bottom: 1px;
}
.sidebar-nav li a:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.88);
}
.sidebar-nav li a.active {
  background: rgba(24,96,161,.28);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(13,137,201,.40);
}
.sidebar-nav li a .bi { font-size: 15px; }

/* ── SIDEBAR STATUS ──────────────────────────────────────────────── */
.sidebar-status {
  padding: 14px 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: 11px;
}
.status-title {
  color: rgba(255,255,255,.28);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 9px;
  font-size: 9.5px;
}
.status-row {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.50);
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
}

/* ── STATUS DOT ──────────────────────────────────────────────────── */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.green  { background: #22c55e; box-shadow: 0 0 6px #22c55eaa; }
.status-dot.red    { background: #ef4444; box-shadow: 0 0 6px #ef4444aa; }
.status-dot.yellow { background: #f59e0b; box-shadow: 0 0 6px #f59e0baa; }
.status-dot.small  { width: 6px; height: 6px; }

/* ── HEADER ──────────────────────────────────────────────────────── */
.main-header {
  height: var(--header-h);
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #1860A1, #0D89C9);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.user-name   { font-size: 13px; font-weight: 600; color: var(--text-main); line-height: 1.2; }
.user-online { font-size: 11px; color: #94a3b8; display: flex; align-items: center; gap: 4px; }

.main-wrapper { background: var(--bg-page); }
.main-content { background: var(--bg-page); }

/* ── KPI CARDS ───────────────────────────────────────────────────── */
.kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 18px rgba(0,0,0,.04);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow .18s, transform .18s;
}
.kpi-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.11);
  transform: translateY(-1px);
}
.kpi-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.kpi-body { flex: 1; min-width: 0; }
.kpi-card .kpi-num { font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.kpi-card .kpi-lbl { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-top: 3px; }
.kpi-card .kpi-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.kpi-blue   .kpi-icon { background: #e8f0fa; color: #1860A1; }
.kpi-blue   .kpi-num  { color: #1860A1; }
.kpi-purple .kpi-icon { background: #f5f3ff; color: #6d28d9; }
.kpi-purple .kpi-num  { color: #6d28d9; }
.kpi-teal   .kpi-icon { background: #e0f5fd; color: #0D89C9; }
.kpi-teal   .kpi-num  { color: #0D89C9; }
.kpi-red    .kpi-icon { background: #fef2f2; color: #dc2626; }
.kpi-red    .kpi-num  { color: #dc2626; }
.kpi-gold   .kpi-icon { background: #fffbeb; color: #b45309; }
.kpi-gold   .kpi-num  { color: #b45309; }

/* ── PANELS ──────────────────────────────────────────────────────── */
.panel-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 18px rgba(0,0,0,.04);
}
.panel-card h6 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 7px;
  letter-spacing: -.01em;
}

/* ── TABLAS ──────────────────────────────────────────────────────── */
.table-elopark thead th {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid #e2e8f0;
  border-top: none;
  padding: 14px 18px;
  background: transparent;
}
.table-elopark tbody td {
  padding: 18px 18px;
  font-size: 15px;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
  color: var(--text-main);
}
.table-elopark tbody tr:nth-child(even) td { background: #f8fafc; }
.table-elopark tbody tr:last-child td { border-bottom: none; }
.table-elopark tbody tr:hover td { background: #eef4ff !important; }

/* ── BADGES ──────────────────────────────────────────────────────── */
.badge-torno-in  { background: #e8f0fa; color: #1860A1; font-size: 11px; border-radius: 5px; padding: 3px 9px; font-weight: 600; }
.badge-torno-out { background: #fef3c7; color: #92400e; font-size: 11px; border-radius: 5px; padding: 3px 9px; font-weight: 600; }
.badge-puerta    { background: #d1fae5; color: #065f46; font-size: 11px; border-radius: 5px; padding: 3px 9px; font-weight: 600; }

/* ── AVATARES ────────────────────────────────────────────────────── */
.av {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.av-0 { background: linear-gradient(135deg,#1860A1,#0D89C9); }
.av-1 { background: linear-gradient(135deg,#6d28d9,#8b5cf6); }
.av-2 { background: linear-gradient(135deg,#0d9488,#14b8a6); }
.av-3 { background: linear-gradient(135deg,#dc2626,#ef4444); }
.av-4 { background: linear-gradient(135deg,#b45309,#f59e0b); }
.av-5 { background: linear-gradient(135deg,#0369a1,#0D89C9); }
.av-6 { background: linear-gradient(135deg,#15803d,#22c55e); }
.av-7 { background: linear-gradient(135deg,#be185d,#ec4899); }
.av-8 { background: linear-gradient(135deg,#4338ca,#6366f1); }
.av-9 { background: linear-gradient(135deg,#0f766e,#2dd4bf); }

/* ── MODALES ─────────────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15,23,42,.25);
  overflow: hidden;
}
.modal-header {
  background: linear-gradient(135deg, #0f172a 0%, #1860A1 100%);
  border-bottom: none;
  padding: 20px 24px;
}
.modal-header .modal-title {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-header .modal-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 18px;
  background: #0D89C9;
  border-radius: 2px;
  flex-shrink: 0;
}
.modal-header .btn-close { filter: invert(1) brightness(2); opacity: .6; }
.modal-header .btn-close:hover { opacity: 1; }
.modal-body { padding: 26px 24px; background: #fff; }
.modal-body .form-label {
  font-weight: 600;
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}
.modal-body .form-control,
.modal-body .form-select {
  border-color: var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.modal-body .form-control:focus,
.modal-body .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24,96,161,.14);
}
.modal-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  gap: 8px;
}

/* ── PI CARDS (sistema) ──────────────────────────────────────────── */
.pi-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.pi-card-header {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13px; margin-bottom: 10px;
  color: var(--text-main);
}
.pi-metrics { display: flex; gap: 8px; flex-wrap: wrap; }
.pi-metric  { background: #f8fafc; border-radius: 8px; padding: 8px 12px; font-size: 12px; border: 1px solid var(--border); }
.pi-metric .pm-val { font-weight: 700; font-size: 15px; display: block; color: var(--accent); }
.pi-metric .pm-lbl { color: var(--text-muted); font-size: 10px; font-weight: 500; }

/* ── HORARIOS ────────────────────────────────────────────────────── */
.horario-bar-wrap { height: 5px; background: #e2e8f0; border-radius: 3px; position: relative; min-width: 140px; }
.horario-bar      { height: 5px; background: linear-gradient(90deg, #1860A1, #0D89C9); border-radius: 3px; position: absolute; }
.horario-ticks    { display: flex; justify-content: space-between; font-size: 9px; color: #94a3b8; margin-top: 3px; }

/* ── LOGIN ───────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #06101f 0%, #0d2647 55%, #06101f 100%);
}
.login-card {
  width: 400px;
  background: #fff;
  border-radius: 18px;
  padding: 44px 40px;
  box-shadow: 0 32px 90px rgba(0,0,0,.40);
}
.login-logo {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, #1860A1, #0D89C9);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(24,96,161,.50);
}

/* ── BOTONES ─────────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #1860A1, #0D89C9);
  border: none;
  border-radius: 9px;
  font-weight: 600;
  letter-spacing: .01em;
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus-visible {
  background: linear-gradient(135deg, #144e87, #1860A1);
  border: none;
  box-shadow: 0 4px 16px rgba(24,96,161,.38);
}
.btn-outline-info { border-color: #0D89C9; color: #0D89C9; border-radius: 8px; font-weight: 500; }
.btn-outline-info:hover { background: #0D89C9; color: #fff; border-color: #0D89C9; }
.btn-outline-secondary { border-radius: 8px; font-weight: 500; }
.btn-outline-success   { border-radius: 8px; font-weight: 500; }
.btn-outline-danger    { border-radius: 8px; font-weight: 500; }
.btn-sm { border-radius: 7px !important; font-size: 12px !important; font-weight: 500 !important; }

/* ── FORM CONTROLS ───────────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--border);
  border-radius: 9px;
  font-size: 13.5px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24,96,161,.14);
}

/* ── ALERTAS ─────────────────────────────────────────────────────── */
.alert { border-radius: 10px; font-size: 13px; border: none; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info    { background: #e8f0fa; color: #1860A1; }

/* ── BREADCRUMB ──────────────────────────────────────────────────── */
.breadcrumb { font-size: 12.5px; }
.breadcrumb-item a { color: var(--accent); text-decoration: none; font-weight: 500; }
.breadcrumb-item a:hover { color: var(--accent-2); }
