/*
 * Sistema visual central de Admin Chequea.
 *
 * Durante la transición convive con las utilidades de Tailwind y con los
 * estilos heredados de index.php/login.php. No contiene lógica ni selectores
 * funcionales; los IDs, data-* y contratos de JavaScript permanecen intactos.
 */

:root {
    --admin-primary: #FE6803;
    --admin-primary-dark: #E85D00;
    --admin-navy: #111827;
    --admin-success: #19B574;
    --admin-info: #0D6EFD;
    --admin-warning: #F59E08;
    --admin-danger: #FF3340;
    --admin-purple: #7C3AED;
    --admin-cyan: #0EA5E9;
    --admin-bg: #F5F7FA;
    --admin-surface: #FFFFFF;
    --admin-border: #E2EBF0;
    --admin-text-secondary: #64748B;
    --admin-text-muted: #94A3B8;
    --admin-shadow-sm: 0 4px 16px rgba(15, 23, 42, .06);
    --admin-shadow-md: 0 14px 32px rgba(15, 23, 42, .08);
    --admin-radius-sm: 10px;
    --admin-radius-md: 14px;
    --admin-radius-lg: 18px;
    --admin-radius-xl: 24px;
    --admin-ink: var(--admin-navy);
    --admin-muted: var(--admin-text-secondary);
    --admin-orange: var(--admin-primary);
    --admin-orange-dark: var(--admin-primary-dark);
    --admin-dark: var(--admin-navy);
}

* {
    box-sizing: border-box;
}

body.admin-app-shell {
    min-width: 0;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    background: var(--admin-bg);
    color: var(--admin-navy);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
}

body.admin-app-shell button,
body.admin-app-shell input,
body.admin-app-shell select,
body.admin-app-shell textarea {
    font: inherit;
}

body.admin-app-shell button,
body.admin-app-shell a {
    -webkit-tap-highlight-color: transparent;
}

body.admin-app-shell :focus-visible,
.delivery-admin-login :focus-visible {
    outline: 3px solid rgba(13, 110, 253, .28);
    outline-offset: 2px;
}

body.admin-app-shell > div.min-h-screen {
    min-width: 0;
    background: transparent;
}

body.admin-app-shell main {
    min-width: 0;
    background: var(--admin-bg);
}

body.admin-app-shell main > div {
    width: min(100%, 1800px);
    min-width: 0;
    margin-inline: auto;
}

/* Shell, sidebar y topbar */

body.admin-app-shell .admin-sidebar-shell {
    background: linear-gradient(180deg, #111827 0%, #0F1A2A 100%) !important;
    border-color: rgba(226, 235, 240, .13) !important;
    box-shadow: 18px 0 42px rgba(15, 23, 42, .16);
}

body.admin-app-shell .admin-sidebar-shell > div {
    border-color: rgba(226, 235, 240, .13) !important;
}

body.admin-app-shell .admin-sidebar-logo {
    display: flex;
    align-items: center;
    width: min(100%, 10.5rem);
    min-height: 2.25rem;
}

body.admin-app-shell .admin-sidebar-logo .logo-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 3rem;
}

body.admin-app-shell .admin-sidebar-shell .admin-nav-item,
body.admin-app-shell .admin-sidebar-shell .admin-submenu-toggle {
    border-radius: var(--admin-radius-md);
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

body.admin-app-shell .admin-sidebar-shell .admin-nav-item:hover,
body.admin-app-shell .admin-sidebar-shell .admin-submenu-toggle:hover {
    background: rgba(255, 255, 255, .08) !important;
    transform: translateX(1px);
}

body.admin-app-shell .admin-sidebar-shell .admin-nav-item.bg-slate-800,
body.admin-app-shell .admin-sidebar-shell .admin-submenu-toggle.bg-slate-800 {
    background: linear-gradient(90deg, rgba(254, 104, 3, .22), rgba(254, 104, 3, .08)) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--admin-primary), inset 0 0 0 1px rgba(254, 104, 3, .15);
}

body.admin-app-shell .admin-sidebar-scroll .admin-nav-item.text-xs {
    font-size: .73125rem !important;
    line-height: 1.14rem !important;
}

body.admin-app-shell .admin-sidebar-scroll .admin-nav-item.text-sm,
body.admin-app-shell .admin-sidebar-scroll .admin-submenu-toggle.text-sm {
    font-size: .84375rem !important;
    line-height: 1.236rem !important;
}

body.admin-app-shell .admin-sidebar-scroll > div > p {
    font-size: .61875rem !important;
    line-height: .84rem !important;
}

body.admin-app-shell .admin-sidebar-scroll [data-submenu-caret] {
    font-size: .73125rem !important;
    line-height: .9rem !important;
}

body.admin-app-shell .admin-sidebar-shell .admin-submenu-toggle:hover {
    background: rgba(254, 104, 3, .18) !important;
    color: #fff !important;
}

body.admin-app-shell .admin-sidebar-shell .admin-submenu-toggle.is-expanded,
body.admin-app-shell .admin-sidebar-shell .admin-submenu-toggle.is-expanded:hover {
    background: linear-gradient(90deg, rgba(254, 104, 3, .28), rgba(254, 104, 3, .10)) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--admin-primary), inset 0 0 0 1px rgba(254, 104, 3, .2);
}
body.admin-app-shell .admin-sidebar-shell .rounded-3xl.bg-slate-800 {
    background: rgba(255, 255, 255, .08) !important;
    border: 1px solid rgba(255, 255, 255, .08);
}

body.admin-app-shell .admin-sidebar-shell a.bg-rose-600,
body.admin-app-shell .admin-sidebar-shell a.bg-rose-700 {
    background: var(--admin-danger) !important;
}

body.admin-app-shell .admin-topbar {
    border: 1px solid rgba(226, 235, 240, .92) !important;
    border-radius: var(--admin-radius-xl) !important;
    background: rgba(255, 255, 255, .92) !important;
    box-shadow: var(--admin-shadow-sm) !important;
    backdrop-filter: blur(14px);
}

body.admin-app-shell .admin-topbar .text-emerald-600 {
    color: var(--admin-primary) !important;
}

body.admin-app-shell .admin-topbar h2 {
    letter-spacing: -.025em;
}

body.admin-app-shell .admin-topbar button {
    border-radius: var(--admin-radius-md);
}

body.admin-app-shell #adminModuleRoot {
    min-width: 0;
    max-width: 100%;
}

body.admin-app-shell #adminModuleRoot > * {
    min-width: 0;
    max-width: 100%;
}

body.admin-app-shell #adminModuleRoot .grid > *,
body.admin-app-shell #adminModuleRoot .flex > * {
    min-width: 0;
}

body.admin-app-shell #adminModuleRoot .overflow-auto,
body.admin-app-shell #adminModuleRoot .overflow-x-auto {
    max-width: 100%;
    scrollbar-color: rgba(148, 163, 184, .52) transparent;
}

body.admin-app-shell #adminModuleRoot img,
body.admin-app-shell #adminModuleRoot canvas,
body.admin-app-shell #adminModuleRoot svg {
    max-width: 100%;
}

/* Superficies y tarjetas existentes */

body.admin-app-shell #adminModuleRoot .rounded-3xl.border.border-slate-200.bg-white,
body.admin-app-shell #adminModuleRoot .rounded-\[2rem\].border.border-slate-200.bg-white,
body.admin-app-shell #adminModuleRoot .rounded-2xl.border.border-slate-200.bg-white,
body.admin-app-shell #adminModuleRoot .rounded-xl.border.border-slate-200.bg-white {
    border-color: var(--admin-border) !important;
    border-radius: var(--admin-radius-lg) !important;
    box-shadow: var(--admin-shadow-sm) !important;
}

