.app-flags__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 6px;
}

.app-flags__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--beto-border);
    border-radius: 8px;
    background: var(--beto-bg);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--beto-text);
    cursor: pointer;
}

.app-flags__item input {
    width: 15px;
    height: 15px;
    accent-color: var(--beto-navy);
}

.app-flags small {
    display: block;
    margin-top: 6px;
    color: var(--beto-text-muted);
    font-size: 0.78rem;
}

:root {
    --beto-navy: #1a3d8f;
    --beto-navy-dark: #122a63;
    --beto-navy-light: #2f5fbf;
    --beto-red: #e41f26;
    --beto-red-dark: #c0181f;
    --beto-white: #ffffff;
    --beto-bg: #f4f6fa;
    --beto-surface: #ffffff;
    --beto-text: #1f2937;
    --beto-text-muted: #6b7280;
    --beto-border: #e5e7eb;
    --beto-shadow: 0 4px 14px rgba(26, 61, 143, 0.07);
    --beto-shadow-sm: 0 2px 8px rgba(26, 61, 143, 0.05);
    --beto-radius: 10px;
    --beto-radius-sm: 8px;
    --beto-sidebar-width: 232px;
    --beto-navbar-height: 52px;
    --beto-control-h: 32px;
    --beto-space-1: 4px;
    --beto-space-2: 8px;
    --beto-space-3: 12px;
    --beto-space-4: 16px;
    --beto-font-size: 13px;
    --beto-gradient: linear-gradient(135deg, var(--beto-navy) 0%, var(--beto-navy-light) 100%);
    --beto-gradient-accent: linear-gradient(135deg, var(--beto-navy) 0%, #3b82f6 55%, var(--beto-red) 100%);
    --beto-font: 'Nunito Sans', Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.beto-body {
    font-family: var(--beto-font);
    font-size: var(--beto-font-size);
    line-height: 1.35;
    background: var(--beto-bg);
    color: var(--beto-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.beto-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.beto-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: var(--beto-navbar-height);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: var(--beto-white);
    border-bottom: 1px solid var(--beto-border);
    box-shadow: var(--beto-shadow-sm);
}

.beto-navbar__toggle {
    display: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: var(--beto-bg);
    color: var(--beto-navy);
    font-size: 1.05rem;
    cursor: pointer;
}

.beto-navbar__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 170px;
}

.beto-navbar__logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.beto-navbar__title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--beto-navy);
    letter-spacing: 0.01em;
}

.beto-navbar__search {
    flex: 1;
    max-width: 360px;
    position: relative;
}

.beto-navbar__search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--beto-text-muted);
    font-size: 0.85rem;
}

.beto-navbar__search input {
    width: 100%;
    height: var(--beto-control-h);
    padding: 0 12px 0 34px;
    border: 1px solid var(--beto-border);
    border-radius: 999px;
    background: #f9fafb;
    color: var(--beto-text);
    outline: none;
    font-size: 0.84rem;
}

.beto-navbar__search input:focus {
    border-color: var(--beto-navy-light);
    box-shadow: 0 0 0 3px rgba(47, 95, 191, 0.12);
}

.beto-navbar__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.beto-navbar__sucursal {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--beto-navy);
}

.beto-navbar__sucursal.is-locked .beto-select {
    background: #f3f4f6;
    color: #4b5563;
    cursor: not-allowed;
}

.beto-select {
    height: var(--beto-control-h);
    padding: 0 10px;
    border: 1px solid var(--beto-border);
    border-radius: 8px;
    background: var(--beto-white);
    color: var(--beto-text);
    font-size: 0.84rem;
}

.beto-select:disabled {
    opacity: 1;
}

.beto-navbar__icon-btn {
    position: relative;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: var(--beto-navy);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.beto-navbar__icon-btn:hover {
    background: #e8edf8;
}

.beto-campana {
    position: relative;
}

.beto-campana__drop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 340px;
    max-width: min(340px, 92vw);
    background: #fff;
    border: 1px solid #d7dde8;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    z-index: 80;
    overflow: hidden;
}

.beto-campana__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #eef1f6;
    background: #f8fafc;
}

.beto-campana__tools {
    display: flex;
    gap: 0.35rem;
}

