/* =============================================================================
   DISEÑO DE MARCA — capa visual sobre la plantilla original (no cambia funciones).
   Todos los colores, la fuente y los bordes salen de variables CSS que calcula App\Services\Brand
   desde Ajustes → Marca y diseño. Cada marca (cliente) tiene su propio estilo sin tocar este archivo.
   Solo se aplica con <body class="marca">; si la marca está desactivada se ve el diseño anterior.
   ============================================================================= */

:root {
  --side-w: 264px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 8px 24px -6px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22);
  --ok: #16a34a; --ok-soft: #dcfce7; --ok-ink: #166534;
  --bad: #dc2626; --bad-soft: #fee2e2; --bad-ink: #991b1b;
  --warn: #f59e0b; --warn-soft: #fef3c7; --warn-ink: #92400e;
  --info: #0284c7; --info-soft: #e0f2fe; --info-ink: #075985;
}

/* ---------- Base ---------- */
body.marca {
  font-family: var(--font) !important;
  font-size: 13.5px !important;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -.005em;
}
body.marca h1, body.marca h2, body.marca h3, body.marca h4, body.marca h5, body.marca h6 {
  font-family: var(--font);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.02em;
}
body.marca h4 { font-size: 1.15rem; }
body.marca h5 { font-size: 1rem; }
body.marca a { color: var(--brand-ink); transition: color .15s; }
body.marca a:hover { color: var(--brand-hover); text-decoration: none; }
body.marca ::selection { background: rgba(var(--brand-rgb), .18); }
body.marca .text-muted { color: var(--text-muted) !important; }
body.marca .text-primary { color: var(--brand-ink) !important; }
body.marca .bg-primary { background: var(--brand) !important; }
body.marca .bg-light { background: var(--brand-softer) !important; }
body.marca .border-primary { border-color: var(--brand) !important; }
body.marca section { min-height: 0; }
body.marca hr { border-top-color: var(--border); }

/* Barra de desplazamiento fina */
body.marca ::-webkit-scrollbar { width: 10px; height: 10px; }
body.marca ::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .28); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
body.marca ::-webkit-scrollbar-thumb:hover { background-color: rgba(100, 116, 139, .45); }

