/* =============================================================================
   DISEÑO MODERNO (v3) — capa visual encima del diseño nuevo (ui2.css). Solo se carga con
   Marca y diseño → Versión = Diseño moderno (App\Services\Brand::v3). Todo va bajo html.ui3:
   con las otras versiones este archivo no se carga. No cambia ninguna función, solo la presentación.
   Los colores salen de la marca: --brand (color principal) y --accent (botón Vender).
   1) Base   2) Menú lateral de siempre + botón Vender   3) Páginas, tarjetas y tablas   4) Celular (barra inferior)
   ============================================================================= */

/* ---------- 1) Base ---------- */
html.ui3 { --ui3-radius: 18px; --ui3-ring: 0 0 0 1px var(--border); --ui3-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04); }
html.ui3:not([data-tema="oscuro"]) { --bg: #f4f4f6; --border: #e4e4e7; --text: #18181b; --text-muted: #71717a; }
html.ui3 body.marca { background: var(--bg); color: var(--text); font-size: 14px !important; letter-spacing: -.005em; }
html.ui3 body.marca h1, html.ui3 body.marca h2, html.ui3 body.marca h3, html.ui3 body.marca h4 { letter-spacing: -.02em; font-weight: 800; color: var(--text); }

/* ---------- 2) Menú: se mantiene el menú lateral de siempre (pedido de Martín, 20-oct) ---------- */
/* Botón Vender (enlace POS de siempre) con el color de acento de la marca */
html.ui3 body.marca nav.navbar .nav-menu > .nav-item > a.pos-link {
  background: var(--accent) !important; color: var(--accent-contrast) !important; border-radius: 12px; padding: 10px 18px; font-weight: 800;
  box-shadow: 0 8px 18px -8px rgba(var(--accent-rgb), .8);
}
html.ui3 body.marca nav.navbar .nav-menu > .nav-item > a.pos-link i { display: none; }
html.ui3 body.marca nav.navbar .nav-menu > .nav-item > a.pos-link::before { content: '+'; font-size: 17px; line-height: 1; }

/* ---------- 3) Páginas, tarjetas y tablas ---------- */
html.ui3 body.marca .page { background: var(--bg); }
html.ui3 body.marca .page > #content, html.ui3 body.marca .page > section, html.ui3 body.marca .page section > .container-fluid { max-width: 1440px; margin-left: auto; margin-right: auto; }
html.ui3 body.marca .container-fluid { padding-left: 24px; padding-right: 24px; }
html.ui3 body.marca .card { border-radius: var(--ui3-radius) !important; border: 1px solid var(--border) !important; box-shadow: var(--ui3-shadow) !important; }
html.ui3 body.marca .card-header { background: transparent !important; border-bottom: 1px solid var(--border) !important; padding: 18px 22px; }
html.ui3 body.marca .card-header h3, html.ui3 body.marca .card-header h4 { font-size: 20px; margin: 0; }
html.ui3 body.marca .card-body { padding: 22px; }
html.ui3 body.marca .btn { border-radius: 12px !important; font-weight: 700; }
html.ui3 body.marca .btn-primary, html.ui3 body.marca .btn-info { background: var(--brand) !important; border-color: var(--brand) !important; color: var(--brand-contrast) !important; }
html.ui3 body.marca .btn-success { background: #16a34a !important; border-color: #16a34a !important; }
html.ui3 body.marca .form-control, html.ui3 body.marca .custom-select, html.ui3 body.marca .bootstrap-select > .dropdown-toggle { border-radius: 12px !important; min-height: 42px; }
html.ui3 body.marca .badge { border-radius: 999px; padding: 4px 10px; font-weight: 700; }
html.ui3 body.marca .table thead th { background: transparent !important; color: var(--text-muted) !important; font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; border-top: 0 !important; border-bottom: 1px solid var(--border) !important; padding: 12px 14px; }
html.ui3 body.marca .table td { padding: 13px 14px; vertical-align: middle; border-color: var(--border) !important; font-size: 14px; }
html.ui3 body.marca .table-striped tbody tr:nth-of-type(odd) { background: transparent !important; }
html.ui3 body.marca .dataTables_wrapper .dataTables_filter input { border-radius: 12px; min-height: 40px; }
html.ui3 body.marca .nav-tabs { border-bottom: 0; gap: 6px; flex-wrap: wrap; }
html.ui3 body.marca .nav-tabs .nav-link { border: 1px solid var(--border) !important; border-radius: 999px !important; background: var(--surface); color: var(--text) !important; font-weight: 600; padding: 8px 15px; }
html.ui3 body.marca .nav-tabs .nav-link.active { background: var(--text) !important; color: var(--surface) !important; border-color: var(--text) !important; }
html.ui3 body.marca .ui-chip { border-radius: 999px; }
html.ui3 body.marca .modal-content { border-radius: 20px !important; }
html.ui3 body.marca .dropdown-menu { border-radius: 14px !important; border: 1px solid var(--border) !important; box-shadow: 0 18px 40px -12px rgba(16, 24, 40, .22) !important; padding: 6px; }
html.ui3 body.marca .alert { border-radius: 14px; }

/* ---------- 4) Celular: barra de navegación inferior ---------- */
html.ui3 .ui3-tabbar { display: none; }
@media (max-width: 767px) {
  html.ui3 body.marca { padding-bottom: 96px; }
  /* El aviso rojo de «Entorno de pruebas» sube encima de la barra inferior */
  html.ui3 body.marca > div[style*="99999"] { bottom: 66px !important; padding: 2px 8px !important; font-size: 11px !important; }
  html.ui3 .ui3-tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
    background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  }
  html.ui3 .ui3-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--text-muted) !important; font-size: 11px; font-weight: 600; text-decoration: none !important; min-height: 44px; }
  html.ui3 .ui3-tabbar a i { font-size: 20px; }
  html.ui3 .ui3-tabbar a.is-active { color: var(--brand-ink) !important; font-weight: 800; }
  html.ui3 .ui3-tabbar a.ui3-tab-vender { color: var(--accent) !important; font-weight: 800; }
  html.ui3 body.marca .container-fluid { padding-left: 16px; padding-right: 16px; }
  html.ui3 body.marca .card-body { padding: 16px; }
}
@media print { html.ui3 .ui3-tabbar { display: none !important; } }