.beto-campana__tools button {
    border: 0;
    background: transparent;
    color: var(--beto-navy);
    font-size: 0.7rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.beto-campana__list {
    max-height: 320px;
    overflow: auto;
}

.beto-campana__item {
    display: grid;
    gap: 0.15rem;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    padding: 0.7rem 0.75rem;
    cursor: pointer;
}

.beto-campana__item:hover {
    background: #f3f6fc;
}

.beto-campana__item strong {
    font-size: 0.84rem;
    color: #0f172a;
}

.beto-campana__item span {
    font-size: 0.75rem;
    color: #64748b;
}

.beto-campana__empty {
    padding: 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.84rem;
}

.beto-campana__foot {
    display: block;
    text-align: center;
    padding: 0.6rem;
    border-top: 1px solid #eef1f6;
    color: var(--beto-navy);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    background: #f8fafc;
}

.beto-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--beto-red);
    color: var(--beto-white);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.beto-user-menu {
    position: relative;
}

.beto-navbar__user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 3px 8px 3px 3px;
    border: 0;
    border-radius: 999px;
    background: #f9fafb;
    color: inherit;
    font: inherit;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.beto-navbar__user:hover,
.beto-user-menu.is-open .beto-navbar__user {
    background: #eef3ff;
}

.beto-navbar__user-caret {
    font-size: 0.68rem;
    color: var(--beto-text-muted);
    line-height: 1;
    transition: transform 0.18s ease;
}

.beto-user-menu.is-open .beto-navbar__user-caret {
    transform: rotate(180deg);
}

.beto-user-menu__drop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 188px;
    padding: 6px;
    background: #fff;
    border: 1px solid #d7dde8;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    z-index: 80;
}

.beto-user-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 8px;
    color: #b42318;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
}

.beto-user-menu__item i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    font-size: 1rem;
    line-height: 1;
}

.beto-user-menu__item i::before {
    vertical-align: 0;
}

.beto-user-menu__item:hover {
    background: #fef2f2;
}

.beto-navbar__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--beto-white);
    box-shadow: 0 0 0 1.5px var(--beto-red);
}

.beto-navbar__user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.beto-navbar__user-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--beto-text);
}

.beto-navbar__user-role {
    font-size: 0.68rem;
    color: var(--beto-text-muted);
}

.beto-sidebar {
    position: fixed;
    top: var(--beto-navbar-height);
    left: 0;
    bottom: 0;
    width: var(--beto-sidebar-width);
    background: var(--beto-white);
    border-right: 1px solid var(--beto-border);
    overflow-y: auto;
    z-index: 1020;
    transition: transform 0.25s ease;
}

.beto-sidebar__nav {
    padding: 10px 8px 72px;
}

.beto-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.beto-menu__group {
    margin-bottom: 8px;
}

.beto-menu__group-toggle {
    width: 100%;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 8px 0 8px;
    border: 0;
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.beto-menu__group-toggle > span {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.beto-menu__group-toggle > span > i {
    width: 15px;
    flex-shrink: 0;
    font-size: 0.82rem;
    text-align: center;
    opacity: 0.85;
}

.beto-menu__group-toggle:hover {
    background: #f8fafc;
    color: var(--beto-navy);
}

.beto-menu__group.is-open > .beto-menu__group-toggle {
    background: linear-gradient(90deg, rgba(47, 95, 191, 0.08), transparent 70%);
    border-left-color: var(--beto-navy-light);
    color: var(--beto-navy);
}

.beto-menu__chevron {
    flex-shrink: 0;
    font-size: 0.68rem;
    opacity: 0.7;
    transition: transform 0.22s ease;
}

.beto-menu__group.is-open .beto-menu__chevron {
    transform: rotate(180deg);
}

.beto-menu__submenu {
    max-height: 0;
    margin: 0;
    padding: 0 0 0 10px;
    list-style: none;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
    border-left: 1px solid transparent;
    margin-left: 14px;
    transition:
        max-height 0.28s ease,
        opacity 0.2s ease,
        margin 0.28s ease,
        border-color 0.2s ease,
        visibility 0s linear 0.28s;
}

.beto-menu__group.is-open > .beto-menu__submenu {
    max-height: 420px;
    margin: 2px 0 6px 14px;
    padding: 1px 0 1px 8px;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    border-left-color: #dbe4f0;
    transition-delay: 0s;
}

.beto-menu__submenu .beto-menu__link {
    padding-left: 10px;
}

.beto-menu__label {
    padding: 12px 10px 6px;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--beto-text-muted);
}

.beto-menu__item {
    margin-bottom: 2px;
}

.beto-menu__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
    border-radius: 7px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.beto-menu__link i {
    font-size: 0.88rem;
    width: 15px;
    text-align: center;
    opacity: 0.9;
}

.beto-menu__link:hover {
    background: #f1f5f9;
    color: var(--beto-navy);
}

.beto-menu__item.is-active .beto-menu__link {
    background: var(--beto-gradient);
    color: var(--beto-white);
    box-shadow: 0 3px 8px rgba(26, 61, 143, 0.16);
}

.beto-menu__item.is-active .beto-menu__link i {
    opacity: 1;
}

.beto-sidebar__footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: var(--beto-sidebar-width);
    height: 48px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--beto-white);
    border-top: 1px solid var(--beto-border);
    border-right: 1px solid var(--beto-border);
    z-index: 1021;
}

