:root{
    --bg:#0b1220;
    --panel:#0f1a30;
    --card:#111f3a;
    --text:#e9eefc;
    --muted:#a8b3d6;
    --line:rgba(255,255,255,.08);
    --pri:#4f8cff;
    --ok:#30d158;
    --warn:#ff9f0a;
    --bad:#ff453a;
    --shadow: 0 14px 30px rgba(0,0,0,.35);
    --r:14px;
    --pad:16px;
    --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  }
  
  *{box-sizing:border-box}
  html,body{height:100%}
  body{
    margin:0;
    font-family:var(--font);
    background:radial-gradient(1200px 700px at 15% 10%, #152a58 0%, var(--bg) 55%);
    color:var(--text);
  }
  
  a{color:var(--pri); text-decoration:none}
  a:hover{text-decoration:underline}
  
  .container{max-width:1150px; margin:0 auto; padding:22px}
  
  .topbar{
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 18px; border:1px solid var(--line);
    background:rgba(15,26,48,.65); backdrop-filter: blur(10px);
    border-radius:var(--r); box-shadow:var(--shadow);
  }
  .brand{display:flex; gap:10px; align-items:center}
  .logo{
    width:34px; height:34px; border-radius:10px;
    background:linear-gradient(135deg, var(--pri), #8a5bff);
    box-shadow:0 8px 20px rgba(79,140,255,.35);
  }
  .brand h1{font-size:15px; margin:0}
  .brand .sub{color:var(--muted); font-size:12px}
  
  .nav{display:flex; gap:12px; align-items:center; flex-wrap:wrap}
  .nav a{
    padding:8px 10px; border-radius:10px;
    border:1px solid transparent;
  }
  .nav a:hover{border-color:var(--line); background:rgba(255,255,255,.03)}
  .nav .danger{color:#ffd3d0}
  .nav .danger:hover{border-color:rgba(255,69,58,.35); background:rgba(255,69,58,.10)}
  
  .grid{display:grid; gap:14px}
  .grid.cols-2{grid-template-columns:1fr 1fr}
  .grid.cols-3{grid-template-columns:repeat(3, 1fr)}
  @media(max-width:920px){.grid.cols-2,.grid.cols-3{grid-template-columns:1fr}}
  
  .card{
    background:rgba(17,31,58,.75);
    border:1px solid var(--line);
    border-radius:var(--r);
    box-shadow:var(--shadow);
    padding:var(--pad);
  }
  .card h2{margin:0 0 8px 0; font-size:18px}
  .card h3{margin:0 0 10px 0; font-size:15px; color:var(--muted)}
  .card .muted{color:var(--muted); font-size:13px}
  
  .row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
  .spread{justify-content:space-between}
  
  .badge{
    display:inline-flex; align-items:center; gap:6px;
    padding:5px 9px; border-radius:999px; font-size:12px;
    border:1px solid var(--line);
    color:var(--muted);
  }
  .badge.ok{color:#bff7c9; border-color:rgba(48,209,88,.35); background:rgba(48,209,88,.10)}
  .badge.warn{color:#ffe0b3; border-color:rgba(255,159,10,.35); background:rgba(255,159,10,.10)}
  .badge.bad{color:#ffd3d0; border-color:rgba(255,69,58,.35); background:rgba(255,69,58,.10)}
  
  .btn{
    appearance:none; border:1px solid var(--line);
    background:rgba(255,255,255,.03);
    color:var(--text);
    padding:9px 12px; border-radius:12px;
    cursor:pointer; transition:.15s ease;
  }
  .btn:hover{transform:translateY(-1px); background:rgba(255,255,255,.06)}
  .btn.primary{border-color:rgba(79,140,255,.5); background:rgba(79,140,255,.12)}
  .btn.primary:hover{background:rgba(79,140,255,.18)}
  .btn.danger{border-color:rgba(255,69,58,.5); background:rgba(255,69,58,.10)}
  .btn.danger:hover{background:rgba(255,69,58,.16)}
  
  .input, select{
    width:100%;
    padding:10px 12px; border-radius:12px;
    background:rgba(0,0,0,.18);
    border:1px solid var(--line);
    color:var(--text);
    outline:none;
  }
  label{font-size:12px; color:var(--muted)}
  .form{display:grid; gap:10px}
  .form .cols-2{display:grid; grid-template-columns:1fr 1fr; gap:10px}
  @media(max-width:920px){.form .cols-2{grid-template-columns:1fr}}
  
  .table-wrap{overflow:auto; border-radius:var(--r); border:1px solid var(--line)}
  table{width:100%; border-collapse:collapse; min-width:860px}
  th,td{padding:10px 10px; border-bottom:1px solid var(--line); font-size:13px; white-space:nowrap}
  th{color:var(--muted); font-weight:600; text-align:left; background:rgba(255,255,255,.03)}
  tr:hover td{background:rgba(255,255,255,.02)}
  
  .alert{
    padding:12px 12px; border-radius:12px; border:1px solid var(--line);
    background:rgba(255,255,255,.03);
  }
  .alert.ok{border-color:rgba(48,209,88,.35); background:rgba(48,209,88,.10)}
  .alert.bad{border-color:rgba(255,69,58,.35); background:rgba(255,69,58,.10)}
  .alert.warn{border-color:rgba(255,159,10,.35); background:rgba(255,159,10,.10)}
  
  .kpi{display:flex; flex-direction:column; gap:6px}
  .kpi .v{font-size:22px; font-weight:700}
  .kpi .t{color:var(--muted); font-size:12px}
  
  .toast{
    position:fixed; right:16px; bottom:16px;
    background:rgba(17,31,58,.92); border:1px solid var(--line);
    padding:10px 12px; border-radius:12px; box-shadow:var(--shadow);
    display:none; max-width:360px;
  }
  .toast.show{display:block
  }

  /* --- FIX LOGO EN TOPBAR (evita banner gigante) --- */
.topbar img{
  max-height: 38px !important;
  width: auto !important;
  object-fit: contain !important;
  border-radius: 10px !important;
}

/* =========================================================
   PATCH LAYOUT (topbar + userbox + menu + márgenes)
   ========================================================= */

/* Ajuste de contenedor: menos pegado en pantallas grandes */
.container{
  max-width: 1150px;
  margin: 0 auto;
  padding: 18px 22px; /* antes 22px, lo dejamos más uniforme */
}

/* Topbar como barra (no como tarjeta duplicada) */
.topbar{
  position: sticky;
  top: 12px;
  z-index: 50;

  /* mantenemos tu estilo pero sin forzar flex directo si usas inner */
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(15,26,48,.65);
  backdrop-filter: blur(10px);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

/* Este wrapper lo usa el layout nuevo */
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 18px;
  padding: 14px 18px;
}

/* Brand */
.brand{display:flex; gap:10px; align-items:center}
.brand-logo{
  width: 150px;
  height: 150px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
}

/* Menú (nombres de clase del layout nuevo) */
.menu{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.menu-link{
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--pri);
}
.menu-link:hover{
  border-color: var(--line);
  background: rgba(255,255,255,.03);
  text-decoration: none;
}

/* Usuario a la derecha */
.userbox{
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:flex-end;
  white-space:nowrap;
}

.user-name{
  color: var(--muted);
  font-weight:600;
}

/* Botón estilo “ghost” si lo usas en layout */
.btn-ghost{
  background: rgba(255,255,255,.03);
}

/* Mantén este fix (lo ajusto para que solo afecte logo y no cualquier img del header) */
.topbar .brand-logo{
  max-height: 150px !important;
  width: 150px !important;
  height: 150px !important;
  object-fit: contain !important;
  border-radius: 10px !important;
}

/* ====== OVERRIDE UI: más corporativo, más aire, tipografía ====== */
:root{
  --pri:#2f7dff;      /* azul más vivo */
  --ok:#2fe06f;
  --warn:#ffb020;
  --bad:#ff4d4d;
  --r:16px;
  --pad:18px;
}

/* letra y legibilidad */
html, body{ font-size: 17px; }
.card h2{ font-size: 20px; }
.card h3{ font-size: 16px; }

/* más aire y nada pegado a bordes */
.container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}
.main{ padding: 18px 0 30px; }

/* topbar más limpia y consistente */
.topbar{
  position: sticky;
  top: 10px;
  z-index: 50;
  border-radius: var(--r);
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  padding: 14px 18px;
}

/* logo SIEMPRE proporcional */
.brand-logo{
  width: 150px !important;
  height: 150px !important;
  object-fit: contain !important;
  border-radius: 12px !important;
}

/* menú */
.menu{ display:flex; gap:12px; align-items:center; }
.menu-link{
  padding: 9px 12px;
  border-radius: 12px;
  border:1px solid transparent;
}
.menu-link:hover{
  border-color: var(--line);
  background: rgba(255,255,255,.04);
  text-decoration: none;
}

/* usuario a la derecha */
.userbox{ display:flex; gap:10px; align-items:center; justify-content:flex-end; }
.user-name{ color: var(--muted); font-weight:700; }

/* botones un poco más grandes */
.btn{ padding: 10px 14px; border-radius: 14px; }

.client-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.client-info h1 {
  margin-bottom: 8px;
}

.client-info p {
  opacity: 0.85;
  font-size: 14px;
}

.client-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #3a6cf4;
  color: #3a6cf4;
}

.btn-secondary:hover {
  background: #3a6cf4;
  color: #fff;
}

.btn-primary {
  background: #3a6cf4;
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: #2f5ad3;
}

.estado-label {
  margin-top: 6px;
  display: block;
}

.estado-badge {
  margin-top: 6px;
}


/* =========================
   SIMULACIÓN - ESTILO PREMIUM
========================= */

/* =========================
   SIMULACIÓN - ESTILO SISTEMA IMPERIO
========================= */

.sim-card {
  border: 1px solid var(--line);
  background: rgba(17,31,58,.75);
  backdrop-filter: blur(8px);
}

.sim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.sim-badge {
  background: rgba(79,140,255,.12);
  color: var(--pri);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid rgba(79,140,255,.35);
}

.sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.sim-box {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: .15s ease;
}

.sim-box:hover {
  background: rgba(255,255,255,.05);
}

.sim-box span {
  font-size: 13px;
  color: var(--muted);
}

.sim-box strong {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.sim-total {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-radius: var(--r);
  background: rgba(79,140,255,.10);
  border: 1px solid rgba(79,140,255,.35);
}

.sim-total span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.sim-total strong {
  font-size: 24px;
  font-weight: 800;
  color: var(--pri);
}

.sim-actions .btn {
  min-width: 160px;
}


/* ===== ICONOS SIMULACIÓN ===== */

.sim-actions.icons {
  margin-top: 14px;
  display: flex;
  gap: 12px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
  cursor: pointer;
  transition: .2s ease;
}

.icon-btn:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-2px);
}

.icon-btn.whatsapp {
  background: rgba(37,211,102,.12);
  border-color: rgba(37,211,102,.35);
  color: #25D366;
}

.icon-btn.whatsapp:hover {
  background: rgba(37,211,102,.25);
}

/* =========================
   FOOTER CORPORATIVO
========================= */

.footer {
  margin-top: 20px;
  padding: 10px 0;
  background: linear-gradient(to top, #0a1428, #0f1c35);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-inner {
  display: flex;
  justify-content: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.footer-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
  opacity: 0.9;
}

.footer-slogan {
  font-size: 15px;
  font-weight: 500;
  color: #d4af37; /* dorado elegante */
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.footer-dev {
  font-size: 13px;
  opacity: 0.6;
}



/* ===== RELOJ CORPORATIVO IMPERIO ===== */
.imperio-clock{
  margin-left:auto;
  margin-right:20px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 12px;
  border-radius:14px;
  background:rgba(0,0,0,0.35);
  border:1px solid rgba(212,175,55,0.4);
  box-shadow:0 3px 12px rgba(0,0,0,0.3);
  font-weight:700;
  letter-spacing:0.5px;
  font-size:14px;
  color:#d4af37;
}

.imperio-clock-icon{
  font-size:15px;
}


/* ===== RELOJ (PLANO) BAJO ENCABEZADO ===== */
.topbar-sub{
  padding: 6px 0 10px 0;
}

.topbar-sub-inner{
  display:flex;
  justify-content:flex-start;
}

.imperio-clock-plain{
  color:#d4af37;
  font-weight:700;
  letter-spacing:0.4px;
  font-size:13px;
}


.menu-link.active{
  color:#d4af37;
  font-weight:700;
  border-bottom:2px solid #d4af37;
  padding-bottom:4px;
}


/* =========================================
   BACKUPS - ESTILO CORPORATIVO IMPERIO
   ========================================= */

   .page-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:16px;
    flex-wrap:wrap;
    margin-bottom:20px;
  }
  
  .page-header h1{
    margin:0 0 8px 0;
    font-size:18px;
    font-weight:800;
    color:var(--text);
  }
  
  .page-header p{
    margin:0;
    color:var(--muted);
    font-size:14px;
  }
  
  .page-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
  }
  
  .mt-3{
    margin-top:18px;
  }
  
  .stats-grid{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:14px;
  }
  
  @media(max-width:920px){
    .stats-grid{
      grid-template-columns:1fr;
    }
  }
  
  .stat-box{
    background:rgba(255,255,255,.03);
    border:1px solid var(--line);
    border-radius:14px;
    padding:16px;
    box-shadow:var(--shadow);
  }
  
  .stat-label{
    display:block;
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
  }
  
  .stat-value{
    font-size:18px;
    font-weight:800;
    color:var(--text);
  }
  
  .section-title{
    margin:0 0 14px 0;
    font-size:16px;
    font-weight:800;
    color:var(--text);
  }
  
  .table-responsive{
    overflow-x:auto;
  }
  
  .table{
    width:100%;
    border-collapse:collapse;
    min-width:860px;
  }
  
  .table thead th{
    text-align:left;
    padding:12px 12px;
    color:var(--muted);
    font-weight:600;
    font-size:13px;
    background:rgba(255,255,255,.03);
    border-bottom:1px solid var(--line);
  }
  
  .table tbody td{
    padding:14px 12px;
    border-bottom:1px solid var(--line);
    vertical-align:middle;
    color:var(--text);
    font-size:13px;
  }
  
  .table tbody tr:hover td{
    background:rgba(255,255,255,.02);
  }
  
  .table-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
  }
  
  .empty-state{
    padding:28px;
    text-align:center;
    border:1px dashed var(--line);
    border-radius:14px;
    color:var(--muted);
    background:rgba(255,255,255,.02);
  }
  
  .backup-file{
    font-weight:700;
    color:var(--text);
  }
  
  .backup-meta{
    font-size:12px;
    color:var(--muted);
    margin-top:4px;
  }


  /* =========================================================
   IMPERIO - LAYOUT APP CON SIDEBAR IZQUIERDO + TOPBAR SIMPLE
   ========================================================= */

:root{
  --sidebar-w: 280px;
  --sidebar-bg: rgba(10,18,34,.92);
  --sidebar-border: rgba(255,255,255,.08);
  --sidebar-hover: rgba(255,255,255,.04);
  --sidebar-active: rgba(212,175,55,.12);
  --sidebar-active-border: rgba(212,175,55,.55);
  --topbar-h: 84px;
}

html, body{
  min-height:100%;
}

body{
  overflow-x:hidden;
}

.app-shell{
  min-height:100vh;
  display:flex;
}

.sidebar{
  width:var(--sidebar-w);
  min-width:var(--sidebar-w);
  background:linear-gradient(180deg, rgba(15,26,48,.96) 0%, rgba(9,16,30,.98) 100%);
  border-right:1px solid var(--sidebar-border);
  padding:20px 18px;
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  z-index:30;
  box-shadow:20px 0 50px rgba(0,0,0,.22);
}

.sidebar-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:var(--text);
}

.sidebar-brand:hover{
  text-decoration:none;
}

.sidebar-logo{
  width:56px;
  height:56px;
  object-fit:contain;
  border-radius:14px;
  background:rgba(255,255,255,.03);
  border:1px solid var(--line);
  padding:6px;
}

.sidebar-brand-text{
  min-width:0;
}

.sidebar-title{
  font-size:18px;
  font-weight:800;
  line-height:1.1;
  letter-spacing:.3px;
  color:#fff;
}

.sidebar-subtitle{
  font-size:13px;
  color:var(--muted);
  margin-top:4px;
}

.sidebar-caption{
  margin:16px 0 22px;
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
  padding-bottom:14px;
  border-bottom:1px solid var(--line);
}

.sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.sidebar-link{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:46px;
  padding:11px 14px;
  border-radius:14px;
  color:var(--text);
  border:1px solid transparent;
  transition:all .2s ease;
  text-decoration:none;
  font-weight:600;
}

.sidebar-link:hover{
  background:var(--sidebar-hover);
  border-color:var(--line);
  text-decoration:none;
}

.sidebar-link.active{
  background:var(--sidebar-active);
  border-color:var(--sidebar-active-border);
  color:#f7d46a;
  box-shadow:0 10px 24px rgba(212,175,55,.08);
}

.sidebar-link-logout{
  margin-top:8px;
  color:#ffd6d1;
}

.sidebar-link-logout:hover{
  border-color:rgba(255,69,58,.28);
  background:rgba(255,69,58,.08);
}

.sidebar-icon{
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.sidebar-icon svg{
  width:20px;
  height:20px;
}

.sidebar-section-title{
  margin:22px 0 10px;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
}

.sidebar-user{
  margin-top:auto;
  padding:14px;
  border-radius:14px;
  background:rgba(255,255,255,.03);
  border:1px solid var(--line);
  display:flex;
  flex-direction:column;
  gap:8px;
}

.sidebar-user-name{
  font-weight:700;
  color:#fff;
}

.app-main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}

.topbar-simple{
  height:var(--topbar-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:16px 26px;
  border-bottom:1px solid var(--line);
  background:rgba(11,18,32,.72);
  backdrop-filter:blur(10px);
  position:sticky;
  top:0;
  z-index:20;
}

.topbar-left{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.topbar-title{
  margin:0;
  font-size:22px;
  font-weight:800;
  color:#fff;
  line-height:1.1;
}

.topbar-subtitle{
  margin-top:4px;
  font-size:13px;
  color:var(--muted);
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.main-content{
  flex:1;
  padding:24px 0 8px;
}

.container-wide{
  max-width:1320px;
}

.app-footer{
  margin-top:auto;
  border-top:1px solid var(--line);
  background:rgba(10,16,30,.68);
}

.sidebar-toggle{
  width:42px;
  height:42px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
}

.sidebar-toggle:hover{
  background:rgba(255,255,255,.06);
}

.desktop-hidden{
  display:none;
}

.mobile-only{
  display:none;
}

.sidebar-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.5);
  opacity:0;
  visibility:hidden;
  transition:.2s ease;
  z-index:25;
}

.sidebar-backdrop.show{
  opacity:1;
  visibility:visible;
}

/* Ajuste de tablas/paneles para contenido más ancho */
.container{
  max-width:1320px;
}

.footer{
  padding:26px 0;
}

.footer-inner{
  display:flex;
  justify-content:center;
}

.footer-brand{
  display:flex;
  align-items:center;
  gap:14px;
  text-align:left;
}

.footer-logo{
  width:58px;
  height:58px;
  object-fit:contain;
}

@media (max-width: 1100px){
  .topbar-title{
    font-size:20px;
  }

  .container-wide,
  .container{
    max-width:100%;
  }
}

@media (max-width: 920px){
  .sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    transform:translateX(-100%);
    transition:transform .24s ease;
    height:100vh;
  }

  .sidebar.open{
    transform:translateX(0);
  }

  .desktop-hidden{
    display:inline-flex;
  }

  .mobile-only{
    display:inline-flex;
  }

  .topbar-simple{
    padding:14px 16px;
  }

  .topbar-title{
    font-size:18px;
  }

  .topbar-subtitle{
    font-size:12px;
  }

  .main-content{
    padding-top:18px;
  }
}

@media (max-width: 640px){
  .topbar-simple{
    height:auto;
    min-height:72px;
    align-items:flex-start;
    flex-direction:column;
  }

  .topbar-right{
    width:100%;
    justify-content:flex-start;
  }

  .footer-brand{
    flex-direction:column;
    text-align:center;
  }
}

.pagination-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.btn-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-page-current {
  min-width: 42px;
  text-align: center;
}


/* =========================================
   SIMULACIÓN - AJUSTE DE CENTRADO
   ========================================= */

   .sim-wrap{
    max-width: 1160px;
    margin: 0 auto;
  }
  
  .sim-narrow{
    max-width: 980px;
    margin: 0 auto;
  }
  
  .sim-note{
    max-width: 980px;
    margin: 18px auto 0;
    color: var(--text);
  }
  
  .sim-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
  }
  
  @media (max-width: 920px){
    .sim-wrap,
    .sim-narrow,
    .sim-note{
      max-width: 100%;
    }
  }


  /* ===============================
   CREDITOS - POPUP
=============================== */
.credito-popup-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:9998;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.credito-popup{
  width:min(520px, 100%);
  background:rgba(17,31,58,.98);
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  box-shadow:0 18px 45px rgba(0,0,0,.45);
  overflow:hidden;
}

