/* =========================================================
   Módulo de Ventas · Importaciones Rivas
   Mismo sistema visual que el Facturador FEL:
   grafito + rojo del logo, tipografía Barlow.
   Se carga después de Bootstrap 3 y main.css y solo cambia
   la apariencia; no cambia nombres de clases usados por el JS.
   ========================================================= */
:root {
  --ink: #1E2228;
  --ink-2: #3A414B;
  --muted: #5F6773;
  --line: #DCE0E5;
  --line-soft: #ECEEF1;
  --bg: #EEF0F3;
  --surface: #FFFFFF;
  --head: #F7F8FA;
  --red: #D10A0A;
  --red-dark: #A80808;
  --red-soft: #FDECEC;

  --ok: #1D7A46;   --ok-soft: #E3F3EA;
  --warn: #8A5800; --warn-soft: #FDF1DA;
  --bad: #B42318;  --bad-soft: #FDE7E5;
  --info: #1F4E8C; --info-soft: #E5EEF9;
  --off: #5F6773;  --off-soft: #ECEEF1;

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --sidebar: 248px;
  --topbar: 60px;
  --radius: 10px;
  --radius-sm: 6px;
}

/* ---------- Base ---------- */
* { font-family: var(--font); -webkit-text-stroke: 0; }
html, body { height: 100%; background: var(--bg); }
body {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .h1, .h2, .h3, .h4 { font-family: var(--font-display); font-weight: 700; color: var(--ink); letter-spacing: .005em; }
a { color: var(--ink); }
a:hover, a:focus { color: var(--red); }
:focus-visible { outline: 3px solid rgba(209,10,10,.35); outline-offset: 2px; }
.text-danger { color: var(--bad); }
.text-success { color: var(--ok); }
.text-primary { color: var(--ink); }
.text-muted { color: var(--muted); }

/* ---------- Estructura: menú lateral ---------- */
.app-sidebar {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  z-index: 1040;
}
.app-brand {
  display: block;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none !important;
}
.app-brand img { display: block; width: 150px; height: auto; }
.app-brand span { display: block; margin-top: 4px; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--muted); }

.app-nav { list-style: none; margin: 0; padding: 16px 12px; flex: 1; overflow-y: auto; }
.app-nav .nav-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 500; font-size: 15px;
  text-decoration: none;
}
.app-nav .nav-link svg { flex: none; width: 18px; height: 18px; stroke: var(--muted); }
.app-nav .nav-link:hover { background: var(--line-soft); color: var(--ink); }
.app-nav .nav-item.active .nav-link { background: var(--red-soft); color: var(--ink); font-weight: 600; }
.app-nav .nav-item.active .nav-link svg { stroke: var(--red); }
.app-nav .nav-item.active .nav-link::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--red);
}
.app-nav-titulo { margin: 18px 14px 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.app-user { border-top: 1px solid var(--line-soft); padding: 14px 16px 16px; }
.app-user-fila { display: flex; align-items: center; gap: 10px; }
.app-user-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
}
.app-user-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-user-acciones { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.app-user-acciones a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: none !important;
}
.app-user-acciones a svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }
.app-user-acciones a:hover { background: var(--line-soft); color: var(--red); }

.app-topbar { display: none; }
.app-backdrop { display: none; position: fixed; inset: 0; background: rgba(30,34,40,.45); z-index: 1030; }

/* Contenido */
#wrap.app-main {
  margin: 0 0 0 var(--sidebar);
  padding: 28px 32px 0;
  min-height: 100vh;
  height: auto !important;
}
#wrap.app-main > .container,
#wrap.app-main .container {
  width: auto; max-width: 1320px;
  margin: 0; padding: 0;
}
#wrap.app-main > br { display: none; }
.app-footer {
  clear: both;
  padding: 28px 0 22px;
  color: var(--muted); font-size: 13px; text-align: center;
}
.app-footer a { color: var(--muted); }
#footer { display: none; }