/* =============================================================================
   5) Páginas rediseñadas (v3) — piezas comunes: .v3-page, encabezado, cifras, filtros, tarjetas, tablas, etiquetas.
   Las usan las vistas resources/views/<módulo>/v3/*. Siguen el lienzo «Entre tu y yo — Rediseño».
   ============================================================================= */
html.ui3 .v3-page { max-width: 1280px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 18px; font-size: 14px; }
html.ui3 .v3-page a { text-decoration: none; }
html.ui3 .v3-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
html.ui3 .v3-head h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
html.ui3 .v3-head .v3-sub { margin: 2px 0 0; color: var(--text-muted); font-size: 13px; }
html.ui3 .v3-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
html.ui3 .v3-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text) !important; font: 700 14px var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
html.ui3 .v3-btn:hover { background: var(--bg); }
html.ui3 .v3-btn:active { transform: scale(.98); }
html.ui3 .v3-btn-icon { width: 44px; padding: 0; }
html.ui3 .v3-btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast) !important; }
html.ui3 .v3-btn-primary:hover { background: var(--brand-hover); }
html.ui3 .v3-btn-green { background: #16a34a; border-color: #16a34a; color: #fff !important; font-weight: 800; }
html.ui3 .v3-btn-green:hover { background: #15803d; }
html.ui3 .v3-btn-big { min-height: 50px; padding: 12px 22px; font-size: 15px; }
html.ui3 .v3-btn-danger { color: #b91c1c !important; }
html.ui3 .v3-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
html.ui3 .v3-kpi { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px 20px; color: var(--text) !important; }
html.ui3 a.v3-kpi:hover { border-color: rgba(var(--brand-rgb), .45); }
html.ui3 .v3-kpi span { display: block; color: var(--text-muted); font-size: 13px; }
html.ui3 .v3-kpi strong { display: block; margin-top: 4px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
html.ui3 .v3-kpi small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 12px; }
html.ui3 .v3-kpi-red { border-color: #fecaca; } html.ui3 .v3-kpi-red span, html.ui3 .v3-kpi-red strong { color: #b91c1c; }
html.ui3 .v3-kpi-brand { background: var(--brand); border-color: var(--brand); }
html.ui3 .v3-kpi-brand span, html.ui3 .v3-kpi-brand strong, html.ui3 .v3-kpi-brand small { color: var(--brand-contrast) !important; opacity: .95; }
html.ui3 .v3-kpi.is-on { border: 2px solid var(--brand); background: var(--brand-softer); }
html.ui3 .v3-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
html.ui3 .v3-search { position: relative; flex: 1 1 280px; }
html.ui3 .v3-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
html.ui3 .v3-search input { width: 100%; min-height: 44px; padding: 10px 14px 10px 38px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: 500 14px var(--font); outline: none; }
html.ui3 .v3-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .18); }
html.ui3 .v3-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text) !important; font-weight: 600; font-size: 13px; white-space: nowrap; cursor: pointer; }
html.ui3 .v3-chip:hover { background: var(--bg); }
html.ui3 .v3-chip.is-on { background: var(--text); border-color: var(--text); color: var(--surface) !important; font-weight: 700; }
html.ui3 .v3-chip-warn { border-color: #fed7aa; background: #fff7ed; color: #9a3412 !important; font-weight: 700; }
html.ui3 .v3-chip-red { border-color: #fecaca; background: #fef2f2; color: #b91c1c !important; font-weight: 700; }
html.ui3 .v3-hint { margin: 0; color: var(--text-muted); font-size: 13px; }
html.ui3 .v3-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px; }
html.ui3 .v3-card h2 { margin: 0 0 14px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
html.ui3 .v3-card-flush { padding: 0; overflow: hidden; }
html.ui3 .v3-empty { color: var(--text-muted); text-align: center; padding: 36px; }
html.ui3 .v3-table { width: 100%; border-collapse: collapse; }
html.ui3 .v3-table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
html.ui3 .v3-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
html.ui3 .v3-table tbody tr:last-child td { border-bottom: 0; }
html.ui3 .v3-table tr[data-href] { cursor: pointer; }
html.ui3 .v3-table tbody tr:hover { background: var(--brand-softer); }
html.ui3 .v3-table .text-right { text-align: right; font-variant-numeric: tabular-nums; }
html.ui3 .v3-table .v3-check { width: 44px; }
html.ui3 .v3-strong { font-weight: 700; color: var(--text) !important; }
html.ui3 a.v3-strong { color: var(--brand-ink) !important; }
html.ui3 .v3-muted { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
html.ui3 .v3-pill { display: inline-block; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
html.ui3 .v3-pill-gray { background: #f4f4f5; color: #3f3f46; }
html.ui3 .v3-pill-brand { background: var(--brand-soft); color: var(--brand-ink); }
html.ui3 .v3-pill-green { background: #dcfce7; color: #166534; }
html.ui3 .v3-pill-red { background: #fef2f2; color: #b91c1c; }
html.ui3 .v3-pill-orange { background: #fff7ed; color: #9a3412; }
html.ui3 .v3-pill-blue { background: #e0f2fe; color: #075985; }
html.ui3[data-tema="oscuro"] .v3-pill-gray { background: rgba(255,255,255,.08); color: var(--text); }
html.ui3[data-tema="oscuro"] .v3-pill-green { background: rgba(22,163,74,.18); color: #86efac; }
html.ui3[data-tema="oscuro"] .v3-pill-red, html.ui3[data-tema="oscuro"] .v3-chip-red { background: rgba(220,38,38,.18); color: #fca5a5 !important; border-color: rgba(220,38,38,.35); }
html.ui3[data-tema="oscuro"] .v3-pill-orange, html.ui3[data-tema="oscuro"] .v3-chip-warn { background: rgba(234,88,12,.18); color: #fdba74 !important; border-color: rgba(234,88,12,.35); }
html.ui3 .v3-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
html.ui3 .v3-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
html.ui3 .v3-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
html.ui3 .v3-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
html.ui3 .v3-row > span:first-child { color: var(--text-muted); }
html.ui3 .v3-row-total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; font-size: 20px; font-weight: 800; }
html.ui3 .v3-row-total > span:first-child { color: var(--text); }
html.ui3 .v3-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg); border-radius: 12px; }
html.ui3 .v3-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
html.ui3 .v3-steps li { border-radius: 14px; padding: 14px 16px; font-weight: 700; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); }
html.ui3 .v3-steps li.is-done { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
html.ui3 .v3-steps li.is-now { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
html.ui3[data-tema="oscuro"] .v3-steps li.is-done { background: rgba(22,163,74,.15); border-color: rgba(22,163,74,.35); color: #86efac; }
html.ui3 .v3-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
html.ui3 .v3-hero h1 { margin: 4px 0 8px; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
html.ui3 .v3-back { font-size: 13px; font-weight: 600; color: var(--brand-ink) !important; }
@media (max-width: 767px) {
  html.ui3 .v3-page { padding: 16px 16px 32px; gap: 14px; }
  html.ui3 .v3-head h1, html.ui3 .v3-hero h1 { font-size: 23px; }
  html.ui3 .v3-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.ui3 .v3-kpi { padding: 14px 16px; } html.ui3 .v3-kpi strong { font-size: 21px; }
  html.ui3 .v3-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  html.ui3 .v3-filters .v3-search { flex: 0 0 100%; }
  html.ui3 .v3-filters { flex-wrap: wrap; }
  /* Tablas como tarjetas en el celular */
  html.ui3 .v3-card-flush { background: transparent; border: 0; overflow: visible; }
  html.ui3 .v3-table thead { display: none; }
  html.ui3 .v3-table, html.ui3 .v3-table tbody, html.ui3 .v3-table tr, html.ui3 .v3-table td { display: block; width: 100%; }
  html.ui3 .v3-table tr { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; position: relative; }
  html.ui3 .v3-table td { border: 0; padding: 3px 0; text-align: left !important; display: flex; justify-content: space-between; gap: 10px; }
  html.ui3 .v3-table td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; font-weight: 600; }
  html.ui3 .v3-table td[data-label="Cliente"] { display: block; padding-bottom: 6px; }
  html.ui3 .v3-table td[data-label="Cliente"]::before, html.ui3 .v3-table td.v3-check::before { display: none; }
  html.ui3 .v3-table td.v3-check { position: absolute; right: 12px; top: 12px; width: auto; }
  html.ui3 .v3-steps { gap: 6px; } html.ui3 .v3-steps li { padding: 10px; font-size: 12px; }
}
/* Las páginas rediseñadas traen su propio título: se ocultan las migas automáticas */
html.ui3 #content:has(.v3-page) > .page-head, html.ui3 .page:has(.v3-page) .page-head { display: none !important; }
html.ui3 .page:has(.v3-page) > #content { padding: 0; }
html.ui3 body.marca .page section.v3-card { padding: 22px; }
html.ui3 .v3-btn { white-space: normal; text-align: center; }
/* Chips que el script de siempre marca con .on (Ventas) */
html.ui3 .v3-chip.on { background: var(--text); border-color: var(--text); color: var(--surface) !important; font-weight: 700; }
html.ui3 .v3-chip-warn.on { background: #9a3412; border-color: #9a3412; color: #fff !important; }
/* Tablas completas (DataTables) dentro de una tarjeta v3: se respetan todas las columnas */
html.ui3 .v3-dt { padding: 18px 20px; }
html.ui3 .v3-dt .table-responsive { margin: 0; }
html.ui3 .v3-dt > .container-fluid { padding: 0 !important; }
/* Sin doble tarjeta: DataTables dentro de .v3-dt no lleva su propio marco */
html.ui3 .v3-dt .dataTables_wrapper, html.ui3 .v3-dt .card { border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 0 !important; }
/* Inventario: tarjetas de local con el estilo de las cifras v3 y avisos como chips */
html.ui3 .v3-inv .pr-stores { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0; }
html.ui3 .v3-inv .pr-store { border-radius: 18px; padding: 18px 20px; border: 1px solid var(--border); background: var(--surface); }
html.ui3 .v3-inv .pr-store .nm { font-size: 13px; font-weight: 500; color: var(--text-muted); }
html.ui3 .v3-inv .pr-store .un { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; color: var(--text); }
html.ui3 .v3-inv .pr-store .pc { margin-top: 2px; }
html.ui3 .v3-inv .pr-store.is-active { border: 2px solid var(--brand); background: var(--brand-softer); box-shadow: none; }
html.ui3 .v3-inv .pr-alerts { margin: 0; }
html.ui3 .v3-inv .pr-alerts a { min-height: 38px; padding: 8px 14px; font-size: 13px; font-weight: 700; }
/* Tabla de productos: más compacta y legible. Solo CSS: no cambia columnas, orden ni exportación. */
html.ui3 .v3-inv #product-data-table { font-size: 14px; }
html.ui3 .v3-inv #product-data-table thead th { font-size: 12px; font-weight: 700; padding: 8px 10px; white-space: nowrap; }
html.ui3 .v3-inv #product-data-table td { padding: 7px 10px; line-height: 1.3; vertical-align: middle; }
html.ui3 .v3-inv #product-data-table td:nth-child(2) img { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; }
html.ui3 .v3-inv #product-data-table td:nth-child(3) { font-weight: 600; color: var(--text); }
html.ui3 .v3-inv #product-data-table td:nth-child(4) { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
html.ui3 .v3-inv #product-data-table td:nth-child(8),
html.ui3 .v3-inv #product-data-table td:nth-child(10) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
html.ui3 .v3-inv #product-data-table .btn { min-height: 34px; }
@media (max-width: 767px) {
  /* En el celular solo se ven lo esencial: nombre, código, cantidad, precio y acciones. El resto sigue en la ficha del producto. */
  html.ui3 .v3-inv #product-data-table th:nth-child(2), html.ui3 .v3-inv #product-data-table td:nth-child(2),
  html.ui3 .v3-inv #product-data-table th:nth-child(5), html.ui3 .v3-inv #product-data-table td:nth-child(5),
  html.ui3 .v3-inv #product-data-table th:nth-child(6), html.ui3 .v3-inv #product-data-table td:nth-child(6),
  html.ui3 .v3-inv #product-data-table th:nth-child(7), html.ui3 .v3-inv #product-data-table td:nth-child(7),
  html.ui3 .v3-inv #product-data-table th:nth-child(9), html.ui3 .v3-inv #product-data-table td:nth-child(9) { display: none; }
  html.ui3 .v3-inv #product-data-table td { padding: 8px 6px; font-size: 14px; }
  html.ui3 .v3-inv #product-data-table td:nth-child(3) { white-space: normal; }
  html.ui3 .v3-inv #product-data-table td:nth-child(4) { font-size: 12px; }
  html.ui3 .v3-inv #product-data-table td:nth-child(10) { white-space: nowrap; }
}
@media (max-width: 767px) {
  html.ui3 .v3-inv .pr-stores { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  html.ui3 .v3-inv .pr-store { padding: 14px 16px; } html.ui3 .v3-inv .pr-store .un { font-size: 21px; }
}
/* Acciones dentro de tablas v3 (conciliación) y tablas en celular sin cabecera de celda vacía */
html.ui3 .v3-acts .v3-btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
@media (max-width: 767px) {
  html.ui3 .v3-table td.v3-acts { display: block; } html.ui3 .v3-table td.v3-acts::before { display: block; margin-bottom: 6px; }
  html.ui3 .v3-table td[data-label="Movimiento"], html.ui3 .v3-table td[data-label="Pago"]:first-child, html.ui3 .v3-table td[data-label="Banco"]:first-child, html.ui3 .v3-table td[data-label="Tienda"] { display: block; padding-bottom: 6px; }
  html.ui3 .v3-table td[data-label="Movimiento"]::before, html.ui3 .v3-table td[data-label="Tienda"]::before { display: none; }
  html.ui3 .v3-hero .v3-actions { width: 100%; } html.ui3 .v3-hero .v3-actions > * { flex: 1 1 auto; }
  html.ui3 .v3-side[style*="sticky"] { position: static !important; }
}
html.ui3 body.marca .page section.v3-card.v3-card-flush { padding: 0; }
@media (max-width: 767px) {
  html.ui3 .v3-filters > span[style*="flex:1"] { display: none; }
  html.ui3 .v3-filters > label { flex: 0 0 100%; margin-top: 4px !important; }
  html.ui3 .v3-filters > select { flex: 1 1 100%; width: 100% !important; }
  html.ui3 .v3-head .v3-actions { width: 100%; } html.ui3 .v3-head .v3-actions > .v3-btn { flex: 1 1 auto; }
}

/* ---------- Celular más compacto (pedido de Martín): letras, tarjetas y campos más pequeños, sin perder fluidez ----------
   Los campos de texto quedan en 16px para que el iPhone no haga zoom al tocarlos; solo bajan su alto y relleno. */
@media (max-width: 767px) {
  html.ui3 body.marca { font-size: 13px !important; }
  html.ui3 .v3-page { padding: 12px 12px 24px; gap: 10px; font-size: 13px; }
  html.ui3 .v3-head h1, html.ui3 .v3-hero h1 { font-size: 20px; }
  html.ui3 .v3-head .v3-sub { font-size: 12px; }
  html.ui3 .v3-card { padding: 14px; border-radius: 14px; }
  html.ui3 body.marca .page section.v3-card { padding: 14px; }
  html.ui3 .v3-card h2 { font-size: 15px; margin-bottom: 10px; }
  html.ui3 .v3-kpis { gap: 8px; }
  html.ui3 .v3-kpi { padding: 10px 12px; border-radius: 14px; }
  html.ui3 .v3-kpi span { font-size: 11.5px; } html.ui3 .v3-kpi strong { font-size: 17px; margin-top: 2px; } html.ui3 .v3-kpi small { font-size: 11px; }
  html.ui3 .v3-btn { min-height: 38px; padding: 7px 12px; font-size: 13px; border-radius: 10px; }
  html.ui3 .v3-btn-icon { width: 38px; } html.ui3 .v3-btn-big { min-height: 44px; font-size: 14px; }
  html.ui3 .v3-chip { min-height: 32px; padding: 5px 11px; font-size: 12px; }
  html.ui3 .v3-search input { min-height: 40px; padding: 8px 12px 8px 34px; font-size: 16px; }
  html.ui3 .v3-table tr { padding: 10px 12px; border-radius: 12px; margin-bottom: 8px; }
  html.ui3 .v3-table td { font-size: 13px; padding: 2px 0; }
  html.ui3 .v3-muted { font-size: 11.5px; }
  html.ui3 .v3-pill { font-size: 11px; padding: 3px 9px; }
  html.ui3 .v3-item { padding: 10px 12px; gap: 10px; }
  html.ui3 .v3-row { padding: 2px 0; } html.ui3 .v3-row-total { font-size: 17px; padding-top: 8px; }
  html.ui3 .v3-steps li { padding: 8px; font-size: 11px; border-radius: 10px; }
  html.ui3 body.marca .form-control, html.ui3 body.marca .custom-select, html.ui3 body.marca .bootstrap-select > .dropdown-toggle { min-height: 40px; padding: 6px 12px; font-size: 16px; }
  html.ui3 body.marca label { font-size: 12.5px; margin-bottom: 4px; }
  html.ui3 body.marca .form-group { margin-bottom: 10px; }
  html.ui3 .v3-inv .pr-store { padding: 10px 12px; border-radius: 14px; }
  html.ui3 .v3-inv .pr-store .un { font-size: 17px; } html.ui3 .v3-inv .pr-store .nm, html.ui3 .v3-inv .pr-store .pc { font-size: 11.5px; }
  html.ui3 .v3-inv .pr-alerts a, html.ui3 .v3-dt .dataTables_wrapper { font-size: 12.5px; }
  html.ui3 .v3-dt { padding: 12px; }
  html.ui3 .zona-avisos > .alert { font-size: 12.5px; padding: 8px 36px 8px 12px; }
  html.ui3 .ui3-tabbar a { font-size: 10.5px; min-height: 40px; } html.ui3 .ui3-tabbar a i { font-size: 18px; }
  /* Fluidez: desplazamiento suave y sin retraso al tocar */
  html.ui3 { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  html.ui3 .v3-btn, html.ui3 .v3-chip, html.ui3 .v3-table tr, html.ui3 .ui3-tabbar a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
}
@media (max-width: 767px) {
  html.ui3 body.marca input::placeholder, html.ui3 body.marca textarea::placeholder { font-size: 13px; }
  html.ui3 .v3-item .form-control-sm { min-height: 32px !important; font-size: 16px; padding: 2px 8px; }
}

/* Encabezado de listados (Clientes, Compras, Usuarios…): título a la izquierda y acciones a la derecha, con los mismos botones que Ventas */
html.ui3 .ui3-pagebar { align-items: center; padding-bottom: 8px; }
html.ui3 .ui3-pagebar .ui2-toolbar { margin: 0 0 0 auto; gap: 10px; justify-content: flex-end; }
html.ui3 .ui3-pagebar .ui2-toolbar .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px; font: 700 14px var(--font); white-space: nowrap; }
html.ui3 .ui3-pagebar .ui2-toolbar .btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast) !important; }
html.ui3 .ui3-pagebar .ui2-toolbar .btn-primary:hover { background: var(--brand-hover); }
html.ui3 .ui3-pagebar .ui2-toolbar .btn-outline-primary, html.ui3 .ui3-pagebar .ui2-toolbar .btn-outline-secondary { background: var(--surface); border-color: var(--border); color: var(--text) !important; }
html.ui3 .ui3-pagebar .ui2-toolbar .btn-outline-primary:hover, html.ui3 .ui3-pagebar .ui2-toolbar .btn-outline-secondary:hover { background: var(--bg); }
html.ui3 .ui3-pagebar .ui2-toolbar .form-inline { margin-right: 6px; }
html.ui3 .ui3-pagebar h1 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 0; }
html.ui3 #content .page-head.ui3-pagebar { padding-left: 24px; padding-right: 24px; }
@media (max-width: 767px) {
  html.ui3 .ui3-pagebar h1 { font-size: 23px; }
  html.ui3 #content .page-head.ui3-pagebar { padding-left: 16px; padding-right: 16px; }
  html.ui3 .ui3-pagebar .ui2-toolbar { width: 100%; margin: 6px 0 0; justify-content: flex-start; }
  html.ui3 .ui3-pagebar .ui2-toolbar .ui2-primary { flex: 1 1 auto; }
}
/* Filtros de etiquetas de Clientes: botones grandes y separados, como los filtros de Ventas */
html.ui3 .customer-tag-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 24px 16px; }
html.ui3 .cust-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text) !important; font: 600 14px var(--font); cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s; }
html.ui3 .cust-chip:hover { background: var(--bg); }
html.ui3 .cust-chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink, var(--brand)) !important; font-weight: 800; }
html.ui3 .cust-count { display: inline-block; min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--text-muted); font-size: 12px; font-weight: 700; text-align: center; }
html.ui3 .cust-chip.on .cust-count { background: var(--surface); color: var(--brand-ink, var(--brand)); }
html.ui3 .cust-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
html.ui3 .cust-spacer { flex: 1 1 auto; }
html.ui3 .cust-chip-add { border-style: dashed; border-color: var(--brand); color: var(--brand-ink, var(--brand)) !important; font-weight: 700; }
@media (max-width: 767px) { html.ui3 .customer-tag-filters { padding: 6px 16px 12px; gap: 10px; } html.ui3 .cust-chip { min-height: 40px; padding: 8px 14px; font-size: 13px; } html.ui3 .cust-spacer { flex: 0 0 100%; height: 0; } }

/* Encabezado de todas las tablas con el color de la marca (el mismo de los botones principales), para distinguirlo del contenido */
html.ui2 body.marca .table thead th,
html.ui2 body.marca table.dataTable thead th,
html.ui2 body.marca .v3-table thead th { background: var(--brand) !important; color: var(--brand-contrast) !important; border-bottom: 0 !important; border-top: 0 !important; font-weight: 700; padding-top: 12px; padding-bottom: 12px; }
html.ui2 body.marca .table thead th:first-child, html.ui2 body.marca .v3-table thead th:first-child { border-top-left-radius: 10px; }
html.ui2 body.marca .table thead th:last-child, html.ui2 body.marca .v3-table thead th:last-child { border-top-right-radius: 10px; }
html.ui2 body.marca table.dataTable thead .sorting::before, html.ui2 body.marca table.dataTable thead .sorting::after,
html.ui2 body.marca table.dataTable thead .sorting_asc::before, html.ui2 body.marca table.dataTable thead .sorting_asc::after,
html.ui2 body.marca table.dataTable thead .sorting_desc::before, html.ui2 body.marca table.dataTable thead .sorting_desc::after { color: var(--brand-contrast) !important; }
html.ui2 body.marca table.dataTable thead .sorting::after, html.ui2 body.marca table.dataTable thead .sorting::before { opacity: .55; }
html.ui2 body.marca table.dataTable thead .sorting_asc::before, html.ui2 body.marca table.dataTable thead .sorting_desc::after { opacity: 1; }
html.ui2 body.marca .table thead th a, html.ui2 body.marca .v3-table thead th a { color: inherit !important; }
