:root{
  --color-primary:#E60000;
  --color-primary-hover:#C50000;

  /* fondo negro profundo */
  --color-bg:#050505;

  /* cards/header/sidebar */
  --color-surface:#1A1A1A;
  --color-surface-2:#242424;

  /* textos */
  --color-text:#FFFFFF;
  --color-text-light:#A1A1AA;

  /* bordes */
  --color-border:rgba(255,255,255,.04);

  --color-success:#16A34A;
  --color-danger:#DC2626;

  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:18px;

  --sidebar-width:240px;
  --header-height:52px;

  --shadow-sm:0 8px 20px rgba(0,0,0,.25);
  --shadow-md:0 18px 40px rgba(0,0,0,.35);
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  background:var(--color-bg);
  color:var(--color-text);
  font-family:Inter,system-ui,sans-serif;
}

/* LAYOUT */

.layout{
  display:flex;
  min-height:100vh;
}

/* HEADER */

.main-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:var(--header-height);
  background:var(--color-surface);
  border-bottom:1px solid var(--color-border);
  z-index:1200;
}

.header-inner{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:8px;
}

.logo{
  width:36px !important;
  height:36px !important;
  object-fit:contain;
  flex-shrink:0;
  margin-left:12px;
}

/* NAV */

.nav{
  display:flex;
  align-items:center;
  gap:12px;
}

.nav-link{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:10px;
  color:var(--color-text);
  transition:.2s;
}

.nav-link:hover{
  background:rgba(230,0,0,.08);
}

/* HELPERS */

.desktop-only{
  display:flex;
}

.mobile-only{
  display:none;
}

/* AVATAR */

.nav-avatar-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  position:relative;
}

.nav-avatar-btn{
  width:34px;
  height:34px;
  border:none;
  border-radius:50%;
  overflow:hidden;
  background:transparent;
  cursor:pointer;
}

.nav-avatar-btn img{
  width:34px;
  height:34px;
  object-fit:cover;
  border-radius:50%;
}

/* SIDEBAR */

.sidebar{
  position:fixed;
  top:var(--header-height);
  left:0;
  width:var(--sidebar-width);
  height:calc(100vh - var(--header-height));
  background:var(--color-surface);
  padding:14px 14px 20px;
  border-right:1px solid var(--color-border);
  z-index:1000;
}

.sidebar-menu{
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* MENU LINKS */

.sidebar-link{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px 16px;
  border-radius:14px;
  color:var(--color-text);
  transition:.2s ease;
}

.sidebar-link i{
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--color-primary);
}

.sidebar-link:hover{
  background:rgba(230,0,0,.08);
}

.sidebar-link.active{
  background:var(--color-primary);
  color:#ffffff;
}

.sidebar-link.active i{
  color:#ffffff;
}

/* CONTENT */

.content{
  margin-left:var(--sidebar-width);
  width:calc(100% - var(--sidebar-width));
  min-height:100vh;
  padding-top:calc(var(--header-height) + 24px);
  padding-right:24px;
  padding-bottom:24px;
  padding-left:24px;
}

/* CARDS */

.card,
.panel,
.kpi-card{
  background:var(--color-surface);
  border:1px solid var(--color-border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
}
.kpi-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.kpi-card .kpi-icon{
  order:2;
  margin-left:auto;
  flex-shrink:0;
}

.kpi-card .kpi-content{
  order:1;
  flex:1;
}

.kpi-card .kpi-content h2,
.kpi-card .kpi-content h3{
  margin:0 0 6px;
}

/* MOBILE BUTTON */

.hamburger{
  width:48px;
  height:48px;
  border:none;
  background:transparent;
  display:none;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#ffffff;
}

.hamburger svg{
  stroke:#ffffff;
}

/* PROFILE MENU */

.nav-avatar-menu{
  position:absolute;
  top:45px;
  right:0;
  min-width:180px;
  background:var(--color-surface);
  border:1px solid var(--color-border);
  border-radius:12px;
  box-shadow:var(--shadow-sm);
  display:none;
  overflow:hidden;
}

.nav-avatar-menu.open{
  display:block;
}

.nav-avatar-menu a{
  display:block;
  padding:12px 14px;
  color:var(--color-text);
}

.nav-avatar-menu a:hover{
  background:var(--color-surface-2);
}

/* BUTTONS */

.btn{
  padding:10px 16px;
  border:none;
  border-radius:10px;
  cursor:pointer;
}

.btn-primary{
  background:var(--color-primary);
  color:#fff;
}

.btn-outline{
  border:1px solid var(--color-border);
  background:var(--color-surface);
  color:var(--color-text);
}

/* INPUTS */

input,
select,
textarea{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--color-border);
  background:var(--color-surface-2);
  color:var(--color-text);
}

