/* ============================================================================
   KF PDV · Tema corporativo (capa sobre AdminLTE 2 / Bootstrap 3)
   ----------------------------------------------------------------------------
   - No cambia el HTML de los módulos: solo re-estiliza clases existentes.
   - Tokens en :root; todo lo demás los usa.
   - Prefijo "body" donde hace falta ganar a estilos en línea de los módulos.
   ========================================================================== */

:root {
  /* Marca */
  --kf-navy-950: #0b1726;
  --kf-navy-900: #10213a;
  --kf-navy-800: #172d4d;
  --kf-navy-700: #1f3d66;
  --kf-primary: #1f5fa6;
  --kf-primary-hover: #194f8b;
  --kf-primary-soft: #e8f0fa;
  --kf-accent: #d62a2f;          /* rojo Materiales Lachica */

  /* Neutros */
  --kf-bg: #f3f5f8;
  --kf-surface: #ffffff;
  --kf-surface-2: #f8f9fb;
  --kf-border: #e1e5eb;
  --kf-border-strong: #cdd3dc;
  --kf-text: #1b2533;
  --kf-text-2: #475467;
  --kf-muted: #7a8699;

  /* Estados */
  --kf-success: #13804f;   --kf-success-hover: #0f6b42;  --kf-success-soft: #e6f5ee;
  --kf-danger: #c8312a;    --kf-danger-hover: #ab2721;   --kf-danger-soft: #fdeceb;
  --kf-warning: #c26a06;   --kf-warning-hover: #a45904;  --kf-warning-soft: #fff3e3;
  --kf-info: #0f7891;      --kf-info-hover: #0c6479;     --kf-info-soft: #e5f4f8;
  --kf-purple: #5b4fb5;    --kf-purple-hover: #4b40a0;

  /* Forma */
  --kf-radius-sm: 5px;
  --kf-radius: 7px;
  --kf-radius-lg: 10px;
  --kf-shadow-sm: 0 1px 2px rgba(16, 33, 58, .06);
  --kf-shadow: 0 1px 3px rgba(16, 33, 58, .08), 0 1px 2px rgba(16, 33, 58, .04);
  --kf-shadow-lg: 0 12px 32px rgba(16, 33, 58, .16);
  --kf-ring: 0 0 0 3px rgba(31, 95, 166, .22);

  --kf-font: 'Inter Tight', 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --kf-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ─────────────────────────── Base ─────────────────────────── */

body,
.main-header .logo,
.main-header .navbar,
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.btn, .form-control, .select2-container, .swal2-popup, .tooltip, .popover {
  font-family: var(--kf-font);
}
body {
  font-size: 13px;
  color: var(--kf-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.content-wrapper, .right-side { background: var(--kf-bg); }
a { color: var(--kf-primary); }
a:hover, a:focus { color: var(--kf-primary-hover); }
::selection { background: rgba(31, 95, 166, .18); }

/* Títulos de página: más sobrios (antes: mayúsculas muy grandes). */
.content-header > h1 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--kf-text);
  text-transform: none;
}
.content-header > h1 strong { font-weight: 650; }
.content-header > h1 .fa, .content-header > h1 i { color: var(--kf-primary); margin-right: 6px; font-size: 17px; }
.content-header > .breadcrumb { font-size: 12px; }
.content-header > .breadcrumb > li > a { color: var(--kf-muted); }

/* Scrollbars discretos */
* { scrollbar-width: thin; scrollbar-color: #c3cad4 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c3cad4; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #9ea8b6; background-clip: content-box; }

/* ─────────────────────────── Encabezado ─────────────────────────── */

.skin-blue .main-header .navbar,
.skin-blue .main-header .logo {
  background: var(--kf-navy-900);
}
.skin-blue .main-header .logo { border-right: 1px solid rgba(255, 255, 255, .06); }
.skin-blue .main-header .logo:hover,
.skin-blue .main-header .navbar .sidebar-toggle:hover { background: var(--kf-navy-800); }
.skin-blue .main-header .navbar { box-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.skin-blue .main-header .navbar .nav > li > a:hover,
.skin-blue .main-header .navbar .nav > .open > a { background: rgba(255, 255, 255, .07); }
.kf-nav-dot { border-color: var(--kf-navy-900) !important; }

/* ─────────────────────────── Menú lateral ─────────────────────────── */

.skin-blue .main-sidebar,
.skin-blue .left-side,
.skin-blue .wrapper { background: var(--kf-navy-950); }
.skin-blue .sidebar-menu > li > a { color: #b6c2d3; transition: background .15s, color .15s; }
.skin-blue .sidebar-menu > li:hover > a { background: rgba(255, 255, 255, .05); color: #fff; }
.skin-blue .sidebar-menu > li.active > a {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-left-color: #4f95e0;
}
.skin-blue .sidebar-menu > li > .treeview-menu { background: var(--kf-navy-900); }
.skin-blue .treeview-menu > li > a { color: #9fadc0; }
.skin-blue .treeview-menu > li > a:hover,
.skin-blue .treeview-menu > li.active > a { color: #fff; }
.skin-blue.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span:not(.pull-right),
.skin-blue.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
  background: var(--kf-navy-800);
  box-shadow: var(--kf-shadow-lg);
}

/* ─────────────────────────── Superficies ─────────────────────────── */

.box {
  border: 1px solid var(--kf-border);
  border-top-width: 1px;
  border-radius: var(--kf-radius-lg);
  box-shadow: var(--kf-shadow-sm);
}
.box.box-primary, .box.box-info, .box.box-danger, .box.box-warning, .box.box-success, .box.box-default {
  border-top-color: var(--kf-border);
}
.box-header.with-border { border-bottom-color: var(--kf-border); }
.box-header .box-title { font-size: 14px; font-weight: 650; color: var(--kf-text); }
.box-header > .fa, .box-header .box-title .fa { color: var(--kf-primary); }

/* Pestañas: subrayado en lugar de pestaña con borde de color */
.nav-tabs-custom {
  border-radius: var(--kf-radius-lg);
  border: 1px solid var(--kf-border);
  box-shadow: var(--kf-shadow-sm);
  overflow: visible;
}
.nav-tabs-custom > .nav-tabs {
  border-bottom: 1px solid var(--kf-border);
  border-radius: var(--kf-radius-lg) var(--kf-radius-lg) 0 0;
  background: var(--kf-surface);
}
.nav-tabs-custom > .nav-tabs > li { border-top: 0; margin-bottom: -1px; margin-right: 2px; }
.nav-tabs-custom > .nav-tabs > li > a {
  color: var(--kf-text-2);
  font-weight: 600;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0;
  padding: 11px 14px;
  transition: color .15s, border-color .15s;
}
.nav-tabs-custom > .nav-tabs > li > a:hover { color: var(--kf-text); background: transparent; }
/* Algunos módulos meten <h4><strong> dentro de la pestaña: mismo tamaño que el resto */
.nav-tabs-custom > .nav-tabs > li > a h4,
.nav-tabs-custom > .nav-tabs > li > a h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  letter-spacing: .02em;
  line-height: 1.4;
}
.nav-tabs-custom > .nav-tabs > li > a h4 strong { font-weight: 600; }
.nav-tabs-custom > .nav-tabs.bg-gray-light { background: var(--kf-surface) !important; }
.nav-tabs-custom > .nav-tabs > li.active > a,
.nav-tabs-custom > .nav-tabs > li.active:hover > a {
  color: var(--kf-primary);
  background: transparent;
  border-bottom-color: var(--kf-primary) !important;
}
.nav-tabs-custom > .nav-tabs > li.active { border-top-color: transparent; }

/* Modales */
.modal-content {
  border: 0;
  border-radius: 12px;
  box-shadow: var(--kf-shadow-lg);
  overflow: hidden;
}
.modal-header { border-bottom: 1px solid var(--kf-border); padding: 14px 18px; }
.modal-header .modal-title { font-size: 15px; font-weight: 650; }
.modal-footer { border-top: 1px solid var(--kf-border); background: var(--kf-surface-2); padding: 12px 18px; }
.modal-backdrop.in { opacity: .45; }
.modal.fade .modal-dialog { transform: translateY(12px) scale(.985); transition: transform .22s var(--kf-ease), opacity .22s; }
.modal.in .modal-dialog { transform: none; }

/* ─────────────────────────── Botones ─────────────────────────── */
/* Compactos (30 px), mismos radios, sombras sutiles y anillo de foco accesible. */

body .btn {
  border-radius: var(--kf-radius);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.38;
  padding: 5px 12px;
  border: 1px solid transparent;
  box-shadow: var(--kf-shadow-sm);
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
body .btn:active, body .btn.active { transform: translateY(1px); box-shadow: none; }
/* Botones sueltos pegados en el HTML: separación mínima (los grupos conservan su unión) */
body .btn + .btn { margin-left: 4px; }
body .btn-group > .btn + .btn, body .input-group-btn > .btn + .btn, body .btn-block + .btn-block { margin-left: -1px; }
body .btn-block + .btn-block { margin-left: 0; }
body .btn:focus, body .btn.focus, body .btn:active:focus { outline: none; box-shadow: var(--kf-ring); }
body .btn .fa, body .btn .fas, body .btn .far, body .btn i { margin-right: 1px; }
body .btn-lg, body .btn-group-lg > .btn { font-size: 15px; padding: 9px 18px; border-radius: 8px; }
body .btn-sm, body .btn-group-sm > .btn { font-size: 12.5px; padding: 4px 10px; }
body .btn-xs, body .btn-group-xs > .btn { font-size: 11.5px; padding: 1px 6px; line-height: 1.5; border-radius: var(--kf-radius-sm); }
/* Acciones dentro de tablas: los grupos de íconos no deben partirse en dos renglones */
body table.dataTable td .btn-group {
  display: inline-flex;          /* los .btn flotan en Bootstrap 3: en flex no se parten */
  flex-wrap: nowrap;
  align-items: center;
  box-shadow: none;
  vertical-align: middle;
}
body table.dataTable td .btn-group > .btn { float: none; }
body table.dataTable td .btn-group > .btn-group.pull-right { order: 99; float: none !important; margin-left: 6px; }
body table.dataTable td .btn + .btn { margin-left: 2px; }
body table.dataTable td .btn-group > .btn + .btn,
body table.dataTable td .btn-group > .btn-group + .btn { margin-left: -1px; }
body .btn-flat { border-radius: var(--kf-radius); box-shadow: var(--kf-shadow-sm); }
body .input-group-btn > .btn { box-shadow: none; }
body .btn.disabled, body .btn[disabled], fieldset[disabled] body .btn { opacity: .5; box-shadow: none; }

body .btn-default {
  background: var(--kf-surface);
  border-color: var(--kf-border-strong);
  color: var(--kf-text);
}
body .btn-default:hover, body .btn-default:focus { background: var(--kf-surface-2); border-color: #b8c0cc; color: var(--kf-text); }
body .btn-default.active, body .btn-default:active, body .open > .dropdown-toggle.btn-default { background: #eef1f5; }

body .btn-primary, body .btn.bg-blue, body .btn.bg-light-blue, body .btn.bg-primary, body .btn.btn-info.bg-blue {
  background: var(--kf-primary) !important; border-color: var(--kf-primary) !important; color: #fff !important;
}
body .btn-primary:hover, body .btn-primary:focus, body .btn-primary:active, body .open > .dropdown-toggle.btn-primary,
body .btn.bg-blue:hover, body .btn.bg-light-blue:hover, body .btn.bg-primary:hover {
  background: var(--kf-primary-hover) !important; border-color: var(--kf-primary-hover) !important; color: #fff !important;
}

body .btn-success, body .btn.bg-green, body .btn.bg-olive {
  background: var(--kf-success); border-color: var(--kf-success); color: #fff;
}
body .btn-success:hover, body .btn-success:focus, body .btn-success:active, body .btn.bg-green:hover {
  background: var(--kf-success-hover); border-color: var(--kf-success-hover); color: #fff;
}

body .btn-danger, body .btn.bg-red {
  background: var(--kf-danger); border-color: var(--kf-danger); color: #fff;
}
body .btn-danger:hover, body .btn-danger:focus, body .btn-danger:active, body .btn.bg-red:hover {
  background: var(--kf-danger-hover); border-color: var(--kf-danger-hover); color: #fff;
}

body .btn-warning, body .btn.bg-orange, body .btn.bg-yellow {
  background: var(--kf-warning); border-color: var(--kf-warning); color: #fff;
}
body .btn-warning:hover, body .btn-warning:focus, body .btn-warning:active, body .btn.bg-orange:hover {
  background: var(--kf-warning-hover); border-color: var(--kf-warning-hover); color: #fff;
}

body .btn-info, body .btn.bg-aqua, body .btn.bg-teal {
  background: var(--kf-info); border-color: var(--kf-info); color: #fff;
}
body .btn-info:hover, body .btn-info:focus, body .btn-info:active, body .btn.bg-aqua:hover {
  background: var(--kf-info-hover); border-color: var(--kf-info-hover); color: #fff;
}

body .btn.bg-purple { background: var(--kf-purple); border-color: var(--kf-purple); color: #fff; }
body .btn.bg-purple:hover { background: var(--kf-purple-hover); border-color: var(--kf-purple-hover); color: #fff; }
body .btn.bg-navy, body .btn.bg-black { background: var(--kf-navy-800); border-color: var(--kf-navy-800); color: #fff; }
body .btn.bg-navy:hover, body .btn.bg-black:hover { background: var(--kf-navy-700); border-color: var(--kf-navy-700); color: #fff; }

/* Grupos: sin sombras dobles entre botones pegados */
body .btn-group > .btn { box-shadow: none; }
body .btn-group { box-shadow: var(--kf-shadow-sm); border-radius: var(--kf-radius); }
body .btn-group > .btn + .dropdown-toggle { border-left-color: rgba(255, 255, 255, .25); }

/* Menús desplegables */
.dropdown-menu {
  border: 1px solid var(--kf-border);
  border-radius: 8px;
  box-shadow: var(--kf-shadow-lg);
  padding: 4px;
  font-size: 13px;
}
.dropdown-menu > li > a { border-radius: 5px; padding: 6px 10px; color: var(--kf-text); }
.dropdown-menu > li > a:hover { background: var(--kf-primary-soft); color: var(--kf-primary); }

/* ─────────────────────────── Formularios ─────────────────────────── */

body .form-control {
  height: 32px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--kf-text);
  border: 1px solid var(--kf-border-strong);
  border-radius: var(--kf-radius);
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
body textarea.form-control { height: auto; }
body .form-control:focus { border-color: var(--kf-primary); box-shadow: var(--kf-ring); }
body .form-control::placeholder { color: #9aa4b2; }
body .form-control[disabled], body .form-control[readonly] { background: var(--kf-surface-2); }
body .input-sm { height: 28px; padding: 3px 8px; font-size: 12.5px; }
body .input-lg { height: 40px; font-size: 15px; }
label { font-weight: 600; color: var(--kf-text-2); font-size: 12.5px; }

/* Input groups: bordes unificados y radios solo en extremos */
body .input-group .form-control:not(:first-child):not(:last-child),
body .input-group-addon:not(:first-child):not(:last-child) { border-radius: 0; }
body .input-group .form-control:first-child, body .input-group-addon:first-child,
body .input-group-btn:first-child > .btn { border-radius: var(--kf-radius) 0 0 var(--kf-radius); }
body .input-group .form-control:last-child, body .input-group-addon:last-child,
body .input-group-btn:last-child > .btn { border-radius: 0 var(--kf-radius) var(--kf-radius) 0; }
body .input-group-addon {
  background: var(--kf-surface-2);
  border-color: var(--kf-border-strong);
  color: var(--kf-text-2);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--kf-radius);
}

/* Select2 a juego con .form-control */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border: 1px solid var(--kf-border-strong) !important;
  border-radius: var(--kf-radius) !important;
  min-height: 32px;
}
.select2-container--default .select2-selection--single { height: 32px !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 30px !important; color: var(--kf-text); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 30px !important; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {
  border-color: var(--kf-primary) !important;
  box-shadow: var(--kf-ring);
}
.input-group .select2-container--default .select2-selection--single { border-radius: 0 var(--kf-radius) var(--kf-radius) 0 !important; }
.select2-dropdown { border-color: var(--kf-border) !important; border-radius: 8px !important; box-shadow: var(--kf-shadow-lg); overflow: hidden; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--kf-primary) !important; }
.select2-search--dropdown .select2-search__field { border-radius: var(--kf-radius-sm); border-color: var(--kf-border-strong) !important; }

/* ─────────────────────────── Etiquetas ─────────────────────────── */

.label, .badge { font-weight: 600; border-radius: 999px; letter-spacing: .01em; }
.label { padding: .25em .65em; font-size: 11px; }
.label-success, .badge.bg-green { background: var(--kf-success) !important; }
.label-danger, .badge.bg-red { background: var(--kf-danger) !important; }
.label-warning, .badge.bg-yellow, .badge.bg-orange { background: var(--kf-warning) !important; }
.label-info, .badge.bg-aqua { background: var(--kf-info) !important; }
.label-primary, .badge.bg-blue, .badge.bg-light-blue { background: var(--kf-primary) !important; }
.label-default { background: #e4e8ee; color: var(--kf-text-2); }

/* ─────────────────────────── Tablas (estilo AG Grid) ─────────────────────────── */

/* Densidad: Inter es más ancha que la fuente anterior; celdas compactas para que
   quepan las mismas columnas que antes (DataTables Responsive oculta las que no caben). */
body .table {
  color: var(--kf-text);
  /* misma familia (Inter Tight) que el resto: compacta para datos densos */
  font-size: 12.5px;
}
body .table td.kf-num { font-variant-numeric: tabular-nums; }
body .table .kf-nw { white-space: nowrap; }
body .table > thead > tr > th,
body table.dataTable thead th,
body table.dataTable thead td {
  background: var(--kf-surface-2) !important;
  color: var(--kf-text-2) !important;
  font-size: 11.5px;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--kf-border) !important;
  border-top: 0 !important;
  padding: 8px 6px !important;
  vertical-align: middle !important;
  line-height: 1.25;
  -webkit-user-select: none; user-select: none;
}
/* Encabezados de color fijados por los módulos (bg-blue, bg-orange, style=...) -> neutros */
body thead.bg-blue, body thead.bg-orange, body thead.bg-green, body thead[style] { background: var(--kf-surface-2) !important; color: var(--kf-text-2) !important; }
body thead.bg-blue th, body thead.bg-orange th, body thead.bg-green th, body thead[style] th { color: var(--kf-text-2) !important; }

body .table > tbody > tr > td,
body table.dataTable tbody td {
  padding: 7px 6px !important;
  border-top: 1px solid #edf0f4 !important;
  vertical-align: middle !important;
  line-height: 1.4;
}
body .table-bordered,
body .table-bordered > thead > tr > th,
body .table-bordered > tbody > tr > td { border-color: #edf0f4 !important; }
body .table-bordered > thead > tr > th, body .table-bordered > tbody > tr > td { border-left: 0 !important; border-right: 0 !important; }

body .table-striped > tbody > tr:nth-of-type(odd) { background: #fbfcfd; }
body .table-hover > tbody > tr:hover,
body table.dataTable tbody tr:hover { background: #f1f6fc !important; }
body table.dataTable tbody tr { transition: background-color .12s; }
body table.dataTable tbody tr.selected { background: var(--kf-primary-soft) !important; }

/* Contenedor de la tabla con borde y radio, como una grilla */
body .dataTables_wrapper table.dataTable {
  border: 1px solid var(--kf-border) !important;
  border-radius: var(--kf-radius-lg);
  border-collapse: separate !important;
  border-spacing: 0;
  margin-top: 8px !important;
  margin-bottom: 8px !important;
  background: var(--kf-surface);
}
body table.dataTable thead tr:first-child th:first-child { border-top-left-radius: var(--kf-radius-lg); }
body table.dataTable thead tr:first-child th:last-child { border-top-right-radius: var(--kf-radius-lg); }
body table.dataTable.no-footer { border-bottom: 1px solid var(--kf-border) !important; }
body table.dataTable tbody tr:first-child td { border-top: 0 !important; }

/* Íconos de orden: flechas finas en lugar de imágenes; columna activa resaltada */
body table.dataTable thead .sorting,
body table.dataTable thead .sorting_asc,
body table.dataTable thead .sorting_desc,
body table.dataTable thead .sorting_asc_disabled,
body table.dataTable thead .sorting_desc_disabled {
  background-image: none !important;
  position: relative;
  padding-right: 20px !important;
  cursor: pointer;
  transition: color .15s, background-color .15s;
}
body table.dataTable thead .sorting:hover { color: var(--kf-text) !important; background: #f0f3f7 !important; }
body table.dataTable thead .sorting:after,
body table.dataTable thead .sorting_asc:after,
body table.dataTable thead .sorting_desc:after,
body table.dataTable thead .sorting:before,
body table.dataTable thead .sorting_asc:before,
body table.dataTable thead .sorting_desc:before {
  content: "" !important;
  position: absolute;
  right: 7px;
  bottom: auto !important;
  left: auto !important;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: .28;
  font-family: inherit !important;
  transition: opacity .15s, transform .2s var(--kf-ease);
}
body table.dataTable thead .sorting:before,
body table.dataTable thead .sorting_asc:before,
body table.dataTable thead .sorting_desc:before { top: calc(50% - 6px) !important; border-bottom: 4px solid currentColor; }
body table.dataTable thead .sorting:after,
body table.dataTable thead .sorting_asc:after,
body table.dataTable thead .sorting_desc:after { top: calc(50% + 2px) !important; border-top: 4px solid currentColor; }
body table.dataTable thead .sorting_asc,
body table.dataTable thead .sorting_desc { color: var(--kf-primary) !important; background: #eef3fa !important; }
body table.dataTable thead .sorting_asc:before { opacity: 1; }
body table.dataTable thead .sorting_asc:after { opacity: 0; transform: translateY(2px); }
body table.dataTable thead .sorting_desc:after { opacity: 1; }
body table.dataTable thead .sorting_desc:before { opacity: 0; transform: translateY(-2px); }
body table.dataTable thead .sorting_disabled { padding-right: 6px !important; }

/* Controles de DataTables */
body .dataTables_wrapper .dataTables_filter input,
body .dataTables_wrapper .dataTables_length select {
  height: 30px;
  border: 1px solid var(--kf-border-strong);
  border-radius: var(--kf-radius);
  padding: 4px 10px;
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
body .dataTables_wrapper .dataTables_filter input {
  min-width: 220px;
  padding-left: 30px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237a8699' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center;
}
body .dataTables_wrapper .dataTables_filter input:focus,
body .dataTables_wrapper .dataTables_length select:focus { border-color: var(--kf-primary); box-shadow: var(--kf-ring); }
body .dataTables_wrapper .dataTables_filter label,
body .dataTables_wrapper .dataTables_length label,
body .dataTables_wrapper .dataTables_info { font-weight: 500; color: var(--kf-muted); font-size: 12.5px; }
body .dataTables_wrapper .dataTables_info { padding-top: 10px !important; }
body .dataTables_wrapper .dataTables_processing {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--kf-border);
  border-radius: 8px;
  box-shadow: var(--kf-shadow);
  color: var(--kf-text-2);
  font-weight: 600;
}

/* Paginación compacta */
body .pagination > li > a,
body .pagination > li > span {
  border: 1px solid var(--kf-border) !important;
  color: var(--kf-text-2);
  margin-left: 4px;
  border-radius: var(--kf-radius) !important;
  min-width: 32px;
  height: 30px;
  padding: 5px 10px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
body .pagination > li > a:hover { background: var(--kf-surface-2); color: var(--kf-text); }
body .pagination > .active > a,
body .pagination > .active > a:hover,
body .pagination > .active > span {
  background: var(--kf-primary) !important;
  border-color: var(--kf-primary) !important;
  color: #fff !important;
}
body .pagination > .disabled > a { color: #b4bcc8; background: #fff; }

/* Botones de exportación de DataTables (Excel, PDF...) */
body .dt-buttons .btn, body .dt-buttons .dt-button, body a.dt-button, body button.dt-button {
  background: var(--kf-surface) !important;
  border: 1px solid var(--kf-border-strong) !important;
  color: var(--kf-text) !important;
  border-radius: var(--kf-radius) !important;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px !important;
  box-shadow: var(--kf-shadow-sm);
  background-image: none !important;
  margin-right: 6px;
  transition: background .15s, border-color .15s;
}
body .dt-buttons .dt-button:hover, body a.dt-button:hover, body button.dt-button:hover {
  background: var(--kf-surface-2) !important;
  border-color: #b8c0cc !important;
}

/* Responsive de DataTables: botón de detalle */
body table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child:before,
body table.dataTable.dtr-inline.collapsed > tbody > tr > th:first-child:before {
  background: var(--kf-primary);
  box-shadow: none;
  border: 0;
  top: 50%;
  margin-top: -8px;
}

/* ─────────────────────────── Grid: animaciones (kf-grid.js) ─────────────────────────── */

body table.dataTable tbody tr.kf-row-move { will-change: transform; }
body table.dataTable.kf-grid-paging tbody { animation: kfGridFade .18s var(--kf-ease); }
@keyframes kfGridFade { from { opacity: .35; } to { opacity: 1; } }

/* ─────────────────────────── Alertas (SweetAlert2) ─────────────────────────── */

.swal2-popup { border-radius: 14px !important; padding: 1.4em !important; }
.swal2-popup .swal2-title { font-size: 19px !important; font-weight: 650 !important; color: var(--kf-text) !important; }
.swal2-popup .swal2-content { font-size: 14px !important; color: var(--kf-text-2) !important; }
.swal2-popup .swal2-styled {
  border-radius: var(--kf-radius) !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  padding: 8px 18px !important;
  box-shadow: var(--kf-shadow-sm) !important;
}
.swal2-popup .swal2-styled.swal2-confirm { background-color: var(--kf-primary) !important; }
.swal2-popup .swal2-styled.swal2-cancel { background-color: #fff !important; color: var(--kf-text) !important; border: 1px solid var(--kf-border-strong) !important; }
.swal2-popup .swal2-styled:focus { box-shadow: var(--kf-ring) !important; }

/* ─────────────────────────── Accesibilidad ─────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Celdas solo con botones (marcadas por kf-grid.js) */
body .table td.kf-acciones { white-space: nowrap; }
body .table td.kf-acciones > .btn { float: none; }

/* ═══════════════════════════ Fase 2 ═══════════════════════════ */

/* ── Encabezado fijo al hacer scroll (la página es el contenedor; el navbar no es fijo) ── */
body table.dataTable thead th,
body table.dataTable thead th.sorting,
body table.dataTable thead th.sorting_asc,
body table.dataTable thead th.sorting_desc,
body table.dataTable thead th.sorting_disabled {
  position: sticky;
  top: 0;
  z-index: 3;
  background-clip: padding-box;
}
body table.dataTable thead th { box-shadow: inset 0 -1px 0 var(--kf-border); }
/* Esquinas inferiores (la tabla ya no recorta con overflow para que el encabezado pueda ser fijo) */
body table.dataTable tbody tr:last-child td:first-child { border-bottom-left-radius: var(--kf-radius-lg); }
body table.dataTable tbody tr:last-child td:last-child { border-bottom-right-radius: var(--kf-radius-lg); }

/* ── Redimensionar columnas ── */
body table.dataTable thead th .kf-resize {
  position: absolute;
  top: 0; right: 0;
  width: 8px; height: 100%;
  cursor: col-resize;
  z-index: 4;
}
body table.dataTable thead th .kf-resize::after {
  content: "";
  position: absolute;
  top: 25%; bottom: 25%; right: 0;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background .15s;
}
body table.dataTable thead th:hover .kf-resize::after { background: var(--kf-border-strong); }
body table.dataTable thead th .kf-resize:hover::after,
html.kf-redimensionando .kf-resize::after { background: var(--kf-primary); }
html.kf-redimensionando, html.kf-redimensionando * { cursor: col-resize !important; -webkit-user-select: none; user-select: none; }
body table.dataTable thead th:last-child .kf-resize { display: none; } /* la última se ajusta desde la anterior */

/* ── Barra de herramientas de la tabla (densidad / restablecer) ── */
body .dataTables_filter .kf-dt-tools { display: inline-flex; gap: 4px; margin-right: 8px; vertical-align: middle; }
body .dataTables_filter .kf-dt-tools .btn { height: 30px; width: 32px; padding: 0; margin: 0; color: var(--kf-text-2); }
body .dataTables_filter .kf-dt-tools .btn + .btn { margin-left: 0; }
html.kf-densidad-comoda .kf-dt-densidad { background: var(--kf-primary-soft); border-color: #b9cfea; color: var(--kf-primary); }

/* ── Densidad cómoda ── */
html.kf-densidad-comoda body table.dataTable tbody td,
html.kf-densidad-comoda body .table > tbody > tr > td { padding: 11px 9px !important; font-size: 13.5px; }
html.kf-densidad-comoda body table.dataTable thead th { padding: 11px 9px !important; font-size: 12.5px; }

/* ── Estatus como etiqueta ── */
body .table .kf-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
  line-height: 1.5;
  white-space: nowrap;
  font-style: normal;
}
body .table .kf-pill-ok      { background: var(--kf-success-soft); color: var(--kf-success) !important; }
body .table .kf-pill-warn    { background: var(--kf-warning-soft); color: var(--kf-warning) !important; }
body .table .kf-pill-err     { background: var(--kf-danger-soft);  color: var(--kf-danger) !important; }
body .table .kf-pill-neutral { background: none; padding: 0; color: var(--kf-muted) !important; font-weight: 500; font-style: italic; white-space: normal; letter-spacing: 0; }

/* ── Pantalla de venta (crear-venta) ── */
/* Total: jerarquía clara, cifra grande alineada a la derecha */
body #nuevoTotalVenta {
  background: var(--kf-navy-900) !important;
  color: #fff !important;
  border-color: var(--kf-navy-900) !important;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  text-align: right;
  height: 52px;
  padding-right: 14px;
}
body #nuevoTotalVenta::placeholder { color: rgba(255, 255, 255, .55); }
body #nuevoTotalVenta + input + .input-group-addon,
body .input-group:has(#nuevoTotalVenta) > .input-group-addon {
  background: var(--kf-navy-800);
  border-color: var(--kf-navy-900);
  color: #c9d6e8;
  font-size: 16px;
}
/* Tipo de pedido como selector segmentado, cómodo para pantalla táctil */
body table.tipopedido { border-collapse: separate; border-spacing: 8px 0; margin: 0 -8px; width: calc(100% + 16px); }
body table.tipopedido td.btn {
  border: 1px solid var(--kf-border-strong) !important;
  border-radius: 10px;
  padding: 16px 12px !important;
  font-size: 15px;
  background: var(--kf-surface);
  color: var(--kf-text);
  box-shadow: var(--kf-shadow-sm);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
body table.tipopedido td.btn:hover { border-color: var(--kf-primary) !important; background: var(--kf-primary-soft); }
body table.tipopedido td.btn.bg-blue {
  background: var(--kf-primary) !important;
  border-color: var(--kf-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(31, 95, 166, .25);
}
/* Botones principales de cobro: un poco más de presencia */
body #btnFinalizarVenta, body #btnGuardarVenta { border-radius: 10px; box-shadow: 0 4px 12px rgba(16, 33, 58, .14); }

/* AdminLTE pone overflow-x:hidden en body y .wrapper: eso los vuelve contenedor de scroll y el
   encabezado "sticky" deja de funcionar. "clip" recorta igual pero sin crear contenedor de scroll. */
html body, html body > .wrapper { overflow-x: clip !important; overflow-y: visible !important; }

/* Tabla con anchos elegidos por el usuario (kf-grid.js): anchos exactos y recorte con "…" */
body table.dataTable.kf-fijo { table-layout: fixed; }
body table.dataTable.kf-fijo td { overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
body table.dataTable.kf-fijo td.kf-nw, body table.dataTable.kf-fijo td.kf-acciones { overflow-wrap: normal; }
body table.dataTable.kf-fijo td.kf-acciones { overflow: visible; } /* menús desplegables de acciones */

/* ── Menú lateral expandido ── */
/* AdminLTE solo da ancho fijo a íconos FA4 (.fa); los de Font Awesome 6 se desalineaban */
.sidebar-menu > li > a > .fa-brands, .sidebar-menu > li > a > .fa-solid, .sidebar-menu > li > a > .fa-regular,
.sidebar-menu > li > a > .fab, .sidebar-menu > li > a > .fas, .sidebar-menu > li > a > .far,
.treeview-menu > li > a > .fa-brands, .treeview-menu > li > a > .fa-solid, .treeview-menu > li > a > .fas {
  width: 20px;
  text-align: center;
}

/* ── Columnas de botones demasiado angostas (col-lg-1) ──
   Con el menú expandido los botones se desbordaban y se enciman: la columna toma el ancho de su botón
   y lo que no quepa baja de renglón en vez de encimarse. */
.box-header .row > [class*="col-"]:has(> .btn:only-child) { width: auto; }
.box-header .row > [class*="col-"]:has(> .btn:only-child) > .btn { white-space: nowrap; }

/* Rangos de fechas: que siempre se lea "dd/mm/aaaa - dd/mm/aaaa" */
/* La columna crece con el campo (si solo se ensancha el campo, se desborda y tapa lo de al lado) */
[class*="col-"]:has(> .input-group input.form-control[name="fechas"]) { min-width: 340px; }


/* ═══════════════════════ Inventario · entradas/salidas por lote ═══════════════════════ */
.kf-modal-xl { width: min(1280px, 96vw); }
.kf-lote .modal-content { border-radius: 14px; }
.kf-lote-header { display: flex; align-items: baseline; gap: 12px; padding: 14px 20px !important; background: linear-gradient(180deg, #f7f9fc, #fff); }
.kf-lote-header .close { order: 3; margin-left: auto; }
.kf-lote-header .modal-title { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.kf-lote-icono { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; }
.kf-lote-entrada .kf-lote-icono { background: var(--kf-success); }
.kf-lote-salida .kf-lote-icono { background: var(--kf-danger); }
.kf-lote-sub { color: var(--kf-muted); font-size: 12.5px; }

.kf-lote .modal-body { padding: 18px 20px; }
.kf-lote-grid { display: grid; grid-template-columns: minmax(330px, 5fr) 118px minmax(0, 8fr); gap: 18px; align-items: start; }
@media (max-width: 991px) { .kf-lote-grid { grid-template-columns: 1fr; } .kf-lote-flecha { transform: rotate(90deg); } }

.kf-paso { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 14px; color: var(--kf-text); margin-bottom: 14px; }
.kf-paso-num { width: 26px; height: 26px; border-radius: 8px; background: var(--kf-primary-soft); color: var(--kf-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.kf-lote-contador { margin-left: 2px; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: #eef1f5; color: var(--kf-muted); font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s, transform .2s; }
.kf-lote-contador-on { background: var(--kf-primary); color: #fff; }

.kf-lote .input-group-addon { min-width: 92px; text-align: left; letter-spacing: .02em; }
.kf-lote .input-group .select2-container { display: table-cell; }
.kf-lote-ficha { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--kf-surface-2); border: 1px solid var(--kf-border); border-radius: 10px; padding: 10px 12px; transition: opacity .2s; }
.kf-lote-ficha > div { display: flex; flex-direction: column; min-width: 0; }
.kf-lote-ficha-label { font-size: 10.5px; font-weight: 650; color: var(--kf-muted); text-transform: uppercase; letter-spacing: .04em; }
.kf-lote-ficha span:not(.kf-lote-ficha-label) { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kf-lote-ficha-cargando { opacity: .45; }
.kf-lote-stock-final { color: var(--kf-primary); }
.kf-lote-stock-final.kf-neg { color: var(--kf-danger); }
.kf-lote-sep { margin: 16px 0; border-color: var(--kf-border); }
.kf-lote-cantidad-grupo .form-control { height: 42px; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.kf-lote-cantidad-grupo .input-group-addon { font-size: 12px; }

.kf-lote-opcional { border: 1px solid var(--kf-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.kf-lote-opcional-toggle { display: flex; gap: 10px; align-items: flex-start; margin: 0; cursor: pointer; font-weight: 500; }
.kf-lote-opcional-toggle input { margin-top: 3px; }
.kf-lote-opcional-toggle b { color: var(--kf-text); display: block; }
.kf-lote-opcional-toggle small { color: var(--kf-muted); font-weight: 400; }
.kf-lote-costo { margin-top: 12px; }
.kf-lote-costo .form-group { margin-bottom: 0; }

/* Acción central */
.kf-lote-accion { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 120px; text-align: center; }
@media (max-width: 991px) { .kf-lote-accion { padding-top: 0; flex-direction: row; justify-content: center; } }
.kf-lote-flecha { font-size: 22px; color: var(--kf-primary); opacity: .55; }
body .btn.kf-lote-agregar {
  width: 112px; height: 84px; border-radius: 12px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: #fff; font-size: 13px; font-weight: 650; border: 0;
  box-shadow: 0 6px 16px rgba(16, 33, 58, .18);
}
.kf-lote-entrada .btn.kf-lote-agregar { background: linear-gradient(160deg, #1a9a63, var(--kf-success)); }
.kf-lote-salida .btn.kf-lote-agregar { background: linear-gradient(160deg, #dd4a3f, var(--kf-danger)); }
body .btn.kf-lote-agregar .fa { font-size: 22px; margin: 0; }
body .btn.kf-lote-agregar:not([disabled]):hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(16, 33, 58, .22); color: #fff; }
body .btn.kf-lote-agregar[disabled] { background: #c7cfda; box-shadow: none; opacity: 1; }
.kf-lote-accion small { color: var(--kf-muted); font-size: 11.5px; line-height: 1.3; }
.kf-lote-accion kbd { background: #eef1f5; color: var(--kf-text-2); box-shadow: none; font-size: 10.5px; padding: 1px 5px; }

/* Lista */
.kf-lote-lista { min-width: 0; }
.kf-lote-lista .dataTables_wrapper { max-height: 52vh; overflow: auto; border-radius: var(--kf-radius-lg); }
.kf-lote-lista table.dataTable { margin: 0 !important; }
.kf-lote-vacio { border: 1.5px dashed var(--kf-border-strong); border-radius: 12px; padding: 48px 20px; text-align: center; color: var(--kf-muted); }
.kf-lote-vacio .fa { font-size: 30px; opacity: .5; margin-bottom: 8px; }
.kf-lote-vacio p { margin: 0; }
.kf-lote-exito { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--kf-success-soft); color: var(--kf-success); font-weight: 600; }
.kf-lote-salida .kf-lote-exito { background: var(--kf-primary-soft); color: var(--kf-primary); }

/* Renglones: entra resaltado, sale desvaneciéndose */
@keyframes kfLoteEntra { from { opacity: 0; transform: translateY(-6px); background: #e6f5ee; } 40% { opacity: 1; transform: none; } to { background: transparent; } }
body table.dataTable tbody tr.kf-lote-nuevo > td { animation: kfLoteEntra 1.3s var(--kf-ease); }
.kf-lote-salida table.dataTable tbody tr.kf-lote-nuevo > td { animation-name: kfLoteEntraS; }
@keyframes kfLoteEntraS { from { opacity: 0; transform: translateY(-6px); background: #fdeceb; } 40% { opacity: 1; transform: none; } to { background: transparent; } }
body table.dataTable tbody tr.kf-lote-saliendo > td { transition: opacity .2s, transform .2s; opacity: 0; transform: translateX(12px); }

/* Pie */
.kf-lote-footer { display: flex; align-items: center; gap: 8px; }
.kf-lote-footer .pull-left { float: none !important; margin-right: auto; }
.kf-lote-resumen { color: var(--kf-text-2); font-size: 13px; margin-right: 6px; font-variant-numeric: tabular-nums; }
body .btn.kf-btn-cargando { position: relative; color: transparent !important; pointer-events: none; }
body .btn.kf-btn-cargando::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: kfGiro .7s linear infinite; }
@keyframes kfGiro { to { transform: rotate(360deg); } }
.kf-lote-cargando .modal-body { opacity: .6; pointer-events: none; transition: opacity .2s; }
.kf-lote .kf-lote-costo .input-group-addon { min-width: 0; text-align: center; }

/* ── Menú lateral: pantalla actual en rojo de la marca (bien visible expandido o contraído) ── */
.skin-blue .sidebar-menu > li.active > a,
.skin-blue .sidebar-menu > li.active:hover > a {
  background: linear-gradient(90deg, rgba(214, 42, 47, .28), rgba(214, 42, 47, .10)) !important;
  border-left: 3px solid var(--kf-accent) !important;
  color: #fff !important;
  font-weight: 600;
}
.skin-blue .sidebar-menu > li.active > a > .fa,
.skin-blue .sidebar-menu > li.active > a > [class*="fa-"] { color: #ff6b70; }
.skin-blue .sidebar-menu > li.treeview.active > .treeview-menu { background: var(--kf-navy-900); }
.skin-blue .treeview-menu > li.active > a {
  color: #fff !important;
  background: rgba(214, 42, 47, .18);
  box-shadow: inset 3px 0 0 var(--kf-accent);
  font-weight: 600;
}
.skin-blue .treeview-menu > li.active > a > .fa,
.skin-blue .treeview-menu > li.active > a > [class*="fa-"] { color: #ff6b70; }
/* Contraído: el ícono activo con fondo rojo sólido para que se distinga entre puros íconos */
.skin-blue.sidebar-collapse .sidebar-menu > li.active > a {
  background: var(--kf-accent) !important;
  border-left-color: #ff8a8e !important;
}
.skin-blue.sidebar-collapse .sidebar-menu > li.active > a > .fa,
.skin-blue.sidebar-collapse .sidebar-menu > li.active > a > [class*="fa-"] { color: #fff; }

/* Traspaso por lote */
.kf-lote-traspaso .kf-lote-icono { background: var(--kf-navy-800); }
.kf-lote-traspaso .btn.kf-lote-agregar { background: linear-gradient(160deg, var(--kf-navy-700), var(--kf-navy-900)); }
.kf-lote-traspaso .kf-lote-exito { background: var(--kf-primary-soft); color: var(--kf-primary); }
.kf-lote-ficha-traspaso { grid-template-columns: 1fr 1fr; row-gap: 10px; }
.kf-lote-ficha-traspaso .kf-lote-ficha-almacen span:not(.kf-lote-ficha-label) { overflow: visible; }
.kf-lote-ficha-flecha { color: var(--kf-muted); margin: 0 4px; font-size: 11px; }
.kf-lote-stock-dest-final { color: var(--kf-success); }
.kf-lote-stock-dest-final.kf-neg { color: var(--kf-danger); }
.kf-lote-lado { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kf-lote-lado > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kf-lote-aviso { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--kf-warning-soft); color: var(--kf-warning); font-size: 12.5px; font-weight: 600; }

/* Botón de acción dentro de la barra de pestañas (p. ej. "Nuevo chofer") */
.nav-tabs-custom > .nav-tabs > li.kf-tab-accion { margin: 0; display: flex; align-items: center; height: 44px; padding-right: 10px; }
.nav-tabs-custom > .nav-tabs > li.kf-tab-accion > .btn { margin: 0; }

/* ── Crear venta: datos del cliente contraíbles (kf-venta-cliente.js) ── */
.kf-cliente-select .select2-container { display: table-cell; width: 100% !important; }
.kf-cliente-select .select2-container--default .select2-selection--single { border-radius: 0 !important; }
.kf-cliente-select .kf-cliente-toggle {
  height: 32px; width: 38px; padding: 0; color: var(--kf-text-2);
  border-color: var(--kf-border-strong); box-shadow: none;
}
.kf-cliente-select .kf-cliente-toggle .fa { transition: transform .25s var(--kf-ease); margin: 0; }
.kf-cliente-select .kf-cliente-toggle[aria-expanded="false"] { color: var(--kf-primary); background: var(--kf-primary-soft); border-color: #b9cfea; }

.kf-cliente-detalle { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .28s var(--kf-ease), opacity .2s ease; }
.kf-cliente-detalle > .kf-cliente-detalle-in { min-height: 0; overflow: hidden; }
.kf-cliente-detalle.kf-contraido { grid-template-rows: 0fr; opacity: 0; }
.kf-cliente-detalle.kf-sin-transicion { transition: none; }

.kf-cliente-resumen {
  display: block; width: 100%; text-align: left;
  border: 1px dashed var(--kf-border-strong); background: var(--kf-surface-2);
  border-radius: var(--kf-radius); padding: 6px 10px; margin: -2px 0 2px;
  font-size: 12.5px; color: var(--kf-text-2); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: border-color .15s, background .15s;
}
.kf-cliente-resumen:hover { border-color: var(--kf-primary); background: var(--kf-primary-soft); color: var(--kf-text); }
.kf-cliente-resumen .fa { color: var(--kf-primary); margin-right: 4px; }

/* ── Crear venta: atajos de teclado (kf-venta-atajos.js) ── */
kbd.kf-atajo, .kf-cliente-requerido kbd {
  display: inline-block; margin-left: 8px; padding: 1px 5px; vertical-align: middle;
  font: 600 10.5px/1.4 var(--kf-font); letter-spacing: .02em;
  color: var(--kf-text-2); background: #eef1f5; border: 1px solid var(--kf-border-strong);
  border-bottom-width: 2px; border-radius: 4px; box-shadow: none;
}
table.tipopedido td.btn.bg-blue kbd.kf-atajo { color: #fff; background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); }
.kf-cliente-select.kf-con-atajo { position: relative; }
.kf-cliente-select.kf-con-atajo::after {
  content: attr(data-atajo); position: absolute; top: 50%; right: 66px; transform: translateY(-50%);
  z-index: 3; pointer-events: none;
  font: 600 10.5px/1.4 var(--kf-font); color: var(--kf-text-2);
  background: #eef1f5; border: 1px solid var(--kf-border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px;
}
@keyframes kfDestello { 0% { box-shadow: 0 0 0 0 rgba(31, 95, 166, .45); } 100% { box-shadow: 0 0 0 10px rgba(31, 95, 166, 0); } }
.kf-atajo-destello { animation: kfDestello .5s ease-out; }

/* Domicilio sin cliente: selector en rojo, sacudida y anillo pulsante */
@keyframes kfSacudida { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes kfPulsoRojo { 0% { box-shadow: 0 0 0 0 rgba(200, 49, 42, .45); } 70% { box-shadow: 0 0 0 8px rgba(200, 49, 42, 0); } 100% { box-shadow: 0 0 0 0 rgba(200, 49, 42, 0); } }
.kf-cliente-select.kf-requiere-cliente { animation: kfSacudida .45s ease-in-out; border-radius: var(--kf-radius); }
.kf-cliente-select.kf-requiere-cliente .input-group-addon,
.kf-cliente-select.kf-requiere-cliente .select2-selection,
.kf-cliente-select.kf-requiere-cliente .kf-cliente-toggle { border-color: var(--kf-danger) !important; }
.kf-cliente-select.kf-requiere-cliente .input-group-addon { color: var(--kf-danger); background: var(--kf-danger-soft); }
.kf-cliente-select.kf-requiere-cliente .select2-selection { animation: kfPulsoRojo 1.4s ease-out .45s infinite; }
.kf-cliente-requerido { margin: -4px 0 8px; padding: 5px 10px; border-radius: var(--kf-radius); background: var(--kf-danger-soft); color: var(--kf-danger); font-size: 12.5px; font-weight: 600; }
.kf-cliente-requerido kbd { margin-left: 4px; }

/* ── Modal: elegir domicilio del cliente (kf-domicilios.js) ── */
.kf-domicilios .modal-dialog { width: min(620px, 94vw); }
.kf-domicilios .modal-content:focus { outline: none; }
.kf-domicilios:focus { outline: none; }
.kf-dom-header { padding: 16px 20px !important; background: linear-gradient(180deg, #f7f9fc, #fff); }
.kf-dom-header .modal-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; }
.kf-dom-icono { width: 30px; height: 30px; border-radius: 9px; background: var(--kf-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.kf-dom-cliente { margin: 4px 0 0 40px; color: var(--kf-muted); font-size: 12.5px; font-weight: 500; }
.kf-domicilios .modal-body { padding: 12px 14px; }
.kf-dom-lista { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 2px !important; }
.kf-dom-cargando { padding: 28px; text-align: center; color: var(--kf-muted); }

.kf-dom-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--kf-border); border-radius: 11px; background: var(--kf-surface);
  cursor: pointer; outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
  animation: kfDomEntra .28s var(--kf-ease) both;
}
.kf-dom-item:nth-child(2) { animation-delay: .03s; } .kf-dom-item:nth-child(3) { animation-delay: .06s; }
.kf-dom-item:nth-child(4) { animation-delay: .09s; } .kf-dom-item:nth-child(5) { animation-delay: .12s; }
@keyframes kfDomEntra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kf-dom-num {
  flex: 0 0 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: #eef1f5; color: var(--kf-text-2); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s;
}
.kf-dom-texto { flex: 1; min-width: 0; }
.kf-dom-dir { font-weight: 600; color: var(--kf-text); font-size: 13.5px; line-height: 1.35; }
.kf-dom-ref { color: var(--kf-muted); font-size: 12px; margin-top: 2px; line-height: 1.35; }
.kf-dom-ir { color: var(--kf-border-strong); transition: color .15s, transform .15s; }
.kf-dom-item.kf-activo { border-color: var(--kf-primary); background: var(--kf-primary-soft); box-shadow: 0 0 0 3px rgba(31, 95, 166, .14); }
.kf-dom-item.kf-activo .kf-dom-num { background: var(--kf-primary); color: #fff; }
.kf-dom-item.kf-activo .kf-dom-ir { color: var(--kf-primary); transform: translateX(3px); }
.kf-dom-item.kf-elegido { transform: scale(.985); background: var(--kf-primary); border-color: var(--kf-primary); }
.kf-dom-item.kf-elegido .kf-dom-dir, .kf-dom-item.kf-elegido .kf-dom-ref, .kf-dom-item.kf-elegido .kf-dom-ir { color: #fff; }

.kf-dom-ayuda { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; color: var(--kf-muted); font-size: 12px; padding: 10px 14px !important; }
.kf-dom-ayuda kbd { background: #fff; color: var(--kf-text-2); border: 1px solid var(--kf-border-strong); border-bottom-width: 2px; box-shadow: none; font-size: 10.5px; padding: 0 5px; margin-right: 3px; }