.credito-popup-head{
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.credito-popup-title{
  font-size:16px;
  font-weight:800;
}

.credito-popup-body{
  padding:18px;
  line-height:1.5;
}

.credito-popup-actions{
  padding:0 18px 18px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

/* ===============================
   CREDITOS - RESUMEN
=============================== */
.credito-resumen-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:14px;
}

.credito-resumen-card{
  padding:18px;
}

.mini-label{
  font-size:13px;
  color:var(--muted);
}

.mini-value{
  font-size:19px;
  font-weight:800;
}

.mini-value-alt{
  font-size:28px;
  font-weight:900;
}

.mini-divider{
  height:1px;
  background:rgba(255,255,255,.08);
  margin:10px 0;
}

.muted-line{
  font-size:13px;
  color:var(--muted);
}

.resumen-monto{
  background:linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.015));
}

.resumen-abonado{
  border-color: rgba(25, 135, 84, .28);
  background: rgba(25, 135, 84, .05);
}

.resumen-saldo{
  border-color: rgba(13, 110, 253, .25);
  background: rgba(13, 110, 253, .05);
}

@media (max-width: 980px){
  .credito-resumen-grid{
    grid-template-columns: 1fr;
  }
}


.credito-popup-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:9998;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.credito-popup{
  width:min(520px, 100%);
  background:rgba(17,31,58,.98);
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  box-shadow:0 18px 45px rgba(0,0,0,.45);
  overflow:hidden;
}
.credito-popup-head{
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.credito-popup-title{
  font-size:16px;
  font-weight:800;
  margin:0;
}
.credito-popup-body{
  padding:18px;
  color:var(--text);
  line-height:1.5;
}
.credito-popup-actions{
  padding:0 18px 18px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
.credito-popup-close{
  min-width:120px;
}

.credito-resumen-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:14px;
}

.credito-resumen-card{
  padding:18px 18px 16px;
}

.credito-resumen-card .mini-label{
  font-size:13px;
  color:var(--muted);
  margin-bottom:6px;
}

.credito-resumen-card .mini-value{
  font-size:19px;
  font-weight:800;
  line-height:1.2;
  margin-bottom:12px;
}

.credito-resumen-card .mini-divider{
  height:1px;
  background:rgba(255,255,255,.08);
  margin:10px 0 12px;
}

.credito-resumen-card .mini-value-alt{
  font-size:28px;
  font-weight:900;
  line-height:1.15;
}

.credito-resumen-card .muted-line{
  margin-top:8px;
  font-size:13px;
  color:var(--muted);
}

.credito-resumen-card.resumen-monto{
  background:linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.015));
}