/* ---------- Menú lateral ---------- */
body.marca .side-navbar {
  top: 0 !important;
  width: var(--side-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  border-right: 1px solid var(--side-border);
  z-index: 1040;
  transition: transform .32s var(--ease), box-shadow .32s;
  overflow-x: hidden;
}
body.marca .side-navbar.shrink { width: var(--side-w); transform: translateX(-100%); }
body.marca .side-navbar .side-navbar-wrapper { padding-bottom: 32px; }
body.marca .side-navbar .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { background: var(--side-muted); }

body.marca .side-brand {
  display: flex; align-items: center; gap: 12px;
  height: var(--header-h); padding: 0 18px;
  border-bottom: 1px solid var(--side-border);
  color: var(--side-active-text);
  text-decoration: none;
}
body.marca .side-brand img {
  width: 38px; height: 38px; border-radius: var(--radius-sm); object-fit: contain;
  background: rgba(255, 255, 255, .08); padding: 3px; flex-shrink: 0;
}
body.marca .side-brand .initials {
  width: 38px; height: 38px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: var(--brand); color: var(--brand-contrast);
}
body.menu-marca .side-brand .initials { background: rgba(255, 255, 255, .2); color: #fff; }
body.marca .side-brand strong {
  display: block; font-size: 15px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
  color: var(--side-active-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px;
}
body.menu-claro .side-brand strong { color: var(--text); }
body.marca .side-brand small { display: block; font-size: 11.5px; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }

body.marca .side-search { padding: 14px 14px 6px; position: relative; }
body.marca .side-search i { position: absolute; left: 27px; top: 50%; transform: translateY(-25%); color: var(--side-muted); font-size: 13px; pointer-events: none; }
body.marca .side-search input {
  width: 100%; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--side-border); background: var(--side-input);
  color: var(--side-active-text); padding: 0 12px 0 34px; font-size: 13px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
body.menu-claro .side-search input { color: var(--text); }
body.marca .side-search input::placeholder { color: var(--side-muted); }
body.marca .side-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .22); }
body.marca .side-search kbd {
  position: absolute; right: 24px; top: 50%; transform: translateY(-25%);
  font: 600 10.5px var(--font); color: var(--side-muted); background: transparent;
  border: 1px solid var(--side-border); border-radius: 5px; padding: 1px 6px; box-shadow: none;
}
body.marca .side-empty { display: none; padding: 10px 26px; color: var(--side-muted); font-size: 12.5px; }

body.marca .side-navbar .main-menu { padding-top: 6px; }
body.marca .side-navbar li a {
  display: flex; align-items: center; gap: 12px;
  margin: 2px 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; line-height: 1.35; text-transform: none; letter-spacing: 0;
  color: var(--side-text) !important; background: transparent;
  transition: background .18s var(--ease), color .18s, transform .18s var(--ease);
}
body.marca .side-navbar li a i { font-size: 18px; width: 22px; margin-right: 0; text-align: center; opacity: .85; flex-shrink: 0; transform: none; }
body.marca .side-navbar li a span { flex: 1; min-width: 0; }
body.marca .side-navbar li a:hover,
body.marca .side-navbar li a:focus { background: var(--side-hover) !important; color: var(--side-active-text) !important; }
body.marca .side-navbar li a:hover i { opacity: 1; }
body.marca .side-navbar li a[aria-expanded="true"] { background: var(--side-hover) !important; color: var(--side-active-text) !important; font-weight: 600; }
body.marca .side-navbar li a[data-toggle="collapse"]::before {
  content: '\f105'; right: 14px; font-size: 13px; opacity: .55;
  transition: transform .25s var(--ease); transform: translateY(-50%);
}
body.marca .side-navbar li a[aria-expanded="true"]::before { content: '\f105'; transform: translateY(-50%) rotate(90deg); color: inherit; opacity: .9; }
body.marca .side-navbar li.active > a { background: var(--side-active) !important; color: var(--side-active-text) !important; }

body.marca .side-navbar li ul {
  background: transparent; border-radius: 0;
  margin: 2px 12px 6px 34px; padding: 2px 0 2px 10px;
  border-left: 1px solid var(--side-border);
}
body.marca .side-navbar li ul a {
  margin: 1px 0; padding: 7px 10px; font-size: 13px; font-weight: 450;
  color: var(--side-muted) !important;
}
body.marca .side-navbar li ul a::after { display: none; }
body.marca .side-navbar li ul a:hover { color: var(--side-active-text) !important; background: var(--side-hover) !important; transform: translateX(2px); }
body.marca .side-navbar li li.active > a {
  background: var(--side-active) !important; color: var(--side-active-text) !important; font-weight: 600;
  box-shadow: inset 2px 0 0 var(--brand);
}
body.menu-marca .side-navbar li li.active > a { box-shadow: inset 2px 0 0 #fff; }
body.marca .side-navbar li ul.collapsing { transition: height .26s var(--ease); }
body.marca .side-navbar li.search-hit > a { background: var(--side-hover) !important; color: var(--side-active-text) !important; }
body.marca .side-navbar li.search-hidden { display: none !important; }
/* Submenús plegables dentro de un grupo (Movimientos, Analizar inventario, Catálogo…) */
body.marca .side-navbar li.menu-group > a { font-weight: 600 !important; color: var(--side-text, var(--side-muted)) !important; position: relative; padding-right: 26px !important; }
body.marca .side-navbar li.menu-group > a::before { right: 8px !important; font-size: 13px; }
body.marca .side-navbar li ul ul { margin: 0 0 4px 10px; padding-left: 8px; }
body.marca .side-navbar li ul ul a { font-size: 12.5px; padding: 6px 10px; }
/* Subtítulos dentro de un grupo del menú (Movimientos, Analizar inventario, Más…) */
body.marca .side-navbar li.menu-sub { padding: 12px 10px 3px; opacity: .75; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--side-muted); pointer-events: none; }

/* ---------- Encabezado ---------- */
body.marca header.header {
  position: sticky; top: 0; z-index: 1030;
  margin-left: var(--side-w);
  transition: margin-left .32s var(--ease), box-shadow .2s, background .2s;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
body.marca.is-scrolled header.header { box-shadow: var(--shadow-md); background: rgba(255, 255, 255, .9); }
body.marca header.header nav.navbar { background: transparent !important; padding: 0; height: var(--header-h); }
body.marca header.header nav.navbar .container-fluid { padding: 0 24px; height: 100%; }
body.marca header.header .navbar-holder { height: 100%; }
body.marca nav.navbar a { color: var(--text); font-size: 13.5px; }
body.marca nav.navbar a.menu-btn,
body.marca #toggle-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff;
  color: var(--text) !important; transition: background .15s, transform .15s, border-color .15s;
}
body.marca #toggle-btn:hover { background: var(--brand-softer); border-color: rgba(var(--brand-rgb), .35); }
body.marca #toggle-btn:active { transform: scale(.95); }
body.marca nav.navbar .nav-menu { gap: 8px; }
body.marca nav.navbar .nav-menu > .nav-item > a.dropdown-item,
body.marca nav.navbar .nav-menu > .nav-item > a.nav-link {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  color: var(--text); font-weight: 600; background: transparent; transition: background .15s, color .15s;
}
body.marca nav.navbar .nav-menu > .nav-item > a:hover { background: var(--brand-softer); color: var(--brand-ink); }
body.marca nav.navbar .nav-menu > .nav-item > a.pos-link {
  background: var(--brand); color: var(--brand-contrast) !important; padding: 8px 16px;
  box-shadow: 0 6px 16px -6px rgba(var(--brand-rgb), .7);
}
body.marca nav.navbar .nav-menu > .nav-item > a.pos-link:hover { background: var(--brand-hover); transform: translateY(-1px); }
body.marca nav.navbar .badge { top: 0; right: -2px; font-size: 10px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 999px; border: 2px solid #fff; }
body.marca .user-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff;
  font-weight: 700; font-size: 12.5px; letter-spacing: .02em; flex-shrink: 0;
}
body.marca .user-name { line-height: 1.15; text-align: left; }
body.marca .user-name small { display: block; color: var(--text-muted); font-weight: 500; font-size: 11px; }
body.marca .current-branch {
  background: var(--brand-soft) !important; color: var(--brand-ink) !important;
  border-radius: 999px !important; font-weight: 600; padding: 7px 14px !important; margin-right: 0 !important;
}

/* ---------- Página ---------- */
body.marca .page {
  margin-left: var(--side-w); width: auto; background: var(--bg);
  transition: margin-left .32s var(--ease); padding-bottom: 40px; min-height: calc(100vh - var(--header-h));
}
body.marca .side-navbar.shrink ~ header.header,
body.marca .side-navbar.shrink ~ .page { margin-left: 0; width: auto; }
body.marca .page > #content { padding: 8px 8px 0; }
body.marca .container-fluid { padding-left: 20px; padding-right: 20px; }
body.marca .page section.forms,
body.marca .page section { padding: 16px 0; }

@media (max-width: 1199px) {
  body.marca header.header, body.marca .page { margin-left: 0 !important; }
  body.marca .side-navbar:not(.shrink) { box-shadow: var(--shadow-lg); }
  body.marca .marca-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035;
    opacity: 0; pointer-events: none; transition: opacity .3s;
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  }
  body.marca.side-open .marca-backdrop { opacity: 1; pointer-events: auto; }
  body.marca .user-name { display: none; }
}
@media (max-width: 575px) {
  body.marca header.header nav.navbar .container-fluid { padding: 0 12px; }
  body.marca .container-fluid { padding-left: 12px; padding-right: 12px; }
  body.marca nav.navbar .nav-menu > .nav-item > a.pos-link span { display: none; }
}

