/* Toyota Go CMS: capa de estilos sobre AdminLTE 3.2 (fase 0 del rediseño UX) */

/* 1. Tokens */
:root {
  --tg-red: #EB0A1E; --tg-red-700: #CE0000; --tg-red-900: #8A0010; --tg-red-50: #FDECEE;
  --ink: #1A1A1A; --ink-2: #333333; --muted: #6B6B6B; --line: #E9E9E9; --bg: #F5F5F5; --card: #fff;
  --ok: #39AA4A; --ok-50: #E8F6EA; --warn: #E59A00; --warn-50: #FFF4DC; --info: #2F6FDE; --info-50: #E8F0FD;
  --r-sm: 8px; --r: 14px; --r-lg: 20px;
  --sh-1: 0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.06);
  --sh-2: 0 6px 24px rgba(0,0,0,.08);
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* Escala tipográfica: xs 11 (th, badge) · sm 12 (pie) · 13 (label, td, btn-sm, migas) · base 14 (texto, btn, input) · md 15 (card anidada) · lg 16 (card-title, btn-lg) · h1 26 */
:root { --fs-xs: 11px; --fs-sm: 12px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 16px; --fs-h1: 26px; }

/* 2. Base */
body {
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .btn, .form-control, .nav-link, .table, .card-title { font-family: inherit; }
a { color: var(--tg-red); background-color: transparent; text-decoration: none; }
a:hover { color: var(--tg-red-700); text-decoration: none; }
.text-primary { color: var(--tg-red) !important; }
.bg-primary { background-color: var(--tg-red) !important; }
.border-primary { border-color: var(--tg-red) !important; }

/* 3. Sidebar */
.main-sidebar, [class*="sidebar-dark-"] { background-color: var(--ink); }
.main-sidebar::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: url(/dist/img/marca/fondorojo.webp) center / cover no-repeat;
  opacity: .07; pointer-events: none; z-index: 0;
}
.main-sidebar > * { position: relative; z-index: 1; }
@media (min-width: 992px) {
  html body:not(.layout-fixed) .main-sidebar { position: fixed; top: 0; bottom: 0; height: 100vh; min-height: 0; }
  html body .main-sidebar .sidebar {
    height: calc(100vh - (3.5rem + 1px)); overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
  }
  .main-sidebar .sidebar::-webkit-scrollbar { width: 6px; }
  .main-sidebar .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
  .main-sidebar .sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }
  .main-sidebar .sidebar::-webkit-scrollbar-track { background: transparent; }
}
.main-sidebar .brand-link {
  display: flex; align-items: center; box-sizing: border-box; height: calc(3.5rem + 1px); padding: 0 22px;
  border-bottom: 0; background: transparent;
}
.main-sidebar .brand-link img { filter: brightness(0) invert(1); max-height: 30px; width: auto !important; max-width: 100%; }
.nav-sidebar .nav-header {
  font-size: 10px; font-weight: 700; letter-spacing: .16em; color: #7a7a7a;
  padding: 18px 12px 6px; text-transform: uppercase;
}
.nav-sidebar .nav-link {
  border-radius: 10px; color: #cfcfcf; font-weight: 500; position: relative;
  transition: background .2s var(--ease), color .2s;
}
.nav-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-sidebar .nav-link { display: flex; align-items: flex-start; }
.nav-sidebar .nav-link > p { flex: 1; margin: 0; min-width: 0; }
.sidebar-mini.sidebar-collapse:not(.sidebar-is-opening) .sidebar .nav-sidebar .nav-link > p { flex: none; }
.nav-sidebar .nav-link .nav-icon { opacity: .85; margin-top: 3px; }
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(235,10,30,.22), rgba(235,10,30,.04));
  color: #fff; box-shadow: none;
}
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active::before,
.sidebar-dark-primary .nav-sidebar .nav-link.active::before {
  content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--tg-red);
}
.user-panel .info a { color: #fff; }

/* 4. Topbar */
.main-header {
  min-height: 64px; height: 64px;
  background: rgba(245,245,245,.85) !important;
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line) !important;
  position: sticky; top: 0;
}
.main-header .nav-link { color: var(--ink-2); }
.main-header .nav-link:hover { color: var(--tg-red); }
.main-header .tg-migas { flex: 1 1 0; min-width: 0; padding-left: 0; }
.main-header .tg-migas li { display: inline; }
.main-header .tg-migas .tg-sep { margin: 0 4px; }
.main-header .tg-usuario { display: flex; align-items: center; gap: 10px; padding-top: 0; padding-bottom: 0; }
.main-header .tg-usuario-nombre { font-weight: 600; font-size: 13px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-header .dropdown-menu { border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--sh-2); }
.main-header .dropdown-item { display: flex; align-items: center; }
.main-header .dropdown-item:active { background: var(--tg-red); }