.credito-resumen-card.resumen-abonado{
  border-color: rgba(25, 135, 84, .28);
  background: rgba(25, 135, 84, .05);
}

.credito-resumen-card.resumen-saldo{
  border-color: rgba(13, 110, 253, .25);
  background: rgba(13, 110, 253, .05);
}

@media (max-width: 980px){
  .credito-resumen-grid{
    grid-template-columns: 1fr;
  }
}


.mora-kpis{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:14px;
}

.kpi.danger{
  border:1px solid rgba(220,53,69,.3);
  background:rgba(220,53,69,.05);
}

.kpi.warn{
  border:1px solid rgba(255,193,7,.3);
  background:rgba(255,193,7,.05);
}

.kpi.info{
  border:1px solid rgba(13,202,240,.3);
  background:rgba(13,202,240,.05);
}

@media(max-width:900px){
  .mora-kpis{
    grid-template-columns: repeat(2,1fr);
  }
}

@media(max-width:500px){
  .mora-kpis{
    grid-template-columns: 1fr;
  }
}

.mora-toolbar{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.mora-toolbar-left{
  flex:1 1 260px;
}

.mora-toolbar-form{
  flex:1 1 520px;
  display:grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap:12px;
  align-items:end;
}

.mora-toolbar-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.mora-toolbar .input{
  width:100%;
}

.mora-kpis{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:14px;
}

.mora-kpi-card{
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 18px 16px;
  min-height: 110px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.mora-kpi-card .label{
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.mora-kpi-card .value{
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.mora-kpi-card.danger{
  border-color: rgba(220, 53, 69, .35);
  background: rgba(220, 53, 69, .06);
}

.mora-kpi-card.warn{
  border-color: rgba(255, 193, 7, .35);
  background: rgba(255, 193, 7, .06);
}

.mora-kpi-card.info{
  border-color: rgba(13, 202, 240, .28);
  background: rgba(13, 202, 240, .05);
}

.mora-kpi-card.ok{
  border-color: rgba(25, 135, 84, .35);
  background: rgba(25, 135, 84, .06);
}

@media (max-width: 1100px){
  .mora-kpis{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px){
  .mora-toolbar-form{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px){
  .mora-kpis{
    grid-template-columns: 1fr;
  }
}

.imperio-swal-popup {
  border: 1px solid rgba(212, 160, 23, 0.25);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.imperio-swal-title {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.imperio-swal-text {
  font-size: 15px;
  line-height: 1.6;
  color: #cbd5e1;
}

.imperio-swal-confirm,
.imperio-swal-cancel {
  border-radius: 12px !important;
  padding: 10px 18px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.swal2-icon.swal2-question,
.swal2-icon.swal2-warning {
  border-color: #d4a017 !important;
  color: #d4a017 !important;
}

.btn.warning {
  border: 1px solid #d4a017;
  color: #fbbf24;
  background: transparent;
}

.imperio-swal-popup {
  border: 1px solid rgba(212, 160, 23, 0.25);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.imperio-swal-title {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.imperio-swal-text {
  font-size: 15px;
  line-height: 1.6;
  color: #cbd5e1;
}

.imperio-swal-confirm,
.imperio-swal-cancel {
  border-radius: 12px !important;
  padding: 10px 18px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.swal2-icon.swal2-question,
.swal2-icon.swal2-warning,
.swal2-icon.swal2-success {
  border-color: #d4a017 !important;
  color: #d4a017 !important;
}

.btn.warning {
  border: 1px solid #d4a017;
  color: #fbbf24;
  background: transparent;
}


.page-card,
.table-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  padding: 20px;
  margin-bottom: 18px;
}

.page-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.section-subtitle {
  margin: 6px 0 0;
  color: #64748b;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.field label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #334155;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #fff;
}

.field-check {
  display: flex;
  align-items: end;
}

.actions-inline,
.actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  background: #0f172a;
  color: #fff;
}

.btn-dark {
  background: #1e293b;
  color: #fff;
}

.btn-light {
  background: #e2e8f0;
  color: #0f172a;
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.kpi-label {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
}

.table-responsive {
  overflow-x: auto;
}

.table-reportes {
  width: 100%;
  border-collapse: collapse;
}

.table-reportes th,
.table-reportes td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.table-reportes th {
  background: #0f172a;
  color: #fff;
  font-size: 0.92rem;
  text-align: left;
}

.text-center {
  text-align: center;
}

.section-card {
  background: rgba(10, 27, 63, 0.92);
  border: 1px solid rgba(90, 125, 190, 0.18);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.section-header-flex,
.table-header-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title,
.block-title {
  margin: 0 0 6px 0;
  color: #f3f6ff;
  font-weight: 800;
}

.section-subtitle,
.block-subtitle {
  margin: 0;
  color: #a9b9df;
}

.section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-grid-reportes {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #dce7ff;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(140, 170, 230, 0.22);
  background: rgba(3, 16, 41, 0.72);
  color: #fff;
}

.form-check-line {
  display: flex;
  align-items: end;
}

.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: #dce7ff;
}

.form-actions-inline {
  display: flex;
  align-items: end;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: #1d3769;
  color: #fff;
}

.btn-primary:hover {
  background: #274886;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.kpi-grid-reportes {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.kpi-box {
  border-radius: 18px;
  padding: 16px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-label {
  display: block;
  color: #c7d7ff;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.kpi-value {
  color: #fff;
  font-size: 1.85rem;
  font-weight: 800;
}

.kpi-neutral { border: 1px solid rgba(145, 160, 210, 0.32); background: rgba(35, 40, 82, 0.55); }
.kpi-gold    { border: 1px solid rgba(217, 175, 58, 0.55); background: rgba(52, 48, 34, 0.45); }
.kpi-blue    { border: 1px solid rgba(23, 156, 214, 0.45); background: rgba(13, 52, 86, 0.45); }
.kpi-red     { border: 1px solid rgba(204, 67, 67, 0.45); background: rgba(79, 26, 26, 0.42); }
.kpi-green   { border: 1px solid rgba(18, 145, 102, 0.42); background: rgba(17, 61, 49, 0.42); }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 14px;
}

.imperio-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}

.imperio-table thead th {
  text-align: left;
  padding: 14px 12px;
  color: #a9c0ff;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(140, 170, 230, 0.16);
}

.imperio-table tbody td {
  padding: 14px 12px;
  color: #f3f6ff;
  border-bottom: 1px solid rgba(140, 170, 230, 0.10);
  vertical-align: middle;
}

.imperio-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.pagination-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(140, 170, 230, 0.18);
}

.page-btn.active,
.page-btn:hover {
  background: #1d3769;
  border-color: #2d58a6;
}

.text-center {
  text-align: center;
}

@media (max-width: 1200px) {
  .form-grid-reportes,
  .kpi-grid-reportes {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .form-grid-reportes,
  .kpi-grid-reportes {
    grid-template-columns: 1fr;
  }
}


.form-grid-reportes .form-check-line {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-top: 28px;
}

.form-grid-reportes .check-inline-reportes {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #dce7ff;
  font-weight: 600;
  cursor: pointer;
}

.form-grid-reportes .check-inline-reportes input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 6px;
  border: 2px solid rgba(140, 170, 230, 0.45);
  background: rgba(3, 16, 41, 0.92);
  display: inline-block;
  position: relative;
  flex: 0 0 20px;
  cursor: pointer;
  vertical-align: middle;
}

.form-grid-reportes .check-inline-reportes input[type="checkbox"]:checked {
  background: #1d3769;
  border-color: #5f8fff;
}

.form-grid-reportes .check-inline-reportes input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-grid-reportes .check-inline-reportes span {
  line-height: 1.2;
  display: inline-block;
}

