:root{
  --bg: #0b1220;
  --panel: rgba(255,255,255,.92);
  --stroke: rgba(15,23,42,.10);
  --text: #0f172a;
  --muted: #64748b;

  --primary: #6366f1;   /* indigo */
  --primary2: #22c55e;  /* green */
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  --radius: 16px;
  --shadow: 0 10px 30px rgba(2, 6, 23, .10);
}

/* Fondo moderno */
body{
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(99,102,241,.25), transparent 60%),
    radial-gradient(800px 500px at 90% 10%, rgba(34,197,94,.20), transparent 55%),
    radial-gradient(1000px 700px at 50% 100%, rgba(6,182,212,.15), transparent 60%),
    #f6f7fb !important;
  color: var(--text);
}

/* Tarjetas */
.card{
  border: 1px solid var(--stroke);
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow);
  background: var(--panel);
  backdrop-filter: blur(6px);
}

.card-soft{ border-radius: var(--radius) !important; }

.table{
  --bs-table-bg: transparent;
}

/* Botones pill y más pro */
.btn-pill{ border-radius: 999px !important; }
.btn-primary{
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border: 0;
}
.btn-outline-primary{
  border-color: rgba(99,102,241,.35);
  color: #4f46e5;
}
.btn-outline-primary:hover{
  background: rgba(99,102,241,.10);
}

/* Badges */
.badge{
  border-radius: 999px;
  padding: .45rem .65rem;
}

/* Animación suave */
@keyframes fadeUp{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}
.page-animate{
  animation: fadeUp .35s ease both;
}

/* Hover elegante */
.card:hover{
  transform: translateY(-2px);
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 18px 50px rgba(2,6,23,.14);
}

/* Sidebar más moderna (si tu sidebar es un div/aside, le ponemos clase .app-sidebar) */
.app-sidebar{
  background: linear-gradient(180deg, #0b1220, #111827);
  color: #e5e7eb;
  border-right: 1px solid rgba(255,255,255,.06);
}
.app-sidebar a{
  color: rgba(229,231,235,.85);
  border-radius: 12px;
}
.app-sidebar a:hover{
  background: rgba(255,255,255,.08);
  color: #fff;
}
.app-sidebar a.active{
  background: rgba(99,102,241,.25);
  color: #fff;
  border: 1px solid rgba(99,102,241,.25);
}

/* Encabezados */
h3,h5{ letter-spacing: .2px; }

/* Inputs */
.form-control, .form-select{
  border-radius: 12px;
  border-color: rgba(15,23,42,.12);
}
.form-control:focus, .form-select:focus{
  border-color: rgba(99,102,241,.45);
  box-shadow: 0 0 0 .2rem rgba(99,102,241,.15);
}

/* ---- Sidebar hard override (para que no se “pierda” el texto) ---- */
.app-sidebar{
  background: linear-gradient(180deg, #0b1220, #111827) !important;
  color: #e5e7eb !important;
}

.app-sidebar .text-white{ color:#fff !important; }
.app-sidebar .small{ color: rgba(229,231,235,.85) !important; }

.app-sidebar .list-group-item{
  background: transparent !important;
  border: 0 !important;
  color: rgba(229,231,235,.85) !important;
  margin-bottom: 6px;
  padding: .65rem .75rem;
  border-radius: 12px !important;
}

.app-sidebar .list-group-item:hover{
  background: rgba(255,255,255,.10) !important;
  color: #fff !important;
}

.app-sidebar .list-group-item.active{
  background: rgba(99,102,241,.25) !important;
  border: 1px solid rgba(99,102,241,.25) !important;
  color: #fff !important;
}

.app-sidebar .badge.text-bg-light{
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.12) !important;
}

/* ---------- Layout con sidebar fijo ---------- */
html, body{
  height: 100%;
}

.sidebar-fixed{
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Scrollbar elegante (opcional, pero se ve pro) */
.sidebar-fixed::-webkit-scrollbar{
  width: 6px;
}
.sidebar-fixed::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.25);
  border-radius: 10px;
}
.sidebar-fixed::-webkit-scrollbar-track{
  background: transparent;
}

/* El contenido principal sí puede scrollear */
main{
  min-height: 100vh;
  overflow-y: auto;
}


/* ---------- LOGIN PRO ---------- */
.login-wrap{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.login-bg{
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(99,102,241,.30), transparent 60%),
    radial-gradient(800px 500px at 90% 10%, rgba(34,197,94,.22), transparent 55%),
    radial-gradient(1000px 700px at 50% 100%, rgba(6,182,212,.18), transparent 60%),
    #0b1220;
}

.login-card{
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(2,6,23,.40);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
}

@media (max-width: 900px){
  .login-card{ grid-template-columns: 1fr; }
  .login-left{ display:none; }
}

.login-left{
  padding: 36px;
  color: rgba(255,255,255,.92);
  background:
    radial-gradient(700px 400px at 20% 20%, rgba(99,102,241,.35), transparent 60%),
    radial-gradient(600px 400px at 80% 20%, rgba(34,197,94,.25), transparent 60%),
    rgba(255,255,255,.02);
}

.login-brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom: 18px;
}
.login-logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
}

.login-title{
  font-size: 28px;
  font-weight: 800;
  margin: 6px 0 8px 0;
}
.login-sub{
  color: rgba(255,255,255,.75);
  line-height: 1.5;
  margin-bottom: 18px;
}
.login-bullets{
  margin: 0;
  padding-left: 18px;
  color: rgba(255,255,255,.80);
}
.login-bullets li{ margin-bottom: 8px; }

.login-right{
  padding: 34px 34px 28px 34px;
  background: rgba(255,255,255,.92);
}

.login-right h4{
  font-weight: 800;
  letter-spacing: .2px;
  margin-bottom: 4px;
}
.login-right .hint{
  color: #64748b;
  margin-bottom: 18px;
}

.input-icon{
  position: relative;
}
.input-icon i{
  position:absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(15,23,42,.55);
}
.input-icon input{
  padding-left: 40px !important;
}

.btn-login{
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 12px 30px rgba(99,102,241,.25);
}
.btn-login:hover{
  filter: brightness(1.04);
}

.login-footer{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(15,23,42,.10);
  color: #64748b;
  font-size: 14px;
}

/* =========================
   ✅ FIX RESPONSIVE (MÓVIL/TABLET)
   No rompe desktop. Solo corrige layout en pantallas chicas.
========================= */
@media (max-width: 992px){

  /* En móvil NO queremos scroll interno en main (causa “se arruina todo”) */
  main{
    overflow-y: visible !important;
    min-height: auto !important;
  }

  /* Sidebar fijo no debe forzar vh ni scroll (igual se oculta por CSS) */
  .sidebar-fixed{
    position: static !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Evita que cosas se salgan del viewport */
  .container-fluid, .row, .col-12, .main-col{
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Tablas: scroll horizontal suave si es necesario */
  .table-responsive{
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Botones y pills no se monten raro */
  .btn, .badge{
    white-space: nowrap;
  }

  /* Ajuste de padding general */
  .page-pad{
    padding: 12px !important;
  }
}

@media (max-width: 576px){
  /* títulos más compactos */
  h3{ font-size: 1.25rem !important; }
  h5{ font-size: 1.05rem !important; }

  /* tarjetas menos padding en móvil */
  .card .card-body{ padding: 14px !important; }
}