body.admin-app-shell #adminModuleRoot .rounded-3xl.border.border-slate-200.bg-white:hover,
body.admin-app-shell #adminModuleRoot .rounded-\[2rem\].border.border-slate-200.bg-white:hover,
body.admin-app-shell #adminModuleRoot .rounded-2xl.border.border-slate-200.bg-white:hover {
    box-shadow: var(--admin-shadow-md) !important;
}

body.admin-app-shell #adminModuleRoot .rounded-3xl.border.border-slate-200.bg-white::before {
    display: none;
}

body.admin-app-shell #adminModuleRoot .rounded-2xl.bg-slate-50,
body.admin-app-shell #adminModuleRoot .rounded-xl.bg-slate-50 {
    background: #F8FAFC !important;
    border-color: var(--admin-border) !important;
}

body.admin-app-shell #adminModuleRoot .bg-white.shadow-sm {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-sm) !important;
}

body.admin-app-shell #adminModuleRoot h1,
body.admin-app-shell #adminModuleRoot h2,
body.admin-app-shell #adminModuleRoot h3,
body.admin-app-shell #adminModuleRoot h4 {
    color: var(--admin-navy);
    letter-spacing: -.018em;
}

body.admin-app-shell #adminModuleRoot .text-slate-500,
body.admin-app-shell #adminModuleRoot .text-slate-400 {
    color: var(--admin-text-secondary) !important;
}

body.admin-app-shell #adminModuleRoot .text-slate-300 {
    color: #475569 !important;
}

body.admin-app-shell #adminModuleRoot .border-slate-100,
body.admin-app-shell #adminModuleRoot .border-slate-200,
body.admin-app-shell #adminModuleRoot .border-slate-300 {
    border-color: var(--admin-border) !important;
}

/* Botones y estados de color */

body.admin-app-shell #adminModuleRoot button.rounded-3xl,
body.admin-app-shell #adminModuleRoot button.rounded-2xl,
body.admin-app-shell #adminModuleRoot button.rounded-xl,
body.admin-app-shell #adminModuleRoot button.rounded-lg {
    min-height: 2.5rem;
    border-radius: var(--admin-radius-md);
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

body.admin-app-shell #adminModuleRoot button.bg-orange-500,
body.admin-app-shell #adminModuleRoot button.bg-orange-600,
body.admin-app-shell #adminModuleRoot button.bg-orange-700 {
    background-color: var(--admin-primary) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button.bg-orange-500:hover,
body.admin-app-shell #adminModuleRoot button.bg-orange-600:hover,
body.admin-app-shell #adminModuleRoot button.bg-orange-700:hover {
    background-color: var(--admin-primary-dark) !important;
    box-shadow: 0 8px 18px rgba(254, 104, 3, .22);
}

body.admin-app-shell #adminModuleRoot button.bg-emerald-500,
body.admin-app-shell #adminModuleRoot button.bg-emerald-600,
body.admin-app-shell #adminModuleRoot button.bg-green-600 {
    background-color: var(--admin-success) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button.bg-rose-500,
body.admin-app-shell #adminModuleRoot button.bg-rose-600,
body.admin-app-shell #adminModuleRoot button.bg-red-600 {
    background-color: var(--admin-danger) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button.bg-slate-900,
body.admin-app-shell #adminModuleRoot button.bg-slate-950 {
    background-color: var(--admin-navy) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button:hover:not(:disabled) {
    transform: translateY(-1px);
}

body.admin-app-shell #adminModuleRoot button:disabled {
    cursor: not-allowed;
    opacity: .58;
    transform: none;
}

body.admin-app-shell #adminModuleRoot .text-orange-500,
body.admin-app-shell #adminModuleRoot .text-orange-600,
body.admin-app-shell #adminModuleRoot .text-orange-700 {
    color: var(--admin-primary) !important;
}

body.admin-app-shell #adminModuleRoot .text-emerald-500,
body.admin-app-shell #adminModuleRoot .text-emerald-600,
body.admin-app-shell #adminModuleRoot .text-green-600 {
    color: var(--admin-success) !important;
}

body.admin-app-shell #adminModuleRoot .text-rose-500,
body.admin-app-shell #adminModuleRoot .text-rose-600,
body.admin-app-shell #adminModuleRoot .text-red-600 {
    color: var(--admin-danger) !important;
}

/* Formularios */

body.admin-app-shell #adminModuleRoot input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body.admin-app-shell #adminModuleRoot select,
body.admin-app-shell #adminModuleRoot textarea {
    min-width: 0;
    border-color: var(--admin-border) !important;
    border-radius: var(--admin-radius-sm) !important;
    background: var(--admin-surface) !important;
    color: var(--admin-navy);
}

body.admin-app-shell #adminModuleRoot input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
body.admin-app-shell #adminModuleRoot select:focus,
body.admin-app-shell #adminModuleRoot textarea:focus {
    border-color: rgba(13, 110, 253, .55) !important;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, .10) !important;
    outline: 0;
}

body.admin-app-shell #adminModuleRoot input::placeholder,
body.admin-app-shell #adminModuleRoot textarea::placeholder {
    color: var(--admin-text-muted);
}

body.admin-app-shell #adminModuleRoot input[type="checkbox"],
body.admin-app-shell #adminModuleRoot input[type="radio"] {
    accent-color: var(--admin-primary);
}

/* Badges, alertas, tablas y estados */

body.admin-app-shell #adminModuleRoot [class*="badge"],
body.admin-app-shell #adminModuleRoot .rounded-full {
    letter-spacing: .01em;
}

body.admin-app-shell #adminModuleRoot table {
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

body.admin-app-shell #adminModuleRoot th {
    color: var(--admin-text-secondary);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .075em;
    text-transform: uppercase;
}

body.admin-app-shell #adminModuleRoot td,
body.admin-app-shell #adminModuleRoot th {
    border-bottom-color: var(--admin-border) !important;
}

body.admin-app-shell #adminToast {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-shadow-md);
}

body.admin-app-shell #adminModuleRoot .bg-emerald-50,
body.admin-app-shell #adminModuleRoot .bg-green-50 {
    background-color: rgba(25, 181, 116, .10) !important;
}

body.admin-app-shell #adminModuleRoot .bg-orange-50 {
    background-color: rgba(254, 104, 3, .10) !important;
}

body.admin-app-shell #adminModuleRoot .bg-amber-50 {
    background-color: rgba(245, 158, 8, .12) !important;
}

body.admin-app-shell #adminModuleRoot .bg-rose-50,
body.admin-app-shell #adminModuleRoot .bg-red-50 {
    background-color: rgba(255, 51, 64, .10) !important;
}

body.admin-app-shell #adminModuleRoot .bg-blue-50 {
    background-color: rgba(13, 110, 253, .09) !important;
}

body.admin-app-shell #adminModuleRoot .bg-sky-50 {
    background-color: rgba(14, 165, 233, .10) !important;
}

body.admin-app-shell #adminModuleRoot .bg-violet-50,
body.admin-app-shell #adminModuleRoot .bg-purple-100 {
    background-color: rgba(124, 58, 237, .10) !important;
}

body.admin-app-shell #adminModuleRoot .bg-indigo-50 {
    background-color: rgba(13, 110, 253, .08) !important;
}

body.admin-app-shell #adminModuleRoot .text-sky-500,
body.admin-app-shell #adminModuleRoot .text-sky-600,
body.admin-app-shell #adminModuleRoot .text-sky-700 {
    color: var(--admin-cyan) !important;
}

body.admin-app-shell #adminModuleRoot .text-violet-600,
body.admin-app-shell #adminModuleRoot .text-violet-700,
body.admin-app-shell #adminModuleRoot .text-purple-600,
body.admin-app-shell #adminModuleRoot .text-purple-700 {
    color: var(--admin-purple) !important;
}