.beto-sidebar__footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--beto-text-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.beto-sidebar__footer-btn i {
    display: block;
    width: 1em;
    height: 1em;
    line-height: 1;
    text-align: center;
}

.beto-sidebar__footer-btn i::before {
    display: block;
    line-height: 1;
    vertical-align: 0;
}

.beto-sidebar__footer-btn:hover {
    background: #eef3ff;
    color: var(--beto-navy);
}

.beto-sidebar-overlay {
    display: none;
}

.beto-content-wrapper {
    flex: 1 0 auto;
    margin-left: var(--beto-sidebar-width);
    margin-top: var(--beto-navbar-height);
    padding: 12px 14px;
}

.beto-content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.beto-page-title {
    margin: 0 0 2px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--beto-text);
}

.beto-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--beto-text-muted);
    font-size: 0.78rem;
}

.beto-breadcrumb li::after {
    content: '/';
    margin-left: 8px;
    color: #cbd5e1;
}

.beto-breadcrumb li:last-child::after {
    content: '';
}

.beto-breadcrumb li.is-active {
    color: var(--beto-navy);
    font-weight: 700;
}

.beto-content-header__actions {
    display: flex;
    gap: 10px;
}

.beto-icon-action {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--beto-white);
    color: var(--beto-navy);
    box-shadow: var(--beto-shadow-sm);
    cursor: pointer;
}

.beto-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.beto-announcement {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--beto-radius-sm);
    background: #111827;
    color: var(--beto-white);
    font-size: 0.8rem;
}

.beto-welcome-card {
    display: grid;
    grid-template-columns: 1.2fr 1.4fr 1fr;
    gap: 12px;
    padding: 14px;
    border-radius: var(--beto-radius);
    background: var(--beto-gradient-accent);
    color: var(--beto-white);
    box-shadow: var(--beto-shadow);
}

.beto-welcome-card__profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.beto-welcome-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.beto-welcome-card__profile h2 {
    margin: 0 0 2px;
    font-size: 1.05rem;
}

.beto-welcome-card__profile p {
    margin: 0;
    opacity: 0.9;
}

.beto-welcome-card__metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.beto-welcome-metric {
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    text-align: center;
}

.beto-welcome-metric strong {
    display: block;
    font-size: 1.05rem;
}

.beto-welcome-metric span {
    font-size: 0.72rem;
    opacity: 0.9;
}

.beto-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.beto-stat-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--beto-radius);
    background: var(--beto-white);
    box-shadow: var(--beto-shadow-sm);
    border-top: 3px solid transparent;
}

.beto-stat-card--primary { border-top-color: var(--beto-navy); }
.beto-stat-card--primary .beto-stat-card__ring { color: var(--beto-navy); }
.beto-stat-card--secondary { border-top-color: #6366f1; }
.beto-stat-card--secondary .beto-stat-card__ring { color: #6366f1; }
.beto-stat-card--accent { border-top-color: var(--beto-red); }
.beto-stat-card--accent .beto-stat-card__ring { color: var(--beto-red); }
.beto-stat-card--dark { border-top-color: #14b8a6; }
.beto-stat-card--dark .beto-stat-card__ring { color: #14b8a6; }

.beto-stat-card__ring {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.beto-stat-card__ring svg {
    transform: rotate(-90deg);
}

.beto-stat-card__ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--beto-navy);
}

.beto-stat-card__content {
    min-width: 0;
}

.beto-stat-card__value {
    display: block;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--beto-text);
}

.beto-stat-card__label {
    display: block;
    margin-top: 3px;
    color: var(--beto-text-muted);
    font-size: 0.76rem;
}

.beto-panel-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 10px;
}

.beto-card {
    background: var(--beto-white);
    border-radius: var(--beto-radius);
    box-shadow: var(--beto-shadow-sm);
    overflow: hidden;
}

.beto-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--beto-border);
}

