/* Historia.pro - estilos base (light/dark) */
:root {
  --hp-primary: #0ea5e9;
  --hp-primary-dark: #0284c7;
  --hp-sidebar-bg: #0f172a;
  --hp-sidebar-fg: #cbd5e1;
  --hp-sidebar-active: #0ea5e9;
}

[data-bs-theme="light"] { --hp-body-bg: #f1f5f9; }
[data-bs-theme="dark"]  { --hp-body-bg: #0b1220; }

body { background: var(--hp-body-bg); }

/* ---- Login ---- */
.hp-login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0ea5e9 0%, #0f172a 100%);
}
.hp-login-card { width: 100%; max-width: 400px; }

/* ---- Layout dashboard ---- */
.hp-layout { display: flex; min-height: 100vh; }
.hp-sidebar {
  width: 250px;
  background: var(--hp-sidebar-bg);
  color: var(--hp-sidebar-fg);
  flex-shrink: 0;
  transition: margin-left .25s ease;
}
.hp-sidebar .hp-brand {
  font-weight: 700; color: #fff; font-size: 1.25rem;
  padding: 1rem 1.25rem; display: flex; align-items: center; gap: .5rem;
}
.hp-nav a {
  display: flex; align-items: center; gap: .75rem;
  color: var(--hp-sidebar-fg); text-decoration: none;
  padding: .7rem 1.25rem; font-size: .95rem;
}
.hp-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.hp-nav a.active { background: var(--hp-sidebar-active); color: #fff; }
.hp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hp-topbar {
  height: 60px; display: flex; align-items: center; gap: 1rem;
  padding: 0 1rem; background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
}
.hp-content { padding: 1.25rem; flex: 1; }

/* ---- Stat cards ---- */
.hp-stat { border: none; border-radius: 1rem; }
.hp-stat .num { font-size: 2rem; font-weight: 700; line-height: 1; }
.hp-stat .lbl { font-size: .85rem; opacity: .8; }
.hp-stat .ico { font-size: 1.75rem; opacity: .35; }

/* ---- Semaforo recepcion ---- */
.badge-estatus { font-weight: 600; }
.estatus-citado    { background:#0d6efd; }
.estatus-espera    { background:#ffc107; color:#000; }
.estatus-consulta  { background:#198754; }
.estatus-finalizado{ background:#6c757d; }
.estatus-cancelado { background:#dc3545; }

/* ---- Indicador de conexion ---- */
.hp-conn { font-size: .8rem; display: inline-flex; align-items: center; gap: .35rem; }
.hp-conn .dot { width: 9px; height: 9px; border-radius: 50%; }
.hp-conn.online .dot  { background: #22c55e; }
.hp-conn.offline .dot { background: #ef4444; }

/* ---- Responsive: sidebar colapsable ---- */
@media (max-width: 768px) {
  .hp-sidebar {
    position: fixed; z-index: 1040; height: 100%;
    margin-left: -250px;
  }
  .hp-sidebar.open { margin-left: 0; }
  .hp-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 1039; display: none;
  }
  .hp-backdrop.show { display: block; }
}

.hp-page { display: none; }
.hp-page.active { display: block; }

/* ---- POS recepcion ---- */
.hp-pos-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.hp-pos-col .card-header { font-weight: 600; color: #fff; border: none; }
.hp-pos-col .col-head-citado    { background: #0d6efd; }
.hp-pos-col .col-head-espera    { background: #ffc107; color: #000; }
.hp-pos-col .col-head-consulta  { background: #198754; }
.hp-pos-col .col-head-finalizado{ background: #6c757d; }
.hp-pos-col .col-head-cancelado { background: #dc3545; }
.hp-pos-col .card-body { background: var(--bs-tertiary-bg); min-height: 120px; max-height: 62vh; overflow-y: auto; }
.hp-pos-card {
  background: var(--bs-body-bg); border-radius: .6rem; padding: .6rem .7rem;
  margin-bottom: .5rem; border: 1px solid var(--bs-border-color);
  cursor: pointer; transition: transform .08s ease;
}
.hp-pos-card:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.hp-pos-card .pac { font-weight: 600; }
.hp-pos-card .meta { font-size: .78rem; opacity: .75; }
.hp-pos-card .wait { font-size: .75rem; font-weight: 600; }
.hp-kpi { border: none; border-radius: .8rem; }
.hp-kpi .n { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.hp-kpi .l { font-size: .75rem; opacity: .8; }

/* Indicador "en vivo" con pulso */
#posLive.online .dot { animation: hp-pulse 1.4s infinite; }
@keyframes hp-pulse { 0%{opacity:1} 50%{opacity:.3} 100%{opacity:1} }

/* Calendario */
#calendario { min-height: 60vh; }
.fc .fc-toolbar-title { font-size: 1.1rem; }
.fc-event { cursor: pointer; }
