:root{
  --rz-bg:#f5f6f8;
  --rz-card:#ffffff;
  --rz-text:#1f2937;
  --rz-muted:#6b7280;
  --rz-border:rgba(0,0,0,.08);
  --rz-shadow:0 2px 10px rgba(0,0,0,.06);
  --rz-radius:16px;
}

html,body{height:100%}
body{
  font-family:"Poppins",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--rz-bg);
  color:var(--rz-text);
}

@media (max-width: 991.98px){
  html,body,.rz-main{
    overflow-x:hidden;
    max-width:100%;
  }
  .rz-page{
    max-width:100%;
    box-sizing:border-box;
  }
}

.rz-card{
  border:none;
  border-radius:var(--rz-radius);
  background:var(--rz-card);
  box-shadow:var(--rz-shadow);
}
.rz-muted{color:var(--rz-muted)}
.rz-btn{border-radius:14px;font-weight:600;padding:.75rem 1rem}
.rz-page{
  max-width:1400px;
  margin:0 auto;
  padding:0 16px;
}
@media (min-width: 992px){
  .rz-page{padding:0 20px}
}

.rz-feature-icon{
  width:48px;
  height:48px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 48px;
  border-radius:16px;
  background:rgba(13,110,253,.1);
  color:#0d6efd;
  font-size:1.2rem;
}