body.admin-app-shell #adminModuleRoot .border-sky-200,
body.admin-app-shell #adminModuleRoot .border-sky-300 {
    border-color: rgba(14, 165, 233, .30) !important;
}

body.admin-app-shell #adminModuleRoot .border-violet-200,
body.admin-app-shell #adminModuleRoot .border-violet-300 {
    border-color: rgba(124, 58, 237, .25) !important;
}

body.admin-app-shell .admin-badge {
    min-height: 1.75rem;
    border-width: 1px;
    font-size: .7rem;
    line-height: 1.1;
}

body.admin-app-shell .admin-badge-emerald {
    border-color: rgba(25, 181, 116, .24) !important;
    background: rgba(25, 181, 116, .12) !important;
    color: #087A4B !important;
}

body.admin-app-shell .admin-badge-amber {
    border-color: rgba(245, 158, 8, .26) !important;
    background: rgba(245, 158, 8, .14) !important;
    color: #A55B00 !important;
}

body.admin-app-shell .admin-badge-rose {
    border-color: rgba(255, 51, 64, .24) !important;
    background: rgba(255, 51, 64, .11) !important;
    color: #C81E2C !important;
}

body.admin-app-shell .admin-badge-sky {
    border-color: rgba(14, 165, 233, .25) !important;
    background: rgba(14, 165, 233, .11) !important;
    color: #036A99 !important;
}

body.admin-app-shell .admin-badge-slate {
    border-color: var(--admin-border) !important;
    background: #F1F5F9 !important;
    color: #475569 !important;
}

body.admin-app-shell .admin-money-stack {
    white-space: nowrap;
}

body.admin-app-shell .admin-field > span,
body.admin-app-shell .admin-checkbox-card span {
    color: var(--admin-navy);
}

body.admin-app-shell .admin-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    min-height: 9rem;
}

body.admin-app-shell .admin-loading-spinner {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    border: 3px solid rgba(254, 104, 3, .20);
    border-top-color: var(--admin-primary);
    border-radius: 50%;
    animation: admin-design-spin .75s linear infinite;
}

@keyframes admin-design-spin {
    to { transform: rotate(360deg); }
}

/* Modulo de categorias: lista, filtros y editor modal. */

body.admin-app-shell .admin-category-page {
    min-width: 0;
    display: grid;
    gap: 1.25rem;
}

body.admin-app-shell .admin-category-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-xl);
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-sm);
}

body.admin-app-shell .admin-category-toolbar,
body.admin-app-shell .admin-category-filter-bar,
body.admin-app-shell .admin-category-list-footer {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

body.admin-app-shell .admin-category-toolbar {
    padding: 1.35rem 1.5rem 1rem;
}

body.admin-app-shell .admin-category-filter-bar {
    align-items: flex-end;
    padding: 0 1.5rem 1.15rem;
    border-bottom: 1px solid var(--admin-border);
}

body.admin-app-shell .admin-category-search-field {
    min-width: 0;
    flex: 1 1 auto;
}

body.admin-app-shell .admin-category-title,
body.admin-app-shell .admin-category-modal-title {
    margin: 0;
    color: var(--admin-navy);
    font-weight: 700;
    letter-spacing: -.025em;
}

body.admin-app-shell .admin-category-title {
    font-size: 1.15rem;
}

body.admin-app-shell .admin-category-modal-title {
    font-size: 1.25rem;
}

body.admin-app-shell .admin-category-subtitle,
body.admin-app-shell .admin-category-help,
body.admin-app-shell .admin-category-file-name {
    color: var(--admin-text-secondary);
    font-size: .78rem;
    line-height: 1.45;
}

body.admin-app-shell .admin-category-subtitle {
    margin: .3rem 0 0;
}

body.admin-app-shell .admin-eyebrow {
    margin: 0 0 .25rem;
    color: var(--admin-primary);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

body.admin-app-shell .admin-btn {
    display: inline-flex;
    min-height: 2.55rem;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 1px solid transparent;
    border-radius: var(--admin-radius-md);
    padding: .65rem 1rem;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease;
}

body.admin-app-shell .admin-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

body.admin-app-shell .admin-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

body.admin-app-shell .admin-btn-primary {
    border-color: var(--admin-primary);
    background: var(--admin-primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(254, 104, 3, .18);
}

body.admin-app-shell .admin-btn-primary:hover:not(:disabled) {
    border-color: var(--admin-primary-dark);
    background: var(--admin-primary-dark);
}

body.admin-app-shell .admin-btn-secondary {
    border-color: var(--admin-border);
    background: #fff;
    color: var(--admin-navy);
}

body.admin-app-shell .admin-btn-secondary:hover:not(:disabled) {
    border-color: rgba(254, 104, 3, .45);
    background: rgba(254, 104, 3, .06);
    color: var(--admin-primary-dark);
}

body.admin-app-shell .admin-input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 2.65rem;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    background: #fff;
    padding: .7rem .85rem;
    color: var(--admin-navy);
    font-size: .8rem;
    line-height: 1.25;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

body.admin-app-shell .admin-input::placeholder {
    color: #94A3B8;
}

body.admin-app-shell .admin-input:focus {
    border-color: rgba(13, 110, 253, .55);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
}

body.admin-app-shell .admin-field {
    display: grid;
    min-width: 0;
    gap: .4rem;
}

body.admin-app-shell .admin-field > span,
body.admin-app-shell .admin-category-label {
    color: var(--admin-text-secondary);
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body.admin-app-shell .admin-category-label {
    display: block;
}

body.admin-app-shell .admin-category-list {
    min-width: 0;
}

body.admin-app-shell .admin-category-list-header,
body.admin-app-shell .admin-category-row {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(14rem, 1.6fr) minmax(5.5rem, .65fr) minmax(4.5rem, .55fr) minmax(7rem, .75fr) minmax(5.5rem, .55fr);
    align-items: center;
    gap: 1rem;
}

body.admin-app-shell .admin-category-list-header {
    padding: .7rem 1.5rem;
    background: #F8FAFC;
    color: var(--admin-text-secondary);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

body.admin-app-shell .admin-category-row {
    min-height: 5.2rem;
    border-top: 1px solid #EEF2F6;
    padding: .75rem 1.5rem;
}

body.admin-app-shell .admin-category-row:hover {
    background: rgba(254, 104, 3, .025);
}

body.admin-app-shell .admin-category-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .8rem;
}

body.admin-app-shell .admin-category-thumb {
    width: 4.2rem;
    height: 3.3rem;
    flex: 0 0 auto;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    background: #F8FAFC;
    object-fit: cover;
}

body.admin-app-shell .admin-category-meta {
    min-width: 0;
    color: var(--admin-navy);
    font-size: .82rem;
}

body.admin-app-shell .admin-category-meta strong {
    display: block;
    margin-top: .25rem;
    font-size: .85rem;
}

body.admin-app-shell .admin-category-status,
body.admin-app-shell .admin-category-action {
    min-width: 0;
}

body.admin-app-shell .admin-category-action {
    display: flex;
    justify-content: flex-end;
}

body.admin-app-shell .admin-category-edit-button {
    min-height: 2.2rem;
    padding-inline: .8rem;
}

body.admin-app-shell .admin-category-empty {
    padding: 3rem 1.5rem;
    color: var(--admin-text-secondary);
    font-size: .82rem;
    text-align: center;
}

body.admin-app-shell .admin-category-list-footer {
    align-items: center;
    padding: 1rem 1.5rem 1.2rem;
    color: var(--admin-text-secondary);
    font-size: .75rem;
}

body.admin-app-shell .admin-category-list-footer p {
    margin: 0;
}

body.admin-app-shell .admin-category-list-footer strong {
    color: var(--admin-navy);
}

body.admin-app-shell .admin-category-pagination {
    display: flex;
    align-items: center;
    gap: .3rem;
}

body.admin-app-shell .admin-category-page-button {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-border);
    border-radius: .65rem;
    background: #fff;
    color: var(--admin-text-secondary);
    font-size: .75rem;
    font-weight: 700;
}

body.admin-app-shell .admin-category-page-button:hover:not(:disabled),
body.admin-app-shell .admin-category-page-button.is-active {
    border-color: var(--admin-primary);
    background: var(--admin-primary);
    color: #fff;
}

body.admin-app-shell .admin-category-page-button:disabled {
    cursor: not-allowed;
    opacity: .4;
}

body.admin-app-shell .admin-category-editor-modal {
    overflow-y: auto;
}

body.admin-app-shell .admin-category-modal-shell {
    border-radius: var(--admin-radius-xl) !important;
}

body.admin-app-shell .admin-category-modal-header {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--admin-border);
    padding: 1.35rem 1.5rem 1.1rem;
}

body.admin-app-shell .admin-icon-button {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    background: #fff;
    color: var(--admin-text-secondary);
    font-size: 1rem;
}

body.admin-app-shell .admin-icon-button:hover {
    border-color: rgba(254, 104, 3, .45);
    color: var(--admin-primary-dark);
}

body.admin-app-shell .admin-category-form {
    min-width: 0;
    overflow-y: auto;
    padding: 1.5rem;
}

body.admin-app-shell .admin-category-form-grid {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(14rem, .8fr) minmax(0, 1.2fr);
    gap: 1.25rem;
}

body.admin-app-shell .admin-category-image-panel,
body.admin-app-shell .admin-category-fields-panel {
    min-width: 0;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-lg);
    padding: 1rem;
}

body.admin-app-shell .admin-category-image-panel {
    background: #F8FAFC;
}

body.admin-app-shell .admin-category-fields-panel {
    display: grid;
    align-content: start;
    gap: 1rem;
    background: #fff;
}

body.admin-app-shell .admin-category-section-title {
    margin: 0;
    color: var(--admin-navy);
    font-size: .9rem;
    font-weight: 700;
}

body.admin-app-shell .admin-category-help {
    margin: .35rem 0 0;
}

body.admin-app-shell .admin-category-preview-wrap {
    display: flex;
    min-height: 11rem;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    overflow: hidden;
    border: 1px dashed #CBD5E1;
    border-radius: var(--admin-radius-md);
    background: #fff;
}

body.admin-app-shell .admin-category-preview {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 13rem;
    object-fit: contain;
}

body.admin-app-shell .admin-category-file-button {
    width: 100%;
    cursor: pointer;
}

body.admin-app-shell .admin-category-file-name {
    min-height: 2.2rem;
    margin: .55rem 0 0;
    overflow-wrap: anywhere;
}

body.admin-app-shell .admin-category-field-grid {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1.4fr) minmax(8rem, .6fr);
    gap: 1rem;
}