.beto-card__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--beto-text);
}

.beto-card__body {
    padding: 12px;
}

.beto-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--beto-control-h);
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.beto-btn:hover {
    transform: none;
}

.beto-btn--primary {
    background: var(--beto-red);
    color: var(--beto-white);
    box-shadow: 0 3px 8px rgba(228, 31, 38, 0.2);
}

.beto-btn--primary:hover {
    background: var(--beto-red-dark);
}

.beto-btn--ghost {
    background: #f3f4f6;
    color: var(--beto-text);
}

.beto-btn--outline {
    background: var(--beto-white);
    color: var(--beto-navy);
    border: 1px solid #dbeafe;
}

.beto-btn--sm {
    height: 28px;
    padding: 0 10px;
    font-size: 0.78rem;
}

.beto-footer {
    flex-shrink: 0;
    margin-left: var(--beto-sidebar-width);
    padding: 8px 14px 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--beto-text-muted);
    font-size: 0.76rem;
    background: transparent;
}

.beto-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.beto-modal.is-open {
    display: flex;
}

.beto-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
}

.beto-modal__dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
    background: var(--beto-white);
    border-radius: var(--beto-radius);
    box-shadow: var(--beto-shadow);
    overflow: hidden;
}

.beto-modal__dialog--lg {
    width: min(920px, 100%);
}

.beto-modal__dialog > form {
    min-height: 0;
    max-height: inherit;
    display: flex;
    flex-direction: column;
}

.beto-modal__header,
.beto-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    flex-shrink: 0;
}

.beto-modal__header {
    border-bottom: 1px solid var(--beto-border);
}

.beto-modal__footer {
    border-top: 1px solid var(--beto-border);
    justify-content: flex-end;
}

.beto-modal__title {
    margin: 0;
    font-size: 0.95rem;
    color: var(--beto-navy);
}

.beto-modal__body {
    padding: 12px;
    overflow-y: auto;
}

.beto-modal__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 7px;
    background: #f3f4f6;
    cursor: pointer;
}

/* Switches globales (evitar checkboxes nativos enormes) */
.beto-field--switch {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
}

.beto-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    cursor: pointer;
    user-select: none;
}

.beto-switch input {
    position: absolute;
    width: 1px !important;
    min-height: 1px !important;
    height: 1px !important;
    opacity: 0;
    pointer-events: none;
}

.beto-switch__track {
    position: relative;
    flex-shrink: 0;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.2s ease;
}

.beto-switch__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--beto-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s ease;
}

.beto-switch input:checked + .beto-switch__track {
    background: #10b981;
}

.beto-switch input:checked + .beto-switch__track::after {
    transform: translateX(16px);
}

.beto-switch input:focus-visible + .beto-switch__track {
    box-shadow: 0 0 0 3px rgba(47, 95, 191, 0.2);
}

.beto-switch__text {
    color: var(--beto-text);
    font-size: 0.78rem;
    font-weight: 700;
}

.beto-modal-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
}

.beto-modal-form__full {
    grid-column: 1 / -1;
}

.beto-modal-form .beto-field {
    margin: 0;
}

.beto-modal-form .beto-field label {
    display: block;
    margin-bottom: 3px;
    font-size: 0.72rem;
    font-weight: 700;
}

.beto-modal-form input:not([type="checkbox"]):not([type="radio"]),
.beto-modal-form select,
.beto-modal-form textarea {
    width: 100%;
    min-height: var(--beto-control-h);
    border: 1px solid var(--beto-border);
    border-radius: 7px;
    background: #fff;
    padding: 0 9px;
    font: inherit;
    font-size: 0.84rem;
    color: var(--beto-text);
    box-sizing: border-box;
}

.beto-modal-form textarea {
    min-height: 64px;
    padding: 7px 9px;
    resize: vertical;
}

.beto-modal-form input:focus,
.beto-modal-form select:focus,
.beto-modal-form textarea:focus {
    outline: none;
    border-color: var(--beto-navy-light);
    box-shadow: 0 0 0 3px rgba(47, 95, 191, 0.12);
}