.rz-sidebar{min-height:100vh;border-right:1px solid var(--rz-border);background:#fff}
.rz-sidehead{padding:16px 16px 8px;display:flex;align-items:center;gap:10px}
.rz-logo{
  width:38px;
  height:38px;
  border-radius:12px;
  object-fit:contain;
  background:#fff;
  border:1px solid var(--rz-border);
  padding:6px;
}
.rz-brand{font-weight:700}

.rz-topbar{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  padding:10px 16px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:nowrap;
}
@media (max-width: 991.98px){
  .rz-topbar{flex-wrap:wrap}
}
.rz-mobile-toggle{border-radius:12px;padding:10px 12px}

.rz-topnav .rz-nav-link{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  font-size:.9em;
  color:var(--rz-text);
  text-decoration:none;
  white-space:nowrap;
}
.rz-topnav .rz-nav-link:hover{background:rgba(13,110,253,.06)}
.rz-topnav .rz-nav-link.active{background:rgba(13,110,253,.10);color:#0b5ed7}

.rz-topbar-user{
  color:var(--rz-muted);
  font-size:.85rem;
}
.rz-topbar-user:hover{
  color:#0d6efd;
}
.rz-user-menu .dropdown-item{
  display:flex;
  align-items:center;
  gap:10px;
}

.rz-nav-dropdown-toggle{
  border:0;
  background:transparent;
  font:inherit;
}
.rz-nav-chevron{
  font-size:.72rem;
  margin-left:auto;
}
.rz-topnav .rz-nav-dropdown{
  display:inline-flex;
}
.rz-topnav .rz-nav-dropdown-menu{
  min-width:220px;
}
.rz-nav-dropdown-menu .dropdown-item{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:.9em;
}

.rz-nav .rz-nav-link{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  margin:4px 10px;
  border-radius:12px;
  font-size:.9em;
  color:var(--rz-text);
  text-decoration:none;
}
.rz-nav .rz-nav-link:hover{background:rgba(13,110,253,.06)}
.rz-nav .rz-nav-link.active{background:rgba(13,110,253,.10);color:#0b5ed7}
.rz-nav .rz-nav-dropdown-toggle{
  width:calc(100% - 20px);
  text-align:left;
}
.rz-nav .rz-nav-dropdown-menu{
  position:static !important;
  transform:none !important;
  width:calc(100% - 20px);
  margin:0 10px 4px;
  border-radius:12px;
}

.btn-primary{
  background-color:#0d6efd;
  border-color:#0d6efd;
}
.btn-outline-primary{
  border-color:#0d6efd;
  color:#0d6efd;
}
.btn-outline-primary:hover{
  background-color:#0d6efd;
  border-color:#0d6efd;
  color:#fff;
}

.dataTables_wrapper{
  width:100%;
  font-family:"Inter","Poppins",system-ui,-apple-system,sans-serif;
}
table.dataTable{
  width:100% !important;
  font-size:.8rem;
  color:#212529;
}
table.dataTable thead th{
  font-weight:600;
  font-size:.8rem;
  text-transform:uppercase;
  white-space:nowrap;
}
table.dataTable tbody td{
  font-weight:300;
  white-space:nowrap;
  vertical-align:middle;
  border-top-color:#edf0f4;
}
table.dataTable tbody tr{border-bottom-color:#edf0f4}

table.dataTable.rz-table-compact thead th,
table.dataTable.rz-table-compact tbody td{
  padding:.35rem .45rem;
}

table.dataTable.rz-table-compact th.no-sort,
table.dataTable.rz-table-compact td.actions{
  width:1%;
}

.rz-mobile-subline{
  margin-top:2px;
  color:#6c757d;
  font-size:.68rem;
  line-height:1.15;
}

.rz-catalogo-header .rz-logo{
  width:auto;
  height:64px;
  max-height:64px;
}

.rz-catalogo-header-text{
  flex:1;
  min-width:0;
}

@media (max-width: 767.98px){
  table.dataTable.rz-table-compact{
    table-layout:fixed;
    font-size:.72rem;
    min-width:0 !important;
    width:100% !important;
  }
  table.dataTable.rz-table-compact thead th,
  table.dataTable.rz-table-compact tbody td{
    padding:.28rem .18rem;
  }
  table.dataTable.rz-table-compact td.actions .btn{
    min-width:28px;
    padding:.22rem .3rem;
  }
  table.dataTable.rz-table-compact td.actions .btn-masinfo{
    font-size:0;
  }
  table.dataTable.rz-table-compact td.actions .btn-masinfo i{
    margin-right:0 !important;
    font-size:.8rem;
  }
  table.dataTable.rz-table-compact tbody td{
    overflow-wrap:anywhere;
  }

  #tablaPropio thead th:nth-child(n+4):nth-child(-n+9),
  #tablaPropio tbody td:nth-child(n+4):nth-child(-n+9),
  #tablaTerceros thead th:nth-child(n+3):nth-child(-n+7),
  #tablaTerceros tbody td:nth-child(n+3):nth-child(-n+7),
  #tablaClientes thead th:nth-child(9),
  #tablaClientes tbody td:nth-child(9),
  #tablaClientes thead th:nth-child(10),
  #tablaClientes tbody td:nth-child(10),
  #tablaMandantes thead th:nth-child(3),
  #tablaMandantes tbody td:nth-child(3),
  #tablaMandantes thead th:nth-child(8),
  #tablaMandantes tbody td:nth-child(8),
  #tablaMandantes thead th:nth-child(9),
  #tablaMandantes tbody td:nth-child(9),
  #tablaOrigenes thead th:nth-child(6),
  #tablaOrigenes tbody td:nth-child(6),
  #tablaNomenclaturas thead th:nth-child(3),
  #tablaNomenclaturas tbody td:nth-child(3),
  #tablaNomenclaturas thead th:nth-child(4),
  #tablaNomenclaturas tbody td:nth-child(4),
  #tablaAreasAcopio thead th:nth-child(3),
  #tablaAreasAcopio tbody td:nth-child(3),
  #tablaAreasAcopio thead th:nth-child(4),
  #tablaAreasAcopio tbody td:nth-child(4){
    display:none;
  }

  #tablaFichaProductos .ficha-mobile-hide{
    display:none !important;
  }
  #tablaFichaProductos .ficha-stock-col,
  #tablaFichaProductos .ficha-action-col{
    display:table-cell !important;
  }

  #tablaFichaProductos thead th:nth-child(1),
  #tablaFichaProductos tbody td:nth-child(1){
    width:54%;
    white-space:normal;
  }
  #tablaFichaProductos .ficha-stock-col{
    width:18%;
    white-space:nowrap;
  }
  #tablaFichaProductos .ficha-action-col{
    width:28%;
    white-space:nowrap;
  }
  #tablaFichaProductos .badge{
    padding:.35em .45em;
  }

  #tablaCatalogoProductos .catalogo-mobile-hide{
    display:none !important;
  }
  #tablaCatalogoProductos .catalogo-stock-col,
  #tablaCatalogoProductos .catalogo-neto-col{
    display:table-cell !important;
  }

  #tablaCatalogoProductos thead th:nth-child(1),
  #tablaCatalogoProductos tbody td:nth-child(1){
    width:54%;
    white-space:normal;
  }
  #tablaCatalogoProductos .catalogo-stock-col{
    width:18%;
    white-space:nowrap;
  }
  #tablaCatalogoProductos .catalogo-neto-col{
    width:28%;
    white-space:nowrap;
  }
  #tablaCatalogoProductos .badge{
    padding:.35em .45em;
  }

  #tablaPropio thead th:nth-child(1),
  #tablaPropio tbody td:nth-child(1),
  #tablaTerceros thead th:nth-child(1),
  #tablaTerceros tbody td:nth-child(1){
    width:34%;
  }
  #tablaPropio thead th:nth-child(3),
  #tablaPropio tbody td:nth-child(3),
  #tablaTerceros thead th:nth-child(2),
  #tablaTerceros tbody td:nth-child(2){
    width:34%;
  }
  #tablaPropio thead th:nth-child(10),
  #tablaPropio tbody td:nth-child(10),
  #tablaTerceros thead th:nth-child(8),
  #tablaTerceros tbody td:nth-child(8){
    width:12%;
  }
  #tablaPropio thead th:nth-child(11),
  #tablaPropio tbody td:nth-child(11),
  #tablaTerceros thead th:nth-child(9),
  #tablaTerceros tbody td:nth-child(9){
    width:20%;
  }

  #tablaClientes thead th:nth-child(1),
  #tablaClientes tbody td:nth-child(1),
  #tablaMandantes thead th:nth-child(1),
  #tablaMandantes tbody td:nth-child(1){
    width:32%;
  }
  #tablaClientes thead th:nth-child(2),
  #tablaClientes tbody td:nth-child(2),
  #tablaMandantes thead th:nth-child(2),
  #tablaMandantes tbody td:nth-child(2){
    width:52%;
  }
  #tablaClientes thead th:nth-child(11),
  #tablaClientes tbody td:nth-child(11),
  #tablaMandantes thead th:nth-child(10),
  #tablaMandantes tbody td:nth-child(10){
    width:16%;
  }

  #tablaOrigenes thead th:nth-child(1),
  #tablaOrigenes tbody td:nth-child(1){
    width:62%;
  }
  #tablaOrigenes thead th:nth-child(5),
  #tablaOrigenes tbody td:nth-child(5){
    width:18%;
  }
  #tablaOrigenes thead th:nth-child(7),
  #tablaOrigenes tbody td:nth-child(7){
    width:20%;
  }

  #tablaNomenclaturas thead th:nth-child(1),
  #tablaNomenclaturas tbody td:nth-child(1),
  #tablaAreasAcopio thead th:nth-child(1),
  #tablaAreasAcopio tbody td:nth-child(1){
    width:30%;
  }
  #tablaNomenclaturas thead th:nth-child(2),
  #tablaNomenclaturas tbody td:nth-child(2),
  #tablaAreasAcopio thead th:nth-child(2),
  #tablaAreasAcopio tbody td:nth-child(2){
    width:54%;
  }
  #tablaNomenclaturas thead th:nth-child(5),
  #tablaNomenclaturas tbody td:nth-child(5),
  #tablaAreasAcopio thead th:nth-child(5),
  #tablaAreasAcopio tbody td:nth-child(5){
    width:16%;
  }
}

