/* ===========================
   ADMIN DASHBOARD — ZENDY PRO
=========================== */

:root{
  --zendy-black: #020617;
  --zendy-dark: #0b1220;
  --zendy-blue: #0f172a;
  --zendy-green: #22c55e;
  --zendy-green-dark: #16a34a;
  --zendy-light: #0b1220;
  --zendy-text: #e5e7eb;
  --zendy-muted: #94a3b8;
}

/* ================= RESET BOOTSTRAP AZUL ================= */

.bg-primary,
.text-primary,
.btn-primary,
.border-primary{
  background: linear-gradient(135deg,var(--zendy-green),var(--zendy-green-dark)) !important;
  border: none !important;
  color:#fff !important;
}

.btn-primary:hover{
  filter: brightness(1.1);
}

/* ================= BODY ================= */

body{
  background: radial-gradient(circle at top, #0f172a, #020617);
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--zendy-text);
}

/* ================= SIDEBAR ================= */

.sidebar{
  width:260px;
  min-height:100vh;
  background: linear-gradient(180deg,#020617,#020617);
  color: var(--zendy-text);
  position:fixed;
  left:0;
  top:0;
  display:flex;
  flex-direction:column;
  border-right:1px solid rgba(255,255,255,.06);
}

/* BRAND */
.sidebar .brand{
  padding:20px;
  font-size:18px;
  font-weight:700;
  background: linear-gradient(135deg,#020617,#020617);
  border-bottom:1px solid rgba(255,255,255,.08);
}

/* USER BOX */
.sidebar .user-box{
  padding:16px 20px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.sidebar .user-box strong{
  color:#fff;
}

.sidebar .user-box small{
  font-size:12px;
  color: var(--zendy-green);
}

/* LINKS */
.sidebar a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 22px;
  color:#cbd5e1;
  text-decoration:none;
  font-size:14px;
  transition:all .25s ease;
  border-left:3px solid transparent;
}

.sidebar a:hover{
  background: rgba(255,255,255,.05);
  color:#fff;
}

/* ACTIVE */
.sidebar a.active{
  background: linear-gradient(90deg,rgba(34,197,94,.25),transparent);
  color:#fff;
  border-left:3px solid var(--zendy-green);
}

/* LOGOUT */
.sidebar a:last-child{
  margin-top:auto;
  color:#fca5a5;
}

.sidebar a:last-child:hover{
  background:rgba(239,68,68,.15);
}

/* ================= MAIN ================= */

.main{
  margin-left:260px;
  padding:24px;
}

/* ================= TOPBAR ================= */

.topbar{
  background: linear-gradient(135deg,#020617,#0b1220);
  padding:16px 20px;
  border-radius:14px;
  margin-bottom:22px;
  box-shadow:0 10px 30px rgba(0,0,0,.5);
  border:1px solid rgba(255,255,255,.06);
}

/* ================= ERP HEADERS ================= */

.erp-header{
  background: linear-gradient(135deg,#0ea5e9,#2563eb);
  color:#fff;
  padding:16px 20px;
  border-radius:14px;
  font-weight:600;
  margin-bottom:18px;
  box-shadow:0 10px 30px rgba(0,0,0,.4);
}

/* ================= CARDS ================= */

.card{
  border-radius:16px;
  box-shadow:0 12px 40px rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.06);
  background:#020617;
  color:var(--zendy-text);
}

.card-header{
  background: linear-gradient(135deg,#0ea5e9,#2563eb) !important;
  color:#fff !important;
  font-weight:600;
  border-bottom:1px solid rgba(255,255,255,.08);
}

/* ================= ALERTS ================= */

.alert-danger{
  background:rgba(239,68,68,.15);
  border-left:5px solid #ef4444;
  color:#fecaca;
}

/* ================= SEMÁFORO ================= */

.progress{
  background:#020617;
  border-radius:10px;
}

.progress-bar.bg-success{
  background: linear-gradient(135deg,#22c55e,#16a34a) !important;
}

.progress-bar.bg-warning{
  background: linear-gradient(135deg,#facc15,#f59e0b) !important;
}

.progress-bar.bg-danger{
  background: linear-gradient(135deg,#ef4444,#dc2626) !important;
}

/* ================= MINI CARDS ================= */

.erp-card{
  background: linear-gradient(180deg,#020617,#020617);
  border-radius:18px;
  padding:22px;
  box-shadow:0 20px 50px rgba(0,0,0,.55);
  position:relative;
  transition:.25s;
  border:1px solid rgba(255,255,255,.06);
}

.erp-card:hover{
  transform:translateY(-6px);
  box-shadow:0 30px 70px rgba(0,0,0,.7);
}

.erp-card-icon{
  font-size:32px;
  margin-bottom:10px;
  color: var(--zendy-green);
}

.erp-card-body strong{
  font-size:16px;
  color:#f8fafc;
}

.erp-card-body small{
  color:#94a3b8;
}

.erp-card-link{
  position:absolute;
  inset:0;
}

/* ================= TABLES ================= */

.table{
  color:var(--zendy-text);
}

.table thead{
  background:#020617;
  color:#fff;
}

.table tbody tr{
  border-color:rgba(255,255,255,.06);
}

.table-hover tbody tr:hover{
  background:rgba(56,189,248,.08);
}

/* ================= SCROLL ================= */

.sidebar-menu{
  flex:1;
  overflow-y:auto;
  scrollbar-width: thin;
  scrollbar-color: var(--zendy-green) transparent;
}

.sidebar-menu::-webkit-scrollbar{
  width:6px;
}

.sidebar-menu::-webkit-scrollbar-thumb{
  background: var(--zendy-green);
  border-radius:10px;
}

.sidebar-menu::-webkit-scrollbar-track{
  background: transparent;
}

/* ================= SELECCIÓN ================= */

::selection{
  background: var(--zendy-green);
  color:#020617;
}

::-moz-selection{
  background: var(--zendy-green);
  color:#020617;
}

/* Evitar selección en UI */
.sidebar,
.erp-header,
.card,
.progress,
.erp-card{
  user-select:none;
}
/* ===============================
   FIX TABLAS Y CONTENEDORES BLANCOS
=============================== */

/* Contenedor principal */
.erp-wrapper,
.table-responsive {
  background: #020617 !important;
  border-radius: 16px;
}

/* Tabla */
.table {
  background: transparent !important;
  color: #e5e7eb;
}

/* Cabecera */
.table thead,
.table thead th {
  background: #020617 !important;
  color: #ffffff !important;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Filas */
.table tbody tr {
  background: transparent !important;
  border-color: rgba(255,255,255,.06);
}

/* Hover */
.table-hover tbody tr:hover {
  background: rgba(56,189,248,.08) !important;
}

/* Quitar blancos heredados */
.bg-light,
.table-light {
  background: #020617 !important;
  color: #ffffff !important;
}

/* Celdas */
.table td,
.table th {
  background: transparent !important;
  color: #e5e7eb;
}

/* Bordes */
.table-bordered > :not(caption) > * {
  border-color: rgba(255,255,255,.08);
}

/* Estados */
.badge.bg-warning {
  background: linear-gradient(135deg,#facc15,#f59e0b) !important;
  color:#020617 !important;
}

.badge.bg-success {
  background: linear-gradient(135deg,#22c55e,#16a34a) !important;
}

.badge.bg-danger {
  background: linear-gradient(135deg,#ef4444,#dc2626) !important;
}

/* Fila anulada (opcional, elegante) */
.table-danger {
  background: rgba(239,68,68,.15) !important;
}
/* ===============================
   FIX SCROLL GENERAL (NO ROMPE HEADER)
=============================== */

html, body {
  height: 100%;
  overflow: hidden;
}

/* Área principal con scroll */
.main {
  height: 100vh;
  overflow-y: auto;
  padding-bottom: 40px;
}

/* Scroll suave */
.main {
  scroll-behavior: smooth;
}

/* Mantener sidebar fijo */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}
/* ===============================
   SIDEBAR USER ERP
=============================== */
.sidebar-user{
  padding: 25px 15px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-user .avatar{
  width: 90px;
  height: 90px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #1e88e5;
}

.sidebar-user .avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user .user-info strong{
  display:block;
  color:#fff;
  font-size:15px;
}

.sidebar-user .role{
  font-size:12px;
  color:#9ecbff;
}
/* ===============================
   SIDEBAR - HEADER ADMIN (PRO)
=============================== */

.sidebar{
  background: linear-gradient(180deg,#0b1220,#0f172a);
}

.brand{
  font-size: 18px;
  font-weight: 700;
  padding: 18px 20px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* bloque usuario */
.sidebar-user{
  padding: 30px 15px 25px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* avatar grande como ERP */
.sidebar-user .avatar{
  width: 110px;
  height: 110px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  background: #0b1220;
  border: 4px solid #1e88e5;
  box-shadow: 0 0 0 4px rgba(30,136,229,.15);
}

.sidebar-user .avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* nombre */
.sidebar-user .user-info strong{
  display:block;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-top: 6px;
}

/* rol */
.sidebar-user .role{
  display:block;
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: .4px;
  color: #9ecbff;
}

/* menú más separado del header */
.sidebar-menu{
  padding-top: 12px;
}

/* links */
.sidebar-menu a{
  padding: 12px 20px;
  font-size: 14px;
  color: #cfd8ff;
}

.sidebar-menu a.active,
.sidebar-menu a:hover{
  background: linear-gradient(90deg,#1e88e5,#1565c0);
  color:#fff;
  border-radius: 8px;
  margin: 0 8px;
}

/* botón salir */
.logout{
  margin: 15px;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  background:#1a2236;
  color:#ffb4b4;
}

.logout:hover{
  background:#2a344d;
}
.sidebar-menu a.active{
  position: relative;
}

.sidebar-menu a.active::before{
  content:'';
  position:absolute;
  left:0;
  top:8px;
  bottom:8px;
  width:4px;
  background:#22c55e;
  border-radius:0 4px 4px 0;
}
/* ===============================
   TIPOGRAFÍA ERP
=============================== */
body{
  font-family:'Inter','Segoe UI',sans-serif;
}

/* ===============================
   MENÚ SIDEBAR PROFESIONAL
=============================== */
.sidebar-menu a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 20px;
  font-size:14px;
  font-weight:500;
  color:#cfd8e3;
  transition:.15s ease;
}

.sidebar-menu a i{
  width:18px;
  text-align:center;
  font-size:15px;
  color:#b6c2d9;
}

.sidebar-menu a:hover,
.sidebar-menu a.active{
  background:rgba(255,255,255,.06);
  color:#ffffff;
  border-radius:8px;
  margin:0 8px;
}

.sidebar-menu a.active i,
.sidebar-menu a:hover i{
  color:#ffffff;
}

/* ===============================
   USUARIO
=============================== */
.sidebar-user strong{
  font-size:15px;
  font-weight:600;
}

.sidebar-user .role{
  font-size:12px;
  color:#9aa9c4;
}

/* ===============================
   LOGOUT
=============================== */
.logout{
  display:flex;
  align-items:center;
  gap:10px;
  margin:15px;
  padding:10px;
  border-radius:8px;
  color:#ffb4b4;
}

.logout:hover{
  background:#2a344d;
}
/* ===============================
   DASHBOARD CARDS PROFESIONALES (DARK)
=============================== */

.dashboard-container{
  background: radial-gradient(circle at top, #0f172a, #020617) !important;
  padding:30px;
  border-radius:18px;
}

/* GRID */
.dashboard-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap:20px;
}

/* CARD */
.dashboard-card{
  background:#0f172a !important;
  border:1px solid rgba(255,255,255,.12) !important;
  border-radius:14px !important;
  padding:22px 18px !important;
  text-align:center;
  box-shadow:0 6px 20px rgba(0,0,0,.6) !important;
  transition:.2s ease;
  position:relative;
  color:#ffffff !important;
}

/* HOVER */
.dashboard-card:hover{
  transform: translateY(-5px);
  box-shadow:0 12px 30px rgba(0,0,0,.8) !important;
  border-color:#38bdf8 !important;
}

/* ICON */
.dashboard-card i{
  font-size:40px !important;
  color:#38bdf8 !important;
  margin-bottom:12px;
}

/* TITULO */
.dashboard-card strong{
  display:block;
  font-size:15px !important;
  font-weight:600;
  color:#ffffff !important;
}

/* SUBTITULO */
.dashboard-card small{
  display:block;
  font-size:12px;
  color:#cbd5e1 !important;
  margin-top:4px;
}

/* LINK ocupa toda la card */
.dashboard-card a{
  position:absolute;
  inset:0;
}
/* ===== COLORES HOVER SEGÚN ESTADO ===== */

.erp-table tbody tr.row-pagado:hover {
  background-color: #198754 !important; /* verde bootstrap */
  color: #fff;
}

.erp-table tbody tr.row-pendiente:hover {
  background-color: #ffc107 !important; /* amarillo */
  color: #000;
}

.erp-table tbody tr.row-anulado:hover {
  background-color: #dc3545 !important; /* rojo */
  color: #fff;
}

/* Que los textos y badges no se vean feos */
.erp-table tbody tr:hover td {
  transition: background-color 0.2s ease;
}
/* ===== HOVER FACTURAS POR ESTADO ===== */

.erp-table tbody tr.row-pagado:hover {
  background-color: #198754 !important; /* verde */
  color: #fff;
}

.erp-table tbody tr.row-pendiente:hover {
  background-color: #ffc107 !important; /* amarillo */
  color: #000;
}

.erp-table tbody tr.row-vencido:hover {
  background-color: #dc3545 !important; /* rojo */
  color: #fff;
}

.erp-table tbody tr:hover td {
  transition: background-color 0.2s ease;
}