/* ---------- Tarjetas ---------- */
body.marca .card {
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); background: var(--surface);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
body.marca .card-header {
  background: transparent; border-bottom: 1px solid var(--border);
  padding: 16px 22px; border-radius: var(--radius) var(--radius) 0 0 !important;
}
body.marca .card-header h4, body.marca .card-header h3 { margin: 0; font-size: 1.15rem; }
body.marca .card-body { padding: 22px; }
body.marca .card-footer { background: var(--brand-softer); border-top: 1px solid var(--border); }
body.marca .card.bg-light { background: var(--brand-softer) !important; box-shadow: none; }
body.marca .card.border-primary { border-color: rgba(var(--brand-rgb), .45) !important; box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .07); }

/* ---------- Botones ---------- */
body.marca .btn {
  font-family: var(--font); font-weight: 600; font-size: 13.5px;
  border-radius: var(--radius-sm); padding: .5rem 1rem; line-height: 1.4;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s, transform .12s var(--ease);
}
body.marca .btn:active { transform: scale(.97); }
body.marca .btn:focus, body.marca .btn.focus { box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .25); }
body.marca .btn-sm { font-size: 12.5px; padding: .32rem .7rem; }
body.marca .btn-lg { font-size: 15px; padding: .7rem 1.4rem; }
body.marca .btn i { margin-right: 2px; }
body.marca .btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), inset 0 1px 0 rgba(255, 255, 255, .12); }
body.marca .btn-primary:hover, body.marca .btn-primary:focus { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-contrast); }
body.marca .btn-primary:not(:disabled):not(.disabled).active, body.marca .btn-primary:not(:disabled):not(.disabled):active { background: var(--brand-strong); border-color: var(--brand-strong); }
body.marca .btn-info { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
body.marca .btn-info:hover, body.marca .btn-info:focus { background: var(--brand); color: var(--brand-contrast); }
body.marca .btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
body.marca .btn-success:hover { background: #15803d; border-color: #15803d; }
body.marca .btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
body.marca .btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
body.marca .btn-warning { background: var(--warn); border-color: var(--warn); color: #1f1300; }
body.marca .btn-warning:hover { background: #d97706; border-color: #d97706; color: #fff; }
body.marca .btn-secondary, body.marca .btn-default, body.marca .btn-light {
  background: #fff; border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-xs);
}
body.marca .btn-secondary:hover, body.marca .btn-default:hover, body.marca .btn-light:hover { background: var(--brand-softer); border-color: rgba(var(--brand-rgb), .3); color: var(--brand-ink); }
body.marca .btn-secondary.active, body.marca .btn-secondary:not(:disabled):not(.disabled).active { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
body.marca .btn-dark { background: #111827; border-color: #111827; }
body.marca .btn-link { color: var(--brand-ink); font-weight: 600; }
body.marca .btn-outline-primary { color: var(--brand-ink); border-color: rgba(var(--brand-rgb), .45); background: #fff; }
body.marca .btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
body.marca .btn-outline-secondary { color: var(--text); border-color: var(--border); background: #fff; }
body.marca .btn-outline-secondary:hover { background: var(--brand-softer); color: var(--brand-ink); border-color: rgba(var(--brand-rgb), .3); }
body.marca .btn-outline-success { color: var(--ok-ink); border-color: #86efac; background: #fff; }
body.marca .btn-outline-success:hover { background: var(--ok); color: #fff; border-color: var(--ok); }
body.marca .btn-outline-danger { color: var(--bad-ink); border-color: #fca5a5; background: #fff; }
body.marca .btn-outline-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
body.marca .btn-outline-info { color: var(--brand-ink); border-color: rgba(var(--brand-rgb), .35); background: #fff; }
body.marca .btn-outline-info:hover { background: var(--brand-soft); color: var(--brand-ink); }
body.marca .btn-group > .btn { box-shadow: none; }
body.marca .btn-group > .btn:not(:first-child) { margin-left: -1px; }

/* Selector de fechas del tablero como control segmentado */
body.marca .filter-toggle.btn-group { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-xs); }
body.marca .filter-toggle.btn-group > .btn { border: 0; border-radius: 999px !important; background: transparent; color: var(--text-muted); padding: .38rem .95rem; margin: 0; }
body.marca .filter-toggle.btn-group > .btn:hover { color: var(--brand-ink); background: var(--brand-softer); }
body.marca .filter-toggle.btn-group > .btn.active { background: var(--brand); color: var(--brand-contrast); box-shadow: 0 4px 12px -4px rgba(var(--brand-rgb), .6); }

/* ---------- Formularios ---------- */
body.marca label { font-size: 13px; color: #374151; margin-bottom: 6px; }
body.marca .form-control, body.marca .custom-select {
  height: 40px; border-radius: var(--radius-sm); border: 1px solid #d8dbe4;
  font-size: 13.5px; color: var(--text); background-color: #fff;
  transition: border-color .15s, box-shadow .15s;
}
body.marca textarea.form-control { height: auto; }
body.marca .form-control-sm { height: 34px; font-size: 12.5px; }
body.marca .form-control:hover { border-color: #c4c8d4; }
body.marca .form-control:focus, body.marca .custom-select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16); outline: 0;
}
body.marca .form-control::placeholder { color: #9aa1af; }
body.marca .form-control:disabled, body.marca .form-control[readonly] { background: #f5f6f9; }
body.marca .input-group-text { background: var(--brand-softer); border-color: #d8dbe4; color: var(--text-muted); border-radius: var(--radius-sm); }
body.marca .input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.marca .input-group > .input-group-append > .input-group-text { border-top-left-radius: 0; border-bottom-left-radius: 0; }
body.marca .input-group > .input-group-prepend > .input-group-text { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.marca .custom-control-input:checked ~ .custom-control-label::before { background: var(--brand); border-color: var(--brand); }
body.marca input[type=checkbox], body.marca input[type=radio] { accent-color: var(--brand); }
/* bootstrap-select (selectpicker) */
body.marca .bootstrap-select > .dropdown-toggle,
body.marca .bootstrap-select .btn-link.dropdown-toggle {
  height: 40px; border-radius: var(--radius-sm) !important; border: 1px solid #d8dbe4 !important;
  background: #fff !important; color: var(--text) !important; font-weight: 500; box-shadow: none; text-decoration: none;
}
body.marca .bootstrap-select.show > .dropdown-toggle,
body.marca .bootstrap-select > .dropdown-toggle:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16) !important; outline: 0 !important; }
body.marca .bootstrap-select .dropdown-menu li a { border-radius: 6px; }
body.marca .bootstrap-select .dropdown-menu li.active a, body.marca .bootstrap-select .dropdown-menu li a:hover { background: var(--brand-soft); color: var(--brand-ink); }
body.marca .bootstrap-select .bs-searchbox .form-control { height: 36px; }

/* ---------- Tablas ---------- */
body.marca .table { color: var(--text); margin-bottom: 0; }
body.marca .table thead th {
  background: transparent; border-top: 0; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  padding: 12px 14px; vertical-align: bottom; white-space: nowrap;
}
body.marca .table td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
body.marca .table-sm td, body.marca .table-sm th { padding: 9px 10px; }
body.marca .table tfoot th, body.marca .table tfoot td { border-top: 2px solid var(--border); font-weight: 700; }
body.marca .table-hover tbody tr, body.marca table.dataTable tbody tr { transition: background .15s; }
body.marca .table-hover tbody tr:hover, body.marca table.dataTable tbody tr:hover { background: var(--brand-softer); }
body.marca .table-striped tbody tr:nth-of-type(odd) { background: rgba(var(--brand-rgb), .025); }
body.marca table.dataTable tbody tr.selected { background: var(--brand-soft) !important; }
body.marca table.dataTable thead .sorting::after, body.marca table.dataTable thead .sorting_asc::after, body.marca table.dataTable thead .sorting_desc::after { opacity: .35; }
body.marca .table-responsive { border-radius: var(--radius-sm); }
body.marca .dataTables_wrapper .dataTables_filter input,
body.marca .dataTables_wrapper .dataTables_length select {
  height: 36px; border-radius: var(--radius-sm); border: 1px solid #d8dbe4; padding: 0 10px; transition: border-color .15s, box-shadow .15s;
}
body.marca .dataTables_wrapper .dataTables_filter input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16); outline: 0; }
body.marca .dataTables_wrapper .dataTables_info { color: var(--text-muted); font-size: 12.5px; }
body.marca .dt-buttons .btn, body.marca .dt-buttons .dt-button {
  background: #fff !important; border: 1px solid var(--border) !important; color: var(--text) !important;
  box-shadow: var(--shadow-xs); font-weight: 600; border-radius: 0 !important;
}
body.marca .dt-buttons .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; }
body.marca .dt-buttons .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }
body.marca .dt-buttons .btn:hover { background: var(--brand-softer) !important; color: var(--brand-ink) !important; }
body.marca .pagination { gap: 4px; }
body.marca .page-link { border: 1px solid var(--border); border-radius: var(--radius-sm) !important; color: var(--text); min-width: 36px; text-align: center; transition: background .15s; }
body.marca .page-link:hover { background: var(--brand-softer); color: var(--brand-ink); }
body.marca .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); box-shadow: 0 4px 10px -4px rgba(var(--brand-rgb), .6); }

/* ---------- Etiquetas (badges) ---------- */
body.marca .badge { font-weight: 600; font-size: 11.5px; padding: .38em .7em; border-radius: 999px; letter-spacing: .01em; }
body.marca .badge-primary { background: var(--brand); color: var(--brand-contrast); }
body.marca .badge-success { background: var(--ok-soft); color: var(--ok-ink); }
body.marca .badge-danger { background: var(--bad-soft); color: var(--bad-ink); }
body.marca .badge-warning { background: var(--warn-soft); color: var(--warn-ink); }
body.marca .badge-info { background: var(--brand-soft); color: var(--brand-ink); }
body.marca .badge-secondary { background: #eef0f4; color: #374151; }
body.marca .badge-light { background: #f6f7f9; color: #4b5563; border: 1px solid var(--border); }
body.marca .badge-dark { background: #111827; color: #fff; }
body.marca nav.navbar .badge-danger { background: var(--bad); color: #fff; }

/* ---------- Avisos ---------- */
body.marca .alert { border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13.5px; }
body.marca .alert-success { background: #f0fdf4; border-color: #bbf7d0; color: var(--ok-ink); }
body.marca .alert-danger { background: #fef2f2; border-color: #fecaca; color: var(--bad-ink); }
body.marca .alert-warning { background: #fffbeb; border-color: #fde68a; color: var(--warn-ink); }
body.marca .alert-info { background: var(--brand-softer); border-color: rgba(var(--brand-rgb), .2); color: var(--brand-ink); }
body.marca .alert-secondary { background: #f6f7f9; border-color: var(--border); color: #374151; }
body.marca .alert .close { opacity: .45; transition: opacity .15s; }
body.marca .alert .close:hover { opacity: .9; }

/* ---------- Pestañas ---------- */
body.marca .nav-pills { gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--border); border-radius: calc(var(--radius-sm) + 4px); display: inline-flex; max-width: 100%; }
body.marca .nav-pills .nav-link { border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; padding: 7px 13px; font-size: 13px; transition: background .18s, color .18s; white-space: nowrap; }
body.marca .nav-pills .nav-link:hover { background: var(--brand-softer); color: var(--brand-ink); }
body.marca .nav-pills .nav-link.active { background: var(--brand); color: var(--brand-contrast); box-shadow: 0 4px 12px -4px rgba(var(--brand-rgb), .55); }
body.marca .nav-pills .nav-link.active small { color: inherit; opacity: .8; }
body.marca .nav-tabs { border-bottom: 1px solid var(--border); }
body.marca .nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 600; }
body.marca .nav-tabs .nav-link.active { color: var(--brand-ink); border-bottom-color: var(--brand); background: transparent; }

/* ---------- Menús desplegables y ventanas ---------- */
body.marca .dropdown-menu {
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 6px; font-size: 13.5px; min-width: 200px;
}
body.marca .dropdown-menu.show { animation: marca-pop .16s var(--ease); }
body.marca .dropdown-menu li a, body.marca .dropdown-menu .dropdown-item, body.marca nav.navbar .dropdown-menu a {
  border-radius: 6px; padding: 8px 10px; color: var(--text); display: flex; align-items: center; gap: 8px;
}
body.marca .dropdown-menu li a:hover, body.marca .dropdown-menu .dropdown-item:hover { background: var(--brand-softer); color: var(--brand-ink); }
body.marca .dropdown-menu .btn-link { text-align: left; width: 100%; }
body.marca .modal-content { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
body.marca .modal-header { border-bottom: 1px solid var(--border); padding: 16px 22px; }
body.marca .modal-header .modal-title { font-weight: 700; }
body.marca .modal-body { padding: 22px; }
body.marca .modal-footer { border-top: 1px solid var(--border); }
body.marca .modal.fade .modal-dialog { transform: translateY(14px) scale(.97); transition: transform .26s var(--ease), opacity .2s; }
body.marca .modal.show .modal-dialog { transform: none; }
body.marca .modal-backdrop.show { opacity: .42; }
body.marca .tooltip-inner { border-radius: 6px; font-size: 12px; padding: 6px 10px; }

/* ---------- Tablero ---------- */
body.marca .brand-text h3 { font-size: 24px; text-transform: none; font-weight: 800; letter-spacing: -.03em; }
body.marca .brand-text h3 span { color: var(--brand-ink); }
body.marca .dashboard-counts .wrapper.count-title {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px 22px; text-align: left !important; display: grid; grid-template-columns: 46px 1fr; column-gap: 14px; align-items: center;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
body.marca .dashboard-counts .wrapper.count-title:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
body.marca .dashboard-counts .count-title .icon {
  grid-row: span 2; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-softer); margin: 0;
}
body.marca .dashboard-counts .count-title .icon i { font-size: 22px; width: auto; }
body.marca .dashboard-counts .count-title .name strong { color: var(--text-muted) !important; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
body.marca .dashboard-counts .count-number { font-size: 24px; font-weight: 800; letter-spacing: -.03em; color: var(--text); margin: 0; }

/* ---------- Pie de página, cargador y aviso de pruebas ---------- */
body.marca footer.main-footer { background: transparent; color: var(--text-muted); border-top: 1px solid var(--border); padding: 14px 0; font-size: 12px; }
body.marca footer.main-footer p { margin: 0; }
body.marca #loader {
  position: fixed; top: 0; left: 0; right: 0; width: auto; height: 3px; margin: 0; border: 0; border-radius: 0; z-index: 2000;
  background: linear-gradient(90deg, transparent, var(--brand), var(--accent), transparent);
  background-size: 50% 100%; background-repeat: no-repeat;
  animation: marca-progress 1s var(--ease) infinite;
}
body.marca::before {
  content: ''; position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; pointer-events: none;
  background: linear-gradient(90deg, var(--brand), var(--accent)); box-shadow: 0 0 10px rgba(var(--brand-rgb), .6);
  opacity: 0; transition: opacity .2s;
}
body.marca.is-navigating::before { opacity: 1; animation: marca-nav 8s cubic-bezier(.1, .7, .1, 1) forwards; }

/* ---------- Animaciones (Ajustes → Marca y diseño → Animaciones) ---------- */
@keyframes marca-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes marca-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes marca-progress { 0% { background-position: -100% 0; } 100% { background-position: 200% 0; } }
@keyframes marca-nav { 0% { width: 0; } 30% { width: 45%; } 100% { width: 92%; } }
body.marca-anim #content.animate-bottom { animation: marca-in .45s var(--ease) backwards; position: relative; }
body.marca-anim #content .card,
body.marca-anim #content .dashboard-counts .col-sm-3 { animation: marca-in .5s var(--ease) backwards; }
body.marca-anim #content .card:nth-of-type(2), body.marca-anim #content .dashboard-counts .col-sm-3:nth-child(2) { animation-delay: .05s; }
body.marca-anim #content .card:nth-of-type(3), body.marca-anim #content .dashboard-counts .col-sm-3:nth-child(3) { animation-delay: .1s; }
body.marca-anim #content .card:nth-of-type(4), body.marca-anim #content .dashboard-counts .col-sm-3:nth-child(4) { animation-delay: .15s; }
body.marca-anim.is-leaving #content { opacity: .55; transition: opacity .25s; }
body.marca:not(.marca-anim) *, body.marca:not(.marca-anim) *::before, body.marca:not(.marca-anim) *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  body.marca *, body.marca *::before, body.marca *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Impresión ---------- */
@media print {
  body.marca { background: #fff; }
  body.marca header.header, body.marca .side-navbar, body.marca footer.main-footer, body.marca #loader { display: none !important; }
  body.marca .page { margin: 0 !important; }
  body.marca .card { box-shadow: none; border: 0; }
}

/* ---------- Ajustes finos sobre reglas de la plantilla ---------- */
body.marca .dt-buttons .btn span { color: inherit !important; }
body.marca nav.navbar .nav-menu > .nav-item > a { line-height: 1.2 !important; height: 40px; }
body.marca nav.navbar .nav-menu > .nav-item > a i { color: inherit; font-size: 15px; }
body.marca .user-avatar { line-height: 1; }
body.marca .side-brand img { background: #fff; }
body.menu-claro .side-brand img { border: 1px solid var(--border); }
@media (max-width: 767px) {
  body.marca .filter-toggle.btn-group { display: flex; overflow-x: auto; max-width: 100%; float: none !important; margin-top: 12px; scrollbar-width: none; }
  body.marca .filter-toggle.btn-group > .btn { white-space: nowrap; flex-shrink: 0; }
  body.marca .nav-pills { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}

/* ---------- Paleta de comandos (Ctrl+K) ---------- */
.cmdk { position: fixed; inset: 0; z-index: 2500; display: flex; justify-content: center; align-items: flex-start; padding: 11vh 16px 16px; font-family: var(--font); }
.cmdk[hidden] { display: none; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s; }
.cmdk-panel { position: relative; width: 100%; max-width: 640px; background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(15, 23, 42, .45), 0 0 0 1px rgba(15, 23, 42, .06);
  opacity: 0; transform: translateY(-10px) scale(.98); transition: opacity .18s, transform .22s cubic-bezier(.2, .7, .2, 1); }
.cmdk.open .cmdk-backdrop { opacity: 1; }
.cmdk.open .cmdk-panel { opacity: 1; transform: none; }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.cmdk-input > i { color: var(--brand); font-size: 17px; }
.cmdk-input input { flex: 1; height: 62px; border: 0; outline: 0; font: 500 17px var(--font); color: var(--text); background: transparent; }
.cmdk-input input::placeholder { color: #9aa1af; }
.cmdk kbd { font: 600 11px var(--font); color: var(--text-muted); background: #f3f4f6; border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; box-shadow: none; }
.cmdk-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand-soft); border-top-color: var(--brand); opacity: 0; animation: cmdk-spin .7s linear infinite; }
.cmdk.loading .cmdk-spin { opacity: 1; }
@keyframes cmdk-spin { to { transform: rotate(360deg); } }
.cmdk-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 12px 12px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text) !important; text-decoration: none !important; }
.cmdk-item.on { background: var(--brand-soft); }
.cmdk-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #f3f4f6; color: var(--text-muted); flex-shrink: 0; transition: background .15s, color .15s; }
.cmdk-item.on .cmdk-ico { background: var(--brand); color: var(--brand-contrast); }
.cmdk-text { flex: 1; min-width: 0; display: grid; }
.cmdk-text b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-text small { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-enter { color: var(--brand-ink); opacity: 0; transition: opacity .15s; }
.cmdk-item.on .cmdk-enter { opacity: 1; }
.cmdk-empty { display: grid; place-items: center; gap: 4px; text-align: center; padding: 34px 10px; color: var(--text-muted); }
.cmdk-empty i { font-size: 22px; color: var(--brand); margin-bottom: 6px; }
.cmdk-empty b { color: var(--text); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); background: #fafbfc; font-size: 12px; color: var(--text-muted); }
.cmdk-foot kbd { margin-right: 3px; }
@media (max-width: 575px) { .cmdk { padding-top: 8px; } .cmdk-foot { display: none; } .cmdk-input input { height: 54px; font-size: 16px; } }

/* Botón de búsqueda del encabezado */
body.marca .hdr-search {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 14px; min-width: 240px;
  border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-muted); font: 500 13px var(--font); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, color .15s;
}
body.marca .hdr-search:hover { border-color: rgba(var(--brand-rgb), .45); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .08); color: var(--text); }
body.marca .hdr-search span { flex: 1; text-align: left; }
body.marca .hdr-search kbd { font: 600 11px var(--font); color: var(--text-muted); background: #f3f4f6; border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; box-shadow: none; }

/* El contenido se muestra apenas carga (las entradas son animadas); la barra de arriba indica la carga. */
body.marca #content { display: block !important; }

/* Transición entre páginas (View Transitions API, Chrome/Edge 126+ y Safari 18.2+; los demás cambian normal).
   El menú y el encabezado quedan quietos; solo el contenido se desvanece y sube. */
@view-transition { navigation: auto; }
body.marca .side-navbar { view-transition-name: marca-side; }
body.marca header.header { view-transition-name: marca-top; }
::view-transition-old(root) { animation: 140ms ease-out both marca-vt-out; }
::view-transition-new(root) { animation: 300ms cubic-bezier(.2, .7, .2, 1) both marca-vt-in; }
@keyframes marca-vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes marca-vt-in { from { opacity: 0; transform: translateY(10px); } }
body.marca:not(.marca-anim) .side-navbar, body.marca:not(.marca-anim) header.header { view-transition-name: none; }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }
