/* =========================================
   SFP Control Financiero — Estilos
   ========================================= */
:root {
  --sfp-dark:    #3d1c08;
  --sfp-medium:  #6b3a1f;
  --sfp-light:   #a0522d;
  --sfp-cream:   #faf3e8;
  --sfp-gold:    #c8963e;
  --sfp-success: #2d6a4f;
  --sfp-warning: #e07b39;
  --sfp-danger:  #b5181f;
}

body {
  background-color: var(--sfp-cream);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 0.925rem;
}

/* ── Sidebar ── */
.wrapper { min-height: 100vh; }

.sidebar {
  width: 240px;
  height: 100%;
  background-color: var(--sfp-dark);
  position: fixed;
  top: 0; left: 0;
  z-index: 1030;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(0);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  -webkit-overflow-scrolling: touch;
}

/* Overlay para móvil */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1029;
  opacity: 0;
  transition: opacity .28s;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar-version {
  font-size: 0.7rem;
  color: rgba(255,255,255,.35);
}

.sidebar .nav-link {
  color: rgba(255,255,255,.72);
  padding: .65rem 1.4rem;
  border-left: 3px solid transparent;
  transition: all .18s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.1);
  border-left-color: var(--sfp-gold);
}
.sidebar .nav-link i { width: 20px; }

.nav-divider {
  padding: .9rem 1.4rem .3rem;
}
.nav-divider span {
  font-size: .68rem;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── Topbar ── */
.main-content { margin-left: 240px; }

.topbar {
  background: #fff;
  border-bottom: 1px solid #e5ddd0;
  padding: .6rem 1rem;
  position: sticky; top: 0;
  z-index: 1020;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.topbar-left  { display: flex; align-items: center; gap: .5rem; min-width: 0; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

/* Botón hamburguesa — visible solo en móvil */
#sidebarToggle {
  display: none;
  flex-shrink: 0;
  width: 38px; height: 38px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: .375rem;
  background: transparent;
  cursor: pointer;
}

.page-content { padding: 1.5rem; }

/* ── KPI Cards ── */
.kpi-card {
  border: none;
  border-left: 4px solid var(--sfp-gold);
  border-radius: .5rem;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.kpi-card.danger  { border-left-color: var(--sfp-danger); }
.kpi-card.warning { border-left-color: var(--sfp-warning); }
.kpi-card.success { border-left-color: var(--sfp-success); }
.kpi-card.info    { border-left-color: #0d6efd; }

.kpi-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--sfp-dark);
  line-height: 1.2;
}
.kpi-label { font-size: .8rem; color: #6c757d; }
.kpi-icon  { font-size: 2rem; opacity: .18; }

/* ── Buttons ── */
.btn-sfp {
  background-color: var(--sfp-dark);
  color: #fff;
  border: none;
}
.btn-sfp:hover, .btn-sfp:focus {
  background-color: var(--sfp-medium);
  color: #fff;
}
.btn-sfp-outline {
  border: 1px solid var(--sfp-dark);
  color: var(--sfp-dark);
  background: transparent;
}
.btn-sfp-outline:hover {
  background-color: var(--sfp-dark);
  color: #fff;
}

/* ── Tables ── */
.table-sfp thead th {
  background-color: var(--sfp-dark);
  color: #fff;
  font-weight: 500;
  border: none;
}
.table-sfp tbody tr:hover { background-color: #fdf6ec; }

/* ── Section title ── */
.section-title {
  color: var(--sfp-dark);
  font-weight: 600;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--sfp-gold);
  margin-bottom: 1.2rem;
}

/* ── Badges custom ── */
.bg-purple { background-color: #6f42c1; }

/* ── Cards generic ── */
.card-sfp {
  border: none;
  border-radius: .5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

/* ── Chart containers ── */
.chart-wrapper {
  position: relative;
  height: 250px;
}

/* ── Login page ── */
.login-card {
  max-width: 420px;
  border-top: 4px solid var(--sfp-dark);
  border-radius: .5rem;
}

/* ── Install page ── */
.install-card {
  max-width: 480px;
  border-top: 4px solid var(--sfp-dark);
}

/* ── Color swatches (catálogos) ── */
.swatch-label input:checked + .swatch-btn {
  outline: 3px solid #000;
  outline-offset: 2px;
}
.swatch-btn { transition: transform .1s; }
.swatch-btn:hover { transform: scale(1.08); }

/* ══════════════════════════════════════
   RESPONSIVE — Tablet & Mobile
   ══════════════════════════════════════ */

/* ── Tablet (≤ 991px) ── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 16px rgba(0,0,0,.25);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  #sidebarToggle { display: inline-flex; align-items: center; justify-content: center; }
  body.sidebar-open { overflow: hidden; }
}

/* ── Mobile (≤ 575px) ── */
@media (max-width: 575.98px) {
  .page-content { padding: 1rem .75rem; }

  /* KPI: 2 por fila */
  .kpi-value { font-size: 1.4rem; }
  .kpi-icon  { font-size: 1.5rem; }

  /* Charts más bajos */
  .chart-wrapper { height: 200px; }

  /* Topbar compacto */
  .topbar { padding: .5rem .75rem; }
  .topbar-right .user-name { display: none; }

  /* Botones con texto: solo icono en xs */
  .btn-sfp .btn-text { display: none; }

  /* Modales: full width */
  .modal-dialog { margin: .5rem; }

  /* Section title más pequeño */
  .section-title { font-size: 1rem; }

  /* Hotel selector compacto */
  #hotelFiltro { max-width: 140px; font-size: .8rem; }

  /* Filtros facturas: full width en móvil */
  .filtros-form .col-auto { width: 100%; }
  .filtros-form .form-select,
  .filtros-form .btn { width: 100%; }
}