/* Encabezado de página (títulos que traían las pantallas) */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
.page-head h1 { font-size: 30px; line-height: 1.15; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

@media (max-width: 991.98px) {
  .app-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; z-index: 1020;
    height: var(--topbar); padding: 0 14px;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .app-topbar-brand img { height: 40px; width: auto; display: block; }
  .app-topbar-titulo { flex: 1; margin-left: 12px; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-menu-toggle {
    display: grid; place-items: center;
    border: 1px solid var(--line); background: var(--surface);
    border-radius: var(--radius-sm); width: 44px; height: 44px; color: var(--ink); padding: 0;
  }
  .app-menu-toggle svg { width: 22px; height: 22px; stroke: var(--ink); }
  .app-sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-abierto .app-sidebar { transform: none; box-shadow: 0 0 40px rgba(30,34,40,.25); }
  body.menu-abierto .app-backdrop { display: block; }
  #wrap.app-main { margin-left: 0; padding: calc(var(--topbar) + 16px) 12px 0; }
  .page-head h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .app-sidebar { transition: none; } }

/* ---------- Barra de acciones de pedidos / recibos ---------- */
DIV#submenu {
  position: fixed; top: 0; left: var(--sidebar); right: 0; width: auto;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  z-index: 1010;
  -webkit-backdrop-filter: saturate(1.4) blur(6px); backdrop-filter: saturate(1.4) blur(6px);
}
DIV#submenu_container { max-width: 1320px; margin: 0; padding: 0 32px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
DIV#submenu BUTTON { margin: 0; }
DIV#submenu .btn-group { margin: 0; }
DIV#submenu .btn-lg { display: inline-flex; align-items: center; gap: 6px; }
DIV#submenu .dropdown-menu { border: 1px solid var(--line) !important; background: var(--surface) !important; box-shadow: 0 10px 30px rgba(30,34,40,.14) !important; padding: 6px; min-width: 190px; }
DIV#submenu .dropdown-menu > li > .btn { width: 100% !important; text-align: left; justify-content: flex-start; margin: 0 0 4px !important; }
DIV#submenu .dropdown-menu > li > .btn.hide { display: none !important; }
.scontainer { margin-top: 56px !important; }
@media (max-width: 991.98px) {
  DIV#submenu { top: var(--topbar); left: 0; padding: 8px 0; }
  DIV#submenu_container { padding: 0 12px; }
}

/* ---------- Paneles ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-default > .panel-heading,
.panel > .panel-heading {
  background: var(--surface);
  background-image: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 16px 20px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.2;
  border-radius: 0;
}
.panel-heading > i[class^="icon-"] { display: none; }
.panel-heading > span[style*="padding-left"] { padding-left: 0 !important; }
.panel-body { padding: 20px; }
.panel-info { border-color: var(--line); }
.panel-info > .panel-heading { background: var(--head); color: var(--ink); font-family: var(--font); font-size: 16px; font-weight: 600; border-color: var(--line-soft); }
.panel-info > .panel-heading * { color: inherit; }
.panel-info > .panel-heading .icon-calendar,
.panel-info > .panel-heading [class*="calendar"] { color: var(--muted); }
.panel .panel { border-radius: var(--radius-sm); }
.panel > .table-responsive { border: 0; margin-bottom: 0 !important; }
.well { background: var(--head); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: none; }

/* ---------- Formularios ---------- */
.form-control {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: none;
  color: var(--ink);
  font-size: 16px;
}
.form-control:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(30,34,40,.12); }
.form-control::placeholder { color: #9AA1AB; }
.input-lg, .form-control.input-lg { height: 46px; font-size: 16px; border-radius: var(--radius-sm); }
.input-group-addon {
  background: var(--head); border-color: var(--line); color: var(--muted);
  border-radius: var(--radius-sm);
}
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group-btn > .btn.input-lg { height: 46px; }
label { font-weight: 600; color: var(--ink-2); }
SELECT:disabled, input[type="text"]:disabled, input[type="number"]:disabled { background: var(--head) !important; color: var(--ink) !important; }

/* ---------- Botones ---------- */
.btn {
  font-weight: 600;
  border-radius: var(--radius-sm);
  background-image: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-lg, .btn-group-lg > .btn { font-size: 16px; padding: 10px 18px; border-radius: var(--radius-sm); }
.btn [class^="icon-"], .btn [class*=" icon-"] { margin-right: 2px; }
.btn:focus, .btn.focus, .btn:active:focus { outline: 0; box-shadow: 0 0 0 3px rgba(209,10,10,.25) !important; }

.btn-default, .btn-info {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.btn-default:hover, .btn-default:focus, .btn-default.active, .open > .dropdown-toggle.btn-default,
.btn-info:hover, .btn-info:focus, .btn-info.active {
  background: var(--line-soft); border-color: var(--line); color: var(--ink);
}
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary {
  background: #000; border-color: #000; color: #fff;
}
.btn-warning { background: var(--red); border-color: var(--red); color: #fff; }
.btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning {
  background: var(--red-dark); border-color: var(--red-dark); color: #fff;
}
.btn-success, .btn-sucess { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active,
.btn-sucess:hover, .btn-sucess:focus { background: #166239; border-color: #166239; color: #fff; }
.btn-danger { background: var(--surface); border: 1px solid #E7B4AF; color: var(--bad); }
.btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger {
  background: var(--bad); border-color: var(--bad); color: #fff;
}
.btn.disabled, .btn[disabled], fieldset[disabled] .btn { opacity: .45; }
.btn-danger.disabled, .btn-danger[disabled] { background: var(--surface); color: var(--bad); }
/* Datos del cliente: descuento, límite, saldo (son indicadores, no botones) */
.panel-cliente p.btn {
  cursor: default; text-align: left; line-height: 1.35;
  padding: 10px 16px; margin: 0 8px 8px 0 !important;
  background: var(--head); border: 1px solid var(--line); color: var(--ink);
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.panel-cliente p.btn strong { display: inline-block; font-weight: 500; font-size: 13px; color: var(--muted); }
.panel-cliente p.btn-danger { background: var(--bad-soft); border-color: #F4C7C2; color: var(--bad); }
.panel-cliente p.btn-success { background: var(--ok-soft); border-color: #BFE2CE; color: var(--ok); }
.panel-cliente p.btn-warning, .panel-cliente p.btn-primary, .panel-cliente p.btn-info, .panel-cliente p.btn-default { background: var(--head); color: var(--ink); }
.panel-cliente p.btn:hover { background: inherit; }
.panel-cliente .btn-group { margin-right: 8px; }
.btn-cheque-rechazado { text-align: left; }
.btn-cheque-rechazado .badge { margin-top: 10px !important; }

/* botones de "seleccionar fila" del detalle */
.btn-default .icon-check-empty { color: #9AA1AB !important; }

/* ---------- Menús desplegables ---------- */
.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(30,34,40,.14);
  padding: 6px;
  margin-top: 4px;
}
.dropdown-menu > li > a {
  padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: 16px !important; color: var(--ink);
}
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { background: var(--line-soft); background-image: none; color: var(--ink); }
.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover { background: var(--red-soft); background-image: none; color: var(--ink); }
.btn .caret { font-size: inherit !important; margin-left: 6px; }

/* ---------- Tablas ---------- */
.table-responsive { border: 0; }
.table { margin-bottom: 0; font-size: 14.5px; background: var(--surface); }
.table > thead > tr > th,
.table > thead > tr > td {
  background: var(--head) !important;
  color: var(--muted) !important;
  font-weight: 600; font-size: 12.5px; letter-spacing: .03em; text-transform: uppercase;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line) !important;
  border-top: 0 !important;
  vertical-align: middle;
  white-space: nowrap;
}
.table > tbody > tr > td, .table > tbody > tr > th {
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  vertical-align: middle;
}
.table-condensed > tbody > tr > td, .table-condenseds > tbody > tr > td { padding: 10px 14px; }
.table-bordered, .table-bordered > thead > tr > th, .table-bordered > tbody > tr > td,
.table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > td, .table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td {
  border-left: 0 !important; border-right: 0 !important;
}
.table-bordered { border: 0; }
.table-striped > tbody > tr:nth-of-type(odd), .table-striped > tbody > tr:nth-child(odd) > td { background: transparent; }
.table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover { background: #FAFBFC; }
TR.datagrid TD { cursor: pointer; }
.table > tfoot > tr > th, .table > tfoot > tr > td {
  background: var(--head) !important;
  color: var(--ink) !important;
  font-weight: 700;
  border-top: 1px solid var(--line) !important;
  padding: 12px 14px;
  font-variant-numeric: tabular-nums;
}
.table > tfoot > tr.warning > th, .table > tfoot > tr.warning > td { background: var(--warn-soft) !important; }
.table .text-right { font-variant-numeric: tabular-nums; }
.table > tbody > tr.success > td, .table > tbody > tr > td.success { background: var(--ok-soft); }
.table > tbody > tr.danger > td, .table > tbody > tr > td.danger { background: var(--bad-soft); }
.table > tbody > tr.warning > td, .table > tbody > tr > td.warning { background: var(--warn-soft); }
.table > tbody > tr.info > td, .table > tbody > tr > td.info { background: var(--info-soft); }
.table > tbody > tr.active > td, .table > tbody > tr > td.active { background: #FFF6F6; }

/* ---------- Etiquetas de estado ---------- */
.label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em; line-height: 1.4;
}
.label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.label-default { background: var(--off-soft); color: var(--off); }
.label-primary { background: #E4E6EA; color: var(--ink); }
.label-success { background: var(--ok-soft); color: var(--ok); }
.label-info    { background: var(--info-soft); color: var(--info); }
.label-warning { background: var(--warn-soft); color: var(--warn); }
.label-danger  { background: var(--bad-soft); color: var(--bad); }
.badge { background: var(--red); font-weight: 600; }

/* ---------- Paginación ---------- */
.pager { margin: 16px 0 6px; }
.pager li > a, .pager li > span {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 16px; color: var(--ink); font-weight: 600; background: var(--surface);
}
.pager li > a:hover { background: var(--line-soft); color: var(--ink); }
.pager .disabled > a, .pager .disabled > a:hover { color: #B2B8C0; background: var(--surface); }
.pagination-lg > li > a { font-size: 16px; }
.paginacion { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

/* ---------- Mensajes ---------- */
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; box-shadow: none; background-image: none; text-shadow: none; }
.alert-danger  { background: var(--bad-soft);  border-color: #F4C7C2; color: var(--bad); }
.alert-success { background: var(--ok-soft);   border-color: #BFE2CE; color: var(--ok); }
.alert-warning { background: var(--warn-soft); border-color: #F2D9A6; color: var(--warn); }
.alert-info    { background: var(--info-soft); border-color: #C9DAF0; color: var(--info); }

/* Ventanas emergentes (bootbox / modal de Bootstrap) */
.modal-content { border: 0; border-radius: 12px; box-shadow: 0 20px 60px rgba(30,34,40,.3); }
.modal-header { border-bottom: 1px solid var(--line); padding: 16px 20px; }
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.modal-body { padding: 20px; font-size: 16px; }
.modal-footer { border-top: 1px solid var(--line); padding: 14px 20px; }
.modal-backdrop.in { opacity: .45; background: var(--ink); }

/* Ventana propia de la aplicación (buscador de productos/clientes) */
DIV#modal, DIV#modal2 { border-radius: 12px; overflow: auto; box-shadow: 0 20px 60px rgba(30,34,40,.3); }
DIV#modal-over, DIV#modal-over2 { background: rgba(30,34,40,.55) !important; }
@media only screen and (max-width: 1023px) { DIV#modal, DIV#modal2 { border-radius: 0; } }

/* Indicador de carga */
.f_circleG { background-color: var(--red); }

/* ---------- Inicio ---------- */
.inicio-saludo { margin: 4px 0 24px; }
.inicio-saludo h1 { font-size: 32px; margin: 0; }
.inicio-saludo p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.inicio-accesos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.acceso {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px; min-height: 150px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none !important;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.acceso:hover, .acceso:focus { border-color: var(--ink); color: var(--ink); box-shadow: 0 8px 24px rgba(30,34,40,.08); transform: translateY(-1px); }
.acceso-icono { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--line-soft); }
.acceso-icono svg { width: 22px; height: 22px; stroke: var(--ink); }
.acceso strong { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.2; }
.acceso span { color: var(--muted); font-size: 14px; }
.acceso.destacado { background: var(--ink); border-color: var(--ink); color: #fff; }
.acceso.destacado .acceso-icono { background: var(--red); }
.acceso.destacado .acceso-icono svg { stroke: #fff; }
.acceso.destacado span { color: #C3C8CF; }
.acceso.destacado:hover { color: #fff; border-color: #000; background: #000; }
.inicio-franja { display: none; height: 6px; margin: 28px 0 0; border-radius: 3px; background: repeating-linear-gradient(-60deg, var(--red) 0 14px, var(--ink) 14px 28px); opacity: .9; }

/* ---------- Login ---------- */
body.login-page { background: var(--bg); }
body.login-page #wrap { margin: 0; padding: 0; min-height: 100vh; display: grid; place-items: center; }
body.login-page .app-footer { display: none; }
.login-wrap { width: 100%; padding: 32px 16px; display: grid; place-items: center; }
.login {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.login-franja { height: 6px; background: repeating-linear-gradient(-60deg, var(--red) 0 14px, var(--ink) 14px 28px); }
.login-cuerpo { padding: 30px 32px 26px; }
.login form.form-signin { max-width: none; padding: 0; margin: 0; background: transparent; border-radius: 0; }
.login img.login-logo { width: 190px; height: auto; display: block; margin: 0 auto 8px; }
.login h1 { font-size: 24px; text-align: center; margin: 0 0 4px; }
.login .sub { text-align: center; color: var(--muted); margin: 0 0 22px; }
.login label { font-size: 14px; margin-bottom: 6px; }
.login .campo { position: relative; margin-bottom: 16px; }
.login .form-signin .form-control,
.login .form-signin input[type="text"],
.login .form-signin input[type="password"] {
  height: 48px; padding: 10px 14px; margin: 0;
  border-radius: var(--radius-sm) !important; font-size: 16px;
}
.login .btn-entrar { width: 100%; height: 50px; font-size: 17px; margin-top: 6px; }
.login .mensajes .alert { margin: 16px 0 0; text-align: center; }
.login-pie { text-align: center; color: var(--muted); font-size: 13px; padding: 14px; border-top: 1px solid var(--line-soft); }

/* ---------- Utilidades heredadas ---------- */
.mayusculas { text-transform: uppercase; }
.mayusculas::placeholder { text-transform: uppercase; }
.parpadeante { color: var(--red); }
@media (prefers-reduced-motion: reduce) { .parpadeante { animation: none !important; } }
@media (max-width: 767px) {
  .mobil-block { display: block; width: 100%; }
  .btn-group.mobil-block > .btn { width: 100%; }
}

/* Detalle del pedido: las filas traían letra de 11-12px */
.table td[style*="font-size:11px"], .table td[style*="font-size:12px"] { font-size: 14px !important; }
.table td input.form-control[style*="font-size:12px"] { font-size: 15px !important; }
.scontainer > br:first-child { display: none; }

/* Filtros de los listados (Hoy, estados, vendedores, Nuevo, Actualizar) */
div[role=filtro2] {
  display: flex !important; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center;
  width: 100%; margin-top: 8px;
}
div[role=filtro2] > .btn, div[role=filtro2] > .btn-group { margin: 0 !important; float: none; }
div[role=filtro2] > .btn-group > .btn { float: none; }
@media (max-width: 767px) {
  div[role=filtro2] > .btn, div[role=filtro2] > .btn-group, div[role=filtro2] > .btn-group > .btn { flex: 1 1 100%; width: 100%; }
  div[role=filtro2] > .btn-group > .dropdown-menu { width: 100%; }
  .inicio-saludo h1 { font-size: 26px; }
  .inicio-accesos { gap: 10px; }
  .acceso { flex-direction: row; align-items: center; min-height: 0; padding: 14px 16px; gap: 14px; flex-wrap: wrap; }
  .acceso strong { font-size: 18px; flex: 1; }
  .acceso > span:last-child { flex-basis: 100%; margin: -8px 0 0 58px; }
}
.panel .pager { padding: 0 20px; }
@keyframes mover_caja { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@-webkit-keyframes mover_caja { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@media only screen and (min-width: 1024px) {
  DIV#modal, DIV#modal2 { left: 50%; max-width: calc(100vw - 48px); }
}
@media only screen and (min-width: 1024px) and (max-width: 1100px) {
  DIV#modal, DIV#modal2 { left: 24px; margin-left: 0; }
}

/* =========================================================
   Versión 2: más color y pantallas a todo lo ancho
   ========================================================= */
:root {
  --blue: #1F6FD1;   --blue-soft: #E6F0FC;
  --orange: #E2622B; --orange-soft: #FDEBDF;
  --green: #1D8A4F;  --green-soft: #E2F4EA;
  --purple: #6B46C1; --purple-soft: #EFE9FB;
  --amber: #C98A0B;  --amber-soft: #FDF3DC;
  --side: #1B1F25;   --side-2: #262B33;
}

/* ---- Ancho completo ---- */
#wrap.app-main > .container,
#wrap.app-main .container { max-width: none; }
DIV#submenu_container { max-width: none; }
@media only screen and (min-width: 1024px) {
  DIV#modal, DIV#modal2 {
    left: calc(var(--sidebar) + 24px); right: 24px; top: 24px; bottom: 24px;
    width: auto; height: auto; max-width: none;
    margin: 0;
  }
}
@media only screen and (min-width: 1024px) and (max-width: 1100px) {
  DIV#modal, DIV#modal2 { left: 24px; }
}
@media (min-width: 992px) and (max-width: 1023px) {
  DIV#modal, DIV#modal2 { left: var(--sidebar); width: auto; right: 0; }
}

/* ---- Menú lateral oscuro ---- */
.app-sidebar { background: var(--side); border-right: 0; }
.app-brand { border-bottom: 1px solid rgba(255,255,255,.08); padding: 18px 18px 16px; }
.app-brand img {
  width: 100%; max-width: 190px; padding: 10px 14px;
  background: #fff; border-radius: 10px;
}
.app-brand span { color: #AEB4BD; margin-top: 10px; padding-left: 4px; letter-spacing: .02em; }
.app-nav .nav-link { color: #D5D9DF; }
.app-nav .nav-link svg { stroke: #8E96A1; }
.app-nav .nav-link:hover { background: var(--side-2); color: #fff; }
.app-nav .nav-link:hover svg { stroke: #fff; }
.app-nav .nav-item.active .nav-link { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(209,10,10,.35); }
.app-nav .nav-item.active .nav-link svg { stroke: #fff; }
.app-nav .nav-item.active .nav-link::before { display: none; }
.app-user { border-top: 1px solid rgba(255,255,255,.08); }
.app-user-avatar { background: var(--red); }
.app-user-name { color: #fff; }
.app-user-acciones a { color: #AEB4BD; }
.app-user-acciones a:hover { background: var(--side-2); color: #fff; }
.app-sidebar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: repeating-linear-gradient(-60deg, var(--red) 0 12px, #000 12px 24px);
}

/* Barra superior en celular */
@media (max-width: 991.98px) {
  .app-topbar { background: var(--side); border-bottom: 3px solid var(--red); }
  .app-topbar-brand img { background: #fff; border-radius: 8px; padding: 3px 6px; height: 40px; }
  .app-topbar-titulo { color: #fff; }
  .app-menu-toggle { background: var(--side-2); border-color: rgba(255,255,255,.12); }
  .app-menu-toggle svg { stroke: #fff; }
}

/* ---- Paneles con acento de color ---- */
.panel { border-top: 3px solid var(--red); box-shadow: 0 1px 2px rgba(30,34,40,.05); }
.panel-default > .panel-heading, .panel > .panel-heading {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFB 100%);
}
.panel-default > .panel-heading::before, .panel > .panel-heading::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  background: var(--red); margin-right: 10px; vertical-align: 2px;
}
.panel-info { border-top-color: var(--blue); }
.panel-info > .panel-heading::before { background: var(--blue); }
.panel .panel { border-top-width: 1px; }
.panel .panel > .panel-heading::before { display: none; }

/* Encabezados de tabla en grafito */
.table > thead > tr > th,
.table > thead > tr > td {
  background: #2B3038 !important;
  color: #FFFFFF !important;
  border-bottom: 2px solid var(--red) !important;
}
.table > thead > tr > th .btn-default { background: transparent; border-color: rgba(255,255,255,.3); }
.table > thead > tr > th .btn-default i { color: #fff !important; }
.table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover { background: #FFF5F5; }
.table > tfoot > tr > th, .table > tfoot > tr > td { background: #F3F4F6 !important; }
.table > tfoot .total_general_consulta, .table > tfoot .total_general_facturado { color: var(--red); }

/* Etiquetas de estado más vivas */
.label-default { background: #E4E7EB; color: #4B525C; }
.label-success { background: var(--green); color: #fff; }
.label-info    { background: var(--blue); color: #fff; }
.label-warning { background: var(--amber); color: #fff; }
.label-danger  { background: var(--red); color: #fff; }
.label-primary { background: var(--purple); color: #fff; }
.label::before { background: rgba(255,255,255,.85); }
.label-default::before { background: currentColor; }

/* Botones con color */
.btn-info { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active { background: #1858A8; border-color: #1858A8; color: #fff; }
.btn-default:hover, .btn-default:focus { border-color: #C5CBD3; }

/* Datos del cliente con color */
.panel-cliente p.btn { border-left: 4px solid var(--line); }
.panel-cliente p.btn-warning { background: var(--amber-soft); border-color: #F2D9A6; border-left-color: var(--amber); color: #6E4A00; }
.panel-cliente p.btn-primary { background: var(--blue-soft); border-color: #C9DAF0; border-left-color: var(--blue); color: #174A8A; }
.panel-cliente p.btn-success { border-left-color: var(--green); }
.panel-cliente p.btn-danger  { border-left-color: var(--red); }
.panel-cliente p.btn strong { color: inherit; opacity: .8; }

/* Barra de acciones */
DIV#submenu { border-bottom: 3px solid var(--red); }

/* ---- Inicio con color ---- */
.inicio-saludo {
  position: relative; overflow: hidden;
  margin: 0 0 20px; padding: 26px 28px;
  background: var(--side); color: #fff; border-radius: 12px;
}
.inicio-saludo h1 { color: #fff; }
.inicio-saludo p { color: #AEB4BD; }
.inicio-saludo::after {
  content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 46%;
  background: repeating-linear-gradient(-60deg, rgba(209,10,10,.9) 0 18px, transparent 18px 40px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%);
  mask-image: linear-gradient(90deg, transparent, #000 70%);
  opacity: .55;
}
.inicio-accesos { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.acceso { border-top: 4px solid var(--c, var(--ink)); }
.acceso .acceso-icono { background: var(--c-soft, var(--line-soft)); }
.acceso .acceso-icono svg { stroke: var(--c, var(--ink)); }
.acceso:hover, .acceso:focus { border-color: var(--line); border-top-color: var(--c, var(--ink)); box-shadow: 0 10px 26px rgba(30,34,40,.10); }
.acceso.destacado { --c: var(--red); background: var(--red); border-color: var(--red); }
.acceso.destacado .acceso-icono { background: rgba(255,255,255,.18); }
.acceso.destacado .acceso-icono svg { stroke: #fff; }
.acceso.destacado span { color: #FFE1E1; }
.acceso.destacado:hover { background: var(--red-dark); border-color: var(--red-dark); }
.acceso.c-azul { --c: var(--blue); --c-soft: var(--blue-soft); }
.acceso.c-naranja { --c: var(--orange); --c-soft: var(--orange-soft); }
.acceso.c-verde { --c: var(--green); --c-soft: var(--green-soft); }
.acceso.c-morado { --c: var(--purple); --c-soft: var(--purple-soft); }
@media (max-width: 767px) { .inicio-saludo { padding: 20px; } .inicio-saludo::after { width: 40%; } }

/* Ingreso */
body.login-page {
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(209,10,10,.18), transparent 60%),
    var(--side);
}
.login { border: 0; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login .btn-entrar { background: var(--red); border-color: var(--red); }
.login .btn-entrar:hover, .login .btn-entrar:focus { background: var(--red-dark); border-color: var(--red-dark); }
