:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --radius:18px;
  --shadow:0 12px 35px rgba(17,24,39,.08);
}
html,body{height:100%;}
body{background:var(--bg);}

.card-soft{
  background:var(--card);
  border:1px solid rgba(0,0,0,.06);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.btn-pill{border-radius:999px !important;}

/* Topbar */
.nav-top{
  position:sticky;top:0;z-index:1000;
  background:#fff;
  border-bottom:1px solid rgba(0,0,0,.06);
}

/* Icon rail */
.rail{
  position:fixed;left:0;top:0;bottom:0;
  width:68px;
  background:#101214;
  border-right:1px solid rgba(255,255,255,.08);
  display:flex;flex-direction:column;align-items:center;
  padding:10px 0;
  transition:width .18s ease;
}
.rail .brand{
  width:44px;height:44px;border-radius:14px;
  background:#1d2228;
  display:flex;align-items:center;justify-content:center;
  margin:6px 0 10px;
  gap:10px;
}
.rail a{
  width:44px;height:44px;
  border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  color:#c8d0da;text-decoration:none;
  margin:6px 0;
  gap:10px;
  transition:background .18s ease, color .18s ease, width .18s ease;
}
.rail a.active,.rail a:hover{background:#1d2228;color:#fff;}

.rail .label{
  display:none;
  white-space:nowrap;
  font-weight:600;
  font-size:.92rem;
  letter-spacing:.02em;
}

/* Expandir al pasar el mouse para mostrar nombres */
@media (min-width: 992px){
  .rail:hover{width:220px; align-items:stretch;}
  .rail:hover .brand,
  .rail:hover a{width:auto; justify-content:flex-start; padding:0 14px;}
  .rail:hover .brand{margin-left:12px; margin-right:12px;}
  .rail:hover a{margin-left:12px; margin-right:12px;}
  .rail:hover .label{display:inline;}
  .rail:hover .brand{justify-content:flex-start;}
  .rail:hover .brand i{min-width:18px;}
}

.main{ margin-left:68px; transition:margin-left .18s ease; }

@media (min-width: 992px){
  .rail:hover ~ .main{ margin-left:220px; }
}

/* Mantener el contenido centrado en pantallas grandes/ultrawide */
.container-app{
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* KPI cards */
.kpi{
  border-radius:18px; color:#fff; overflow:hidden;
  position:relative;
}
.kpi .icon{
  width:44px;height:44px;border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.18);
}
.kpi::after{
  content:'';
  position:absolute; right:-30px; top:-30px;
  width:120px;height:120px;border-radius:999px;
  background:rgba(255,255,255,.12);
}
.kpi-link{color:inherit;text-decoration:none;}

.table thead th{
  font-size:.78rem;
  letter-spacing:.04em;
  text-transform:uppercase;
  white-space:nowrap;
}
.badge-soft{padding:.45rem .75rem;border-radius:999px;}

/* Responsive: hide table on small, show cards */
@media (max-width: 768px){
  .table-responsive-md{display:none;}
  .cards-mobile{display:block;}
}
@media (min-width: 769px){
  .cards-mobile{display:none;}
}

.card-row{
  border:1px solid rgba(0,0,0,.06);
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 24px rgba(17,24,39,.06);
  padding:12px;
  margin-bottom:10px;
}
.card-row .top{
  display:flex;justify-content:space-between;gap:10px;
}
.card-row .folio{
  font-weight:700;
  letter-spacing:.08em;
}
.card-row .muted{color:#6b7280;font-size:.9rem;}
.card-row .grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin-top:10px;
}
.card-row .actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;}

/* Print label 62mm */
@media print{
  .no-print{display:none !important;}
}

/* Mobile rail (offcanvas) */
.rail-backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.45);
  z-index:1500;
  display:none;
}
body.rail-open .rail-backdrop{ display:block; }

@media (max-width: 991.98px){
  .main{ margin-left:0!important; }
  .rail{
    width:240px;
    align-items:stretch;
    padding:10px;
    transform:translateX(-110%);
    z-index:1600;
  }
  .rail .brand,
  .rail a{
    width:auto;
    justify-content:flex-start;
    padding:0 14px;
  }
  .rail .label{ display:inline; }
  body.rail-open .rail{ transform:none; }
}