@media (max-width: 640px) {
    .beto-modal-form {
        grid-template-columns: 1fr;
    }

    .beto-modal-form__full {
        grid-column: auto;
    }
}

.beto-modal-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--beto-border);
    background: #f8fafc;
    overflow-x: auto;
    flex-shrink: 0;
}

.beto-modal-tabs__button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--beto-text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.beto-modal-tabs__button:hover {
    background: #eef3ff;
    color: var(--beto-navy);
}

.beto-modal-tabs__button.is-active {
    background: var(--beto-navy);
    color: var(--beto-white);
    box-shadow: 0 5px 12px rgba(26, 61, 143, 0.18);
}

[data-modal-section] {
    display: none;
}

[data-modal-section].is-active {
    display: block;
}

.beto-toast-container {
    position: fixed;
    top: 60px;
    right: 12px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.beto-toast {
    min-width: 220px;
    max-width: 300px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--beto-white);
    font-size: 0.8rem;
    box-shadow: var(--beto-shadow);
    animation: betoToastIn 0.25s ease;
}

.beto-toast--success { background: #059669; }
.beto-toast--error { background: var(--beto-red); }
.beto-toast--info { background: var(--beto-navy); }
.beto-toast--warning { background: #d97706; }

@keyframes betoToastIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1200px) {
    .beto-welcome-card {
        grid-template-columns: 1fr;
    }

    .beto-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .beto-panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .beto-navbar__toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .beto-navbar__search,
    .beto-navbar__sucursal,
    .beto-navbar__user-info {
        display: none;
    }

    .beto-sidebar,
    .beto-sidebar__footer {
        transform: translateX(-100%);
    }

    .beto-sidebar.is-open,
    .beto-sidebar.is-open .beto-sidebar__footer {
        transform: translateX(0);
    }

    .beto-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1015;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .beto-sidebar-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    .beto-content-wrapper,
    .beto-footer {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .beto-stats-grid {
        grid-template-columns: 1fr;
    }

    .beto-content-wrapper {
        padding: 10px;
    }
}

/* --- Picker de sucursales (muchas sucursales) --- */
.beto-branch-picker {
    border: 1px solid var(--beto-border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.beto-branch-picker__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 7px;
    border-bottom: 1px solid #e8eef4;
    background: #f8fafc;
}

.beto-branch-picker__search {
    position: relative;
    flex: 1 1 180px;
    min-width: 0;
}

.beto-branch-picker__search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a97a5;
    font-size: .9rem;
    pointer-events: none;
}

.beto-branch-picker__search input {
    width: 100%;
    min-height: 30px !important;
    padding: 0 8px 0 28px !important;
    border: 1px solid var(--beto-border);
    border-radius: 7px;
    background: #fff;
    font: inherit;
    font-size: 0.8rem;
    box-sizing: border-box;
}

.beto-branch-picker__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.beto-branch-picker__btn {
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid #d5dee8;
    border-radius: 6px;
    background: #fff;
    color: var(--beto-navy);
    font: inherit;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
}

.beto-branch-picker__btn:hover {
    background: #eef3f8;
}

.beto-branch-picker__meta {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 6px 12px;
    color: #5f6f7d;
    font-size: .78rem;
    border-bottom: 1px solid #eef2f6;
}

.beto-branch-picker__meta span[data-branch-count] {
    color: var(--beto-navy);
    font-weight: 800;
}

.beto-branch-picker__hint {
    margin-left: auto;
    color: #8a97a5;
}

.beto-branch-picker__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    max-height: 180px;
    overflow: auto;
    padding: 7px;
}

.beto-branch-picker__list .client-branch-check,
.beto-branch-picker__list .employee-branch-check {
    display: flex !important;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 5px 7px;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 0.78rem;
    cursor: pointer;
}

.beto-branch-picker__list .client-branch-check.is-hidden,
.beto-branch-picker__list .employee-branch-check.is-hidden {
    display: none !important;
}

.beto-branch-picker__list input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    margin: 0;
    flex-shrink: 0;
}

.beto-branch-picker__empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 18px;
    color: #6b7b88;
    text-align: center;
}

@media (max-width: 640px) {
    .beto-branch-picker__list {
        grid-template-columns: 1fr;
    }
}

/* --- Búsqueda predictiva compartida --- */
.beto-predictive {
    position: relative;
    width: 100%;
}