/* TABLAS */

.tabla-wrap{
  width:100%;
  overflow-x:auto;
  margin-top:16px;
}

.tabla{
  width:100%;
  border-collapse:collapse;
  min-width:700px;
}

.tabla thead th{
  text-align:left;
  padding:14px 12px;
  font-size:14px;
  font-weight:700;
  color:var(--color-text-light);
  border-bottom:1px solid var(--color-border);
}


.tabla tbody td{
  padding:14px 12px;
  border-bottom:1px solid var(--color-border);
  color:var(--color-text);
}

.tabla tbody tr{
  transition:.2s ease;
}

.tabla tbody tr:hover{
  background:rgba(255,255,255,.03);
}

/* MOBILE */

@media (max-width:768px){

  .content{
    margin-left:0;
    width:100%;
    padding-left:16px;
    padding-right:16px;
  }

  .sidebar{
    left:-240px;
    transition:.3s;
  }

  body.sidebar-open .sidebar{
    left:0;
  }

  .desktop-only{
    display:none !important;
  }

  .mobile-only{
    display:flex !important;
  }

  .hide-sm{
    display:none;
  }
}
/* =========================
   AUTH / LOGIN
========================= */

.login-wrapper{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--color-bg);
  padding:20px;
}

.login-card{
  width:100%;
  max-width:380px;
  background:var(--color-surface);
  border:1px solid var(--color-border);
  border-radius:var(--radius-lg);
  padding:24px;
  box-shadow:var(--shadow-md);
}

.auth-head{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  margin-bottom:20px;
}

.auth-logo{
  width:90px;
  height:auto;
  object-fit:contain;
  margin-bottom:12px;
}

.auth-title{
  font-size:24px;
  font-weight:800;
  margin-bottom:8px;
}

.muted{
  color:var(--color-text-light);
}

label{
  display:block;
  margin-bottom:8px;
  font-size:14px;
  font-weight:600;
}

.field{
  position:relative;
  margin-bottom:14px;
}

.eye-btn{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  border:none;
  background:transparent;
  color:var(--color-text-light);
  cursor:pointer;
}

.eye-btn:hover{
  color:#ffffff;
}

.actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:14px;
}

.link{
  color:var(--color-primary);
  text-decoration:none;
  cursor:pointer;
}

.link:hover{
  text-decoration:underline;
}

.error{
  color:#ff6b6b;
  margin-top:12px;
}

.auth-footer{
  margin-top:16px;
  font-size:14px;
}

.auth-footer a{
  color:var(--color-primary);
  text-decoration:none;
}

.auth-footer a:hover{
  text-decoration:underline;
}

/* spacing auth */

#btnLogin,
#btnForgot,
#btnReset{
  width:100%;
  margin-top:10px;
}

#msgForgot,
#msgReset,
#errForgot,
#errReset,
#errLogin{
  margin-top:10px;
}

#view-forgot p,
#view-reset p{
  text-align:center;
}

/* mobile auth */

@media (max-width:640px){

  .login-card{
    max-width:340px;
    padding:18px;
  }

  .auth-logo{
    width:80px;
  }

  .auth-title{
    font-size:20px;
  }
}
.progress{
  width:100%;
  height:10px;
  background:#2F2F2F;
  border-radius:999px;
  overflow:hidden;
  margin:14px 0;
}

.progress-bar{
  display:block;
  height:100%;
  min-width:8px;
  background:var(--color-success);
  border-radius:999px;
  transition:width .3s ease;
}

.status-success{
  color:var(--color-success);
}

.status-warning{
  color:#f59e0b;
}

.status-info{
  color:#3b82f6;
}

/* REPORTES */

.row{
  display:flex;
  gap:14px;
}

.row .field{
  flex:1;
}