/* 5. Contenido */
.content-wrapper { background: var(--bg); }
.content-header h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.content-header .breadcrumb { display: none; }

/* 6. Componentes Bootstrap */
.card { border: 1px solid #efefef; border-top: 1px solid #efefef; border-radius: var(--r); box-shadow: var(--sh-1); }
.card-primary.card-outline, .card-outline { border-top: 1px solid #efefef; }
.card-header {
  border-bottom: 1px solid var(--line); background: transparent; border-radius: var(--r) var(--r) 0 0;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.card-header::after { display: none; }
.card-header > * { flex: 0 1 auto; }
.card-header > .card-title { float: none; margin: 0; flex: 1 1 auto; min-width: 0; }
.card-header > .nav-tabs, .card-header > .row { flex: 1 1 100%; }
.card-header > .float-right, .card-header > .card-tools { float: none !important; margin-left: auto; }
.card > .card-header .card-title, .card-title { font-size: var(--fs-lg); font-weight: 700; }
.card .card .card-title { font-size: var(--fs-md) !important; font-weight: 700; }
label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.card-footer { background: transparent; border-top: 1px solid var(--line); }
.m-b-10 { margin-bottom: 10px; }
.m-b-20 { margin-bottom: 20px; }
.btn { font-size: var(--fs-base); line-height: 1.4; border-radius: 10px; font-weight: 600; transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s; }
.btn-sm { font-size: 13px; }
.btn-lg { font-size: var(--fs-lg); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.card-body i[class*="fa-"] { font-size: var(--fs-base); }
.btn i[class*="fa-"], .card-body .btn i[class*="fa-"] { font-size: 1em; line-height: 1; }
.btn-sm i[class*="fa-"], .card-body .btn-sm i[class*="fa-"] { font-size: 12px; }
.btn:active { transform: scale(.97); }
.btn + .btn, .btn + a > .btn, a + .btn { margin-left: 8px; }
.btn-group .btn + .btn, .btn-group > .btn + a > .btn, .btn-group a + .btn, .input-group .btn + .btn,
.input-group .btn + a > .btn, .input-group a + .btn { margin-left: 0; }
.btn-group > .btn:not(:first-child), .btn-group > a:not(:first-child) > .btn { margin-left: -1px; }
/* Acción principal: rojo de marca relleno */
.btn-primary, .btn-success { color: #fff; background-color: var(--tg-red); border-color: var(--tg-red); box-shadow: 0 4px 14px rgba(235,10,30,.28); }
.btn-primary:hover, .btn-success:hover { color: #fff; background-color: var(--tg-red-700); border-color: var(--tg-red-700); box-shadow: 0 6px 18px rgba(235,10,30,.36); }
.btn-primary:focus, .btn-primary.focus, .btn-success:focus, .btn-success.focus { color: #fff; box-shadow: 0 0 0 4px var(--tg-red-50); }
.btn-primary.disabled, .btn-primary:disabled, .btn-success.disabled, .btn-success:disabled { background-color: var(--tg-red); border-color: var(--tg-red); box-shadow: none; opacity: .55; }
.btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle, .show > .btn-success.dropdown-toggle,
.btn-success:not(:disabled):not(.disabled):active, .btn-success:not(:disabled):not(.disabled).active {
  color: #fff; background-color: var(--tg-red-900); border-color: var(--tg-red-900);
}
/* Destructivo: contorneado */
.btn-danger { color: var(--tg-red); background-color: #fff; border-color: var(--tg-red); box-shadow: none; }
.btn-danger:hover, .btn-danger:not(:disabled):not(.disabled):active, .btn-danger:not(:disabled):not(.disabled).active {
  color: #fff; background-color: var(--tg-red); border-color: var(--tg-red); box-shadow: none;
}
.btn-danger:focus, .btn-danger.focus { box-shadow: 0 0 0 4px var(--tg-red-50); }
.btn-danger.disabled, .btn-danger:disabled { color: var(--tg-red); background-color: #fff; border-color: var(--tg-red); opacity: .55; }
/* Neutros: acciones de fila y secundarias */
.btn-info, .btn-secondary, .btn-warning, .btn[style*="#007bff"] {
  color: var(--ink-2); background-color: #fff; border-color: #ddd; box-shadow: none;
}
.btn[style*="#007bff"] { color: var(--ink-2) !important; background: #fff !important; border-color: #ddd !important; }
.btn-info:hover, .btn-secondary:hover, .btn-warning:hover, .btn[style*="#007bff"]:hover,
.btn-info:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled):active, .btn-warning:not(:disabled):not(.disabled):active {
  color: var(--ink-2); background-color: var(--bg); border-color: #cfcfcf; box-shadow: none;
}
.btn[style*="#007bff"]:hover { background: var(--bg) !important; border-color: #cfcfcf !important; color: var(--ink-2) !important; }
.btn-info:focus, .btn-secondary:focus, .btn-warning:focus, .btn[style*="#007bff"]:focus { box-shadow: 0 0 0 4px var(--tg-red-50); }
.btn-danger i[style*="color:white"], .btn-danger i[style*="color: white"],
.btn-info i[style*="color:white"], .btn-info i[style*="color: white"],
.btn-secondary i[style*="color:white"], .btn-secondary i[style*="color: white"],
.btn-warning i[style*="color:white"], .btn-warning i[style*="color: white"],
.btn[style*="#007bff"] i { color: inherit !important; }
.btn-dark { color: #fff; background-color: var(--ink); border-color: var(--ink); }
.btn-dark:hover { color: #fff; background-color: #000; border-color: #000; }
.btn[style*="#4285F4"], .btn[style*="#4285f4"] { color: #fff !important; background: var(--ink) !important; border-color: var(--ink) !important; box-shadow: none; }
.btn[style*="#4285F4"]:hover, .btn[style*="#4285f4"]:hover { background: #000 !important; border-color: #000 !important; }
.fc-barra-acciones .btn + .btn, .fc-barra-acciones .btn + a > .btn, .fc-barra-acciones a + .btn { margin-left: 0; }
/* Grupos de acciones de fila segmentados: toda variante se ve neutra */
html body .btn.derecho, html body .btn.centro, html body .btn.izquierdo,
html body .btn.derecho:not(:disabled):not(.disabled), html body .btn.centro:not(:disabled):not(.disabled), html body .btn.izquierdo:not(:disabled):not(.disabled) {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  width: 32px; height: 32px; padding: 0; font-size: 14px;
  background: #fff; border: 1px solid #ddd; color: var(--ink-2); box-shadow: none; transform: none;
}
html body .btn.derecho i, html body .btn.centro i, html body .btn.izquierdo i { color: var(--ink-2) !important; font-size: 14px; }
html body .btn.derecho.btn-danger i, html body .btn.centro.btn-danger i, html body .btn.izquierdo.btn-danger i { color: var(--tg-red) !important; }
html body .btn.derecho:not(:disabled):not(.disabled):hover, html body .btn.centro:not(:disabled):not(.disabled):hover, html body .btn.izquierdo:not(:disabled):not(.disabled):hover,
html body .btn.derecho:not(:disabled):not(.disabled):active, html body .btn.centro:not(:disabled):not(.disabled):active, html body .btn.izquierdo:not(:disabled):not(.disabled):active {
  background: var(--bg); border-color: #cfcfcf; color: var(--ink-2); box-shadow: none; z-index: 1;
}
html body .btn.derecho:not(:disabled):not(.disabled):focus-visible, html body .btn.centro:not(:disabled):not(.disabled):focus-visible, html body .btn.izquierdo:not(:disabled):not(.disabled):focus-visible { z-index: 2; box-shadow: 0 0 0 3px var(--tg-red-50); outline: 0; }
html body .btn.derecho { border-radius: 10px 0 0 10px !important; }
html body .btn.centro { border-radius: 0 !important; }
html body .btn.izquierdo { border-radius: 0 10px 10px 0 !important; }
.btn-group > a:first-child > .btn { border-radius: 10px 0 0 10px !important; }
.btn-group > a:last-child > .btn { border-radius: 0 10px 10px 0 !important; }
.btn-group > a:only-child > .btn { border-radius: 10px !important; }
#filtrocabecera > .row .btn-group > a > .btn { height: 38px; box-sizing: border-box; }
/* Par buscar / agregar filtro: 38 px, buscar rojo, agregar neutro */
html body #filtrocabecera > .row .btn-group > a > .btn.centro:not(:disabled):not(.disabled) { width: 42px; height: 38px; }
html body #filtrocabecera > .row .btn-group > a > .btn.centro.btn-success:not(:disabled):not(.disabled) { background: var(--tg-red); border-color: var(--tg-red); box-shadow: none; }
html body #filtrocabecera > .row .btn-group > a > .btn.centro.btn-success:not(:disabled):not(.disabled):hover { background: var(--tg-red-700); border-color: var(--tg-red-700); }
html body #filtrocabecera > .row .btn-group > a > .btn.centro.btn-success i { color: #fff !important; }
.btn-group > a { display: inline-flex; }
.btn-group > a:hover { z-index: 1; }
td > .btn-group, td:has(> .btn-group), td:has(> .btn) { white-space: nowrap; }
.btn-group { flex-wrap: nowrap; }
.btn-outline-primary { color: var(--tg-red); border-color: var(--tg-red); }
.btn-outline-primary:hover { color: #fff; background-color: var(--tg-red); border-color: var(--tg-red); }
.btn-default { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-default:hover { border-color: #cfcfcf; box-shadow: var(--sh-1); }
.form-control, .custom-select, .custom-file-label { font-size: var(--fs-base);
  border-radius: 10px; border: 1px solid #ddd; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .custom-select:focus, .custom-file-input:focus ~ .custom-file-label {
  border-color: var(--tg-red); box-shadow: 0 0 0 4px var(--tg-red-50); outline: 0;
}
.custom-control-input:checked ~ .custom-control-label::before { background-color: var(--tg-red); border-color: var(--tg-red); }
.custom-control-input:focus ~ .custom-control-label::before { box-shadow: 0 0 0 4px var(--tg-red-50); }
.custom-switch .custom-control-input:checked ~ .custom-control-label::before { background-color: var(--tg-red); border-color: var(--tg-red); }
.card-body :not(.form-inline) > .form-control + .form-control { margin-top: 8px; }
.input-group > .form-control + .form-control { margin-top: 0; }
.input-group-text { border-radius: 10px; border-color: #ddd; background: #fafafa; }
.table thead th, .table th {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  font-weight: 700; background: #fafafa; border-bottom: 1px solid var(--line); border-top: 0;
}
.table td, .table th { padding: .65rem .75rem; }
.table th i, .table th .fa, .table th .fas { font-size: 10px; }
.table-responsive .table td, .table-responsive .table th { padding: .6rem .5rem; }
.table-responsive td div[style*="width"], .table-responsive td span[style*="width"],
.table-responsive th div[style*="width"], .table-responsive th span[style*="width"] { width: auto !important; }
.table thead th { white-space: normal; }
.table thead th a, .table thead th i, .table thead th .fa, .table thead th .fas { white-space: nowrap; }
.table td { font-size: 13px; border-top: 1px solid var(--line); vertical-align: middle; }
.table-responsive {
  background:
    linear-gradient(to right, #fff 30%, rgba(255,255,255,0)) left center / 40px 100% no-repeat local,
    linear-gradient(to left, #fff 30%, rgba(255,255,255,0)) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.18), rgba(0,0,0,0)) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.18), rgba(0,0,0,0)) right center / 12px 100% no-repeat scroll;
}
.table-responsive > .table, .table-responsive > .table tbody td { background-color: transparent; }
.table-responsive > .table tbody tr:hover { background-color: rgba(235,10,30,.035); }
.table-responsive { scrollbar-width: thin; scrollbar-color: #cfcfcf transparent; }
.table-responsive::-webkit-scrollbar { height: 8px; width: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: #cfcfcf; border-radius: 4px; }
.table-responsive::-webkit-scrollbar-track { background: transparent; }
.table-hover tbody tr:hover, .table tbody tr:hover { background-color: #fcf6f6; }
.badge { font-size: var(--fs-xs); letter-spacing: .02em; font-weight: 600; border-radius: 999px; padding: .35em .75em; }
.badge-primary, .badge-danger { background-color: var(--tg-red); color: #fff; }
.badge-success { background-color: var(--ok-50); color: #22803a; }
.badge-warning { background-color: var(--warn-50); color: #a76d00; }
.badge-info { background-color: var(--info-50); color: var(--info); }
.badge-secondary { background-color: #eee; color: #666; }
.modal-content { border: 0; border-radius: var(--r-lg); box-shadow: 0 20px 50px rgba(0,0,0,.22); }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-footer { border-top: 1px solid var(--line); }
.pagination .page-link { color: var(--ink-2); border-color: var(--line); border-radius: 8px; margin: 0 2px; }
.pagination .page-link:hover { color: var(--tg-red); background-color: var(--tg-red-50); border-color: var(--line); }
.pagination .page-item.active .page-link { color: #fff; background-color: var(--ink); border-color: var(--ink); }
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link { border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; border-radius: 0; }
.nav-tabs .nav-link:hover { color: var(--ink); border-color: transparent; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: var(--ink); background: transparent; border-color: transparent transparent var(--tg-red); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background-color: var(--tg-red); color: #fff; }
.alert { border-radius: 12px; }

.info-box {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1);
  min-height: 120px; align-items: center;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.info-box:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.info-box .info-box-content { justify-content: center; }
.info-box .info-box-text { white-space: normal; overflow: visible; text-overflow: clip; color: var(--ink) !important; font-weight: 600; }
.info-box a { color: var(--tg-red); font-weight: 600; }
.info-box a:hover { color: var(--tg-red-700); }

/* 7. Plugins */
.select2-container--bootstrap4 .select2-selection,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple { border-radius: 10px; border: 1px solid #ddd; }
.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap4.select2-container--open .select2-selection,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--tg-red); box-shadow: 0 0 0 4px var(--tg-red-50); }
.select2-container--bootstrap4 .select2-results__option--highlighted,
.select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background-color: var(--tg-red) !important; color: #fff !important; }
.select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { background-color: var(--tg-red); border-color: var(--tg-red); color: #fff; border-radius: 6px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove { color: rgba(255,255,255,.8); }
.select2-dropdown { border-color: var(--line); border-radius: 10px; box-shadow: var(--sh-2); overflow: hidden; }
.daterangepicker { border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-2); font-family: inherit; }
.daterangepicker td.active, .daterangepicker td.active:hover { background-color: var(--tg-red); }
.daterangepicker td.in-range { background-color: var(--tg-red-50); color: var(--ink); }
.daterangepicker .ranges li.active { background-color: var(--tg-red); }
.daterangepicker .drp-buttons .btn-success, .daterangepicker .applyBtn { background-color: var(--tg-red); border-color: var(--tg-red); color: #fff; }
.bootstrap-datetimepicker-widget { border-radius: var(--r); }
.bootstrap-datetimepicker-widget table td.active, .bootstrap-datetimepicker-widget table td.active:hover { background-color: var(--tg-red); text-shadow: none; }
.bootstrap-datetimepicker-widget table td.today::before { border-bottom-color: var(--tg-red); }
.bootstrap-datetimepicker-widget table td span.active { background-color: var(--tg-red); }
.swal2-popup { border-radius: var(--r-lg); font-family: inherit; }
.swal2-styled { border-radius: 10px !important; font-weight: 600; }
.swal2-styled.swal2-confirm { background-color: var(--tg-red) !important; }
.swal2-styled:focus { box-shadow: 0 0 0 4px var(--tg-red-50) !important; }
#toast-container > div { border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.16); opacity: 1; font-family: inherit; }
#toast-container > .toast-success { background-color: var(--ok); }
#toast-container > .toast-error { background-color: var(--tg-red); }
#toast-container > .toast-warning { background-color: var(--warn); }
#toast-container > .toast-info { background-color: var(--info); }
.dropzone { border: 2px dashed #ddd; border-radius: var(--r); background: #fff; transition: all .2s; }
.dropzone:hover, .dropzone.dz-drag-hover { border-color: var(--tg-red); background: var(--tg-red-50); }
.dropzone .dz-preview .dz-progress .dz-upload { background: var(--tg-red); }
[class*="icheck-primary"] > input:first-child:checked + input[type="hidden"] + label::before,
[class*="icheck-primary"] > input:first-child:checked + label::before { background-color: var(--tg-red); border-color: var(--tg-red); }
[class*="icheck-primary"] > input:first-child:not(:checked):not(:disabled):hover + label::before { border-color: var(--tg-red); }

/* 8. Preloader */
.preloader { background-color: var(--bg); transition: height 250ms var(--ease); }
.preloader img { width: 56px; height: 56px; object-fit: contain; animation: tg-pulso 1.2s ease-in-out infinite; }
@keyframes tg-pulso { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* 9. Utilitarias de la interfaz */
.tg-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.tg-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--tg-red); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none;
}
.tg-migas { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tg-migas a { color: var(--muted); }
.tg-migas a:hover { color: var(--tg-red); }
.tg-migas b, .tg-migas strong { color: var(--ink); font-weight: 600; }
.tg-toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 10000; }
.tg-toast {
  background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.16); padding: 14px 16px;
  display: flex; gap: 12px; align-items: center; min-width: 300px; max-width: 420px;
  border-left: 4px solid var(--ok); animation: tg-in .4s var(--ease);
}
.tg-toast > span { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; }
.tg-toast > .tg-ico { width: 20px; height: 20px; }
.tg-toast[data-tipo="ok"] { border-left-color: var(--ok); } .tg-toast[data-tipo="ok"] > .tg-ico { color: var(--ok); }
.tg-toast[data-tipo="aviso"] { border-left-color: var(--warn); } .tg-toast[data-tipo="aviso"] > .tg-ico { color: var(--warn); }
.tg-toast[data-tipo="error"] { border-left-color: var(--tg-red); } .tg-toast[data-tipo="error"] > .tg-ico { color: var(--tg-red); }
.tg-toast[data-tipo="info"] { border-left-color: var(--info); } .tg-toast[data-tipo="info"] > .tg-ico { color: var(--info); }
.tg-toast-cerrar { background: none; border: 0; padding: 4px; margin: -4px; color: var(--muted); cursor: pointer; border-radius: 6px; line-height: 0; }
.tg-toast-cerrar:hover { color: var(--ink); background: var(--bg); }
.tg-toast-cerrar .tg-ico { width: 16px; height: 16px; }
.tg-toast.saliendo { animation: tg-out .3s var(--ease) forwards; }
@keyframes tg-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes tg-out { to { opacity: 0; transform: translateX(30px); } }

/* 10. Celular y tableta (corte del panel de AdminLTE) */
@media (max-width: 991.98px) {
  .content-wrapper { margin-left: 0 !important; }
  .content { padding-left: 16px; padding-right: 16px; }
  .content-header { padding-left: 16px; padding-right: 16px; }
  .content-header h1 { font-size: 22px; }
  .tg-toasts { left: 16px; right: 16px; bottom: 16px; }
  .tg-toast { min-width: 0; max-width: none; }
  #sidebar-overlay, .sidebar-overlay { background: rgba(0,0,0,.4); }
}
@media (max-width: 767.98px) {
  .form-control, .custom-select, .custom-file-label { font-size: 16px; }
  #filtrocabecera br { display: none; }
  #filtrocabecera .row > [class*="col-"] { margin-bottom: 10px; }
  #filtrocabecera .row > [class*="col-"].m-b-20 { margin-bottom: 20px; }
}
@media (max-width: 991.98px) {
  /* Tablas de listado en tableta y celular: letra y filas más compactas */
  .table td { font-size: 12px; line-height: 1.35; }
  .table thead th, .table th { font-size: 10px; letter-spacing: .04em; }
  .table-responsive .table td, .table-responsive .table th { padding: .45rem .4rem; }
  .table td strong, .table td b { font-weight: 600; }
  .table td .badge { font-size: 10px; padding: .3em .6em; }
  /* Acciones de fila: botones de 28 px en varias filas en vez de una sola de ~230 px */
  .table td .btn-group { flex-wrap: wrap; gap: 4px; width: 124px; margin-bottom: 0 !important; }
  .table td .btn-group > .btn, .table td .btn-group > a > .btn { border-radius: 8px !important; margin-left: 0 !important; }
  html body .table td .btn.derecho, html body .table td .btn.centro, html body .table td .btn.izquierdo,
  html body .table td .btn.derecho:not(:disabled):not(.disabled), html body .table td .btn.centro:not(:disabled):not(.disabled), html body .table td .btn.izquierdo:not(:disabled):not(.disabled) { width: 28px; height: 28px; font-size: 12px; }
  html body .table td .btn.derecho i, html body .table td .btn.centro i, html body .table td .btn.izquierdo i { font-size: 12px; }
  /* Paginación centrada (el pie llega con float-right) */
  .card-footer:has(> .pagination) { float: none !important; width: 100%; display: flex; justify-content: center; }
  .pagination { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 575.98px) {
  .table { font-size: 12px; }
  #condicionfechas { margin-top: 8px; }
  .card-body form .btn + .btn, .card-footer .btn + .btn, .modal-footer .btn + .btn { margin-left: 0; }
  .card-footer, .modal-footer { display: flex; flex-wrap: wrap; gap: 8px; }
}

/* 11. Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
  *:not(.fa-spin):not(.spinner-border):not(.spinner-grow):not(.overlay):not(.overlay *):not(.swal2-loader):not(.swal2-loading *),
  *:not(.fa-spin):not(.spinner-border):not(.spinner-grow):not(.overlay):not(.overlay *):not(.swal2-loader):not(.swal2-loading *)::before,
  *:not(.fa-spin):not(.spinner-border):not(.spinner-grow):not(.overlay):not(.overlay *):not(.swal2-loader):not(.swal2-loading *)::after { animation: none !important; }
}

/* 10. Login (.tg-login): dos columnas; solo la tarjeta bajo 768 px */
body.tg-login {
  display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; height: auto;
  background: var(--bg); font-family: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink);
}
.tg-login__marca {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: linear-gradient(115deg, #c40015 0%, var(--tg-red-900) 70%, #5c000a 100%);
}
.tg-login__marca::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: url(/dist/img/marca/fondorojo.webp) center / cover no-repeat; mix-blend-mode: screen; opacity: .35; pointer-events: none;
}
.tg-login__marca img { position: relative; width: min(320px, 60%); height: auto; }
.tg-login__panel { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.tg-login__card {
  width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 32px 28px; box-shadow: 0 8px 28px rgba(0, 0, 0, .06);
}
.tg-login__card h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; color: var(--ink); }
.tg-login__card .tg-login__sub { font-size: 13px; color: var(--muted); margin: 0 0 22px; }
.tg-login__card .form-control { height: 42px; border-radius: 8px; border-color: var(--line); }
.tg-login__card .form-control:focus { border-color: var(--tg-red); box-shadow: 0 0 0 3px var(--tg-red-50); }
.tg-login__card .btn-primary { height: 44px; font-weight: 600; border-radius: 8px; }
.tg-login__card label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tg-login__card .icheck-primary label { font-weight: 400; }
.tg-login__enlace { display: inline-block; margin-top: 18px; font-size: 13px; color: var(--tg-red); }
.tg-login__enlace:hover { color: var(--tg-red-700); }
@media (max-width: 767.98px) {
  body.tg-login { grid-template-columns: 1fr; grid-template-rows: 120px 1fr; }
  .tg-login__marca img { width: 150px; }
  .tg-login__panel { align-items: flex-start; padding: 24px 16px; }
  .tg-login__card { padding: 24px 20px; }
}

/* 11. Pie */
.main-footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 0; background: transparent; font-size: 12px; color: var(--muted);
}