body.admin-app-shell .admin-category-textarea {
    min-height: 7rem;
    resize: vertical;
}

body.admin-app-shell .admin-checkbox-card {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: .65rem;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    background: #F8FAFC;
    padding: .8rem;
    color: var(--admin-navy);
    font-size: .8rem;
}

body.admin-app-shell .admin-checkbox-card input {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    margin-top: .12rem;
    accent-color: var(--admin-primary);
}

body.admin-app-shell .admin-checkbox-card small {
    display: block;
    margin-top: .25rem;
    color: var(--admin-text-secondary);
    font-size: .72rem;
    font-weight: 400;
    line-height: 1.4;
}

body.admin-app-shell .admin-category-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--admin-border);
    padding-top: 1.1rem;
}

@media (max-width: 820px) {
    body.admin-app-shell .admin-category-list-header,
    body.admin-app-shell .admin-category-row {
        grid-template-columns: minmax(12rem, 1.7fr) minmax(5rem, .7fr) minmax(7rem, .8fr) minmax(5.5rem, .55fr);
    }

    body.admin-app-shell .admin-category-list-header span:nth-child(3),
    body.admin-app-shell .admin-category-row > .admin-category-meta:nth-child(3) {
        display: none;
    }

    body.admin-app-shell .admin-category-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body.admin-app-shell .admin-category-toolbar,
    body.admin-app-shell .admin-category-filter-bar,
    body.admin-app-shell .admin-category-list-footer,
    body.admin-app-shell .admin-category-modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    body.admin-app-shell .admin-category-toolbar,
    body.admin-app-shell .admin-category-filter-bar,
    body.admin-app-shell .admin-category-list-footer {
        padding-inline: 1rem;
    }

    body.admin-app-shell .admin-category-new-button,
    body.admin-app-shell .admin-category-search-button {
        width: 100%;
    }

    body.admin-app-shell .admin-category-list-header {
        display: none;
    }

    body.admin-app-shell .admin-category-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .75rem;
        padding: .9rem 1rem;
    }

    body.admin-app-shell .admin-category-meta,
    body.admin-app-shell .admin-category-status {
        display: none;
    }

    body.admin-app-shell .admin-category-action {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
    }

    body.admin-app-shell .admin-category-edit-button {
        min-height: 2.1rem;
        padding-inline: .7rem;
    }

    body.admin-app-shell .admin-category-list-footer {
        gap: .75rem;
    }

    body.admin-app-shell .admin-category-pagination {
        justify-content: center;
    }

    body.admin-app-shell .admin-category-modal-header,
    body.admin-app-shell .admin-category-form {
        padding-inline: 1rem;
    }

    body.admin-app-shell .admin-category-field-grid {
        grid-template-columns: 1fr;
    }

    body.admin-app-shell .admin-category-modal-actions > .flex {
        width: 100%;
    }

    body.admin-app-shell .admin-category-modal-actions > .flex .admin-btn {
        flex: 1 1 8rem;
    }
}

/* Login administrativo: comparte tokens sin alterar su flujo de sesión. */

.delivery-admin-login {
    color: var(--admin-navy);
    background: var(--admin-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.delivery-admin-login-pane {
    background: var(--admin-surface);
}

.delivery-admin-login-form-wrap {
    border-color: var(--admin-border) !important;
    box-shadow: var(--admin-shadow-md);
}

.delivery-admin-login-submit {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-dark)) !important;
    box-shadow: 0 10px 22px rgba(254, 104, 3, .20);
}

.delivery-admin-login-submit:hover {
    background: var(--admin-primary-dark) !important;
}

/* Dashboard */

body.admin-app-shell .admin-dashboard-root {
    min-width: 0;
    color: var(--admin-navy);
}

body.admin-app-shell .admin-dashboard-kpi,
body.admin-app-shell .admin-dashboard-section,
body.admin-app-shell .admin-dashboard-quick-card {
    border-color: var(--admin-border) !important;
    border-radius: var(--admin-radius-lg) !important;
    box-shadow: var(--admin-shadow-sm) !important;
}

body.admin-app-shell .admin-dashboard-kpi {
    background: var(--admin-surface) !important;
}

body.admin-app-shell .admin-dashboard-kpi:hover,
body.admin-app-shell .admin-dashboard-quick-card:hover {
    border-color: rgba(254, 104, 3, .30) !important;
    box-shadow: var(--admin-shadow-md) !important;
}

body.admin-app-shell .admin-dashboard-kpi-icon,
body.admin-app-shell .admin-dashboard-quick-icon,
body.admin-app-shell .admin-dashboard-approval-icon {
    border-radius: 12px !important;
}

body.admin-app-shell .admin-dashboard-section canvas {
    max-width: 100%;
}

/* Modales, drawers y mapas */

body.admin-app-shell .admin-modal-shell {
    max-width: calc(100vw - 2rem);
    border: 1px solid var(--admin-border) !important;
    border-radius: var(--admin-radius-xl) !important;
    background: var(--admin-surface) !important;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24) !important;
}

body.admin-app-shell .admin-modal-header {
    border-color: var(--admin-border) !important;
    background: var(--admin-surface) !important;
}

body.admin-app-shell .admin-modal-header::after {
    left: 1.5rem;
    right: 1.5rem;
    background: linear-gradient(90deg, var(--admin-primary), rgba(254, 104, 3, .08)) !important;
}

body.admin-app-shell .leaflet-container {
    z-index: 0 !important;
    isolation: isolate;
    border-radius: var(--admin-radius-md);
}

/* Scrollbars y comportamiento responsive */

body.admin-app-shell .admin-sidebar-scroll {
    scrollbar-color: rgba(148, 163, 184, .52) transparent;
}

body.admin-app-shell .admin-sidebar-scroll::-webkit-scrollbar {
    width: 7px;
}

body.admin-app-shell .admin-sidebar-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(148, 163, 184, .42);
    background-clip: padding-box;
}

@media (max-width: 1023px) {
    body.admin-app-shell main > div {
        padding-inline: 1rem;
    }

    body.admin-app-shell .admin-topbar {
        border-radius: var(--admin-radius-lg) !important;
    }
}