.beto-predictive__results {
    position: absolute;
    z-index: 40;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--beto-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(29, 49, 64, .12);
}

.beto-predictive__item,
.beto-predictive__empty {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.beto-predictive__item:hover,
.beto-predictive__item.is-active {
    background: #eef3f8;
}

.beto-predictive__item strong {
    display: block;
    font-weight: 800;
}

.beto-predictive__item span,
.beto-predictive__item small {
    display: block;
    margin-top: 2px;
    color: #71808d;
    font-size: 0.74rem;
    font-weight: 500;
}

.beto-predictive__empty {
    color: #6b7b88;
    cursor: default;
}

.clients-search {
    position: relative;
}

/* --- Densidad compacta global (módulos / tablas / formularios) --- */
.beto-card__header p,
.clients-header p {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--beto-text-muted);
}

.clients-toolbar,
.employees-toolbar,
.users-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.clients-search input,
.employees-search input,
[id^="buscar"] {
    min-height: var(--beto-control-h) !important;
    height: var(--beto-control-h);
    font-size: 0.82rem;
}

.clients-table th,
.clients-table td,
.employees-table th,
.employees-table td,
.users-table th,
.users-table td,
table.clients-table th,
table.clients-table td {
    padding: 7px 8px !important;
    font-size: 0.8rem;
}

.clients-table th,
.employees-table th,
.users-table th {
    font-size: 0.68rem !important;
}

.clients-table__secondary,
.employees-table__secondary {
    font-size: 0.72rem !important;
}

.clients-empty,
.employees-empty {
    padding: 22px 12px !important;
    font-size: 0.82rem;
}

.client-form__grid,
.employee-form__grid,
.users-form__grid {
    gap: 10px !important;
}

.client-form__section h3,
.employee-form__section h3,
.client-section-heading h3,
.inventory-section-heading h3 {
    margin: 0 0 8px !important;
    font-size: 0.84rem !important;
}

.client-form .beto-field > input:not([type="checkbox"]):not([type="radio"]),
.client-form .beto-field > select,
.employee-form .beto-field > input:not([type="checkbox"]):not([type="radio"]),
.employee-form .beto-field > select,
.users-form input:not([type="checkbox"]):not([type="radio"]),
.users-form select,
.users-form textarea,
.personal-catalog input:not([type="checkbox"]):not([type="radio"]),
.personal-catalog select,
.doc-shell input:not([type="checkbox"]):not([type="radio"]),
.doc-shell select,
.doc-shell textarea,
.kardex-filters input,
.kardex-filters select {
    min-height: var(--beto-control-h) !important;
    border-radius: 7px !important;
    font-size: 0.82rem !important;
}

.client-form .beto-field > label,
.employee-form .beto-field > label,
.beto-field > label,
.beto-field__label {
    margin-bottom: 3px !important;
    font-size: 0.72rem !important;
}

.users-lookup input {
    min-height: var(--beto-control-h) !important;
    font-size: 0.82rem !important;
}

.users-lookup__item,
.users-lookup__empty {
    padding: 7px 10px !important;
    font-size: 0.8rem !important;
    text-align: left;
}

.users-lookup__item strong {
    display: block;
    font-weight: 800;
}

.users-lookup__item small {
    display: block;
    margin-top: 1px;
    color: #71808d;
    font-size: 0.74rem;
    font-weight: 500;
}

.doc-shell__bar {
    padding: 7px 10px !important;
}

.doc-shell__title h2 {
    font-size: 0.92rem !important;
}

.doc-layout {
    gap: 8px !important;
    padding: 8px !important;
}

.doc-panel {
    border-radius: 8px !important;
}

.doc-panel h3 {
    margin: 0 0 6px !important;
    font-size: 0.7rem !important;
}

.doc-panel--datos,
.doc-panel--partidas,
.doc-panel--pie {
    padding: 8px 10px !important;
}

.doc-panel--resumen {
    padding: 0 !important;
}

.doc-meta {
    gap: 6px 8px !important;
}

.doc-lines-head,
.doc-line {
    padding: 6px 8px !important;
    gap: 6px !important;
}

.doc-line input {
    min-height: 28px !important;
}

.kardex-filters {
    gap: 8px !important;
    margin-bottom: 10px !important;
    padding: 10px !important;
    border-radius: 8px !important;
}

