/* =========================
   Signal UI – Base
   ========================= */

:root {
  --font-base: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reset suave */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-base);
  font-size: 14px;
  line-height: 1.45;
  color: #2a2a2a;
  background: #f2f2f2;
}

/* =========================
   INDEX / PANTALLAS SIMPLES
   ========================= */

.wrap {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 16px 30px;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

/* Header meta */
.top-right {
  position: absolute;
  top: -22px;
  right: 0;
  font-size: 13px;
  color: #777;
}

.top-right a {
  color: #777;
  text-decoration: none;
  margin-left: 6px;
}

.top-right a:hover {
  color: #000;
  text-decoration: underline;
}

/* Panel */
.panel {
  background: #fff;
  padding: 24px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Header */
.header {
  margin-bottom: 24px;
}

.logo {
  max-width: 140px;
}

/* Typography */
h1 {
  font-size: 22px;
  margin: 0 0 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* Cards */
.card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 16px;
  background: #fafafa;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: #777;
}

.card a {
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  font-size: 14px;
  color: #2a2a2a;
  text-decoration: none;
}

.card a:hover {
  color: #000;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .top-right {
    top: -18px;
    font-size: 12px;
  }
}

/* =========================
   LOGIN
   ========================= */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 320px;
  background: #fff;
  padding: 24px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.login-box .logo {
  display: block;
  max-width: 150px;
  margin: 0 auto 20px auto;
}

/* Forms */
.field {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-family: var(--font-base);
  border: 1px solid #ccc;
  border-radius: 4px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #999;
}

/* Buttons */
button {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background: #000;
}

.error {
  background: #ffecec;
  color: #b00020;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}

/* =========================
   APP (ORDERS_NEW)
   ========================= */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header fijo */
.app-header {
  position: sticky;
  top: 0;
  height: 110px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  z-index: 100;
}

.app-header-inner {
  max-width: 900px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-header .logo {
  height: 80px;
}

.header-right {
  font-size: 13px;
  color: #777;
  white-space: nowrap;
}

.header-right a {
  color: #777;
  text-decoration: none;
  margin-left: 6px;
}

.header-right a:hover {
  color: #000;
  text-decoration: underline;
}

/* Badge de rol/superadmin/técnico en header (solo visual) */
.role-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 4px;
  background: #e8e8e8;
  color: #555;
  font-weight: 500;
}

.top-right .role-badge {
  margin-left: 4px;
}

/* Contenido con scroll */
.app-content {
  flex: 1;
  overflow-y: auto;
  background: #f2f2f2;
  padding: 24px 0;
}

/* =========================
   Formularios / tablas
   ========================= */

.panel-form {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.form-section {
  margin-bottom: 26px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.form-section:first-child {
  border-top: none;
  padding-top: 0;
}

.form-section h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 8px;
  border-bottom: 1px solid #ddd;
  font-size: 13px;
}

.table th {
  font-weight: 600;
  background: #f7f7f7;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #666;
}

.table tr:hover {
  background: #fafafa;
}

.table td[data-label="Cantidad"] input.qty {
  width: 80px;
  text-align: center;
}


/* =========================
   Responsive – Orders table
   ========================= */

@media (max-width: 768px) {

  /* Header */
  .app-header {
    height: 80px;
  }

  .app-header .logo {
    height: 48px;
  }

  /* Tabla → cards */
  .table {
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr {
    display: block;
    width: 100%;
  }

  .table tr {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px;
  }

  .table td {
    display: block;
    border: none;
    padding: 8px 0;
  }

  .table td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .table input,
  .table select {
    width: 100%;
  }

}







.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge.OK { background:#e6f6ea; color:#0a0; }
.badge.PENDIENTE { background:#fff3e0; color:#b60; }
.badge.RECHAZADO { background:#ffecec; color:#b00; }

/* =========================
   Order detail - Mobile cards polish
   (no afecta orders_new)
   ========================= */
@media (max-width: 768px) {

  .table.table-detail td {
    text-align: left !important; /* anula los inline right/center */
  }

  .table.table-detail td::before {
    margin-bottom: 2px;
  }

  .table.table-detail td {
    padding: 10px 0;
  }

  .table.table-detail tr {
    padding: 14px;
  }

  /* valor un poco más “importante” */
  .table.table-detail td {
    font-size: 14px;
  }
}
@media (max-width: 768px) {
  .table.table-detail td[data-label="Producto"] {
    font-weight: 700;
    font-size: 15px;
    padding-top: 0;
  }
}
.field-select {
  width: 100%;
  max-width: 520px;
}

@media (max-width: 768px) {
  .field-select {
    max-width: 100%;
  }
}
.field-select {
  width: 100%;
  max-width: 520px;
}

.field-select--small {
  max-width: 320px;
}

@media (max-width: 768px) {
  .field-select,
  .field-select--small {
    max-width: 100%;
  }
}
/* Columna producto */
.col-product {
  vertical-align: top;
  min-width: 220px;
}

/* Nombre del producto */
.col-product .product-name {
  font-weight: 500;
  line-height: 1.2;
}

/* Mensaje contextual */
.col-product .pmsg {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.3;
  color: #666;
  display: none;
}

/* Cuando se muestra */
.col-product .pmsg.show {
  display: block;
}

/* ===============================
   Tabla productos SOLO orders_new
   =============================== */
.table.table-orders-new{
  table-layout: fixed;
  width: 100%;
}

/* Head y celdas */
.table.table-orders-new th,
.table.table-orders-new td{
  vertical-align: middle;
  text-align: left;
  padding: 10px 12px;
}

/* Anchos por columna (desktop) */
.table.table-orders-new th:nth-child(1),
.table.table-orders-new td:nth-child(1){ width: 21%; } /* Producto */

.table.table-orders-new th:nth-child(2),
.table.table-orders-new td:nth-child(2){ width: 11%; }

.table.table-orders-new th:nth-child(3),
.table.table-orders-new td:nth-child(3){ width: 11%; }

.table.table-orders-new th:nth-child(4),
.table.table-orders-new td:nth-child(4){ width: 11%; }

.table.table-orders-new th:nth-child(5),
.table.table-orders-new td:nth-child(5){
  width: 9%;
  white-space: nowrap;
}

.table.table-orders-new th:nth-child(6),
.table.table-orders-new td:nth-child(6){ width: 12%; }

.table.table-orders-new th:nth-child(7),
.table.table-orders-new td:nth-child(7){ width: 12%; }

.table.table-orders-new th:nth-child(8),
.table.table-orders-new td:nth-child(8){
  width: 13%;
  text-align: left;
}
/* Inputs y selects dentro de la tabla */
.table.table-orders-new input,
.table.table-orders-new select{
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

/* Cantidad */
.table.table-orders-new input[type="number"]{
  max-width: 80px;
}
/* ===============================
   FIX headers + selects (orders_new)
   =============================== */

/* Encabezados: que no se pisen y se lean prolijos */
.table.table-orders-new thead th{
  padding: 12px 12px;
  line-height: 1.15;
  font-size: 12px;          /* un toque más chico para que entren */
  white-space: normal;      /* permite salto de línea sin pegarse */
  overflow: hidden;         /* evita que invada la columna de al lado */
  word-break: break-word;
}

/* En particular, estas dos cabeceras suelen romper */
.table.table-orders-new thead th:nth-child(5), /* DESC. TOTAL */
.table.table-orders-new thead th:nth-child(6){ /* PRECIO FINAL */
  white-space: normal;
}

/* Select de descuento extra: que ocupe la celda y se vea parejo */
.table.table-orders-new td:nth-child(4) select{
  width: 100%;
  min-width: 70px;
  height: 38px;
  padding: 6px 10px;
  box-sizing: border-box;
}

/* Opcional: inputs de cantidad para que queden alineados con el select */
.table.table-orders-new td:nth-child(7) input[type="number"]{
  height: 38px;
  padding: 6px 10px;
  box-sizing: border-box;
}

/* ===============================
   FIX REAL: select DESC. EXTRA (% tapado)
   =============================== */

/* Select de DESC. EXTRA */
.table.table-orders-new td:nth-child(4) select{
  padding-right: 30px !important; /* espacio para el caret */
  text-overflow: clip;
  overflow: visible;
  white-space: nowrap;
}

/* ===============================
   DESKTOP – DESC. EXTRA compacto
   =============================== */
@media (min-width: 769px){
  .table.table-orders-new td:nth-child(4) select{
    width: 64px !important;       /* más chico */
    min-width: 64px !important;
    max-width: 64px !important;
    padding: 6px 26px 6px 8px !important; /* caret */
    font-size: 13px;
  }
}



/* ===============================
   Mobile: mensaje historial producto
   =============================== */
@media (max-width: 768px) {

  .table-orders-new .pmsg{
    margin-top: 4px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.3;
    color: #555;
    background: #f6f6f6;
    border-left: 3px solid #ccc;
    border-radius: 3px;
  }

  .table-orders-new .pmsg.warn{
    background: #fff2f2;
    border-left-color: #c00;
    color: #900;
  }
}

/* ===============================
   MOBILE – usar ancho completo
   =============================== */
@media (max-width: 768px){

  .app-content{
    padding: 12px 0 !important;
  }

  .container{
    width: 100% !important;
    max-width: none !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .panel{
    padding: 14px !important;
  }
}

/* ===============================
   MOBILE – no cortar texto ni títulos
   =============================== */
@media (max-width: 768px){

  .table-orders-new,
  .table-orders-new *{
    box-sizing: border-box;
  }

  .table-orders-new td,
  .table-orders-new td::before,
  .table-orders-new .product-name,
  .table-orders-new .pmsg{
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: normal !important;
  }

  .table-orders-new td::before{
    font-size: 11px;
    letter-spacing: .3px;
    opacity: .75;
  }

  .table-orders-new .pmsg{
    width: 100%;
  }
}
/* ===============================
   MOBILE – cards: label arriba, valor abajo (no angosta)
   =============================== */
@media (max-width: 768px){

  /* cada celda ocupa el ancho */
  .table.table-orders-new td{
    display: block;
    width: 100% !important;
  }

  /* el “título” (PRECIO LISTA, etc.) arriba */
  .table.table-orders-new td::before{
    display: block !important;
    width: 100% !important;
    margin-bottom: 4px;
  }

  /* el contenido debajo ocupa todo */
  .table.table-orders-new td{
    padding-right: 0 !important;
  }


}
/* ===============================
   MOBILE – ancho contenido para DESC. EXTRA y CANTIDAD
   =============================== */
@media (max-width: 768px){

  /* DESC. EXTRA (col 4) */
  .table.table-orders-new td:nth-child(4) select{
    width: auto !important;
    min-width: 60px;
    max-width: 120px;
    text-align: left;
    padding-right: 32px; /* caret */
  }

  /* CANTIDAD (col 7) */
  .table.table-orders-new td:nth-child(7) input[type="number"]{
    width: auto !important;
    min-width: 50px;
    max-width: 100px;
    text-align: left;
  }
}
/* ===============================
   MOBILE – FIX: DESC. EXTRA y CANTIDAD NO full width
   (poner al FINAL del CSS)
   =============================== */
@media (max-width: 768px){

  /* bloquea cualquier width:100% heredado */
  .table.table-orders-new td:nth-child(4) select,
  .table.table-orders-new td:nth-child(7) input[type="number"]{
    width: auto !important;
    max-width: none !important;
  }

  /* DESC. EXTRA (col 4) */
  .table.table-orders-new td:nth-child(4) select{
    display: inline-block !important;
    min-width: 90px;
    width: 90px !important;       /* fijo para que no se estire */
    padding-right: 32px !important; /* caret */
    text-align: left !important;
  }

  /* CANTIDAD (col 7) */
  .table.table-orders-new td:nth-child(7) input[type="number"]{
    display: inline-block !important;
    width: 90px !important;        /* fijo para que no se estire */
    text-align: left !important;
  }
}
@media (max-width: 768px){

  /* oculto el mensaje bajo el producto (se pierde arriba) */
  .table-orders-new .pmsg{
    display: none !important;
  }

  /* lo muestro debajo de ESTADO */
  .table-orders-new td.status[data-histmsg]:not([data-histmsg=""])::after{
    content: attr(data-histmsg);
    display: block;
    margin-top: 8px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.3;
    color: #555;
    background: #f6f6f6;
    border-left: 3px solid #ccc;
    border-radius: 3px;
    white-space: normal;
  }

  /* variante warn */
  .table-orders-new td.status.histwarn[data-histmsg]:not([data-histmsg=""])::after{
    background: #fff2f2;
    border-left-color: #c00;
    color: #900;
  }
}
/* =========================================
   FIX DESC. EXTRA cortado (DESKTOP)
   ========================================= */

/* La columna DESC. EXTRA no necesita 11% */
.table.table-orders-new th:nth-child(4),
.table.table-orders-new td:nth-child(4){
  width: 9% !important;
}

/* El select no va al 100%: ancho fijo y sin corte */
.table.table-orders-new td:nth-child(4) select.extra{
  width: 74px !important;     /* suficiente para 30% + caret */
  min-width: 74px !important;
  max-width: 74px !important;
  padding-right: 28px !important; /* espacio caret */
  text-overflow: clip !important;
  overflow: visible !important;
  white-space: nowrap !important;
  display: inline-block;
}

/* Opcional: que quede más “lindo” en la celda */
.table.table-orders-new td:nth-child(4){
  text-align: left;
}
/* =========================================
   MOBILE: DESC. EXTRA y CANTIDAD compactos (no full width)
   ========================================= */
@media (max-width: 768px){

  /* asegurar que el valor quede alineado a la izq */
  .table.table-orders-new td{
    text-align: left !important;
  }

  /* DESC. EXTRA (select) */
  .table.table-orders-new td:nth-child(4) select.extra{
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    display: inline-block !important;

    padding-right: 28px !important; /* espacio caret */
    white-space: nowrap !important;
  }

  /* CANTIDAD (input) */
  .table.table-orders-new td:nth-child(7) input.qty{
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    display: inline-block !important;
    text-align: left !important;
  }
}
/* =========================================
   FIX FINAL: texto del select "Desc. extra" cortado
   ========================================= */

/* Desktop */
.table.table-orders-new select.extra{
  width: 74px !important;
  min-width: 74px !important;
  max-width: 74px !important;

  height: 38px;
  line-height: 38px;              /* centra vertical */
  padding: 6px 34px 6px 10px !important;  /* <-- MÁS espacio para caret */

  font-size: 14px;                 /* un pelín más legible */
  box-sizing: border-box;

  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  appearance: menulist;
}

/* Mobile */
@media (max-width: 768px){
  .table.table-orders-new select.extra{
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;

    padding-right: 34px !important; /* caret */
    font-size: 15px;
  }
}
/* =========================================
   DESKTOP – DESC. EXTRA columna compacta real
   ========================================= */

@media (min-width: 769px){

  /* columna: ancho real chico */
  .table.table-orders-new th:nth-child(4),
  .table.table-orders-new td:nth-child(4){
    width: 89px !important;
    min-width: 89px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  /* select */
  .table.table-orders-new td:nth-child(4) select.extra{
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;

    height: 34px !important;
    font-size: 13px !important;

    padding: 4px 26px 4px 6px !important; /* caret justo */
    box-sizing: border-box !important;

    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}
/* =========================================
   DESKTOP – FIX REAL: % no se corta en Windows/Chrome
   ========================================= */
@media (min-width: 769px){

  /* Columna DESC. EXTRA: un poco más ancha y con menos padding */
  .table.table-orders-new th:nth-child(4),
  .table.table-orders-new td:nth-child(4){
    width: 96px !important;
    min-width: 96px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  /* Select: NO forzar line-height/height; darle ancho real */
  .table.table-orders-new td:nth-child(4) select.extra{
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;

    padding: 6px 28px 6px 8px !important; /* espacio caret + % */
    font-size: 13px !important;

    height: auto !important;
    line-height: normal !important;

    box-sizing: border-box !important;
    -webkit-appearance: auto !important;
    appearance: auto !important;
  }
}
/* =========================================
   MOBILE – FIX REAL: % no se corta en DESC. EXTRA
   (PEGAR AL FINAL)
   ========================================= */
@media (max-width: 768px){

  /* En mobile la tabla ya es “card”, así que el ancho lo manda el select */
  .table.table-orders-new td:nth-child(4) select.extra{
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;

    padding: 6px 30px 6px 10px !important; /* caret + % */
    font-size: 14px !important;

    height: auto !important;
    line-height: normal !important;

    box-sizing: border-box !important;
    -webkit-appearance: auto !important;
    appearance: auto !important;
  }
}
/* ===== Mensajitos bajo producto ===== */
.pmsg{ font-size:12px; margin-top:6px; line-height:1.25; color:#333; }
.pmsg.show{ display:block; }
.pmsg-list{ margin:0; padding:0; list-style:none; }
.pmsg-item{ margin:2px 0; }
.pmsg-label{ color:#666; }

.tone-good{ color:#0a7a2a; font-weight:600; }     /* verde */
.tone-bad{  color:#b00020; font-weight:700; }     /* rojo */
.tone-neutral{ color:#6b7280; font-weight:600; }  /* gris suave */

/* ===== Duplicado en mobile dentro de ESTADO (via data-histmsg) ===== */
/* Mantiene tu lógica actual; se colorea toda la línea (no por partes) */
.status.histwarn{ color:#b00020 !important; }
.status.histgood{ color:#0a7a2a !important; }
.status.histneutral{ color:#6b7280 !important; }

/* Historial / sugerencias (cliente) */
#client_history_box{
  color:#666;
  font-size: 13px;
}

#client_history_box strong{
  color:#444;
  font-size: 13px;
}

#client_history_box ul{
  margin: 6px 0 0 18px !important;
}

#client_history_box li{
  margin: 2px 0;
  color:#666;
}
.btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 14px;        /* ⬆️ un poco más alto */
  border-radius:6px;      /* ⬇️ esquinas apenas más chicas */
  text-decoration:none;
  font-weight:600;
  font-size:13px;
  line-height:1;
  border:1px solid rgba(0,0,0,.15);
  background:#f5f7fa;
  color:#111;
}

.btn-primary{
  background:#2b6cff;
  color:#fff;
  border-color:#2b6cff;
  box-shadow:none;
}

.btn-primary:hover{
  background:#1f5ae0;
  transform:none;
}

/* asegurar que el "+" no quede gris */
.btn-primary span{
  color:#fff;
}


@media (max-width: 768px){
  /* apagar el sistema viejo (texto plano) */
  .table-orders-new td.status[data-histmsg]::after{
    content: none !important;
    display: none !important;
  }

  /* mostrar el historial real */
  .table-orders-new td.status .status-hist{
    display: block !important;
    margin-top: 8px;
    padding: 6px 8px;
    background: #f6f6f6;
    border-left: 3px solid #ccc;
    border-radius: 3px;
  }

  .table-orders-new td.status.histwarn .status-hist{
    background:#fff2f2;
    border-left-color:#c00;
  }
}

.stat-value{
  font-size:16px;
  font-weight:700;
  line-height:1.15;
  word-break:break-word;
  overflow-wrap:anywhere;
}
.stat-card{min-width:0;}

/* =========================================
   SOLO STATS: tabla compacta con ellipsis
   (no afectar Orders / Admin / forms)
   ========================================= */

.stats-grid .table{
  table-layout: fixed;
  width: 100%;
}

.stats-grid .table th,
.stats-grid .table td{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.stats-grid .table th:nth-child(1),
.stats-grid .table td:nth-child(1){ width: 56%; }

.stats-grid .table th:nth-child(2),
.stats-grid .table td:nth-child(2){ width: 16%; text-align:right; }

.stats-grid .table th:nth-child(3),
.stats-grid .table td:nth-child(3){ width: 28%; text-align:right; }

a{
  color:#6f2dbd;
  text-decoration:none;
  transition:opacity .15s ease, color .15s ease;
}
a:visited{ color:#6f2dbd; }
a:hover{ opacity:.75; text-decoration:none; }
a:focus{ outline:none; }

/* =========================
   Botones (links con clase btn)
   ========================= */
a.btn{
  color:#333;
  opacity:1;
}

a.btn:visited{
  color:#333;
}

/* Botones rango (7d / 30d / 90d / Total) */
.stats-actions a.btn{
  border:1px solid #ddd;
  background:#fff;
  color:#444;
}

.stats-actions a.btn:hover{
  background:#f3f3f3;
  opacity:1;
}

/* Activo: sutil, moderno */
.stats-actions a.btn.active{
  background:#f0f0f0;
  border-color:#e0e0e0;
  color:#000;        /* texto negro */
  font-weight:600;
}

/* Botón Volver */
.stats-actions a.btn.btn-back{
  margin-left:20px;              /* más aire respecto a los filtros */
  padding-left:12px;
  border-left:1px solid #e0e0e0; /* separador visual */
  background:transparent;
  color:#666;
  font-weight:500;
  opacity:.85;
  border-top:none;
  border-right:none;
  border-bottom:none;
  box-shadow:none;
}

.stats-actions a.btn.btn-back:hover{
  background:transparent;
  text-decoration:none;
  opacity:1;
}


/* Stats tables: alineación correcta */
.stats-grid .table th{
  text-align: left;
}

.stats-grid .table th:nth-child(2),
.stats-grid .table th:nth-child(3),
.stats-grid .table td:nth-child(2),
.stats-grid .table td:nth-child(3){
  text-align: right;
}

/* =========================
   Stats tables – FIX mobile (no cards)
   ========================= */

/* títulos alineados */
.stats-grid h2{
  text-align:left;
}

/* Desktop/tablet: podés mantener tu layout compacto actual */
.table.table-stats{
  width:100%;
  border-collapse:collapse;
}

/* MOBILE: anular el "modo cards" global de .table */
@media (max-width: 768px){

  .table.table-stats{
    display: table !important;
    table-layout: fixed;
  }

  .table.table-stats thead{
    display: table-header-group !important;
  }

  .table.table-stats tbody{
    display: table-row-group !important;
  }

  .table.table-stats tr{
    display: table-row !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .table.table-stats th,
  .table.table-stats td{
    display: table-cell !important;
    padding: 8px 8px !important;
    border-bottom: 1px solid #ddd !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
  }

  /* apagar labels ::before del modo card */
  .table.table-stats td::before{
    content: none !important;
    display: none !important;
  }

  /* ancho columnas (mobile) */
  .table.table-stats th:nth-child(1),
  .table.table-stats td:nth-child(1){
    width: 58%;
    white-space: normal !important;   /* permite 2 líneas */
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .table.table-stats th:nth-child(2),
  .table.table-stats td:nth-child(2){
    width: 14%;
    text-align: right;
  }

  .table.table-stats th:nth-child(3),
  .table.table-stats td:nth-child(3){
    width: 28%;
    text-align: right;
  }
}

/* ===============================
   orders_new: NO ellipsis en celdas (evita "...")
   =============================== */
.table.table-orders-new th,
.table.table-orders-new td{
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

/* En desktop, mantener números en una línea donde corresponde */
@media (min-width: 769px){
  .table.table-orders-new td:nth-child(2),
  .table.table-orders-new td:nth-child(3),
  .table.table-orders-new td:nth-child(5),
  .table.table-orders-new td:nth-child(6),
  .table.table-orders-new td:nth-child(8){
    white-space: nowrap !important;
  }
}
/* =========================
   Links: SIN estado visitado
   ========================= */

a,
a:visited{
  color:#111 !important;     /* o el color que quieras */
  text-decoration:none;
}

a:hover{
  opacity:.75;
}

a:focus,
a:active{
  outline:none;
}

a.btn.btn-primary,
a.btn.btn-primary:visited{
  background:#222 !important;
  border-color:#222 !important;
  color:#fff !important;
}
a.btn.btn-primary:hover{
  background:#000 !important;
  border-color:#000 !important;
}

/* =========================
   Botón secundario (Cancelar)
   ========================= */
a.btn.btn-secondary,
a.btn.btn-secondary:visited{
  background:#f3f3f3;
  margin-top:12px;
  border:1px solid #d0d0d0;
  color:#555 !important;
  font-weight:500;
}

a.btn.btn-secondary:hover{
  background:#e6e6e6;
  border-color:#bbb;
  color:#222 !important;
}
/* =========================
   Acciones de formularios
   ========================= */
.form-actions{
  margin-top:28px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

/* =========================
   Signal – Asistente flotante
   ========================= */
.sig-assist-btn{
  position: fixed;
  right: 22px;
  bottom: 16px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
  user-select: none;
}

.sig-assist-btn:active{
  transform: translateY(1px);
}

.sig-assist-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 9998;
}

.sig-assist-panel{
  position: fixed;
  right: 16px;
  bottom: 80px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  overflow: auto;

  background: #111;
  color: #eee;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,.45);
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
}

.sig-assist-panel.is-open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sig-assist-backdrop.is-open{
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.sig-assist-head{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sig-assist-title{
  font-weight:700;
  font-size:14px;
  flex: 1 1 auto;
}

.sig-assist-close{
  margin-left: auto;
  background: none;
  border: 0;
  color: #aaa;
  line-height: 1;
  width: 34px;
  height: 34px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 10px;
  cursor: pointer;
}

.sig-assist-close:hover{
  background: rgba(255,255,255,.06);
  color: #fff;
}

/* Body */
.sig-assist-body{
  padding: 12px;
  font-size: 13px;
  line-height: 1.35;
}

.sig-assist-intro{
  margin-bottom: 10px;
  color: rgba(255,255,255,.90);
}

.sig-assist-box{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
}

.sig-assist-h{
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  color: #fff;
}

.sig-assist-t{
  color: rgba(255,255,255,.85);
}

.sig-assist-footnote{
  margin-top: 8px;
  color: rgba(255,255,255,.75);
}

/* Actions */
.sig-assist-actions{
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sig-assist-ok,
.sig-assist-wa{
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.sig-assist-ok{
  background: #222;
  color: #fff;
  border: 1px solid rgba(255,255,255,.10);
}

.sig-assist-ok:hover{
  background: #2a2a2a;
}

.sig-assist-wa{
  background: #0b3;
  color: #fff;
  border: 1px solid rgba(255,255,255,.10);
}

.sig-assist-wa:hover{
  filter: brightness(1.05);
}

/* Pulso sutil */
@keyframes sigAssistPulse{
  0%{ transform: scale(1) translateY(0); }
  40%{ transform: scale(1.08) translateY(-4px); }
  100%{ transform: scale(1) translateY(0); }
}
.sig-assist-pulse{
  animation: sigAssistPulse .7s ease-out;
}

@media (max-width: 420px){
  .sig-assist-panel{
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 76px;
  }
  .sig-assist-btn{
    right: 12px;
    bottom: 12px;
  }
}


/* =====================================================
   Tabla "Pedidos" – balance visual de columnas
   ===================================================== */

.table-orders{
  width: 100%;
  table-layout: fixed;
}

.table-orders th,
.table-orders td{
  padding: 10px 12px;
  vertical-align: middle;
  text-align: left;
}

/* Anchos ajustados (7 columnas) */
.table-orders th:nth-child(1),
.table-orders td:nth-child(1){ width: 8%; }    /* # */

.table-orders th:nth-child(2),
.table-orders td:nth-child(2){ width: 18%; }   /* Fecha */

.table-orders th:nth-child(3),
.table-orders td:nth-child(3){ width: 26%; }   /* Cliente */

.table-orders th:nth-child(4),
.table-orders td:nth-child(4){ width: 16%; }   /* Cargado por */

.table-orders th:nth-child(5),
.table-orders td:nth-child(5){
  width: 14%;
  text-align: right;                           /* Total */
}

.table-orders th:nth-child(6),
.table-orders td:nth-child(6){ width: 14%; }   /* Estado */

.table-orders th:nth-child(7),
.table-orders td:nth-child(7){ width: 6%; }    /* Ver */

/* Evitar desbordes feos */
.table-orders td:nth-child(3),
.table-orders td:nth-child(4){
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================================================
   Tabla Pedidos – Desktop: columnas balanceadas
   (En mobile NO, porque usa layout con data-label)
   ===================================================== */

@media (min-width: 769px){

  .table-orders{
    width: 100%;
    table-layout: fixed;
  }

  .table-orders th,
  .table-orders td{
    padding: 10px 12px;
    vertical-align: middle;
    text-align: left;
  }

  /* Anchos ajustados (7 columnas) */
  .table-orders th:nth-child(1),
  .table-orders td:nth-child(1){ width: 8%; }    /* # */

  .table-orders th:nth-child(2),
  .table-orders td:nth-child(2){ width: 18%; }   /* Fecha */

  .table-orders th:nth-child(3),
  .table-orders td:nth-child(3){ width: 26%; }   /* Cliente */

  .table-orders th:nth-child(4),
  .table-orders td:nth-child(4){ width: 16%; }   /* Cargado por */

  .table-orders th:nth-child(5),
  .table-orders td:nth-child(5){
    width: 14%;
    text-align: right;                           /* Total */
  }

  .table-orders th:nth-child(6),
  .table-orders td:nth-child(6){ width: 12%; }   /* Estado */

  .table-orders th:nth-child(7),
  .table-orders td:nth-child(7){ width: 6%; }    /* Ver */

  /* Ellipsis solo en desktop */
  .table-orders td:nth-child(3),
  .table-orders td:nth-child(4){
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


/* =====================================================
   Tabla Pedidos – Mobile: NO tocar con fixed/ellipsis
   (Dejá que el ui.css haga el modo "fichas")
   ===================================================== */

@media (max-width: 768px){

  .table-orders{
    table-layout: auto;
  }

  .table-orders td,
  .table-orders th{
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}
/* ===============================
   Mobile: labels sin cortar palabras
   =============================== */
@media (max-width: 768px){

  .table-orders td::before{
    white-space: nowrap;      /* mantiene "Cargado por" en una línea */
  }

}

/* =====================================================
   Signal – Filtros de pedidos (botones de estado)
   ===================================================== */

.orders-filters{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.orders-filters strong{
  margin-right: 6px;
  font-size: 13px;
  color: #bbb;
}

.btn-filter{
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  background: #1c1c1c;
  color: #ccc;
  text-decoration: none;
  border: 1px solid #2a2a2a;
  transition: all .15s ease;
}

.btn-filter:hover{
  background: #262626;
  color: #fff;
}

.btn-filter.active{
  background: #3b82f6; /* Estado activo */
  color: #fff;
  border-color: #3b82f6;
  font-weight: 600;
}

/* =========================
   Admin – Action bar + Back button
   ========================= */
.admin-topbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  margin: 10px 0 14px;
  flex-wrap:wrap;
}

.admin-topbar .left{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.admin-topbar .right{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.btn-back{
  display:inline-flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  color:#111;
}

.btn-back:hover{ filter:brightness(.98); }

.admin-search{
  min-width: 240px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.12);
}

/* Forzar “primario” consistente en admin */
.admin-form .btn-primary,
.admin-topbar .btn-primary{
  background:#111;   /* <- si tu primario es otro, cambiá solo este */
  color:#fff;
  border:1px solid #111;
}

.admin-form .btn-primary:hover,
.admin-topbar .btn-primary:hover{
  filter:brightness(1.05);
}

/* Form collapse */
.admin-collapse{ display:none; }
.admin-collapse.is-open{ display:block; }

.admin-footer-actions{
  display:flex;
  justify-content:flex-start;
}

/* =========================
   ADMIN ONLY: botones no full width
   (no afecta el resto del sistema)
   ========================= */
.admin-form button,
.admin-topbar button{
  width: auto;
}

/* layout de acciones en admin */
.admin-form .form-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}

/* desktop: lado a lado */
@media (min-width: 769px){
  .admin-form .form-actions button{
    min-width: 180px;
  }
}

/* mobile: uno abajo del otro */
@media (max-width: 768px){
  .admin-form .form-actions button{
    width: 100%;
    min-width: 0;
  }
}
.admin-form button.btn-secondary{
  background:#f3f3f3;
  border:1px solid #d0d0d0;
  color:#555;
}
.admin-form button.btn-secondary:hover{
  background:#e6e6e6;
  border-color:#bbb;
  color:#222;
}


/* =========================
   Admin – Tabla clientes
   ========================= */

.table.table-admin{
  table-layout: fixed;
  width: 100%;
}

.table.table-admin th,
.table.table-admin td{
  text-align: left;
  padding: 10px 12px;
}

/* Anchos de columnas */
.table.table-admin th:nth-child(1),
.table.table-admin td:nth-child(1){ width: 6%; }   /* N° */

.table.table-admin th:nth-child(2),
.table.table-admin td:nth-child(2){ width: 32%; }  /* Cliente */

.table.table-admin th:nth-child(3),
.table.table-admin td:nth-child(3){ width: 10%; }  /* Desc */

.table.table-admin th:nth-child(4),
.table.table-admin td:nth-child(4){ width: 22%; }  /* Condición */

.table.table-admin th:nth-child(5),
.table.table-admin td:nth-child(5){ width: 10%; }  /* Estado */

.table.table-admin th:nth-child(6),
.table.table-admin td:nth-child(6){ width: 20%; }  /* Acción */

/* Headers */
.table.table-admin th{
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #666;
}

/* =========================
   CLIENTS (admin) – MOBILE: tabla en CARDS (sin data-label)
   ========================= */
@media (max-width: 768px){

  /* el wrapper que ya tenés en el HTML */
  .table.table-admin{
    width:100% !important;
  }

  .table.table-admin thead{
    display:none !important;
  }

  .table.table-admin,
  .table.table-admin tbody,
  .table.table-admin tr{
    display:block !important;
    width:100% !important;
  }

  .table.table-admin tr.client-row{
    background:#fff !important;
    border:1px solid rgba(0,0,0,.10) !important;
    border-radius:12px !important;
    margin:12px 0 !important;
    padding:10px 12px !important;
  }

  .table.table-admin td{
    display:block !important;
    width:100% !important;
    border:0 !important;
    border-bottom:1px solid rgba(0,0,0,.08) !important;

    padding:10px 0 10px 132px !important; /* espacio para label */
    position:relative !important;

    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
  }

  .table.table-admin td:last-child{
    border-bottom:0 !important;
  }

  /* Labels fijos por columna */
  .table.table-admin td:before{
    position:absolute;
    left:0;
    top:10px;
    width:120px;
    font-size:11px;
    font-weight:700;
    letter-spacing:.04em;
    text-transform:uppercase;
    color:#666;
    content:"";
  }

  .table.table-admin tr.client-row td:nth-child(1):before{ content:"N°"; }
  .table.table-admin tr.client-row td:nth-child(2):before{ content:"Cliente"; }
  .table.table-admin tr.client-row td:nth-child(3):before{ content:"Desc."; }
  .table.table-admin tr.client-row td:nth-child(4):before{ content:"Cond. pago"; }
  .table.table-admin tr.client-row td:nth-child(5):before{ content:"Estado"; }
  .table.table-admin tr.client-row td:nth-child(6):before{ content:"Acción"; }

  /* Links de acción más tocables */
  .table.table-admin tr.client-row td:nth-child(6) a{
    display:inline-block;
    margin:4px 10px 4px 0;
  }
}

/* =========================
   Admin warning – FIX alineación botones
   ========================= */
.admin-warning .form-actions{
  align-items: center; /* fuerza misma línea base */
}

.admin-warning .form-actions .btn{
  height: 40px;                /* altura unificada */
  display: inline-flex;
  align-items: center;         /* centra texto vertical */
  justify-content: center;
}

/* =========================
   admin_warning.php – no bajar el botón Cancelar
   ========================= */
.admin-warning a.btn.btn-secondary{
  margin-top: 0 !important;
}
/* =====================================================
   admin_precios.php – balance visual de columnas
   ===================================================== */

#productsTable{
  width: 100%;
  table-layout: fixed;
}

#productsTable th,
#productsTable td{
  padding: 10px 12px;
  vertical-align: middle;
  text-align: left;
}

/* Anchos ajustados (desktop) */
#productsTable th:nth-child(1),
#productsTable td:nth-child(1){ width: 16%; }  /* SKU */

#productsTable th:nth-child(2),
#productsTable td:nth-child(2){ width: 24%; }  /* Producto */

#productsTable th:nth-child(3),
#productsTable td:nth-child(3){ width: 15%; }  /* Precio lista */

#productsTable th:nth-child(4),
#productsTable td:nth-child(4){ width: 15%; }  /* Precio mínimo */

#productsTable th:nth-child(5),
#productsTable td:nth-child(5){ width: 8%; }  /* Estado */

#productsTable th:nth-child(6),
#productsTable td:nth-child(6){ width: 18%; }  /* Acción */

/* Evita que "Producto" te rompa el layout */
#productsTable td:nth-child(2){
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* SKU no se parte */
#productsTable td:nth-child(1){
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inputs más prolijos dentro de celdas */
#productsTable input.money-ar{
  width: 100% !important;
  max-width: 160px;
  box-sizing: border-box;
}

/* Acción: que no haga wrap raro */
#productsTable td:nth-child(6){
  white-space: nowrap;
}


/* Mobile: tabla -> cards (como tu captura) */
@media (max-width: 640px){

  /* sacamos header */
  #productsTable thead{ display:none; }

  #productsTable,
  #productsTable tbody,
  #productsTable tr,
  #productsTable td{
    display:block;
    width:100%;
  }

  /* tarjeta */
  #productsTable tr.product-row{
    background:#fff;
    border:1px solid #eee;
    border-radius: 12px;
    padding: 12px;
    margin: 12px 0;
    box-shadow: 0 8px 18px rgba(0,0,0,.06);
  }

  /* si está inactivo mantenemos “grisado”, pero prolijo */
  #productsTable tr.product-row[style*="background:#f2f2f2"]{
    background:#f7f7f7 !important;
    color:#666 !important;
  }

  /* cada celda como fila */
  #productsTable td{
    padding: 10px 0;
    border: 0 !important;
  }

  /* separadores suaves */
  #productsTable td + td{
    border-top: 1px solid #eee !important;
  }

  /* primera celda (SKU) más “title” */
  #productsTable td:nth-child(1){
    padding-top: 0;
    font-weight: 700;
  }

  /* inputs al 100% */
  #productsTable input.money-ar{
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  /* acción abajo, sin romperse */
  #productsTable td:nth-child(6){
    padding-bottom: 0;
  }
  #productsTable td:nth-child(6) a{
    font-weight: 700;
  }
}

/* =====================================================
   admin_precios.php – mobile full width (limpio)
   ===================================================== */
@media (max-width: 640px){

  body.page-admin-precios .wrap,
  body.page-admin-precios .container,
  body.page-admin-precios .panel,
  body.page-admin-precios .card{
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  body.page-admin-precios .container{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}
/* =====================================================
   admin_precios – override del modo "cards con labels"
   (porque .table.table-admin aplica a todos)
   ===================================================== */
@media (max-width: 768px){

  /* en productos NO usamos el padding-left 132px */
  body.page-admin-precios #productsTable td{
    padding: 10px 0 !important;
  }

  /* y anulamos los pseudo-labels */
  body.page-admin-precios #productsTable td:before{
    content: none !important;
    display: none !important;
  }

  /* la fila tarjeta ocupa todo */
  body.page-admin-precios #productsTable tr.product-row{
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }
}

/* Permite ocultar filas aunque el CSS mobile fuerce display:block !important */
.is-hidden{
  display:none !important;
}

/* =========================================
   FORCE HIDE rows even in mobile cards mode
   ========================================= */
@media (max-width: 768px){

  /* Clientes (tabla admin en modo cards) */
  .table.table-admin tr.is-hidden{
    display: none !important;
  }

  /* Productos (tabla específica) */
  #productsTable tr.is-hidden{
    display: none !important;
  }
}
/* =====================================================
   Admin – Usuarios
   Normalización de inputs SOLO en la pantalla Usuarios
   (evita afectar Clientes / Productos / Precios)
   ===================================================== */

.admin-users .admin-form input[type="text"],
.admin-users .admin-form input[type="email"],
.admin-users .admin-form input[type="password"],
.admin-users .admin-form select {
  height: 38px;           /* Altura uniforme de campos */
  padding: 8px 10px;      /* Espaciado interno consistente */
  line-height: 22px;      /* Alineación vertical del texto */
  box-sizing: border-box; /* Incluye padding dentro del alto */
}

/* =========================
   USERS (admin) – MOBILE: tabla en CARDS (sin data-label)
   Solo aplica a users.php (scope .admin-users)
   ========================= */
@media (max-width: 768px){

  /* ocultar header */
  .admin-users .table.table-admin thead{
    display:none !important;
  }

  .admin-users .table.table-admin,
  .admin-users .table.table-admin tbody,
  .admin-users .table.table-admin tr{
    display:block !important;
    width:100% !important;
  }

  /* tarjeta */
  .admin-users .table.table-admin tr.user-row{
    background:#fff !important;
    border:1px solid rgba(0,0,0,.10) !important;
    border-radius:12px !important;
    margin:12px 0 !important;
    padding:10px 12px !important;
  }

  /* cada “fila” dentro de la tarjeta */
  .admin-users .table.table-admin td{
    display:block !important;
    width:100% !important;
    border:0 !important;
    border-bottom:1px solid rgba(0,0,0,.08) !important;

    padding:10px 0 10px 132px !important; /* espacio para label */
    position:relative !important;

    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
  }

  .admin-users .table.table-admin td:last-child{
    border-bottom:0 !important;
  }

  /* labels (columna fija) */
  .admin-users .table.table-admin td:before{
    position:absolute;
    left:0;
    top:10px;
    width:120px;
    font-size:11px;
    font-weight:700;
    letter-spacing:.04em;
    text-transform:uppercase;
    color:#666;
    content:"";
  }

  /* Labels por columna (ajustá si tu tabla tiene otro orden) */
  .admin-users .table.table-admin tr.user-row td:nth-child(1):before{ content:"ID"; }
  .admin-users .table.table-admin tr.user-row td:nth-child(2):before{ content:"Usuario"; }
  .admin-users .table.table-admin tr.user-row td:nth-child(3):before{ content:"Email"; }
  .admin-users .table.table-admin tr.user-row td:nth-child(4):before{ content:"Rol"; }
  .admin-users .table.table-admin tr.user-row td:nth-child(5):before{ content:"Estado"; }
  .admin-users .table.table-admin tr.user-row td:nth-child(6):before{ content:"Acción"; }

  /* acciones más tocables */
  .admin-users .table.table-admin tr.user-row td:nth-child(6) a{
    display:inline-block;
    margin:4px 10px 4px 0;
    font-weight:700;
  }
}
/* =========================================
   USERS (admin) – mobile cards
   Permitir ocultar filas con el buscador
   (porque el modo cards fuerza display:block !important)
   ========================================= */
@media (max-width: 768px){
  .admin-users .table.table-admin tr.is-hidden{
    display:none !important;
  }
}

/* =========================
   USERS (admin) – DESKTOP
   Ajuste fino de columnas
   ========================= */

.admin-users .table.table-admin{
  table-layout: fixed;
  width: 100%;
}

/* ID */
.admin-users .table.table-admin th:nth-child(1),
.admin-users .table.table-admin td:nth-child(1){
  width: 3%;
  text-align: center;
}

/* Usuario */
.admin-users .table.table-admin th:nth-child(2),
.admin-users .table.table-admin td:nth-child(2){
  width: 11%;
}

/* Email */
.admin-users .table.table-admin th:nth-child(3),
.admin-users .table.table-admin td:nth-child(3){
  width: 25%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rol */
.admin-users .table.table-admin th:nth-child(4),
.admin-users .table.table-admin td:nth-child(4){
  width: 9%;
  text-transform: capitalize;
}

/* Estado */
.admin-users .table.table-admin th:nth-child(5),
.admin-users .table.table-admin td:nth-child(5){
  width: 12%;
}

/* Acción */
.admin-users .table.table-admin th:nth-child(6),
.admin-users .table.table-admin td:nth-child(6){
  width: 18%;

}

/* =====================================================
   orders_new – FIX columnas (sin Precio mínimo)
   Scope: SOLO .table.table-orders-new
   ===================================================== */

@media (min-width: 769px){

  /* 7 columnas: Producto | Lista | Extra | Total | Final | Cant | Estado */
  .table.table-orders-new th:nth-child(1),
  .table.table-orders-new td:nth-child(1){ width: 30% !important; }

  .table.table-orders-new th:nth-child(2),
  .table.table-orders-new td:nth-child(2){ width: 12% !important; white-space: nowrap !important; }

  .table.table-orders-new th:nth-child(3),
  .table.table-orders-new td:nth-child(3){ width: 12% !important; } /* Desc. extra */

  .table.table-orders-new th:nth-child(4),
  .table.table-orders-new td:nth-child(4){ width: 10% !important; } /* Desc. total */

  .table.table-orders-new th:nth-child(5),
  .table.table-orders-new td:nth-child(5){ width: 12% !important; white-space: nowrap !important; } /* Precio final */

  .table.table-orders-new th:nth-child(6),
  .table.table-orders-new td:nth-child(6){ width: 12% !important; } /* Cantidad */

  .table.table-orders-new th:nth-child(7),
  .table.table-orders-new td:nth-child(7){ width: 12% !important; } /* Estado */

  /* Select Desc. extra (col 3) */
  .table.table-orders-new td:nth-child(3) select.extra{
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    padding: 6px 28px 6px 8px !important;
    box-sizing: border-box !important;
    -webkit-appearance: auto !important;
    appearance: auto !important;
  }

  /* Input cantidad (col 6) */
  .table.table-orders-new td:nth-child(6) input.qty{
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    box-sizing: border-box !important;
  }
}

/* Mobile: tu tabla ya es "cards"; solo corregimos targets por si había reglas viejas */
@media (max-width: 768px){

  /* Select Desc. extra ahora es col 3 */
  .table.table-orders-new td:nth-child(3) select.extra{
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    padding: 6px 30px 6px 10px !important;
  }

  /* Cantidad ahora es col 6 */
  .table.table-orders-new td:nth-child(6) input.qty{
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
  }
}
/* =========================================
   orders_new – FIX select Desc. extra (Windows/Chrome)
   SOLO afecta a orders_new
   ========================================= */

@media (min-width: 769px){

  .table.table-orders-new td[data-label="Desc. extra"] select.extra{
    /* más compacto */
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;

    height: 34px !important;        /* menos alto */
    padding: 0 32px 0 10px !important; /* 0 vertical -> centra */
    line-height: 34px !important;   /* centra vertical real */
    font-size: 13px !important;

    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    background-color: #fff !important;
    color: #111 !important;

    box-sizing: border-box !important;

    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;

    /* caret centrado */
    background-image:
      linear-gradient(45deg, transparent 50%, #444 50%),
      linear-gradient(135deg, #444 50%, transparent 50%);
    background-position:
      calc(100% - 16px) 50%,
      calc(100% - 11px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }

  /* en Chrome/Win a veces ayuda */
  .table.table-orders-new td[data-label="Desc. extra"] select.extra::-ms-expand{
    display:none;
  }
}
/* orders_new: tabla bloqueada hasta elegir cliente */
.table-orders-new.is-locked{
  opacity: .55;
  filter: grayscale(1);
  pointer-events: none; /* evita clicks */
}

.table-orders-new.is-locked::before{
  content: "Elegí un cliente para cargar productos.";
  display: block;
  padding: 10px 12px;
  margin: 10px 0;
  border: 1px dashed #bbb;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 13px;
  font-weight: 600;
}

/* =========================
   LOGIN – Toggle contraseña
   Fix: evitar que herede estilo de botón principal
   (ui.css suele tener button { width:100%; background... })
   ========================= */

/* Botón secundario tipo link (no CTA) */
.login-box .pw-link{
  display: inline-block;        /* Evita width:100% heredado */
  width: auto;                  /* Asegura ancho mínimo */
  background: transparent;      /* Sin fondo */
  border: 0;                    /* Sin borde */
  box-shadow: none;             /* Sin sombra de botón */
  padding: 4px 0;               /* Compacto */
  margin-top: 6px;              /* Separación del input */
  border-radius: 0;             /* Neutral */
  font-size: 13px;              /* Chico */
  font-weight: 500;             /* Sutil */
  color: #6b7280;               /* Gris neutro */
  cursor: pointer;              /* Interactivo */
  text-align: left;             /* Consistente con campos */
  line-height: 1.2;             /* Compacto */
  -webkit-appearance: none;     /* Evita estilos por defecto */
}

/* Hover/focus: que NO aparezca barra negra */
.login-box .pw-link:hover,
.login-box .pw-link:focus,
.login-box .pw-link:active{
  background: transparent;      /* Mata hover global */
  box-shadow: none;             /* Mata sombras globales */
  color: #111827;               /* Feedback sutil */
  text-decoration: underline;   /* Feedback visual */
  outline: none;                /* Si ui.css mete outline feo */
}
/* =========================
   LOGIN – Toggle contraseña (mobile hardening)
   Evita estilos nativos (iOS/Android) y tap highlight
   ========================= */

.login-box .pw-link{
  font-family: inherit;                 /* Evita tipografía distinta en mobile */
  -webkit-appearance: none;             /* iOS/Safari */
  -moz-appearance: none;                /* Firefox mobile */
  appearance: none;                     /* Estándar */
  -webkit-tap-highlight-color: rgba(0,0,0,0); /* Quita flash al tocar */
  touch-action: manipulation;           /* Reduce delay/cosas raras */
}

/* En mobile no existe hover real: evitamos estados raros al tocar */
@media (hover: none) and (pointer: coarse){
  .login-box .pw-link:hover{
    text-decoration: none;
    color: #6b7280;
  }
  .login-box .pw-link:active{
    background: transparent;
    box-shadow: none;
    text-decoration: underline; /* feedback al tap */
  }
}

/* =====================================================
   install_check.php – tablas (aislado por ID)
   ===================================================== */

#installCheckResults,
#installCheckMail{
  width: 100% !important;
  table-layout: fixed !important; /* clave */
}

/* Resultados: 2 columnas */
#installCheckResults th:nth-child(1),
#installCheckResults td:nth-child(1){
  width: 72% !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#installCheckResults th:nth-child(2),
#installCheckResults td:nth-child(2){
  width: 28% !important;
  white-space: nowrap;
  text-align: right;
}

/* Mail: 2 columnas (no hay thead) */
#installCheckMail td:nth-child(1){
  width: 72% !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#installCheckMail td:nth-child(2){
  width: 28% !important;
  white-space: nowrap;
  text-align: right;
}
/* =====================================================
   install_check.php – MOBILE: no usar cards/labels de .table-admin
   (aislado por IDs, no afecta clients/users/products)
   ===================================================== */
@media (max-width: 768px){

  /* 1) Sacar el indent gigante + labels vacíos que mete .table.table-admin en mobile */
  table#installCheckResults.table.table-admin td,
  table#installCheckMail.table.table-admin td{
    padding: 10px 0 !important;     /* mata el 10px 0 10px 132px */
    position: static !important;     /* no necesitamos relative */
    text-align: left !important;     /* <-- lo que querés */
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  table#installCheckResults.table.table-admin td::before,
  table#installCheckMail.table.table-admin td::before{
    content: none !important;
    display: none !important;
  }

  /* 2) En mobile, el “Estado” NO a la derecha (tu regla desktop lo deja right) */
  table#installCheckResults td:nth-child(2),
  table#installCheckMail td:nth-child(2){
    text-align: left !important;
  }

  /* 3) Si alguna regla te “cardea” las filas, mantenemos prolijo el bloque */
  table#installCheckResults tr,
  table#installCheckMail tr{
    text-align: left !important;
  }
}
/* =========================
   USERS (admin) – MOBILE fix: ID alineado
   ========================= */
@media (max-width: 768px){
  /* En modo cards, todo a la izquierda (incluye ID) */
  .admin-users .table.table-admin td{
    text-align: left !important;
  }

  /* por si el desktop fuerza center en la 1ra col */
  .admin-users .table.table-admin tr.user-row td:nth-child(1){
    text-align: left !important;
  }
}

/* =========================
   admin_precios.php – Aumento masivo (baja visibilidad + dropdown flotante)
   ========================= */

.page-admin-precios .admin-topbar{
  align-items: flex-start;
}

.page-admin-precios .admin-topbar .right{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  position: relative; /* ancla dropdown */
}

/* Botón "Aumento masivo" debe verse como acción secundaria (no CTA) */
.page-admin-precios #btnToggleBulkIncrease.btn-bulk-link{
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280; /* gris */
  cursor: pointer;
}

.page-admin-precios #btnToggleBulkIncrease.btn-bulk-link:hover{
  background: #f3f4f6;
  color: #111827;
}

/* Dropdown flotante: NO empuja el layout */
.page-admin-precios .admin-topbar .admin-bulk-increase{
  display: none; /* lo maneja JS */
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  width: 360px;
  max-width: calc(100vw - 40px);
}

.page-admin-precios .admin-topbar .admin-bulk-increase form{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
}

/* Labels compactos */
.page-admin-precios .admin-topbar .admin-bulk-increase .bulk-label{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.page-admin-precios .admin-topbar .admin-bulk-increase .bulk-label-text{
  font-size: 13px;
  color: #555;
}

/* Input */
.page-admin-precios .admin-topbar .admin-bulk-increase input[type="number"]{
  width: 90px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

/* Checkbox */
.page-admin-precios .admin-topbar .admin-bulk-increase .bulk-check{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  margin: 0;
}

/* En mobile: dropdown pasa a bloque (no flotante) */
@media (max-width: 720px){
  .page-admin-precios .admin-topbar .right{
    justify-content: stretch;
  }

  .page-admin-precios .admin-topbar .admin-bulk-increase{
    position: static;
    width: 100%;
    max-width: none;
    margin-top: 10px;
  }

  .page-admin-precios .admin-topbar .admin-bulk-increase form{
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
  }
}