@media (max-width: 640px) {
    body.admin-app-shell main > div {
        padding-inline: .75rem;
    }

    body.admin-app-shell .admin-topbar {
        padding: .875rem !important;
    }

    body.admin-app-shell .admin-modal-shell {
        max-width: calc(100vw - 1rem);
        border-radius: var(--admin-radius-lg) !important;
    }

    body.admin-app-shell #adminModuleRoot table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-height: 680px) and (min-width: 1024px) {
    body.admin-app-shell .admin-sidebar-shell > div:first-child {
        padding-block: 1rem;
    }

    body.admin-app-shell .admin-sidebar-shell nav {
        padding-block: 1rem;
    }

    body.admin-app-shell .admin-sidebar-shell > div:last-child {
        padding-bottom: 1rem;
        padding-top: .75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.admin-app-shell *,
    .delivery-admin-login * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/*
 * Normalizacion integral de componentes.
 *
 * Los modulos existentes se renderizan con utilidades Tailwind distintas y
 * algunas fueron creadas antes del sistema visual. Estas reglas uniforman su
 * medida y apariencia sin depender de renombrar clases ni tocar listeners.
 */

body.admin-app-shell #adminModuleRoot,
body.admin-app-shell [id$="Modal"] {
    color: var(--admin-navy);
    font-size: .875rem;
    line-height: 1.45;
}

body.admin-app-shell #adminModuleRoot h1,
body.admin-app-shell [id$="Modal"] h1 {
    font-size: 1.75rem !important;
    line-height: 1.15 !important;
}

body.admin-app-shell #adminModuleRoot h2,
body.admin-app-shell [id$="Modal"] h2 {
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
}

body.admin-app-shell #adminModuleRoot h3,
body.admin-app-shell [id$="Modal"] h3 {
    font-size: 1.0625rem !important;
    line-height: 1.3 !important;
}

body.admin-app-shell #adminModuleRoot h4,
body.admin-app-shell [id$="Modal"] h4 {
    font-size: .9375rem !important;
    line-height: 1.3 !important;
}

body.admin-app-shell #adminModuleRoot .text-3xl,
body.admin-app-shell [id$="Modal"] .text-3xl {
    font-size: 1.75rem !important;
    line-height: 1.15 !important;
}

body.admin-app-shell #adminModuleRoot .text-2xl,
body.admin-app-shell [id$="Modal"] .text-2xl {
    font-size: 1.375rem !important;
    line-height: 1.2 !important;
}

body.admin-app-shell #adminModuleRoot .text-xl,
body.admin-app-shell [id$="Modal"] .text-xl {
    font-size: 1.125rem !important;
    line-height: 1.25 !important;
}

body.admin-app-shell #adminModuleRoot .text-lg,
body.admin-app-shell [id$="Modal"] .text-lg {
    font-size: 1rem !important;
    line-height: 1.3 !important;
}

body.admin-app-shell #adminModuleRoot .text-sm,
body.admin-app-shell [id$="Modal"] .text-sm {
    font-size: .8125rem !important;
}

body.admin-app-shell #adminModuleRoot .text-xs,
body.admin-app-shell [id$="Modal"] .text-xs {
    font-size: .71875rem !important;
}

/* Inputs, selects y textareas: altura y ritmo común de 40–44 px. */

body.admin-app-shell #adminModuleRoot input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
body.admin-app-shell #adminModuleRoot select,
body.admin-app-shell [id$="Modal"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
body.admin-app-shell [id$="Modal"] select {
    width: 100%;
    min-height: 2.5rem !important;
    height: 2.5rem !important;
    padding: .625rem .75rem !important;
    border: 1px solid var(--admin-border) !important;
    border-radius: var(--admin-radius-sm) !important;
    background: var(--admin-surface) !important;
    color: var(--admin-navy) !important;
    font-size: .8125rem !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
}

body.admin-app-shell #adminModuleRoot textarea,
body.admin-app-shell [id$="Modal"] textarea {
    width: 100%;
    min-height: 5.5rem !important;
    height: auto !important;
    padding: .75rem !important;
    border: 1px solid var(--admin-border) !important;
    border-radius: var(--admin-radius-sm) !important;
    background: var(--admin-surface) !important;
    color: var(--admin-navy) !important;
    font-size: .8125rem !important;
    line-height: 1.45 !important;
    box-shadow: none !important;
}

body.admin-app-shell #adminModuleRoot input[type="file"],
body.admin-app-shell [id$="Modal"] input[type="file"] {
    width: 100%;
    min-height: 2.5rem !important;
    padding: .45rem .625rem !important;
    border: 1px solid var(--admin-border) !important;
    border-radius: var(--admin-radius-sm) !important;
    background: var(--admin-surface) !important;
    color: var(--admin-text-secondary) !important;
    font-size: .75rem !important;
}

body.admin-app-shell #adminModuleRoot input[type="file"]::file-selector-button,
body.admin-app-shell [id$="Modal"] input[type="file"]::file-selector-button {
    margin-right: .625rem;
    border: 0;
    border-right: 1px solid var(--admin-border);
    background: #F8FAFC;
    color: var(--admin-navy);
    font-size: .75rem;
    font-weight: 700;
}

body.admin-app-shell #adminModuleRoot input:focus,
body.admin-app-shell #adminModuleRoot select:focus,
body.admin-app-shell #adminModuleRoot textarea:focus,
body.admin-app-shell [id$="Modal"] input:focus,
body.admin-app-shell [id$="Modal"] select:focus,
body.admin-app-shell [id$="Modal"] textarea:focus {
    border-color: rgba(13, 110, 253, .62) !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .11) !important;
    outline: 0 !important;
}

body.admin-app-shell #adminModuleRoot label,
body.admin-app-shell [id$="Modal"] label {
    min-width: 0;
    color: var(--admin-text-secondary);
    font-size: .71875rem;
    line-height: 1.25;
}

body.admin-app-shell #adminModuleRoot label input[type="checkbox"],
body.admin-app-shell #adminModuleRoot label input[type="radio"],
body.admin-app-shell [id$="Modal"] label input[type="checkbox"],
body.admin-app-shell [id$="Modal"] label input[type="radio"] {
    width: 1rem;
    height: 1rem;
    min-height: 1rem !important;
    flex: 0 0 auto;
}

/* Botones: misma densidad, radio y jerarquía en todos los módulos. */

body.admin-app-shell #adminModuleRoot button[class*="px-"],
body.admin-app-shell [id$="Modal"] button[class*="px-"] {
    min-height: 2.5rem !important;
    padding: .625rem .875rem !important;
    border-radius: var(--admin-radius-sm) !important;
    font-size: .8125rem !important;
    font-weight: 700;
    line-height: 1.2 !important;
    white-space: normal;
}

body.admin-app-shell #adminModuleRoot button.inline-flex[class*="h-10"][class*="w-10"],
body.admin-app-shell #adminModuleRoot button.inline-flex[class*="h-11"][class*="w-11"],
body.admin-app-shell [id$="Modal"] button.inline-flex[class*="h-10"][class*="w-10"],
body.admin-app-shell [id$="Modal"] button.inline-flex[class*="h-11"][class*="w-11"] {
    width: 2.5rem !important;
    min-width: 2.5rem !important;
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    padding: 0 !important;
    border-radius: 50% !important;
}

body.admin-app-shell #adminModuleRoot button.bg-orange-500,
body.admin-app-shell #adminModuleRoot button.bg-orange-600,
body.admin-app-shell #adminModuleRoot button.bg-orange-700,
body.admin-app-shell [id$="Modal"] button.bg-orange-500,
body.admin-app-shell [id$="Modal"] button.bg-orange-600,
body.admin-app-shell [id$="Modal"] button.bg-orange-700 {
    background: var(--admin-primary) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button.bg-emerald-500,
body.admin-app-shell #adminModuleRoot button.bg-emerald-600,
body.admin-app-shell #adminModuleRoot button.bg-green-600,
body.admin-app-shell [id$="Modal"] button.bg-emerald-500,
body.admin-app-shell [id$="Modal"] button.bg-emerald-600,
body.admin-app-shell [id$="Modal"] button.bg-green-600 {
    background: var(--admin-success) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button.bg-indigo-600,
body.admin-app-shell #adminModuleRoot button.bg-blue-600,
body.admin-app-shell #adminModuleRoot button.bg-sky-600,
body.admin-app-shell [id$="Modal"] button.bg-indigo-600,
body.admin-app-shell [id$="Modal"] button.bg-blue-600,
body.admin-app-shell [id$="Modal"] button.bg-sky-600 {
    background: var(--admin-info) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button.bg-purple-600,
body.admin-app-shell #adminModuleRoot button.bg-violet-600,
body.admin-app-shell [id$="Modal"] button.bg-purple-600,
body.admin-app-shell [id$="Modal"] button.bg-violet-600 {
    background: var(--admin-purple) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button.bg-amber-500,
body.admin-app-shell #adminModuleRoot button.bg-amber-600,
body.admin-app-shell [id$="Modal"] button.bg-amber-500,
body.admin-app-shell [id$="Modal"] button.bg-amber-600 {
    background: var(--admin-warning) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button.bg-rose-500,
body.admin-app-shell #adminModuleRoot button.bg-rose-600,
body.admin-app-shell #adminModuleRoot button.bg-red-600,
body.admin-app-shell [id$="Modal"] button.bg-rose-500,
body.admin-app-shell [id$="Modal"] button.bg-rose-600,
body.admin-app-shell [id$="Modal"] button.bg-red-600 {
    background: var(--admin-danger) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button.bg-slate-900,
body.admin-app-shell #adminModuleRoot button.bg-slate-950,
body.admin-app-shell [id$="Modal"] button.bg-slate-900,
body.admin-app-shell [id$="Modal"] button.bg-slate-950 {
    background: var(--admin-navy) !important;
    color: #fff !important;
}

body.admin-app-shell #adminModuleRoot button.border,
body.admin-app-shell [id$="Modal"] button.border {
    border-color: var(--admin-border) !important;
}

/* Tarjetas, contenedores internos y separadores. */

body.admin-app-shell #adminModuleRoot [class*="rounded-3xl"][class*="border"][class*="bg-white"],
body.admin-app-shell #adminModuleRoot [class*="rounded-2xl"][class*="border"][class*="bg-white"],
body.admin-app-shell #adminModuleRoot [class*="rounded-\[2rem\]"][class*="border"][class*="bg-white"],
body.admin-app-shell [id$="Modal"] [class*="rounded-3xl"][class*="bg-white"],
body.admin-app-shell [id$="Modal"] [class*="rounded-2xl"][class*="bg-white"] {
    border-color: var(--admin-border) !important;
    border-radius: var(--admin-radius-lg) !important;
    box-shadow: var(--admin-shadow-sm) !important;
}

body.admin-app-shell #adminModuleRoot [class*="rounded-3xl"][class*="border"],
body.admin-app-shell #adminModuleRoot [class*="rounded-2xl"][class*="border"],
body.admin-app-shell [id$="Modal"] [class*="rounded-3xl"][class*="border"],
body.admin-app-shell [id$="Modal"] [class*="rounded-2xl"][class*="border"] {
    border-color: var(--admin-border) !important;
}

body.admin-app-shell #adminModuleRoot [class*="bg-slate-50"],
body.admin-app-shell [id$="Modal"] [class*="bg-slate-50"] {
    background: #F8FAFC !important;
}

body.admin-app-shell #adminModuleRoot [class*="divide-slate-"],
body.admin-app-shell [id$="Modal"] [class*="divide-slate-"] {
    --tw-divide-opacity: 1;
    border-color: var(--admin-border) !important;
}

/* Badges y estados, con ancho determinado por su contenido. */

body.admin-app-shell #adminModuleRoot [class*="rounded-full"]:not(button),
body.admin-app-shell [id$="Modal"] [class*="rounded-full"]:not(button) {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    min-height: 1.625rem;
    align-items: center;
    gap: .3rem;
    padding: .25rem .625rem !important;
    border-radius: 999px !important;
    font-size: .6875rem !important;
    line-height: 1.1 !important;
    white-space: normal;
}

body.admin-app-shell #adminModuleRoot [class*="bg-emerald-50"],
body.admin-app-shell [id$="Modal"] [class*="bg-emerald-50"] {
    background-color: rgba(25, 181, 116, .11) !important;
}

body.admin-app-shell #adminModuleRoot [class*="bg-amber-50"],
body.admin-app-shell [id$="Modal"] [class*="bg-amber-50"] {
    background-color: rgba(245, 158, 8, .12) !important;
}

body.admin-app-shell #adminModuleRoot [class*="bg-rose-50"],
body.admin-app-shell [id$="Modal"] [class*="bg-rose-50"] {
    background-color: rgba(255, 51, 64, .10) !important;
}

/* Tablas: densidad compacta y scroll exclusivamente en su envoltorio. */

body.admin-app-shell #adminModuleRoot table,
body.admin-app-shell [id$="Modal"] table {
    width: 100%;
    max-width: 100%;
    font-size: .8125rem !important;
    table-layout: auto;
}

body.admin-app-shell #adminModuleRoot th,
body.admin-app-shell #adminModuleRoot td,
body.admin-app-shell [id$="Modal"] th,
body.admin-app-shell [id$="Modal"] td {
    padding: .625rem .75rem !important;
    vertical-align: middle;
}

body.admin-app-shell #adminModuleRoot [class*="overflow-x-auto"],
body.admin-app-shell [id$="Modal"] [class*="overflow-x-auto"] {
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
}

/* Modales y drawers: una única superficie, encabezado compacto y backdrop. */

/* Conserva las prioridades originales de los modales estaticos (80–140).
 * Solo se elevan los modales dinamicos que nacen con z-50 para no quedar
 * debajo del sidebar durante una edicion de datos o de una auditoria. */

body.admin-app-shell #carouselEditorModal,
body.admin-app-shell #spidiAuditModal {
    z-index: 125 !important;
}

body.admin-app-shell [id$="Modal"] > .absolute.inset-0,
body.admin-app-shell [id$="Modal"] > .fixed.inset-0 {
    background: rgba(17, 24, 39, .62) !important;
    backdrop-filter: blur(2px);
}

body.admin-app-shell [id$="Modal"] .admin-modal-shell,
body.admin-app-shell [id$="Modal"] > .flex > .rounded-3xl.bg-white,
body.admin-app-shell [id$="Modal"] > .flex > .relative.rounded-3xl.bg-white,
body.admin-app-shell [id$="Modal"] > .relative.w-full.rounded-3xl.bg-white {
    width: min(100%, 72rem) !important;
    max-width: calc(100vw - 2rem) !important;
    border: 1px solid var(--admin-border) !important;
    border-radius: var(--admin-radius-xl) !important;
    background: var(--admin-surface) !important;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24) !important;
}

body.admin-app-shell [id$="Modal"] .admin-modal-header,
body.admin-app-shell [id$="Modal"] > .relative.rounded-3xl.bg-white > .flex:first-child {
    min-height: 4.25rem;
    padding: .875rem 1.25rem !important;
    border-bottom: 1px solid var(--admin-border) !important;
}

body.admin-app-shell [id$="Modal"] .admin-modal-header h3,
body.admin-app-shell [id$="Modal"] > .relative.rounded-3xl.bg-white h2,
body.admin-app-shell [id$="Modal"] > .relative.rounded-3xl.bg-white h3 {
    margin: 0;
    font-size: 1.125rem !important;
}

body.admin-app-shell [id$="Modal"] .admin-modal-shell > :not(.admin-modal-header),
body.admin-app-shell [id$="Modal"] #driverDetailBody,
body.admin-app-shell [id$="Modal"] #storeDetailBody,
body.admin-app-shell [id$="Modal"] #clientDetailBody,
body.admin-app-shell [id$="Modal"] #logisticsDetailBody,
body.admin-app-shell [id$="Modal"] #carouselForm {
    min-width: 0;
    max-width: 100%;
}

body.admin-app-shell [id$="Modal"] .overflow-y-auto,
body.admin-app-shell [id$="Modal"] [class*="max-h-[90vh]"],
body.admin-app-shell [id$="Modal"] [class*="max-h-[92vh]"] {
    scrollbar-color: rgba(148, 163, 184, .52) transparent;
    overscroll-behavior: contain;
}

/* Responsive: los grupos se apilan, los campos no crecen y los botones no se deforman. */

@media (max-width: 767px) {
    body.admin-app-shell #adminModuleRoot .grid[class*="grid-cols-2"],
    body.admin-app-shell #adminModuleRoot .grid[class*="grid-cols-3"],
    body.admin-app-shell #adminModuleRoot .grid[class*="grid-cols-4"],
    body.admin-app-shell [id$="Modal"] .grid[class*="grid-cols-2"],
    body.admin-app-shell [id$="Modal"] .grid[class*="grid-cols-3"],
    body.admin-app-shell [id$="Modal"] .grid[class*="grid-cols-4"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.admin-app-shell #adminModuleRoot .flex.items-center.justify-between,
    body.admin-app-shell [id$="Modal"] .flex.items-center.justify-between {
        flex-wrap: wrap;
    }

    body.admin-app-shell #adminModuleRoot button[class*="w-full"],
    body.admin-app-shell [id$="Modal"] button[class*="w-full"] {
        width: 100% !important;
    }

    body.admin-app-shell [id$="Modal"] .admin-modal-shell,
    body.admin-app-shell [id$="Modal"] > .flex > .rounded-3xl.bg-white,
    body.admin-app-shell [id$="Modal"] > .relative.w-full.rounded-3xl.bg-white {
        max-width: calc(100vw - 1rem) !important;
        max-height: calc(100dvh - 1rem) !important;
        border-radius: var(--admin-radius-lg) !important;
    }
}

/* Modulo de tiendas: resultados compactos, pendientes visibles y paginacion. */

body.admin-app-shell #adminModuleRoot .admin-stores-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-lg);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .3) transparent;
}

body.admin-app-shell #adminModuleRoot .admin-stores-table-scroll table {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed !important;
}

body.admin-app-shell #adminModuleRoot .admin-stores-table-scroll th {
    background: #F8FAFC;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--admin-text-secondary);
    border-bottom: 1px solid var(--admin-border);
    padding: .45rem .35rem;
}

body.admin-app-shell #adminModuleRoot .admin-stores-table-scroll td {
    border-bottom: 1px solid #F1F5F9;
    padding: .5rem .35rem;
    vertical-align: top;
}

body.admin-app-shell #adminModuleRoot .admin-stores-table-scroll .admin-badge {
    min-height: 1.3rem;
    padding: 0.12rem 0.45rem;
    font-size: .64rem;
    line-height: 1;
    white-space: nowrap;
}

body.admin-app-shell #adminModuleRoot .admin-store-row {
    transition: background-color .18s ease, box-shadow .18s ease;
}