.lbl{
  display:block;
  font-size:13px;
  color:var(--color-text-light);
  margin-bottom:6px;
}

.checks{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}

.checks label{
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  font-size:14px;
}

.checks input[type="checkbox"]{
  width:auto;
}

@media(max-width:600px){
  .row{
    flex-direction:column;
  }

  .checks{
    grid-template-columns:1fr;
  }
}

.status-danger{
  color:var(--color-danger);
}
.form-grid-4{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}

.combo-item{
  background:var(--color-surface-2);
  border:1px solid var(--color-border);
  border-radius:12px;
  padding:14px;
  margin-top:14px;
}

.combo-actions{
  display:flex;
  gap:14px;
  margin-top:20px;
}

.calc-box{
  display:flex;
  gap:20px;
  margin:20px 0;
  font-size:14px;
}

@media(max-width:768px){
  .form-grid-4{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width:600px){
  .form-grid-4{
    grid-template-columns:1fr;
  }

  .combo-actions{
    flex-direction:column;
  }

  .calc-box{
    flex-direction:column;
    gap:10px;
  }
}
.actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:20px;
}

.inline{
  display:flex;
  gap:10px;
  align-items:center;
}

.inline > *{
  flex:1;
}

.hint{
  font-size:12px;
  color:var(--color-text-light);
  margin-top:6px;
}

.preview{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin-top:16px;
}

.preview > div{
  background:var(--color-surface-2);
  padding:10px 14px;
  border-radius:10px;
}

.modal{
  position:fixed;
  inset:0;
  display:none;
  place-items:center;
  background:rgba(0,0,0,.60);
  z-index:9999;
}

.modal.open{
  display:grid;
}

.modal__card{
  width:min(520px,92vw);
  background:var(--color-surface);
  border:1px solid var(--color-border);
  border-radius:14px;
  padding:18px;
}

.modal__title{
  font-size:18px;
  font-weight:800;
  margin-bottom:8px;
}

.modal__msg{
  margin-bottom:14px;
}

.modal__actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
/* QUITAR SUBRAYADO GLOBAL */
a{
  text-decoration:none !important;
  color:inherit;
}

/* BOTONES COMO LINKS */
a.btn,
a.btn:hover,
a.btn:focus,
a.btn:active{
  text-decoration:none !important;
}

/* LINKS DEL SIDEBAR */
.sidebar a{
  text-decoration:none !important;
}

/* LINKS DEL HEADER */
.main-header a{
  text-decoration:none !important;
}

/* LINKS DE TABLAS / ACCIONES */
.tabla a{
  text-decoration:none !important;
}
#network-bg{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  z-index:0;
  pointer-events:none;
}

.login-card{
  position:relative;
  z-index:2;
}
.site-footer{
  width:100%;
  margin-top:40px;
  padding:20px 0;
  border-top:1px solid rgba(255,255,255,.06);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  flex-wrap:wrap;
  font-size:14px;
  color:#a1a1aa;
}

.footer-left{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  line-height:1.8;
}

.footer-left strong{
  color:#fff;
}

.footer-sep{
  opacity:.4;
}

.footer-right{
  display:flex;
  align-items:center;
  gap:14px;
  margin-left:auto;
}

.footer-right a{
  display:flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border-radius:14px;
  background:rgba(255,255,255,.04);
  transition:.2s ease;
}

.footer-right a:hover{
  transform:translateY(-2px);
}

/* MOBILE */
@media(max-width:768px){

  .site-footer{
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:24px 10px;
    gap:18px;
  }

  .footer-left{
    justify-content:center;
    width:100%;
    text-align:center;
  }

  .footer-right{
    margin-left:0;
    justify-content:center;
    width:100%;
  }

  .footer-sep{
    display:none;
  }
}

html,
body{
  height:100%;
  min-height:100%;
}

body{
  min-height:100vh;
}

.layout{
  min-height:calc(100vh - var(--header-height));
  display:flex;
}

.content{
  flex:1;
}

.site-footer{
  width:100%;
  margin-top:40px;
  padding:20px 0;
  border-top:1px solid rgba(255,255,255,.06);
}

/* wrapper para sticky footer limpio */
.page-wrap{
  min-height:calc(100vh - var(--header-height));
  display:flex;
  flex-direction:column;
}

.page-content{
  flex:1;
}