thead .filters th{
  padding:4px;
  background-color:#f8f9fa;
}
thead .filters input{
  width:100%;
  font-size:11px;
  padding:3px 5px;
  border-radius:6px;
  border:1px solid #dee2e6;
}

.dataTables_info,
.dataTables_length,
.dataTables_paginate{
  font-size:.8rem;
  color:#6c757d;
}
.dataTables_paginate{
  display:flex;
  align-items:center;
  gap:6px;
}
.dataTables_paginate .paginate_button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:34px;
  font-size:.85rem;
  line-height:1;
  padding:0;
  margin:0 !important;
  border-radius:.45rem;
  border:1px solid #e9ecef;
  background-color:#f8f9fa;
  color:#495057 !important;
  cursor:pointer !important;
  text-decoration:none !important;
  transition:all .15s ease-in-out;
}
.dataTables_paginate .paginate_button.current{
  background-color:#0d6efd;
  color:#fff !important;
  border-color:#0d6efd;
  font-weight:500;
  cursor:default !important;
}
.dataTables_paginate .paginate_button.disabled{display:none !important}
.dataTables_paginate > span{display:flex;gap:6px}

table .badge{
  font-weight:500;
  padding:.45em .65em;
  line-height:1;
  border-radius:.2rem;
}
table .badge.bg-success{
  background-color:#d1e7dd !important;
  color:#0f5132 !important;
}
table .badge.bg-danger{
  background-color:#f8d7da !important;
  color:#842029 !important;
}
table .badge.bg-secondary{
  background-color:#e9ecef !important;
  color:#495057 !important;
}

.btn-masinfo{
  padding:5px 10px;
  font-size:12px;
  border-radius:8px;
}
.item-field{
  background:#f8f9fa;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #e9ecef;
}
.item-label{
  font-size:10px;
  font-weight:600;
  color:#6c757d;
  text-transform:uppercase;
  margin-bottom:3px;
}
.item-value{
  font-size:13px;
  font-weight:500;
  color:#2e3440;
}
.ficha-section{
  padding:16px;
  margin-bottom:16px;
  border:1px solid #e9ecef;
  border-radius:14px;
  background:#fff;
}
.ficha-section h6{
  margin-bottom:14px;
  font-size:.92rem;
  font-weight:700;
  color:#2e3440;
}
.ficha-code-badge{
  padding:.45rem .75rem;
  font-size:1rem;
  letter-spacing:.01em;
}
.ficha-image-picker{
  display:flex;
  flex-direction:column;
  gap:12px;
  width:100%;
  min-height:320px;
  padding:12px;
  overflow:hidden;
  border:1px dashed #ced4da;
  border-radius:14px;
  background:#f8f9fa;
  cursor:pointer;
}
.ficha-image-picker img{
  width:100%;
  height:292px;
  object-fit:contain;
}
.ficha-image-picker span{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(13,110,253,.92);
  color:#fff;
  font-size:.85rem;
  font-weight:500;
}
.ficha-status-badge{
  min-width:84px;
  padding:.65rem .85rem;
  font-size:.95rem;
}
.dt-buttons{
  margin-bottom:10px;
  display:flex;
  justify-content:flex-end;
}