body.admin-app-shell #adminModuleRoot .admin-store-row:hover > td {
    background: #F8FAFC;
}

body.admin-app-shell #adminModuleRoot .admin-store-row-pending > td {
    background: #FFFBEB;
}

body.admin-app-shell #adminModuleRoot .admin-store-row-pending:hover > td {
    background: #FEF3C7;
}

body.admin-app-shell #adminModuleRoot .admin-store-row-pending > td:first-child {
    box-shadow: inset 4px 0 0 var(--admin-warning);
}

body.admin-app-shell #adminModuleRoot .admin-store-row-warning,
body.admin-app-shell #adminModuleRoot .admin-store-row-ok {
    display: inline-flex;
    max-width: 100%;
    margin-top: .25rem;
    border-radius: .45rem;
    padding: .15rem .35rem;
    font-size: .62rem;
    line-height: 1.15;
}

body.admin-app-shell #adminModuleRoot .admin-store-row-warning {
    flex-direction: column;
    align-items: flex-start;
    gap: .1rem;
    border: 1px solid #FCD34D;
    background: #FEF3C7;
    color: #92400E;
}

body.admin-app-shell #adminModuleRoot .admin-store-row-warning-title {
    font-weight: 800;
    white-space: nowrap;
}

body.admin-app-shell #adminModuleRoot .admin-store-row-warning-detail {
    color: #A16207;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.admin-app-shell #adminModuleRoot .admin-store-row-ok {
    color: var(--admin-success);
}

body.admin-app-shell #adminModuleRoot #storesReload {
    min-width: 6.5rem !important;
}

body.admin-app-shell #adminModuleRoot .admin-stores-pagination {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .9rem;
    border-top: 1px solid var(--admin-border);
    padding-top: .9rem;
    color: var(--admin-text-secondary);
    font-size: .75rem;
}

body.admin-app-shell #adminModuleRoot .admin-stores-pagination-actions {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: .5rem;
}

body.admin-app-shell #adminModuleRoot .admin-stores-pagination-actions button {
    min-height: 2.25rem;
    border: 1px solid var(--admin-border);
    border-radius: .65rem;
    background: var(--admin-surface);
    padding: .45rem .7rem;
    color: var(--admin-navy);
    font-size: .72rem;
    font-weight: 700;
}

body.admin-app-shell #adminModuleRoot .admin-stores-pagination-actions button:hover:not(:disabled) {
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

body.admin-app-shell #adminModuleRoot .admin-stores-pagination-actions button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

@media (max-width: 767px) {
    body.admin-app-shell #adminModuleRoot .admin-stores-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    body.admin-app-shell #adminModuleRoot .admin-stores-pagination-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Modulo de repartidores: filtros compactos, tabla contenida y paginacion. */
body.admin-app-shell #adminModuleRoot .admin-drivers-filter-grid {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(175px, 210px) minmax(175px, 210px) auto;
}