.kardex-summary {
    gap: 8px !important;
    margin-bottom: 10px !important;
}

.kardex-summary > div {
    padding: 8px 10px !important;
    border-radius: 8px !important;
}

.kardex-summary strong {
    font-size: 0.88rem !important;
}

.movement-line-remove,
.clients-actions .beto-btn,
.employees-actions .beto-btn {
    width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
}

/* Acciones CRUD unificadas (editar / eliminar) */
.clients-actions,
.employees-actions,
.personal-catalog__actions,
.auxiliary-catalog__actions,
.contacts-actions,
.sucursales-actions,
.users-actions,
.notif-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    vertical-align: middle;
}

/* Título y contenido de Acciones alineados al centro */
th.clients-actions,
th.clients-table__actions-heading,
th.personal-catalog__actions-heading,
th.auxiliary-catalog__actions-heading,
th.contacts-actions-heading,
th.employees-table__actions-heading,
th.sucursales-table__actions,
th.users-table__actions,
th.is-actions,
th.is-col-actions {
    text-align: center !important;
}

td:has(> .clients-actions),
td:has(> .employees-actions),
td:has(> .personal-catalog__actions),
td:has(> .auxiliary-catalog__actions),
td:has(> .contacts-actions),
td:has(> .sucursales-actions),
td:has(> .users-actions),
td:has(> .notif-actions),
td:has(> .cc-actions),
td.is-col-actions {
    text-align: center !important;
}

/* Estatus / badges / días / booleanos: título y celda al centro */
th.is-col-center,
td.is-col-center,
td:has(> .personal-status),
td:has(> .auxiliary-catalog__status),
td:has(> .auxiliary-catalog__boolean),
td:has(> .client-badge),
td:has(> .aux-day),
td:has(> .doc-status),
td:has(> .an-status),
td:has(> .employee-flag),
td:has(> .pos-turno-abierto),
td:has(> .pos-turno-cerrado) {
    text-align: center !important;
}

td .clients-actions,
td .employees-actions,
td .personal-catalog__actions,
td .auxiliary-catalog__actions,
td .contacts-actions,
td .sucursales-actions,
td .users-actions,
td .notif-actions,
td .cc-actions {
    display: inline-flex;
    width: auto;
    margin-inline: auto;
    justify-content: center;
}

.personal-catalog__action,
.sucursales-action,
.auxiliary-catalog__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 0;
    border-radius: 10px;
    background: #eef3ff;
    color: var(--beto-navy);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.personal-catalog__action:hover,
.sucursales-action:hover,
.auxiliary-catalog__action:hover {
    background: var(--beto-navy);
    color: #fff;
}

.personal-catalog__action--delete,
.sucursales-action--delete,
.auxiliary-catalog__action--delete {
    background: #fff0f1;
    color: var(--beto-red);
}

.personal-catalog__action--delete:hover,
.sucursales-action--delete:hover,
.auxiliary-catalog__action--delete:hover {
    background: var(--beto-red);
    color: #fff;
}

.personal-catalog__action i,
.sucursales-action i,
.auxiliary-catalog__action i {
    font-size: 0.95rem;
    line-height: 1;
}

/* Badges de estatus (tenues) */
.personal-status,
.doc-status,
.an-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.personal-status--active,
.doc-status--ok,
.an-status--ok {
    background: #e9fbf3;
    color: #047857;
}

.personal-status--inactive,
.doc-status--muted,
.an-status--muted {
    background: #f3f4f6;
    color: #6b7280;
}

.doc-status--warn,
.an-status--warn {
    background: #fff7e8;
    color: #b45309;
}

.doc-status--info,
.an-status--info {
    background: #eef5ff;
    color: #1d4ed8;
}

.doc-status--danger,
.an-status--danger {
    background: #fff1f2;
    color: #be123c;
}

.doc-flag {
    display: inline-flex;
    margin-left: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 700;
}

.beto-btn--soft {
    background: #eef3ff;
    color: var(--beto-navy);
    border: 0;
}

.beto-btn--soft:hover {
    background: #dbe6ff;
}

.beto-empty-state {
    padding: 28px 16px !important;
}

.beto-empty-state i {
    font-size: 1.6rem !important;
}

.beto-empty-state h3 {
    margin: 8px 0 4px !important;
    font-size: 0.95rem !important;
}

.beto-empty-state p {
    font-size: 0.8rem !important;
}