body.admin-app-shell #adminModuleRoot .admin-drivers-filter-grid > * {
    min-width: 0;
    width: 100%;
}

body.admin-app-shell #adminModuleRoot #driversReload {
    min-width: 6.5rem !important;
}

body.admin-app-shell #adminModuleRoot .admin-drivers-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-lg);
    scrollbar-color: rgba(148, 163, 184, .52) transparent;
}

body.admin-app-shell #adminModuleRoot .admin-drivers-table-scroll table {
    min-width: 820px;
}

body.admin-app-shell #adminModuleRoot .admin-drivers-pagination {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .9rem;
    border-top: 1px solid var(--admin-border);
    padding-top: .9rem;
    color: var(--admin-text-secondary);
    font-size: .75rem;
}

body.admin-app-shell #adminModuleRoot .admin-drivers-pagination-actions {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: .5rem;
}

body.admin-app-shell #adminModuleRoot .admin-drivers-pagination-actions button {
    min-height: 2.25rem;
    border: 1px solid var(--admin-border);
    border-radius: .65rem;
    background: var(--admin-surface);
    padding: .45rem .7rem;
    color: var(--admin-navy);
    font-size: .72rem;
    font-weight: 700;
}

body.admin-app-shell #adminModuleRoot .admin-drivers-pagination-actions button:hover:not(:disabled) {
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

body.admin-app-shell #adminModuleRoot .admin-drivers-pagination-actions button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

body.admin-app-shell #adminModuleRoot .admin-clients-pagination {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .9rem;
    border-top: 1px solid var(--admin-border);
    padding-top: .9rem;
    color: var(--admin-text-secondary);
    font-size: .75rem;
}

body.admin-app-shell #adminModuleRoot .admin-clients-pagination-actions {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: .5rem;
}

body.admin-app-shell #adminModuleRoot .admin-clients-pagination-actions button {
    min-height: 2.25rem;
    border: 1px solid var(--admin-border);
    border-radius: .65rem;
    background: var(--admin-surface);
    padding: .45rem .7rem;
    color: var(--admin-navy);
    font-size: .72rem;
    font-weight: 700;
}

body.admin-app-shell #adminModuleRoot .admin-clients-pagination-actions button:hover:not(:disabled) {
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

body.admin-app-shell #adminModuleRoot .admin-clients-pagination-actions button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

body.admin-app-shell #adminModuleRoot #clientsReload {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

@media (max-width: 1099px) {
    body.admin-app-shell #adminModuleRoot .admin-drivers-filter-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 767px) {
    body.admin-app-shell #adminModuleRoot .admin-drivers-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.admin-app-shell #adminModuleRoot .admin-drivers-pagination,
    body.admin-app-shell #adminModuleRoot .admin-clients-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    body.admin-app-shell #adminModuleRoot .admin-drivers-pagination-actions,
    body.admin-app-shell #adminModuleRoot .admin-clients-pagination-actions {
        width: 100%;
        justify-content: space-between;
    }
}
/* Controles exclusivos de configuración Split: la regla global de badges no debe deformar el switch. */
body.admin-app-shell #adminModuleRoot span.admin-spidi-split-status-badge {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: 100% !important;
    min-height: 1.625rem !important;
    align-items: center !important;
    justify-content: center !important;
    padding: .25rem .625rem !important;
    border-radius: 999px !important;
    font-size: .625rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

body.admin-app-shell #adminModuleRoot span.admin-spidi-toggle-track {
    position: relative !important;
    display: block !important;
    box-sizing: border-box !important;
    flex: 0 0 2.75rem !important;
    width: 2.75rem !important;
    min-width: 2.75rem !important;
    max-width: 2.75rem !important;
    height: 1.5rem !important;
    min-height: 1.5rem !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 999px !important;
    background-color: #CBD5E1 !important;
    transition: background-color .2s ease;
}

body.admin-app-shell #adminModuleRoot input#spidiSplitEnabled:checked + span.admin-spidi-toggle-track {
    background-color: #059669 !important;
}

body.admin-app-shell #adminModuleRoot span.admin-spidi-toggle-track::after {
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background-color: #FFFFFF !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .28);
    content: "" !important;
    transform: translateX(0);
    transition: transform .2s ease;
}

body.admin-app-shell #adminModuleRoot input#spidiSplitEnabled:checked + span.admin-spidi-toggle-track::after {
    transform: translateX(20px) !important;
}

body.admin-app-shell #adminModuleRoot input#spidiSplitEnabled:focus-visible + span.admin-spidi-toggle-track {
    outline: 3px solid rgba(13, 110, 253, .28);
    outline-offset: 2px;
}

/* Campos de contraseña del perfil: el selector general de hover mueve botones. */
body.admin-app-shell #adminModuleRoot .admin-password-field {
    position: relative;
}

body.admin-app-shell #adminModuleRoot .admin-password-field > input {
    display: block !important;
    padding-right: 3rem !important;
}

body.admin-app-shell #adminModuleRoot .admin-password-field > button.admin-password-visibility {
    position: absolute !important;
    top: 50% !important;
    right: .5rem !important;
    z-index: 2;
    display: inline-flex !important;
    width: 2.25rem !important;
    min-width: 2.25rem !important;
    height: 2.25rem !important;
    min-height: 2.25rem !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: .625rem !important;
    background: transparent !important;
    color: #64748b !important;
    box-shadow: none !important;
    transform: translateY(-50%) !important;
    transition: color .18s ease, background-color .18s ease !important;
    cursor: pointer;
}

body.admin-app-shell #adminModuleRoot .admin-password-field > button.admin-password-visibility:hover:not(:disabled) {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    box-shadow: none !important;
    transform: translateY(-50%) !important;
}

body.admin-app-shell #adminModuleRoot .admin-password-visibility:focus-visible {
    outline: 2px solid #6366f1 !important;
    outline-offset: 2px !important;
}

body.admin-app-shell #adminModuleRoot .admin-password-visibility svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
}

body.admin-app-shell #adminModuleRoot .admin-password-visibility [data-password-icon="hide"],
body.admin-app-shell #adminModuleRoot .admin-password-visibility[aria-pressed="true"] [data-password-icon="show"] {
    display: none;
}

body.admin-app-shell #adminModuleRoot .admin-password-visibility[aria-pressed="true"] [data-password-icon="hide"] {
    display: block;
}

/* Tarjetas y switches accesibles de medios de pago */
body.admin-app-shell #adminModuleRoot .admin-payment-method-card {
    min-width: 0;
    min-height: 9rem;
}

body.admin-app-shell #adminModuleRoot .admin-payment-method-card > :last-child {
    margin-top: auto;
}

body.admin-app-shell #adminModuleRoot .admin-payment-method-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    width: 44px;
    height: 28px;
    align-items: center;
    cursor: pointer;
}

body.admin-app-shell #adminModuleRoot .admin-payment-method-switch-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.admin-app-shell #adminModuleRoot .admin-payment-method-switch-track {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: #cbd5e1;
    transition: background-color .18s ease, border-color .18s ease;
}

body.admin-app-shell #adminModuleRoot .admin-payment-method-switch-track::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
    content: "";
    transition: transform .18s ease;
}

body.admin-app-shell #adminModuleRoot .admin-payment-method-switch-input:checked + .admin-payment-method-switch-track {
    border-color: #059669;
    background: #059669;
}

body.admin-app-shell #adminModuleRoot .admin-payment-method-switch-input:checked + .admin-payment-method-switch-track::after {
    transform: translateX(20px);
}

body.admin-app-shell #adminModuleRoot .admin-payment-method-switch-input:focus-visible + .admin-payment-method-switch-track {
    outline: 3px solid rgba(5, 150, 105, .25);
    outline-offset: 3px;
}
