:root {
    color-scheme: light;
    --bg: #f5f6f2;
    --surface: #ffffff;
    --surface-muted: #f0f2ed;
    --surface-strong: #e5e9e1;
    --text: #17211b;
    --text-muted: #657168;
    --border: #dce2da;
    --primary: #214d37;
    --primary-hover: #183d2b;
    --primary-soft: #e5f0e9;
    --accent: #b88028;
    --accent-soft: #f8eedc;
    --danger: #b43d3d;
    --danger-soft: #fbe8e8;
    --warning: #9a6700;
    --warning-soft: #fff3cd;
    --success: #267a4a;
    --success-soft: #e5f4eb;
    --info: #2d668c;
    --info-soft: #e8f2f9;
    --sidebar: #17221b;
    --sidebar-muted: #9bac9f;
    --sidebar-active: #2a6044;
    --shadow-sm: 0 1px 2px rgba(18, 32, 23, .08);
    --shadow-md: 0 12px 30px rgba(20, 38, 27, .12);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --sidebar-width: 278px;
    --topbar-height: 72px;
    --transition: 180ms ease;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.noscript {
    padding: 16px;
    color: #fff;
    background: var(--danger);
    text-align: center;
}

.boot-screen {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 16px;
    background:
        radial-gradient(circle at 20% 10%, rgba(184,128,40,.16), transparent 32%),
        radial-gradient(circle at 85% 80%, rgba(33,77,55,.17), transparent 30%),
        var(--bg);
}

.brand-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .05em;
    background: linear-gradient(145deg, var(--primary), #317052);
    box-shadow: var(--shadow-md);
}

.boot-screen p { margin: 0; color: var(--text-muted); }
.boot-spinner {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 1.08fr) minmax(420px, .92fr);
    background: var(--surface);
}

.login-showcase {
    position: relative;
    overflow: hidden;
    min-height: 100%;
    padding: clamp(42px, 6vw, 84px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #f6faf7;
    background:
        radial-gradient(circle at 12% 14%, rgba(202,154,72,.30), transparent 25%),
        radial-gradient(circle at 85% 80%, rgba(71,139,101,.24), transparent 28%),
        linear-gradient(145deg, #17221b 0%, #1d3829 52%, #244934 100%);
}
.login-showcase::before, .login-showcase::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 50%;
}
.login-showcase::before { width: 440px; height: 440px; right: -180px; top: -190px; }
.login-showcase::after { width: 300px; height: 300px; left: -120px; bottom: -150px; }
.login-brand, .login-copy, .login-benefits { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand .brand-mark { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18); box-shadow: none; }
.login-brand strong { display: block; font-size: 20px; }
.login-brand span { color: #b9c8bd; font-size: 13px; }
.login-copy { max-width: 660px; margin: auto 0; padding: 56px 0; }
.login-copy .eyebrow { color: #e3bd78; }
.login-copy h1 { margin: 12px 0 18px; max-width: 650px; font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -.045em; }
.login-copy p { max-width: 590px; color: #c6d2c9; font-size: 17px; line-height: 1.65; }
.login-benefits { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.login-benefit { padding: 15px; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); background: rgba(255,255,255,.055); backdrop-filter: blur(10px); }
.login-benefit strong { display: block; margin-bottom: 4px; font-size: 14px; }
.login-benefit span { color: #aebfb3; font-size: 12px; line-height: 1.45; }

.login-panel { display: grid; place-items: center; padding: clamp(28px, 5vw, 76px); background: var(--surface); }
.login-card { width: min(100%, 440px); }
.login-card-header { margin-bottom: 30px; }
.login-card h2 { margin: 8px 0 8px; font-size: 32px; letter-spacing: -.035em; }
.login-card-header p { margin: 0; color: var(--text-muted); line-height: 1.55; }
.eyebrow { margin: 0; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.form-group { display: grid; gap: 8px; margin-bottom: 18px; }
.form-label { font-size: 13px; font-weight: 700; }
.input-wrap { position: relative; }
.form-control {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(33,77,55,.11); }
.form-control[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(180,61,61,.09); }
.password-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 38px; height: 36px; border: 0; border-radius: 8px; color: var(--text-muted); background: transparent; }
.password-toggle:hover { background: var(--surface-muted); color: var(--text); }
.form-error { min-height: 18px; margin: -8px 0 10px; color: var(--danger); font-size: 12px; }

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 750;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), opacity var(--transition);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .62; }
.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { color: var(--text); background: var(--surface); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-muted); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }
.btn svg { width: 18px; height: 18px; }
.login-help { margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; line-height: 1.55; text-align: center; }

/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    color: #eef4ef;
    background: var(--sidebar);
    border-right: 1px solid rgba(255,255,255,.06);
    transition: transform var(--transition);
}
.sidebar-head { height: var(--topbar-height); padding: 0 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-head .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; box-shadow: none; background: #2c6447; }
.sidebar-head strong { display: block; font-size: 16px; }
.sidebar-head span { color: var(--sidebar-muted); font-size: 11px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px 24px; scrollbar-width: thin; scrollbar-color: #395343 transparent; }
.nav-group { margin-bottom: 18px; }
.nav-group-title { padding: 0 12px 8px; color: #819287; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-link {
    width: 100%;
    min-height: 42px;
    margin: 2px 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #c9d5cc;
    text-decoration: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 650;
    transition: background var(--transition), color var(--transition);
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.065); }
.nav-link.active { color: #fff; background: var(--sidebar-active); box-shadow: inset 3px 0 0 #d3a24f; }
.nav-link svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .9; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-version { padding: 10px 12px; color: #819287; font-size: 11px; }

.main-area { grid-column: 2; min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 clamp(18px, 3vw, 36px);
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.topbar-left, .topbar-actions, .user-button { display: flex; align-items: center; }
.topbar-left { min-width: 0; gap: 12px; }
.page-heading { min-width: 0; }
.page-heading h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; letter-spacing: -.02em; }
.page-heading p { margin: 2px 0 0; color: var(--text-muted); font-size: 11px; }
.topbar-actions { gap: 8px; }
.menu-toggle { display: none; }
.user-menu { position: relative; }
.user-button { gap: 10px; padding: 5px 8px 5px 5px; border: 0; border-radius: 12px; background: transparent; }
.user-button:hover { background: var(--surface-muted); }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--primary); font-size: 12px; font-weight: 800; }
.user-meta { text-align: left; }
.user-meta strong { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-meta span { display: block; color: var(--text-muted); font-size: 10px; }
.user-dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 230px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); }
.dropdown-info { padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-info strong, .dropdown-info span { display: block; }
.dropdown-info span { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.dropdown-action { width: 100%; min-height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 8px; color: var(--text); background: transparent; text-align: left; }
.dropdown-action:hover { background: var(--surface-muted); }
.dropdown-action.danger { color: var(--danger); }

.page-content { padding: clamp(20px, 3vw, 38px); }
.page-container { width: min(100%, 1540px); margin: 0 auto; }
.page-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-toolbar-copy h2 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.03em; }
.page-toolbar-copy p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { min-height: 60px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; }
.card-body { padding: 18px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { min-height: 124px; padding: 18px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 80px; height: 80px; right: -25px; bottom: -30px; border-radius: 50%; background: var(--primary-soft); }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.stat-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.stat-icon svg { width: 17px; height: 17px; }
.stat-value { margin-top: 18px; font-size: clamp(22px, 2vw, 30px); font-weight: 800; letter-spacing: -.04em; }
.stat-foot { margin-top: 4px; color: var(--text-muted); font-size: 11px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 18px; }
.dashboard-stack { display: grid; gap: 18px; }
.empty-state { min-height: 220px; padding: 30px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--text-muted); }
.empty-state svg { width: 36px; height: 36px; margin-bottom: 12px; color: var(--primary); }
.empty-state h3 { margin: 0 0 6px; color: var(--text); }
.empty-state p { max-width: 470px; margin: 0; font-size: 13px; line-height: 1.55; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 11px 12px; color: var(--text-muted); background: var(--surface-muted); font-size: 10px; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbf8; }
.text-right { text-align: right !important; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-info { color: var(--info); background: var(--info-soft); }
.badge-muted { color: var(--text-muted); background: var(--surface-muted); }

.alert-list, .activity-list { display: grid; gap: 10px; }
.alert-item, .activity-item { padding: 12px; display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--border); border-radius: 11px; background: #fbfcfa; }
.alert-dot { width: 9px; height: 9px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: var(--warning); }
.alert-dot.danger { background: var(--danger); }
.alert-item strong, .activity-item strong { display: block; font-size: 12px; }
.alert-item span, .activity-item span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.activity-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.activity-value { margin-left: auto; white-space: nowrap; font-size: 12px; font-weight: 800; }

.placeholder-page { min-height: calc(100vh - var(--topbar-height) - 76px); display: grid; place-content: center; }
.placeholder-card { width: min(100%, 690px); padding: clamp(28px, 5vw, 52px); text-align: center; }
.placeholder-icon { width: 64px; height: 64px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 20px; color: var(--primary); background: var(--primary-soft); }
.placeholder-icon svg { width: 30px; height: 30px; }
.placeholder-card h2 { margin: 0 0 10px; font-size: 26px; }
.placeholder-card p { margin: 0 auto; max-width: 520px; color: var(--text-muted); line-height: 1.65; }
.placeholder-meta { margin-top: 22px; display: inline-flex; gap: 8px; padding: 9px 12px; border-radius: 999px; color: var(--warning); background: var(--warning-soft); font-size: 11px; font-weight: 800; }

.page-loader { min-height: 300px; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--text-muted); }
.skeleton { position: relative; overflow: hidden; background: var(--surface-strong); border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

.toast-region { position: fixed; z-index: 100; top: 18px; right: 18px; width: min(390px, calc(100vw - 36px)); display: grid; gap: 10px; }
.toast { padding: 13px 14px; display: flex; align-items: flex-start; gap: 11px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: 11px; box-shadow: var(--shadow-md); animation: toast-in .22s ease; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast-content { flex: 1; }
.toast strong { display: block; font-size: 12px; }
.toast p { margin: 3px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.toast-close { border: 0; color: var(--text-muted); background: transparent; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.overlay { position: fixed; z-index: 25; inset: 0; background: rgba(9,17,12,.42); opacity: 0; pointer-events: none; transition: opacity var(--transition); }
.overlay.visible { opacity: 1; pointer-events: auto; }

@media (max-width: 1180px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
    .login-page { grid-template-columns: 1fr; }
    .login-showcase { display: none; }
    .login-panel { min-height: 100vh; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { grid-column: 1; }
    .menu-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
    .topbar { padding: 0 14px; }
    .page-content { padding: 18px 14px 26px; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-toolbar { align-items: flex-start; flex-direction: column; }
    .user-meta { display: none; }
    .page-heading p { display: none; }
    .login-panel { padding: 28px 20px; }
    .toast-region { top: 10px; right: 10px; width: calc(100vw - 20px); }
}

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

/* FASE 16 · Administración y catálogos */
body.modal-open { overflow: hidden; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.admin-card { overflow: hidden; }
.admin-filters { min-height: 66px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); background: #fbfcfa; }
.admin-filters form { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.filter-control { width: auto; min-width: 170px; height: 40px; }
.admin-filters input[type="search"], .admin-filters input[name="buscar"] { min-width: min(310px, 100%); flex: 1; }
.records-count { color: var(--text-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.admin-table td { max-width: 320px; }
.admin-table small, .muted { color: var(--text-muted); font-size: 10px; line-height: 1.45; }
.admin-table code { padding: 3px 6px; border-radius: 6px; color: var(--primary); background: var(--primary-soft); font-size: 10px; }
.table-actions, .inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.table-action { min-height: 29px; padding: 0 8px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background: var(--surface); font-size: 10px; font-weight: 750; white-space: nowrap; }
.table-action:hover { border-color: #b5c5b9; background: var(--surface-muted); }
.table-action.danger { color: var(--danger); }
.table-action svg { width: 13px; height: 13px; }
.pagination { min-height: 62px; padding: 12px 16px; display: flex; align-items: center; justify-content: center; gap: 14px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid-padded { padding: 20px; }
.form-field { min-width: 0; }
.form-field .form-label { display: block; margin-bottom: 7px; }
.form-field.span-2, .span-2 { grid-column: 1 / -1; }
.form-textarea { min-height: 96px; padding-top: 12px; resize: vertical; }
.field-help { display: block; margin-top: 6px; color: var(--text-muted); font-size: 10px; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 8px; }
.switch-control { min-height: 48px; display: flex; align-items: center; gap: 10px; }
.switch-control input { position: absolute; opacity: 0; }
.switch-control span { width: 42px; height: 24px; position: relative; border-radius: 999px; background: #cfd8d1; transition: background var(--transition); }
.switch-control span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform var(--transition); }
.switch-control input:checked + span { background: var(--primary); }
.switch-control input:checked + span::after { transform: translateX(18px); }
.switch-control em { color: var(--text-muted); font-size: 11px; font-style: normal; }
.info-banner { margin-top: 16px; padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; color: var(--info); background: var(--info-soft); border: 1px solid #c9dcdf; border-radius: var(--radius); }
.info-banner svg { width: 20px; height: 20px; flex: 0 0 auto; }
.info-banner strong, .info-banner span { display: block; }
.info-banner span { margin-top: 3px; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.modal-backdrop { position: fixed; z-index: 120; inset: 0; padding: 22px; display: grid; place-items: center; background: rgba(8,16,11,.58); backdrop-filter: blur(3px); }
.app-modal { width: min(100%, 720px); max-height: calc(100vh - 44px); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid rgba(255,255,255,.18); border-radius: 16px; box-shadow: 0 24px 80px rgba(0,0,0,.30); animation: modal-in .18s ease; }
.app-modal-small { width: min(100%, 520px); }
.app-modal-large { width: min(100%, 920px); }
.app-modal-wide { width: min(100%, 1160px); }
.modal-head { min-height: 72px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.modal-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { min-height: 66px; padding: 12px 18px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--border); background: #fbfcfa; }
.confirmation-copy { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.65; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.detail-grid > div { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfa; }
.detail-grid span, .detail-grid strong { display: block; }
.detail-grid span { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.detail-grid strong { margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.detail-section { margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; }
.detail-section h3 { margin: 0 0 12px; font-size: 13px; }
.detail-section p { color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.detail-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 10px; }
.json-view { max-height: 320px; margin: 0; padding: 12px; overflow: auto; color: #dce9df; background: #17221b; border-radius: 10px; font-size: 10px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.compact-list { display: grid; gap: 8px; }
.compact-list > div { min-height: 48px; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 9px; background: #fbfcfa; }
.compact-list strong, .compact-list small { display: block; }
.compact-list small { margin-top: 3px; color: var(--text-muted); font-size: 9px; }
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.product-cell > img, .product-cell > span { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; object-fit: cover; border: 1px solid var(--border); border-radius: 10px; color: var(--primary); background: var(--surface-muted); }
.product-cell svg { width: 20px; height: 20px; }
.product-cell strong, .product-cell small { display: block; }
.product-cell small { margin-top: 3px; color: var(--text-muted); font-size: 9px; }
.product-detail-head { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 18px; align-items: start; }
.product-detail-image { height: 150px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; color: var(--primary); background: var(--surface-muted); }
.product-detail-image img { width: 100%; height: 100%; object-fit: contain; }
.product-detail-image svg { width: 48px; height: 48px; }
.image-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.image-grid article { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.image-grid img { width: 100%; height: 110px; display: block; object-fit: cover; background: var(--surface-muted); }
.image-grid article.image-error img { display: none; }
.image-grid article.image-error::before { content: "Imagen no disponible"; height: 110px; display: grid; place-items: center; color: var(--text-muted); background: var(--surface-muted); font-size: 10px; }
.image-grid article > div { padding: 9px; }
.image-grid strong, .image-grid small { display: block; }
.image-grid small { margin: 3px 0 8px; color: var(--text-muted); font-size: 9px; }

@media (max-width: 800px) {
    .admin-filters { align-items: stretch; flex-direction: column; }
    .admin-filters form { width: 100%; }
    .filter-control { width: 100%; min-width: 0; flex: 1 1 180px; }
    .form-grid, .detail-grid, .detail-columns, .product-detail-head { grid-template-columns: 1fr; }
    .form-field.span-2, .span-2 { grid-column: auto; }
    .product-detail-image { width: 150px; }
    .app-modal { max-height: calc(100vh - 20px); }
    .modal-backdrop { padding: 10px; }
}
@media (max-width: 520px) {
    .toolbar-actions { width: 100%; }
    .toolbar-actions .btn { flex: 1; }
    .image-grid { grid-template-columns: 1fr; }
    .modal-body { padding: 16px; }
}


.cash-page { display: grid; gap: 18px; }


.cash-history-head { min-height: 72px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.data-table td > small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 8px; }


.cash-empty-card { min-height: 220px; padding: 30px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 22px; }
.cash-empty-icon { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 18px; color: var(--primary); background: var(--primary-soft); }
.cash-empty-icon svg { width: 36px; height: 36px; }
.cash-empty-card h2 { margin: 3px 0 7px; }
.cash-empty-card p { margin: 0; color: var(--text-muted); }
.cash-current { display: grid; gap: 16px; }
.cash-session-head { min-height: 96px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cash-session-head h2 { margin: 3px 0 6px; }
.cash-session-head p { margin: 0; color: var(--text-muted); font-size: 11px; }
.cash-dashboard-grid { grid-template-columns: 1.25fr .75fr; }
.cash-balance-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.cash-balance-grid article { padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: #fbfcfa; }
.cash-balance-grid article > div:first-child, .cash-balance-grid article > strong { display: block; }
.cash-balance-grid article > div:first-child span, .cash-balance-grid article > div:first-child small { display: block; }
.cash-balance-grid article > div:first-child span { font-size: 11px; font-weight: 800; }
.cash-balance-grid article > div:first-child small { color: var(--text-muted); font-size: 8px; }
.cash-balance-grid article > strong { margin: 8px 0; color: var(--primary); font-size: 18px; }
.cash-balance-detail { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 9px; }
.cash-history { overflow: hidden; }
.cash-count-list { margin-bottom: 14px; display: grid; gap: 9px; }
.cash-count-row { padding: 10px; display: grid; grid-template-columns: minmax(0,1fr) 140px; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfa; }
.cash-count-row strong, .cash-count-row small { display: block; }
.cash-count-row strong { font-size: 11px; }
.cash-count-row small { margin-top: 3px; color: var(--text-muted); font-size: 8px; }
.cash-live-difference { margin-top: 12px; padding: 12px; display: flex; justify-content: space-between; border-radius: 10px; color: #fff; background: #173a25; }
.cash-live-difference span { color: rgba(255,255,255,.7); font-size: 10px; }


@media (max-width: 900px) {
    
    
    
    
    .cash-dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    
    
    
    
    
    .cash-balance-grid { grid-template-columns: 1fr; }
    .cash-empty-card { grid-template-columns: 1fr; text-align: center; }
    .cash-empty-icon { margin: auto; }
    .cash-session-head { align-items: flex-start; flex-direction: column; }
    .cash-count-row { grid-template-columns: 1fr; }
}

/* FASE 17.5 · Ajustes y reinicio seguro */
.settings-page { max-width: 1100px; }
.settings-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 24px; }
.settings-card h3, .danger-zone-card h3 { margin: 0 0 6px; }
.settings-card p, .danger-zone-card p { margin: 0; color: var(--text-muted); }
.settings-card-icon, .danger-zone-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-soft); color: var(--primary); }
.settings-card-icon svg, .danger-zone-icon svg { width: 23px; height: 23px; }
.danger-zone-card { border: 1px solid color-mix(in srgb, #b93a3a 35%, var(--border)); overflow: hidden; }
.danger-zone-head { display: flex; gap: 16px; padding: 24px; background: color-mix(in srgb, #b93a3a 7%, var(--surface)); }
.danger-zone-head span { display: block; margin-bottom: 5px; color: #a82f2f; font-size: .73rem; font-weight: 800; letter-spacing: .14em; }
.danger-zone-icon { flex: 0 0 auto; background: #f9e4e4; color: #b63737; }
.danger-zone-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.danger-zone-grid div { padding: 20px 24px; border-right: 1px solid var(--border); }
.danger-zone-grid div:last-child { border-right: 0; }
.danger-zone-grid strong, .danger-zone-grid span { display: block; }
.danger-zone-grid strong { font-size: 1.25rem; }
.danger-zone-grid span { margin-top: 4px; color: var(--text-muted); font-size: .83rem; }
.reset-details { margin: 20px 24px 0; border: 1px solid var(--border); border-radius: 12px; }
.reset-details summary { cursor: pointer; padding: 14px 16px; font-weight: 700; }
.reset-details ul { list-style: none; margin: 0; padding: 0 16px 14px; }
.reset-details li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.danger-zone-notes { display: grid; gap: 9px; padding: 20px 24px; }
.danger-zone-notes div { display: flex; align-items: center; gap: 9px; color: var(--text-muted); }
.danger-zone-notes svg { width: 17px; height: 17px; flex: 0 0 auto; }
.danger-zone-actions { display: flex; justify-content: flex-end; padding: 0 24px 24px; }
.reset-warning { display: flex; gap: 14px; margin-bottom: 22px; padding: 16px; border-radius: 12px; background: #fff1f1; color: #7e2424; }
.reset-warning svg { width: 24px; height: 24px; flex: 0 0 auto; }
.reset-warning p { margin: 6px 0 0; color: #7e4a4a; }
.muted-copy { padding: 20px 24px 0; color: var(--text-muted); }
@media (max-width: 720px) {
    .settings-card { grid-template-columns: auto 1fr; }
    .settings-card .btn { grid-column: 1 / -1; }
    .danger-zone-grid { grid-template-columns: 1fr; }
    .danger-zone-grid div { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* FASE 18 · Inventario, compras y finanzas */
.operations-page, .report-page { max-width: 1540px; }
.module-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; padding: 5px; width: fit-content; max-width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.module-tabs button { min-height: 36px; padding: 0 13px; border: 0; border-radius: 8px; color: var(--text-muted); background: transparent; font-size: 11px; font-weight: 800; }
.module-tabs button:hover { color: var(--text); background: var(--surface-muted); }
.module-tabs button.active { color: #fff; background: var(--primary); }
.mini-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; border-bottom: 1px solid var(--border); background: var(--border); }
.mini-stats > div { padding: 14px 16px; background: var(--surface); }
.mini-stats span, .mini-stats strong { display: block; }
.mini-stats span { color: var(--text-muted); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.mini-stats strong { margin-top: 5px; font-size: 18px; }
.compact-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.compact-stats .stat-card { min-height: 104px; }
.compact-stats .stat-value { margin-top: 13px; font-size: 22px; }
.detail-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.detail-grid > div { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfa; }
.detail-grid > .span-2 { grid-column: 1 / -1; }
.detail-grid span, .detail-grid strong { display: block; }
.detail-grid span { color: var(--text-muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.detail-grid strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 12px; }
.section-title { margin: 22px 0 10px; font-size: 14px; }
.empty-state.compact { min-height: 130px; }
.purchase-form { display: grid; gap: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h3 { margin: 0; font-size: 14px; }
.section-head p { margin: 3px 0 0; color: var(--text-muted); font-size: 10px; }
#purchase-lines { display: grid; gap: 9px; }
.purchase-line { padding: 10px; display: grid; grid-template-columns: 1.65fr .65fr .8fr .65fr auto; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: 11px; background: #fbfcfa; }
.purchase-line .form-control { height: 40px; }
.modal-toolbar { margin-bottom: 14px; justify-content: flex-end; }
.report-filter-card { margin-bottom: 16px; padding: 14px; }
.report-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.report-filters .form-field { min-width: 170px; }
.report-filters .form-label { display: block; margin-bottom: 6px; }
.report-card { margin-top: 16px; overflow: hidden; }
.report-card .stats-grid { margin: 0; }
.report-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.report-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
.report-tabs button { white-space: nowrap; }
@media (max-width: 1080px) {
    .compact-stats, .report-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .purchase-line { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .purchase-line .table-action { justify-self: start; }
}
@media (max-width: 640px) {
    .mini-stats, .compact-stats, .report-stats, .detail-grid { grid-template-columns: 1fr; }
    .detail-grid > .span-2 { grid-column: auto; }
    .purchase-line { grid-template-columns: 1fr; }
    .report-filters { display: grid; grid-template-columns: 1fr; }
    .report-filters .form-field { min-width: 0; }
}


/* FASE 19 — Configuración, respaldos y seguridad operativa */
.ops-health,
.ops-section { padding: 24px; }
.ops-health-head,
.ops-section > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.ops-health-head h3,
.ops-section h3 { margin: 8px 0 0; }
.ops-section header p { margin: 5px 0 0; color: var(--text-muted); }
.ops-kpis { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ops-kpis div { padding: 18px; border-right: 1px solid var(--border); }
.ops-kpis div:last-child { border-right: 0; }
.ops-kpis strong,
.ops-kpis span { display: block; }
.ops-kpis span { color: var(--text-muted); font-size: .82rem; margin-top: 4px; }
.ops-warnings { margin: 18px 0 0; padding: 14px 18px 14px 36px; border-radius: 12px; background: #fff8df; color: #7b5b0a; }
.ops-ok { margin: 18px 0 0; color: #2f754c; }
.ops-form-actions { display: flex; justify-content: flex-end; }
.ops-section .data-table td small { display: block; color: var(--text-muted); margin-top: 4px; max-width: 260px; }
.ops-section code { font-size: .75rem; }
.reset-details { padding: 18px 24px; }
.reset-details ul { display: grid; gap: 7px; padding-left: 0; list-style: none; }
.reset-details li { display: flex; justify-content: space-between; }
.muted-copy { padding: 20px 24px; color: var(--text-muted); }
@media (max-width: 900px) {
    .ops-kpis { grid-template-columns: repeat(2,1fr); }
    .ops-kpis div:nth-child(2) { border-right: 0; }
    .ops-kpis div:nth-child(-n/**/+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 640px) {
    .ops-health-head,
    .ops-section > header { flex-direction: column; }
    .ops-kpis { grid-template-columns: 1fr; }
    .ops-kpis div { border-right: 0; border-bottom: 1px solid var(--border); }
    .ops-kpis div:last-child { border-bottom: 0; }
}

/* CORRECCIÓN 19.1 — Inventario inicial y stock actual */
.form-section-title { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.form-section-title strong { font-size: 13px; }
.form-section-title span { color: var(--text-muted); font-size: 10px; line-height: 1.45; }
.inventory-current { margin-bottom: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.inventory-current .section-head { margin-bottom: 12px; }
.inventory-current .section-head strong, .inventory-current .section-head small { display: block; }
.inventory-current .section-head small { margin-top: 3px; color: var(--text-muted); font-size: 10px; }

/* CORRECCIÓN 19.4 · Imagen principal única por producto */
.product-image-uploader { padding: 14px; display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 16px; align-items: center; border: 1px solid var(--border); border-radius: 12px; background: #fbfcfa; }
.product-image-preview { width: 150px; height: 150px; display: grid; place-items: center; overflow: hidden; border: 1px dashed var(--border); border-radius: 12px; color: var(--primary); background: var(--surface-muted); text-align: center; }
.product-image-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.product-image-preview span { display: grid; place-items: center; }
.product-image-preview svg { width: 42px; height: 42px; }
.product-image-preview small { color: var(--text-muted); font-size: 9px; }
.product-image-controls { display: grid; justify-items: start; gap: 9px; }
.product-image-controls strong { display: block; font-size: 12px; }
.product-image-controls p { max-width: 560px; margin: 4px 0 0; color: var(--text-muted); font-size: 10px; line-height: 1.5; }
.product-image-controls > small { color: var(--text-muted); font-size: 9px; overflow-wrap: anywhere; }
.product-image-select { position: relative; overflow: hidden; cursor: pointer; }
.product-image-select input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.product-image-remove { display: flex; align-items: center; gap: 7px; color: #a43131; font-size: 10px; font-weight: 700; cursor: pointer; }
.single-product-image { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 12px; align-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfa; }
.single-product-image > img { width: 130px; height: 130px; display: block; object-fit: contain; background: #fff; }
.single-product-image > div { padding: 12px 12px 12px 0; }
.single-product-image strong, .single-product-image small { display: block; }
.single-product-image small { margin-top: 5px; color: var(--text-muted); font-size: 9px; overflow-wrap: anywhere; }
.single-product-image.image-error img { display: none; }
.single-product-image.image-error::before { content: "Imagen no disponible"; width: 130px; height: 130px; display: grid; place-items: center; color: var(--text-muted); background: var(--surface-muted); font-size: 10px; }
@media (max-width: 640px) {
    .product-image-uploader, .single-product-image { grid-template-columns: 1fr; }
    .product-image-preview { width: 100%; max-width: 220px; }
    .single-product-image > img { width: 100%; height: 180px; }
    .single-product-image > div { padding: 12px; }
}

/* Configuración de permisos por rol */
.permissions-manager { display: grid; gap: 16px; }
.permissions-toolbar { display: grid; grid-template-columns: minmax(190px, .75fr) minmax(260px, 1fr) auto; align-items: end; gap: 14px; }
.permissions-role-field, .permissions-search-field { margin: 0; }
.permissions-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 1px; }
.permissions-role-summary { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.permissions-role-summary strong { font-size: 15px; }
.permissions-role-summary span { color: var(--text-muted); font-size: 12px; }
.permissions-warning { margin: 0; }
.permission-groups { display: grid; gap: 14px; }
.permission-group { overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.permission-group-head { min-height: 68px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); background: #fbfcfa; }
.permission-group-head h3 { margin: 0; font-size: 15px; }
.permission-group-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; }
.permission-group-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 11px; font-weight: 750; }
.permission-group-toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.permission-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.permission-option { min-height: 62px; padding: 12px 14px; display: flex; align-items: flex-start; gap: 11px; border-bottom: 1px solid var(--border); }
.permission-option:nth-child(odd) { border-right: 1px solid var(--border); }
.permission-option input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--primary); }
.permission-option span { min-width: 0; }
.permission-option strong, .permission-option small { display: block; }
.permission-option strong { font-size: 12px; line-height: 1.4; }
.permission-option small { margin-top: 3px; overflow-wrap: anywhere; color: var(--text-muted); font-size: 10px; }
.permission-option:hover { background: var(--primary-soft); }

@media (max-width: 820px) {
    .permissions-toolbar { grid-template-columns: 1fr; }
    .permissions-quick-actions .btn { flex: 1; }
    .permission-options { grid-template-columns: 1fr; }
    .permission-option:nth-child(odd) { border-right: 0; }
    .permissions-role-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* ==========================================================================
   LICOFULL CLASSIC DESKTOP ERP UI · PRUEBA VISUAL
   Rediseño desktop-first inspirado en patrones WinForms/Delphi/.NET.
   No modifica lógica de negocio ni contratos de API.
   ========================================================================== */

:root {
    --bg: #d7dce2;
    --surface: #ffffff;
    --surface-muted: #eef1f4;
    --surface-strong: #dfe4e9;
    --text: #1f252b;
    --text-muted: #5b6570;
    --border: #aeb7c1;
    --border-dark: #7e8995;
    --primary: #2f5f93;
    --primary-hover: #244d79;
    --primary-soft: #dce9f6;
    --accent: #c77922;
    --accent-soft: #f7ead9;
    --danger: #b23b3b;
    --danger-soft: #f7dddd;
    --warning: #8b6500;
    --warning-soft: #fff0bd;
    --success: #287342;
    --success-soft: #dcefe2;
    --info: #2e628f;
    --info-soft: #deebf6;
    --shadow-sm: 0 1px 1px rgba(0,0,0,.08);
    --shadow-md: 0 4px 14px rgba(0,0,0,.18);
    --radius-sm: 2px;
    --radius: 3px;
    --radius-lg: 5px;
    --desktop-titlebar-height: 54px;
    --desktop-module-height: 50px;
    --desktop-subtab-height: 35px;
    --desktop-statusbar-height: 28px;
    --control-height: 34px;
    --transition: 70ms linear;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

html, body { width: 100%; height: 100%; min-width: 960px; }
body { overflow: hidden; background: var(--bg); font-size: 13px; }
#app-root { width: 100%; height: 100vh; }
button, input, select, textarea { font-family: "Segoe UI", Tahoma, Arial, sans-serif; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid #1b72c5; outline-offset: 1px; }

/* Arranque y acceso: aspecto de aplicación, no de landing page */
.boot-screen { min-height: 100vh; background: #d8dde3; gap: 10px; }
.boot-screen .brand-mark { width: 50px; height: 50px; border-radius: 4px; background: #2f5f93; box-shadow: none; }
.boot-spinner { width: 20px; height: 20px; border-width: 2px; border-radius: 50%; border-color: #b8c0c8; border-top-color: #2f5f93; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr; place-items: center; padding: 28px; background: #cfd5dc; }
.login-showcase { display: none !important; }
.login-panel { min-height: 0; width: 100%; padding: 0; background: transparent; }
.login-card { width: min(100%, 430px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #707b86; border-radius: 3px; background: #f8f9fa; box-shadow: 0 10px 32px rgba(0,0,0,.25); }
.login-card::before { content: "LicoFULL · Acceso al sistema"; display: block; padding: 9px 12px; color: #fff; background: #2f5f93; border-bottom: 1px solid #244d79; font-size: 13px; font-weight: 600; }
.login-card-header { margin: 0; padding: 20px 22px 10px; }
.login-card .eyebrow { color: #4d5965; font-size: 10px; letter-spacing: .08em; }
.login-card h2 { margin: 4px 0 5px; font-size: 20px; letter-spacing: 0; }
.login-card-header p { font-size: 11px; line-height: 1.4; }
.login-card form { padding: 6px 22px 20px; }
.login-help { margin: 0 22px 18px; padding-top: 12px; font-size: 10px; }

/* Ventana principal */
.app-shell.desktop-shell { width: 100%; height: 100vh; min-height: 0; display: flex; flex-direction: column; background: #cfd4da; }
.desktop-titlebar { flex: 0 0 var(--desktop-titlebar-height); min-width: 0; display: flex; align-items: stretch; justify-content: space-between; color: #1f252b; background: #eef1f4; border-bottom: 1px solid #8b96a2; box-shadow: inset 0 1px #fff; }
.desktop-brand-area, .desktop-session-area { min-width: 0; display: flex; align-items: center; }
.desktop-brand-area { padding-left: 10px; gap: 10px; }
.desktop-brand-mark { width: 34px; height: 34px; border-radius: 3px; background: #2f5f93; box-shadow: none; font-size: 13px; letter-spacing: .02em; }
.desktop-brand-copy { min-width: 132px; }
.desktop-brand-copy strong, .desktop-brand-copy span { display: block; line-height: 1.15; }
.desktop-brand-copy strong { color: #173f68; font-size: 16px; }
.desktop-brand-copy span { margin-top: 2px; color: #67717b; font-size: 10px; }
.desktop-divider { width: 1px; height: 30px; margin: 0 4px; background: #b5bdc6; box-shadow: 1px 0 #fff; }
.desktop-context { min-width: 0; display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.desktop-context-label { color: #6c7680; font-size: 10px; text-transform: uppercase; }
.desktop-context strong { max-width: 340px; overflow: hidden; text-overflow: ellipsis; color: #20262c; font-size: 14px; }
.desktop-session-area { margin-left: auto; }
.desktop-branch, .desktop-clock { min-width: 122px; height: 100%; padding: 7px 12px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid #c0c7ce; }
.desktop-branch span, .desktop-clock span { color: #6a747e; font-size: 10px; }
.desktop-branch strong, .desktop-clock strong { margin-top: 1px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.desktop-clock { min-width: 104px; text-align: right; }
.desktop-user-menu { height: 100%; border-left: 1px solid #c0c7ce; }
.desktop-user-menu .user-button { height: 100%; min-width: 182px; padding: 5px 10px; border: 0; border-radius: 0; background: transparent; }
.desktop-user-menu .user-button:hover { background: #e0e5ea; }
.user-avatar { width: 32px; height: 32px; border-radius: 3px; background: #486f98; font-size: 11px; }
.user-meta strong { font-size: 13px; }
.user-meta span { font-size: 10px; }
.user-dropdown { top: calc(100% + 1px); right: 0; width: 240px; padding: 0; overflow: hidden; border: 1px solid #707b86; border-radius: 2px; box-shadow: 0 5px 16px rgba(0,0,0,.22); }
.dropdown-info { padding: 10px 12px; background: #eef1f4; border-bottom: 1px solid #c2c9d0; }
.dropdown-shortcut { padding: 8px 12px; color: #5a6570; border-bottom: 1px solid #d5d9de; font-size: 10px; }
.dropdown-action { min-height: 31px; border-radius: 0; }
.desktop-logout { height: 100%; min-width: 70px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: #802c2c; background: #f1f2f3; border: 0; border-left: 1px solid #c0c7ce; font-size: 11px; font-weight: 600; }
.desktop-logout:hover { background: #f5dede; }
.desktop-logout svg { width: 15px; height: 15px; }

/* Pestañas principales: siempre visibles y desplazables horizontalmente */
.desktop-module-strip { flex: 0 0 var(--desktop-module-height); min-width: 0; background: #d9dee4; border-bottom: 1px solid #8d98a4; box-shadow: inset 0 1px #f8f9fa; }
.desktop-module-scroll { height: 100%; display: flex; align-items: flex-end; gap: 3px; padding: 6px 7px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #8f9aa5 #d9dee4; }
.desktop-module-tab { position: relative; flex: 0 0 auto; height: 38px; min-width: 88px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #2d343a; text-decoration: none; white-space: nowrap; background: #eef1f4; border: 1px solid #9ca6b0; border-bottom: 0; border-radius: 3px 3px 0 0; box-shadow: inset 0 1px #fff; font-size: 12px; font-weight: 600; }
.desktop-module-tab svg { width: 16px; height: 16px; color: #53606d; }
.desktop-module-tab:hover { background: #f8f9fa; border-color: #7f8a96; }
.desktop-module-tab.active { height: 40px; color: #fff; background: var(--module-accent, #2f5f93); border-color: var(--module-accent-dark, #244d79); box-shadow: none; }
.desktop-module-tab.active svg { color: #fff; }

/* Color funcional por módulo */
#app-root[data-active-module="dashboard"] { --module-accent: #367a45; --module-accent-dark: #285f34; }
#app-root[data-active-module="ventas"] { --module-accent: #2f67a1; --module-accent-dark: #244f7b; }
#app-root[data-active-module="productos"], #app-root[data-active-module="categorias"], #app-root[data-active-module="marcas"], #app-root[data-active-module="unidades-medida"] { --module-accent: #397ba4; --module-accent-dark: #2a5e7e; }
#app-root[data-active-module="inventario"] { --module-accent: #bc5a2d; --module-accent-dark: #93421f; }
#app-root[data-active-module="compras"], #app-root[data-active-module="proveedores"], #app-root[data-active-module="cuentas-por-pagar"] { --module-accent: #c07822; --module-accent-dark: #935b18; }
#app-root[data-active-module="clientes"], #app-root[data-active-module="creditos"] { --module-accent: #73559b; --module-accent-dark: #59417a; }
#app-root[data-active-module="caja"] { --module-accent: #247782; --module-accent-dark: #1b5c65; }
#app-root[data-active-module="gastos"], #app-root[data-active-module="reportes"] { --module-accent: #70549a; --module-accent-dark: #554075; }
#app-root[data-active-module="empresa"], #app-root[data-active-module="sucursales"], #app-root[data-active-module="formas-pago"], #app-root[data-active-module="usuarios"], #app-root[data-active-module="auditoria"], #app-root[data-active-module="configuracion"] { --module-accent: #596570; --module-accent-dark: #414b54; }

.desktop-subtab-strip { flex: 0 0 var(--desktop-subtab-height); min-width: 0; display: flex; align-items: flex-end; gap: 2px; padding: 4px 8px 0; overflow-x: auto; overflow-y: hidden; background: #f1f3f5; border-bottom: 1px solid #aeb6bf; }
.desktop-subtabs-label { height: 27px; padding: 7px 9px 0 2px; color: #68727c; font-size: 10px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.desktop-subtab { flex: 0 0 auto; height: 30px; padding: 0 11px; display: inline-flex; align-items: center; color: #343b42; text-decoration: none; white-space: nowrap; border: 1px solid transparent; border-bottom: 0; border-radius: 2px 2px 0 0; font-size: 11px; }
.desktop-subtab:hover { background: #e4e8ec; border-color: #b2bbc4; }
.desktop-subtab.active { color: #16202a; background: #fff; border-color: #9da7b1; font-weight: 700; box-shadow: inset 0 2px var(--module-accent, #2f5f93); }

/* Área de trabajo y barra de estado */
.main-area.desktop-main-area { min-height: 0; flex: 1 1 auto; display: flex; grid-column: auto; overflow: hidden; background: #cfd4da; }
.page-content.desktop-workspace { min-width: 0; min-height: 0; width: 100%; flex: 1 1 auto; padding: 8px 9px 9px; overflow: auto; background: #d5d9de; }
.page-container, .admin-page, .settings-page, .operations-page, .report-page { width: 100%; max-width: none !important; margin: 0 !important; }
.desktop-statusbar { flex: 0 0 var(--desktop-statusbar-height); min-width: 0; display: flex; align-items: stretch; color: #303840; background: #e6e9ec; border-top: 1px solid #9ca6af; box-shadow: inset 0 1px #fff; font-size: 10px; }
.status-segment { min-width: 0; padding: 5px 9px 0; display: flex; align-items: flex-start; gap: 5px; white-space: nowrap; border-right: 1px solid #c3c9cf; }
.status-segment strong { overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.desktop-statusbar .sidebar-version { padding: 5px 9px 0; color: inherit; font-size: inherit; }
.status-spacer { flex: 1 1 auto; }
.status-light { width: 7px; height: 7px; margin-top: 2px; border: 1px solid #1f642f; border-radius: 50%; background: #43a658; }
.status-segment.is-offline { color: #9b2f2f; }
.status-segment.is-offline .status-light { border-color: #882727; background: #d14a4a; }

/* Encabezado contextual de cada módulo: barra de herramientas real */
.page-toolbar { min-height: 50px; margin: 0 0 8px !important; padding: 6px 8px; display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: space-between; gap: 8px; background: #eef1f4; border: 1px solid #a8b1bb; border-radius: 2px; box-shadow: inset 0 1px #fff; }
.page-toolbar > div:first-child, .page-toolbar-copy { min-width: 0; }
.page-toolbar h2, .page-toolbar-copy h2 { margin: 0 0 1px !important; color: #20262c; font-size: 16px !important; line-height: 1.2; letter-spacing: 0 !important; }
.page-toolbar p, .page-toolbar-copy p { margin: 0 !important; color: #636d77; font-size: 10px !important; line-height: 1.28 !important; }
.page-toolbar .eyebrow { display: none; }
.toolbar-actions { gap: 4px; }

/* Controles clásicos */
.btn { min-height: var(--control-height); height: auto; padding: 0 12px; gap: 6px; border-radius: 2px; border-width: 1px; box-shadow: inset 0 1px rgba(255,255,255,.8); font-size: 11px; font-weight: 600; transition: none; }
.btn:active { transform: none; box-shadow: inset 0 1px 2px rgba(0,0,0,.16); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { color: #fff; background: var(--module-accent, #2f5f93); border-color: var(--module-accent-dark, #244d79); box-shadow: inset 0 1px rgba(255,255,255,.18); }
.btn-primary:hover:not(:disabled) { background: var(--module-accent-dark, #244d79); }
.btn-secondary { color: #2f363d; background: #f5f6f7; border-color: #9ba5af; }
.btn-secondary:hover:not(:disabled) { background: #e5e9ed; border-color: #78848f; }
.btn-danger { background: #b04444; border-color: #843131; }
.btn-small { min-height: 30px; padding: 0 9px; font-size: 10px; }
.btn-icon { width: 34px; padding: 0; }
.btn kbd { margin-left: 4px; padding: 1px 4px; color: inherit; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4); border-radius: 2px; font: 9px "Segoe UI", Tahoma, sans-serif; }
.btn-secondary kbd { color: #59636d; background: #fff; border-color: #b9c1c8; }

.form-group { gap: 4px; margin-bottom: 10px; }
.form-label { font-size: 11px; font-weight: 600; }
.form-control { height: var(--control-height); padding: 0 8px; color: #1f252b; background: #fff; border: 1px solid #929da8; border-radius: 2px; box-shadow: inset 0 1px 2px rgba(0,0,0,.05); font-size: 12px; transition: none; }
.form-control:focus { border-color: #2874ba; box-shadow: 0 0 0 1px #69a8e1; }
.form-control[aria-invalid="true"] { border-color: #b13c3c; box-shadow: 0 0 0 1px #d99090; }
.form-textarea { min-height: 68px; padding-top: 6px; }
.form-grid { gap: 8px 10px; }
.form-grid-padded { padding: 10px; }
.form-field .form-label { margin-bottom: 3px; }
.field-help { margin-top: 3px; font-size: 9px; }
.filter-control { min-width: 145px; height: var(--control-height); }


.card { background: #fff; border: 1px solid #aeb7c1; border-radius: 3px; box-shadow: none; }
.card-head { min-height: 36px; padding: 6px 9px; background: #e9edf1; border-bottom: 1px solid #abb4bd; }
.card-head h3 { font-size: 12px; font-weight: 700; }
.card-body { padding: 9px; }
.section-head { min-height: 34px; padding: 5px 8px; }
.section-head h3 { font-size: 12px; }
.section-head p { font-size: 10px; }
.eyebrow { color: #596570; font-size: 9px; letter-spacing: .07em; }
.badge { min-height: 20px; padding: 1px 6px; border-radius: 2px; font-size: 9px; font-weight: 700; }
.info-banner { margin-top: 8px; padding: 7px 9px; gap: 7px; border-radius: 2px; }
.info-banner svg { width: 15px; height: 15px; }
.info-banner span { font-size: 9px; }
.detail-section { margin-top: 8px; padding: 8px; border-radius: 2px; }
.detail-section h3 { margin-bottom: 6px; font-size: 11px; }
.detail-grid { margin-bottom: 8px; gap: 5px; }
.detail-grid > div { padding: 6px 7px; border-radius: 2px; background: #f7f8f9; }
.detail-grid span { font-size: 8px; }
.detail-grid strong { margin-top: 2px; font-size: 10px; }
.compact-list { gap: 3px; }
.compact-list > div { min-height: 34px; padding: 5px 7px; border-radius: 2px; background: #f8f9fa; }

/* Dashboard clásico con cajas de colores e iconos marca de agua */
.dashboard-page .stats-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; margin-bottom: 7px; }
.dashboard-page .classic-kpi { position: relative; min-height: 82px; padding: 10px 12px; overflow: hidden; color: #fff; border: 1px solid rgba(0,0,0,.18); border-radius: 3px; }
.dashboard-page .classic-kpi .stat-label { color: rgba(255,255,255,.93); font-size: 12px; font-weight: 700; text-transform: none; }
.dashboard-page .classic-kpi .stat-value { margin-top: 5px; color: #fff; font-size: 24px; font-weight: 700; line-height: 1; }
.dashboard-page .classic-kpi .stat-foot { margin-top: 4px; color: rgba(255,255,255,.85); font-size: 9px; }
.dashboard-page .classic-kpi .stat-icon { position: absolute; right: 6px; bottom: 3px; width: 48px; height: 48px; display: grid; place-items: center; color: rgba(255,255,255,.28); background: transparent; }
.dashboard-page .classic-kpi .stat-icon svg { width: 44px; height: 44px; }
.dashboard-page .kpi-cart { background: #2f8651; }
.dashboard-page .kpi-trend { background: #3d76ae; }
.dashboard-page .kpi-inventory { background: #c4573c; }
.dashboard-page .kpi-credit { background: #73589f; }
.dashboard-page .kpi-truck { background: #cb7a29; }
.dashboard-page .kpi-receipt { background: #a94d4d; }
.dashboard-page .kpi-wallet { background: #65717d; }
.dashboard-page .kpi-cash { background: #26818c; }
.dashboard-page .dashboard-grid { grid-template-columns: minmax(0,1.55fr) minmax(280px,.78fr); gap: 7px; }
.dashboard-page .dashboard-stack { gap: 7px; }
.alert-list, .activity-list { gap: 4px; }
.alert-item, .activity-item { padding: 6px 7px; gap: 7px; border-radius: 2px; background: #f8f9fa; }
.activity-icon { width: 24px; height: 24px; border-radius: 2px; }
.alert-item strong, .activity-item strong { font-size: 10px; }
.alert-item span, .activity-item span { margin-top: 1px; font-size: 8px; }
.activity-value { font-size: 10px; }

/* Estadísticas compactas en módulos administrativos */
.compact-stats, .report-stats { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; margin-bottom: 7px; }
.compact-stats .stat-card, .report-stats .stat-card { min-height: 64px; padding: 8px 10px; background: #f8f9fa; border-top: 3px solid var(--module-accent, #2f5f93); }
.compact-stats .stat-label, .report-stats .stat-label { font-size: 10px; }
.compact-stats .stat-value, .report-stats .stat-value { margin-top: 5px; font-size: 18px; }

/* Tablas de trabajo: alta densidad y encabezado fijo */
.table-wrap, .table-scroll { width: 100%; overflow: auto; }
.admin-card > .table-wrap, .admin-card > [data-table] > .table-wrap, .cash-history .table-scroll { max-height: calc(100vh - 312px); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.data-table th { position: sticky; top: 0; z-index: 2; height: 29px; padding: 5px 7px; color: #30373e; background: #dfe4e9; border-right: 1px solid #b6bec6; border-bottom: 1px solid #929da8; letter-spacing: 0; text-transform: none; font-size: 10px; font-weight: 700; }
.data-table th:last-child { border-right: 0; }
.data-table td { min-height: 29px; padding: 5px 7px; border-right: 1px solid #e0e4e8; border-bottom: 1px solid #d7dce1; vertical-align: middle; }
.data-table td:last-child { border-right: 0; }
.data-table tbody tr:nth-child(even) { background: #f7f8f9; }
.data-table tbody tr:hover { background: #dce9f6; }
.data-table tbody tr:focus-within { background: #d2e5f7; }
.data-table td > small { margin-top: 1px; font-size: 9px; }
.data-table code { padding: 1px 3px; border-radius: 1px; color: #254f78; background: #e4edf5; font: 9px Consolas, monospace; }
.admin-table td { max-width: 360px; }
.table-actions, .inline-actions { gap: 3px; }
.table-action { min-height: 25px; padding: 0 6px; gap: 4px; color: #273038; background: #f5f6f7; border: 1px solid #a3adb7; border-radius: 2px; font-size: 9px; font-weight: 600; }
.table-action:hover { background: #e4e9ed; border-color: #75818c; }
.table-action svg { width: 12px; height: 12px; }
.table-action.danger { color: #942f2f; }
.admin-filters { min-height: 45px; padding: 6px 8px; gap: 6px; background: #edf0f3; border-bottom: 1px solid #aeb7c1; }
.admin-filters form { gap: 4px; }
.admin-filters input[type="search"], .admin-filters input[name="buscar"] { min-width: 190px; }
.records-count { font-size: 10px; }
.pagination { min-height: 38px; padding: 5px 8px; gap: 8px; background: #eef1f3; border-top: 1px solid #b6bec6; font-size: 10px; }

/* Pestañas internas reales de Inventario, Reportes, etc. */
.module-tabs { width: auto; max-width: 100%; min-height: 34px; margin: 0 0 7px; padding: 2px 3px 0; display: flex; flex-wrap: nowrap; gap: 1px; overflow-x: auto; background: #dfe4e9; border: 1px solid #a8b1bb; border-radius: 2px; }
.module-tabs button { min-height: 29px; padding: 0 10px; color: #343c44; background: #edf0f3; border: 1px solid #b1bac3; border-bottom: 0; border-radius: 2px 2px 0 0; font-size: 10px; font-weight: 600; white-space: nowrap; }
.module-tabs button:hover { color: #20262c; background: #fff; }
.module-tabs button.active { color: #1d2832; background: #fff; border-color: #929da8; box-shadow: inset 0 2px var(--module-accent, #2f5f93); }
.report-tabs { width: 100%; }

/* Formularios y cajas de grupo */
.form-section-title, .inventory-current, .product-image-uploader, .single-product-image, .permissions-role-summary, .permission-group, .reset-details { border-radius: 2px; }
.form-section-title { margin-top: 4px; padding: 6px 8px; background: #e9edf1; }
.form-section-title strong { font-size: 10px; }
.form-section-title span { font-size: 9px; }
.inventory-current { margin-bottom: 8px; padding: 8px; background: #f5f7f8; }
.product-image-uploader { padding: 8px; grid-template-columns: 110px minmax(0,1fr); gap: 10px; background: #f8f9fa; }
.product-image-preview { width: 110px; height: 110px; border-radius: 2px; }
.product-image-controls strong { font-size: 10px; }
.product-image-controls p { font-size: 9px; }
.product-cell { gap: 6px; min-width: 200px; }
.product-cell > img, .product-cell > span { width: 32px; height: 32px; border-radius: 2px; }
.product-detail-head { grid-template-columns: 120px minmax(0,1fr); gap: 10px; }
.product-detail-image { height: 120px; border-radius: 2px; }

/* Modales como diálogos de escritorio */
.modal-backdrop { padding: 18px; background: rgba(39,45,51,.48); backdrop-filter: none; }
.app-modal { width: min(100%, 720px); max-height: calc(100vh - 36px); border: 1px solid #59636e; border-radius: 3px; box-shadow: 0 9px 28px rgba(0,0,0,.28); animation: none; }
.app-modal-small { width: min(100%, 500px); }
.app-modal-large { width: min(100%, 900px); }
.app-modal-wide { width: min(100%, 1180px); }
.modal-head { min-height: 37px; padding: 5px 7px 5px 10px; background: #dce5ee; border-bottom: 1px solid #8f9aa5; }
.modal-head h2 { font-size: 12px; letter-spacing: 0; }
.modal-head p { margin-top: 1px; font-size: 8px; }
.modal-head .btn-icon { min-height: 25px; width: 25px; }
.modal-body { padding: 9px; }
.modal-foot { min-height: 40px; padding: 5px 7px; gap: 4px; background: #eceff2; border-top: 1px solid #b0b9c2; }
.confirmation-copy { font-size: 11px; line-height: 1.45; }


.cash-page { gap: 7px; }


/* Caja */
.cash-empty-card { min-height: 150px; padding: 14px; gap: 12px; border-radius: 2px; }
.cash-empty-icon { width: 48px; height: 48px; border-radius: 3px; }
.cash-empty-icon svg { width: 24px; height: 24px; }
.cash-session-head { min-height: 62px; padding: 8px 10px; }
.cash-session-head h2 { margin: 1px 0 3px; font-size: 15px; }
.cash-balance-grid { gap: 5px; }
.cash-balance-grid article { padding: 7px; border-radius: 2px; background: #f8f9fa; }
.cash-balance-grid article > strong { margin: 4px 0; font-size: 14px; }
.cash-count-row { padding: 5px 6px; border-radius: 2px; background: #f7f8f9; }
.cash-live-difference { margin-top: 6px; padding: 7px; border-radius: 2px; }

/* Configuración, permisos y zonas especiales */
.settings-card, .ops-health, .ops-section { padding: 10px; }
.settings-card { gap: 10px; }
.settings-card-icon, .danger-zone-icon { width: 34px; height: 34px; border-radius: 3px; }
.danger-zone-head { padding: 10px; gap: 8px; }
.danger-zone-grid div { padding: 8px 10px; }
.danger-zone-grid strong { font-size: 14px; }
.danger-zone-grid span { font-size: 9px; }
.danger-zone-actions { padding: 0 10px 10px; }
.ops-health-head, .ops-section > header { margin-bottom: 8px; gap: 8px; }
.ops-kpis { border-radius: 2px; }
.ops-kpis div { padding: 8px; }
.ops-kpis span { font-size: 9px; }
.permissions-manager { gap: 7px; }
.permissions-toolbar { gap: 7px; }
.permissions-role-summary { min-height: 37px; padding: 6px 8px; }
.permission-groups { gap: 6px; }
.permission-group { border-radius: 2px; }
.permission-group-head { min-height: 42px; padding: 6px 8px; }
.permission-group-head h3 { font-size: 11px; }
.permission-group-head p { font-size: 9px; }
.permission-option { min-height: 43px; padding: 6px 8px; gap: 6px; }
.permission-option strong { font-size: 10px; }
.permission-option small { font-size: 8px; }

/* Estados vacíos y avisos: pequeños, no ocupan media pantalla */
.empty-state { min-height: 110px; padding: 14px; }
.empty-state svg { width: 24px; height: 24px; margin-bottom: 5px; }
.empty-state h3 { margin-bottom: 3px; font-size: 11px; }
.empty-state p { font-size: 9px; line-height: 1.4; }
.page-loader { min-height: 150px; gap: 7px; font-size: 10px; }
.placeholder-page { min-height: calc(100vh - 160px); }
.placeholder-card { width: min(100%, 620px); padding: 22px; border-radius: 3px; }
.placeholder-icon { width: 44px; height: 44px; border-radius: 3px; }
.placeholder-card h2 { font-size: 18px; }
.placeholder-card p { font-size: 11px; }
.placeholder-meta { margin-top: 12px; padding: 5px 7px; border-radius: 2px; }

/* Toasts del sistema */
.toast-region { top: auto; right: 8px; bottom: 32px; width: min(360px, calc(100vw - 16px)); gap: 4px; }
.toast { padding: 7px 8px; gap: 7px; border-radius: 2px; box-shadow: 0 4px 12px rgba(0,0,0,.18); animation: none; }
.toast strong { font-size: 10px; }
.toast p { margin-top: 1px; font-size: 9px; }

/* Ayuda de teclado */
.shortcut-help-backdrop { position: fixed; z-index: 300; inset: 0; display: grid; place-items: center; background: rgba(40,46,52,.42); }
.shortcut-help-dialog { width: 520px; max-width: calc(100vw - 40px); overflow: hidden; background: #f7f8f9; border: 1px solid #59636e; border-radius: 3px; box-shadow: 0 9px 28px rgba(0,0,0,.28); }
.shortcut-help-dialog > header { height: 34px; padding: 0 6px 0 10px; display: flex; align-items: center; justify-content: space-between; color: #1f2a34; background: #dce5ee; border-bottom: 1px solid #929da8; }
.shortcut-help-dialog > header button { width: 26px; height: 24px; border: 1px solid #9ba5af; border-radius: 2px; background: #f3f5f6; }
.shortcut-help-grid { padding: 10px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }
.shortcut-help-grid span { min-height: 31px; padding: 5px 7px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #c8ced4; }
.shortcut-help-grid kbd { min-width: 54px; padding: 3px 5px; text-align: center; background: #e7eaed; border: 1px solid #9ba5af; border-radius: 2px; font: 9px Consolas, monospace; }
.shortcut-help-dialog > footer { padding: 7px 10px; color: #5c6670; background: #eceff2; border-top: 1px solid #c3c9cf; font-size: 9px; }

/* Desktop-first. Se conserva scroll en vez de esconder funciones. */
@media (max-width: 1180px) {
    html, body { min-width: 960px; }
    .desktop-context { display: none; }
    .desktop-branch { min-width: 92px; }
    .desktop-user-menu .user-button { min-width: 132px; }
    
    .dashboard-page .stats-grid { grid-template-columns: repeat(4,minmax(180px,1fr)); overflow-x: auto; }
    .dashboard-page .dashboard-grid { grid-template-columns: minmax(660px,1.5fr) minmax(280px,.8fr); }
}

@media (max-width: 980px) {
    .desktop-clock, .desktop-branch { display: none; }
    .desktop-module-tab { min-width: 74px; }
    .page-content.desktop-workspace { overflow: auto; }
    .form-grid { grid-template-columns: repeat(2,minmax(220px,1fr)); }
}

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

/* Indicadores visuales de atajos frecuentes */
.module-hotkey { margin-left: 2px; padding: 1px 3px; color: #626d77; background: #fff; border: 1px solid #b4bdc6; border-radius: 2px; font: 7px Consolas, monospace; }
.desktop-module-tab.active .module-hotkey { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.42); }
#route-view button[data-create]::after, #route-view button[data-admin-create]::after { content: "Ctrl+N"; margin-left: 3px; padding: 1px 3px; color: inherit; background: rgba(255,255,255,.15); border: 1px solid currentColor; border-radius: 2px; font: 7px Consolas, monospace; opacity: .72; }
#route-view button[data-refresh]::after, #route-view button[data-admin-refresh]::after, #route-view button[data-cash-refresh]::after, #dashboard-refresh::after { content: "F5"; margin-left: 3px; padding: 1px 3px; color: #64707b; background: #fff; border: 1px solid #b4bdc6; border-radius: 2px; font: 7px Consolas, monospace; }

.desktop-subtab-strip.is-empty { display: none; }

/* Remates de consistencia: elimina restos visuales del tema SaaS original. */
.dashboard-page .classic-kpi::after, .compact-stats .stat-card::after, .report-stats .stat-card::after { display: none !important; }

.skeleton::after { display: none !important; animation: none !important; }

.detail-grid > div, .detail-section, .json-view, .image-grid article, .reset-warning, .ops-warnings, .purchase-line { border-radius: 2px; }

.detail-grid > div { padding: 7px 8px; background: #f8f9fa; }
.detail-section { margin-top: 8px; padding: 8px; }
.json-view { padding: 8px; }
.image-grid article { background: #fff; }


.reset-warning { margin-bottom: 10px; padding: 8px; gap: 8px; }
.ops-warnings { margin: 8px 0 0; padding: 8px 10px 8px 24px; }
.purchase-line { padding: 5px; gap: 5px; }
.report-filter-card { margin-bottom: 7px; padding: 7px; }

.switch-control { min-height: 30px; gap: 7px; }
.switch-control span { width: 32px; height: 16px; border-radius: 2px; background: #c6ccd2; transition: none; }
.switch-control span::after { top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 1px; transition: none; }
.switch-control input:checked + span::after { transform: translateX(16px); }

.dropdown-info { margin-bottom: 0; }


/* ===== Refinamientos UX · Iteración 3 ===== */
#modal-root { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
#modal-root > * { pointer-events: auto; }
.modal-backdrop { z-index: 1000 !important; align-items: center; }
.app-modal { font-size: 12px; }
.app-modal-small { width: min(100%, 900px); max-width: 900px; }
.app-modal .form-label, .app-modal label span.form-label, .app-modal .cash-count-row small, .app-modal .cash-count-row strong { font-size: 11px; }
.app-modal .form-control { min-height: 34px; font-size: 12px; }
.app-modal .form-textarea { min-height: 72px; padding-top: 7px; padding-bottom: 7px; }
.modal-head { min-height: 42px; }
.modal-head h2 { font-size: 14px; }
.modal-head p { font-size: 10px; }
.modal-body { padding: 11px; }
.modal-foot { min-height: 46px; padding: 6px 8px; }


.cash-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; }
.cash-kpi-card { position: relative; min-height: 98px; padding: 10px 12px; overflow: hidden; display: flex; align-items: stretch; justify-content: space-between; gap: 10px; background: #f7f8f9; border: 1px solid #aeb7c1; border-radius: 2px; }
.cash-kpi-copy { position: relative; z-index: 1; display: grid; align-content: start; gap: 4px; }
.cash-kpi-copy span { color: #55606b; font-size: 11px; font-weight: 700; }
.cash-kpi-copy strong { color: #1e2730; font-size: 16px; line-height: 1.1; }
.cash-kpi-copy small { color: #6a7580; font-size: 10px; }
.cash-kpi-icon { position: absolute; right: 8px; bottom: 6px; color: rgba(91,114,136,.22); }
.cash-kpi-icon svg { width: 44px; height: 44px; }
.cash-session-head { min-height: 74px; padding: 10px 12px; }
.cash-session-head h2 { font-size: 18px; }
.cash-session-head p { font-size: 12px; }
.cash-balance-grid article { min-height: 86px; display: grid; gap: 4px; align-content: start; }
.cash-balance-grid article > div:first-child span { font-size: 12px; }
.cash-balance-grid article > div:first-child small { font-size: 9px; }
.cash-balance-grid article > strong { font-size: 16px; }
.cash-balance-detail { font-size: 10px; }
.cash-count-row { padding: 8px 9px; }
.cash-count-row strong { font-size: 12px; }
.cash-count-row small { font-size: 10px; }
.cash-live-difference span { font-size: 11px; }
.cash-live-difference strong { font-size: 18px; }

.data-table td .badge, .data-table th, .data-table td, .table-action, .records-count { font-size: 10px; }
.empty-state h3 { font-size: 18px; }
.empty-state p { font-size: 11px; }

@media (max-width: 1320px) {
  .cash-kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* ===== Refinamiento UX integral · Iteración 4 =====
   Objetivo: legibilidad, densidad útil, jerarquía y capas correctas.
   Mantiene la identidad Classic Desktop ERP. */

/* Capas: la barra del usuario debe desplegarse sobre pestañas y los diálogos sobre TODO. */
.desktop-titlebar { position: relative; z-index: 5000; overflow: visible; }
.desktop-session-area, .desktop-user-menu { position: relative; z-index: 5100; overflow: visible; }
.user-dropdown { z-index: 5200 !important; }
.desktop-module-strip { position: relative; z-index: 100; }
.desktop-subtab-strip { position: relative; z-index: 90; }
#modal-root { position: fixed !important; inset: 0 !important; z-index: 2147483000 !important; isolation: isolate; }
#modal-root .modal-backdrop { position: fixed !important; inset: 0 !important; z-index: 2147483001 !important; }
#modal-root .app-modal { position: relative; z-index: 2147483002 !important; }
.shortcut-help-backdrop { z-index: 2147483100 !important; }
.toast-region { z-index: 2147483200 !important; }

/* Escala base: ningún texto operativo crítico debe quedar microscópico. */
body { font-size: 13px; }
#app-root small { font-size: 10px; line-height: 1.35; }
.eyebrow { font-size: 10px; letter-spacing: .055em; }
.field-help { font-size: 10px; line-height: 1.35; }
.badge { min-height: 21px; padding: 2px 6px; font-size: 10px; }
.info-banner span { font-size: 10px; line-height: 1.35; }
.form-error { min-height: 18px; margin: 4px 0 0; font-size: 11px; font-weight: 600; }

/* Barras y controles compartidos */
.page-toolbar { min-height: 52px; padding: 7px 9px; }
.page-toolbar h2, .page-toolbar-copy h2 { font-size: 17px !important; }
.page-toolbar p, .page-toolbar-copy p { font-size: 11px !important; }
.btn { min-height: 35px; padding: 0 12px; font-size: 11px; }
.btn-small { min-height: 31px; font-size: 10px; }
.btn svg { width: 16px; height: 16px; }
.form-group { margin-bottom: 11px; }
.form-label { font-size: 11px; }
.form-control { min-height: 35px; height: 35px; padding: 0 9px; font-size: 12px; }
.form-textarea { min-height: 76px; height: auto; padding: 7px 9px; line-height: 1.4; }
.form-grid { gap: 10px 12px; }
.form-field .form-label { margin-bottom: 4px; }
.filter-control { min-width: 155px; }

/* Paneles: menos aire muerto, más jerarquía */
.card-head { min-height: 38px; padding: 6px 9px; }
.card-head h3 { font-size: 13px; }
.card-body { padding: 10px; }
.section-head { min-height: 36px; padding: 6px 9px; }
.section-head h3 { font-size: 13px; }
.section-head p { font-size: 10px; }
.detail-section { padding: 9px; }
.detail-section h3, .section-title { font-size: 13px; }
.detail-grid { gap: 6px; }
.detail-grid > div { padding: 8px 9px; }
.detail-grid span { font-size: 10px; letter-spacing: .025em; }
.detail-grid strong { margin-top: 3px; font-size: 12px; }
.compact-list > div { min-height: 38px; padding: 6px 8px; }

/* Estados vacíos y cargas: informativos, no enormes */
.empty-state { min-height: 96px; padding: 12px; }
.empty-state svg { width: 27px; height: 27px; margin-bottom: 5px; }
.empty-state h3 { margin-bottom: 3px; font-size: 14px; }
.empty-state p { max-width: 520px; font-size: 11px; line-height: 1.4; }
.empty-state.compact { min-height: 76px; }
.page-loader { min-height: 110px; gap: 7px; font-size: 11px; }

/* Tablas: densas pero realmente legibles */
.data-table { font-size: 11px; }
.data-table th { height: 31px; padding: 5px 7px; font-size: 10px; }
.data-table td { min-height: 31px; padding: 5px 7px; font-size: 11px; line-height: 1.28; }
.data-table td > small { margin-top: 2px; font-size: 10px; }
.data-table code { font-size: 10px; }
.table-action { min-height: 27px; padding: 0 7px; font-size: 10px; }
.table-action svg { width: 12px; height: 12px; }
.admin-filters { min-height: 48px; padding: 6px 8px; gap: 6px; }
.records-count, .pagination { font-size: 10px; }

/* Productos / catálogo administrativo */
.product-cell { gap: 8px; min-width: 220px; }
.product-cell > img, .product-cell > span { width: 38px; height: 38px; }
.product-cell strong { font-size: 12px; }
.product-cell small { font-size: 10px; }
.form-section-title { padding: 8px 9px; }
.form-section-title strong { font-size: 12px; }
.form-section-title span { font-size: 10px; }
.product-image-controls strong { font-size: 12px; }
.product-image-controls p { font-size: 10px; }
.inventory-current { padding: 9px; }

/* Compras / líneas editables */
.purchase-line { padding: 7px; gap: 7px; }
.purchase-line .form-control { height: 35px; }
.report-filter-card { padding: 9px; }
.report-filters .form-label { margin-bottom: 4px; }

/* Configuración, permisos y administración técnica */
.settings-card, .ops-health, .ops-section { padding: 12px; }
.settings-card { gap: 11px; }
.settings-card h3, .ops-health h3, .ops-section h3 { font-size: 13px; }
.settings-card p, .ops-health p, .ops-section p { font-size: 10px; line-height: 1.4; }
.ops-kpis div { padding: 10px; }
.ops-kpis strong { font-size: 13px; }
.ops-kpis span { font-size: 10px; }
.danger-zone-head { padding: 12px; }
.danger-zone-grid div { padding: 10px 12px; }
.danger-zone-grid strong { font-size: 16px; }
.danger-zone-grid span { font-size: 10px; }
.permission-group-head { min-height: 48px; padding: 7px 9px; }
.permission-group-head h3 { font-size: 12px; }
.permission-group-head p { font-size: 10px; }
.permission-option { min-height: 48px; padding: 7px 9px; }
.permission-option strong { font-size: 11px; }
.permission-option small { font-size: 10px; }
.permissions-role-summary strong { font-size: 13px; }
.permissions-role-summary span { font-size: 10px; }

/* Dashboard: mantiene sus proporciones, sube solo la lectura secundaria */
.dashboard-page .classic-kpi .stat-label { font-size: 12px; }
.dashboard-page .classic-kpi .stat-value { font-size: 25px; }
.dashboard-page .classic-kpi .stat-foot { font-size: 10px; }
.alert-item strong, .activity-item strong { font-size: 11px; }
.alert-item span, .activity-item span { font-size: 10px; }
.activity-value { font-size: 11px; }

/* Caja: cards neutras, estilo dashboard, sin bloques flotantes extraños */
.cash-kpi-grid { gap: 8px; }
.cash-kpi-card { min-height: 92px; padding: 11px 13px; background: #f8f9fa; border-color: #a8b2bc; box-shadow: inset 0 1px #fff; }
.cash-kpi-copy { gap: 3px; }
.cash-kpi-copy span { font-size: 12px; }
.cash-kpi-copy strong { font-size: 20px; }
.cash-kpi-copy small { font-size: 10px; }
.cash-kpi-icon { right: 9px; bottom: 7px; color: rgba(63,91,117,.18); }
.cash-kpi-icon svg { width: 46px; height: 46px; }
.cash-session-head { min-height: 76px; padding: 11px 13px; }
.cash-session-head h2 { font-size: 18px; }
.cash-session-head p { font-size: 11px; }
.cash-balance-grid { gap: 7px; }
.cash-balance-grid article { min-height: 88px; padding: 9px; }
.cash-balance-grid article > div:first-child span { font-size: 12px; }
.cash-balance-grid article > div:first-child small { font-size: 10px; }
.cash-balance-grid article > strong { font-size: 17px; }
.cash-balance-detail { font-size: 10px; }
.cash-count-row { padding: 9px; }


/* Modales generales: se leen como diálogo Windows, no como panel comprimido */
.app-modal { font-size: 12px; }
.app-modal-small { width: min(640px, calc(100vw - 36px)); }
.app-modal-large { width: min(920px, calc(100vw - 36px)); }
.app-modal-wide { width: min(1180px, calc(100vw - 36px)); }
.modal-head { min-height: 44px; padding: 6px 8px 6px 11px; }
.modal-head h2 { font-size: 14px; }
.modal-head p { font-size: 10px; }
.modal-head .btn-icon { min-height: 29px; width: 29px; }
.modal-body { padding: 11px; }
.modal-foot { min-height: 48px; padding: 6px 8px; }
.modal-foot .btn { min-height: 35px; }
.confirmation-copy { margin: 4px 0; font-size: 12px; line-height: 1.5; }

/* Menú del usuario: menú clásico visible por encima de módulos */
.desktop-user-menu .user-dropdown { min-width: 255px; }
.dropdown-info strong { font-size: 12px; }
.dropdown-info span, .dropdown-shortcut { font-size: 10px; }
.dropdown-action { min-height: 36px; font-size: 11px; }

/* Toasts y ayudas */
.toast { padding: 8px 9px; }
.toast strong { font-size: 11px; }
.toast p { font-size: 10px; }
.shortcut-help-grid kbd { font-size: 10px; }
.shortcut-help-dialog > footer { font-size: 10px; }
.module-hotkey, #route-view button[data-create]::after, #route-view button[data-admin-create]::after, #route-view button[data-refresh]::after, #route-view button[data-admin-refresh]::after, #route-view button[data-cash-refresh]::after, #dashboard-refresh::after { font-size: 9px !important; }


/* Cabecera del ticket más limpia y con jerarquía de escritorio. */


/* El total pertenece a la misma barra de resumen: solo se destaca con contraste sutil. */


/* ========================================================================
   LICOFULL POS · ESTILO CANÓNICO
   Única fuente de estilos para Ventas/POS y su checkout.
   Reemplaza todos los estilos POS heredados y duplicados anteriores.
   ======================================================================== */

/* Modo POS independiente */
body.pos-mode { overflow: hidden; }
.desktop-shell.pos-mode .desktop-titlebar,
.desktop-shell.pos-mode .desktop-module-strip,
.desktop-shell.pos-mode .desktop-subtab-strip,
.desktop-shell.pos-mode .desktop-statusbar { display: none; }
.desktop-shell.pos-mode .desktop-main-area { min-height: 100vh; height: 100vh; }
.desktop-shell.pos-mode .desktop-workspace { height: 100vh; padding: 6px; overflow: auto; background: #d3d8de; }

/* Estructura general */
.pos-page { display: grid; gap: 7px; min-width: 1180px; min-height: calc(100vh - 12px); }
.pos-toolbar { min-height: 48px; margin: 0 !important; padding: 6px 8px; }
.pos-toolbar h2 { font-size: 17px !important; }
.pos-toolbar p { font-size: 10px !important; }
.pos-toolbar .toolbar-actions { gap: 6px; flex-wrap: nowrap; }
.pos-toolbar .btn-primary { background: #2d66a3; border-color: #234f7e; }
.pos-toolbar .btn-primary:hover:not(:disabled) { background: #255689; }

.pos-operator-chip,
.pos-cash-chip {
    min-height: 34px;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #aebbc7;
    border-radius: 2px;
    box-shadow: inset 0 1px #fff;
    text-align: left;
}
.pos-operator-chip { color: #26323e; background: #eef3f7; }
.pos-operator-chip svg,
.pos-cash-chip svg { width: 15px; height: 15px; flex: 0 0 auto; }
.pos-operator-chip svg { color: #386c9f; }
.pos-operator-chip span,
.pos-cash-chip > div { display: grid; line-height: 1.05; }
.pos-operator-chip small { color: #6a7580; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.pos-operator-chip strong { margin-top: 2px; color: #1f2d3a; font-size: 11px; white-space: nowrap; }
.pos-cash-chip strong { font-size: 10px; }
.pos-cash-chip span { margin-top: 2px; font-size: 8px; }
.pos-cash-chip.is-open { color: #23613d; background: #edf7ef; border-color: #b9d8c4; }
.pos-cash-chip.is-closed { color: #873737; background: #fff1ef; border-color: #e5b9b3; cursor: pointer; }

.pos-workspace {
    min-width: 1120px;
    display: grid;
    grid-template-columns: minmax(350px, .78fr) minmax(720px, 1.42fr);
    gap: 7px;
    align-items: stretch;
}
.pos-catalog-panel,
.pos-cart-panel {
    min-height: 515px;
    height: calc(100vh - 232px);
    overflow: hidden;
    border-radius: 2px;
}

/* Catálogo de productos */
.pos-catalog-panel { display: flex; flex-direction: column; }
.pos-search-bar {
    flex: 0 0 44px;
    min-height: 44px;
    padding: 5px 7px;
    display: grid;
    grid-template-columns: 18px minmax(0,1fr) auto;
    align-items: center;
    gap: 6px;
    background: #e9edf1;
    border-bottom: 1px solid #aeb7c1;
}
.pos-search-bar svg { width: 16px; height: 16px; color: #2d66a3; }
.pos-search-bar input { width: 100%; border: 0; outline: 0; background: transparent; color: #20262c; font-size: 13px; font-weight: 600; }
.pos-search-bar kbd { padding: 2px 5px; color: #66717b; background: #fff; border: 1px solid #b4bdc6; border-radius: 2px; font-size: 8px; }
.pos-catalog-meta {
    flex: 0 0 28px;
    min-height: 28px;
    padding: 5px 7px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #66717c;
    background: #f5f6f7;
    border-bottom: 1px solid #c2c9cf;
    font-size: 9px;
}
#pos-products { min-height: 0; flex: 1 1 auto; overflow: hidden; background: #f2f4f6; }
.pos-product-list { height: 100%; padding: 4px; display: grid; align-content: start; gap: 3px; overflow-y: auto; }
.pos-product-card.pos-product-row {
    min-height: 68px;
    width: 100%;
    padding: 0;
    display: grid;
    grid-template-columns: 52px minmax(170px,1fr) 96px 86px;
    align-items: stretch;
    overflow: hidden;
    color: #21272d;
    background: #fff;
    border: 1px solid #c0c7ce;
    border-radius: 2px;
    box-shadow: none;
    text-align: left;
    transition: none;
}
.pos-product-card.pos-product-row:hover:not(:disabled) { background: #e7f0f8; border-color: #6f8daa; }
.pos-product-card.pos-product-row:focus-visible { outline: 2px solid #2b76b7; outline-offset: -2px; }
.pos-product-card.is-unavailable { opacity: .52; cursor: not-allowed; }
.pos-product-image { min-height: 66px; height: 100%; display: grid; place-items: center; overflow: hidden; color: #2d66a3; background: #f0f2f4; border-right: 1px solid #d5dbe0; }
.pos-product-image img,
.pos-product-image > span { width: 100%; height: 100%; display: grid; place-items: center; object-fit: contain; }
.pos-product-image svg { width: 20px; height: 20px; }
.pos-product-copy { min-width: 0; padding: 7px 8px; display: flex; flex-direction: column; justify-content: center; }
.pos-product-name { min-width: 0; display: flex; align-items: center; gap: 5px; }
.pos-product-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.pos-product-copy small { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #66717c; font-size: 9px; }
.night-price { display: inline-flex; align-items: center; gap: 3px; color: #7a5714; font-size: 9px; }
.night-price svg { width: 10px; height: 10px; }
.pos-product-stock,
.pos-product-price { padding: 6px; display: flex; flex-direction: column; justify-content: center; text-align: right; border-left: 1px solid #d5dbe0; }
.pos-product-stock small,
.pos-product-price small { color: #69747e; font-size: 8px; }
.pos-product-stock strong { margin-top: 3px; font-size: 11px; }
.pos-product-price strong { margin-top: 3px; color: #1c5e38; font-size: 14px; }

/* Ticket */
.pos-cart-panel { display: flex; flex-direction: column; position: static; background: #f2f4f6; }
.pos-cart-head {
    flex: 0 0 50px;
    min-height: 50px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #dfe6ed;
    border-bottom: 1px solid #94a4b3;
}
.pos-ticket-heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pos-ticket-label { flex: 0 0 auto; padding: 4px 7px; color: #285a88; background: #edf4fa; border: 1px solid #9ec3df; border-radius: 2px; font-size: 9px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.pos-ticket-heading > div { min-width: 0; }
.pos-ticket-heading h3 { margin: 0 !important; color: #17232e; font-size: 14px !important; line-height: 1.1; }
.pos-ticket-heading small { display: block; margin-top: 2px; color: #65717c; font-size: 9px; }

.pos-customer-quick {
    flex: 0 0 64px;
    min-height: 64px;
    padding: 7px 10px 9px;
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    gap: 8px;
    background: #f2f4f6;
    border-bottom: 1px solid #aeb7c1;
}
.pos-customer-quick label { color: #58636e; font-size: 9px; font-weight: 700; }
.pos-customer-quick .form-control { height: 32px; margin-top: 4px; font-size: 12px; }

.pos-cart-scroll {
    min-height: 0;
    flex: 1 1 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f2f4f6;
}
.pos-ticket-content {
    min-height: 0;
    flex: 1 1 auto;
    padding: 10px 10px 8px;
    display: flex;
    overflow: hidden;
    background: #f2f4f6;
}
.pos-ticket-table-wrap,
.pos-ticket-empty {
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    background: #fff;
    border: 1px solid #aeb7c1;
}
.pos-ticket-empty { display: grid; place-items: center; }
.pos-ticket-empty .empty-state { min-height: 100%; padding: 18px; }

.pos-ticket-table { width: 100%; min-width: 760px; font-size: 11px; background: #fff; }
.pos-ticket-table th { height: 31px; padding: 5px 6px; color: #30373e; background: #dfe4e9; border-right: 1px solid #b6bec6; border-bottom: 1px solid #929da8; font-size: 10px; }
.pos-ticket-table td { height: 44px; padding: 5px 6px; background: #fff; border-right: 1px solid #d8dde2; border-bottom: 1px solid #d8dde2; vertical-align: middle; }
.pos-ticket-table tbody tr:nth-child(even) td { background: #fff; }
.pos-ticket-table tbody tr:hover td { background: #e7f0f8; }
.pos-ticket-table td:nth-child(2) { min-width: 190px; }
.pos-ticket-table .pos-ticket-input { width: 68px; height: 30px; margin-left: auto; padding: 0 5px; text-align: right; font-size: 11px; }
.pos-ticket-table .night-line { display: block; margin-top: 2px; color: #936500; font-size: 8px; }
.pos-remove-line { min-width: 62px; min-height: 28px; justify-content: center; }

.pos-ticket-table input[data-cart-discount] {
    width: 72px;
    padding: 0 20px 0 7px;
    text-align: center;
}

.pos-clear-cart {
    min-width: 82px;
    color: #922f2f;
    background: #fbeaea;
    border-color: #d7a2a2;
    font-weight: 800;
}
.pos-clear-cart svg { width: 14px; height: 14px; }
.pos-clear-cart:hover:not(:disabled) {
    color: #7e2424;
    background: #f6dcdc;
    border-color: #c98888;
}
.pos-clear-cart:disabled {
    color: #9b6f6f;
    background: #f4e8e8;
    border-color: #d8bcbc;
    opacity: .65;
}

.pos-fullscreen-button {
    width: 38px;
    min-width: 38px;
    padding: 0;
}
.pos-fullscreen-button svg { width: 17px; height: 17px; }

/* Resumen del ticket: seis celdas hermanas, una sola geometría */
.pos-cart-summary {
    flex: 0 0 auto;
    margin: 0 10px 10px;
    display: grid;
    grid-template-columns: .68fr .68fr 1.26fr .9fr .9fr 1.35fr;
    align-items: stretch;
    overflow: hidden;
    background: #e8ecef;
    border: 1px solid #9eabb7;
    border-radius: 2px;
}
.pos-summary-cell {
    min-width: 0;
    min-height: 64px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    color: #202a33;
    position: relative;
    background: #e8ecef;
    border-right: 0;
}
.pos-summary-cell:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: #b5bec7;
    pointer-events: none;
}
.pos-summary-cell span { color: #5d6873; font-size: 9px; line-height: 1.15; }
.pos-summary-cell strong { overflow: hidden; color: #18222c; font-size: 13px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.pos-global-discount { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.pos-global-discount span { min-width: 0; flex: 1 1 auto; padding-right: 2px; }
.pos-global-discount .form-control { width: 64px; min-width: 64px; height: 30px; padding: 0 20px 0 7px; text-align: center; font-size: 11px; font-weight: 700; }
.pos-grand-total { background: #dce4eb; border-left: 1px solid #78b5df; box-shadow: inset 0 0 0 1px #9fcbed; }
.pos-grand-total span { color: #315d83; font-weight: 800; }
.pos-grand-total strong { color: #173f68; font-size: clamp(22px, 2vw, 29px); text-align: right; }

.pos-charge-button {
    flex: 0 0 46px;
    min-height: 46px;
    width: calc(100% - 20px);
    margin: 0 10px 10px;
    color: #fff;
    background: #2d66a3;
    border: 1px solid #234f7e;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 700;
}
.pos-charge-button:hover:not(:disabled) { background: #255689; }
.pos-charge-button kbd { margin-left: 4px; padding: 1px 4px; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.45); border-radius: 2px; font: 9px Consolas, monospace; }

/* Historial */
.pos-sales-history { overflow: hidden; }
.pos-history-head { min-height: 39px; padding: 4px 6px; background: #e9edf1; border-bottom: 1px solid #aeb7c1; }
.pos-history-head h3 { margin: 0; font-size: 11px; }
.pos-sales-history .table-scroll { max-height: 190px; }

/* Checkout */
.app-modal-checkout {
    width: min(1140px, calc(100vw - 28px));
    max-height: calc(100vh - 24px);
}
.app-modal-checkout .modal-head,
.app-modal-checkout .modal-foot { flex: 0 0 auto; }
.app-modal-checkout .modal-body {
    min-height: 0;
    padding: 10px;
    overflow: hidden;
}
.app-modal-checkout .modal-foot { justify-content: flex-end; gap: 7px; }
.payment-form { min-height: 0; display: block; }

/*
 * Layout estructural 1.6.2
 *
 * CSS Grid define de forma natural una sola fila cuya altura es la del
 * contenido mas alto. Por eso main y aside nacen siempre simetricos.
 * La fila puede crecer hasta el limite util del viewport. Cuando el lado
 * izquierdo necesita mas espacio, el grid ya no crece y el overflow queda
 * exclusivamente en checkout-main-scroll.
 *
 * No existe calculo de altura por JavaScript ni alturas inline persistentes.
 */
.checkout-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(290px, .8fr);
    gap: 12px;
    align-items: stretch;
}
.checkout-main,
.checkout-aside {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    overflow: hidden;
}
.checkout-main {
    max-height: calc(100vh - 138px);
}

/*
 * Unico viewport desplazable del lado operativo.
 * El padding derecho crea separacion real entre los formularios y la barra.
 */
.checkout-main-scroll {
    flex: 1 1 auto;
    min-height: 0;
    padding-right: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
.checkout-main-content {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}
.checkout-aside-content {
    flex: 1 1 auto;
    min-height: 100%;
    display: grid;
    gap: 10px;
    align-content: start;
}
.checkout-block { min-width: 0; padding: 11px; border: 1px solid #aeb8c2; background: #f7f8f9; }
.checkout-block-title { margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.checkout-block-title strong { display: block; font-size: 14px; }
.checkout-block-title small { display: block; margin-top: 1px; color: #66717c; font-size: 11px; }
.checkout-step { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; color: #fff; background: #386c9f; border: 1px solid #28547d; border-radius: 2px; font-size: 12px; font-weight: 800; }
.checkout-condition-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.checkout-credit-grid { margin-top: 8px; padding-top: 8px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; border-top: 1px solid #cbd1d7; }
.checkout-payment-section { min-height: 0; flex: 1 1 auto; padding: 0; border: 1px solid #9faab5; border-radius: 2px; background: #fff; }
.checkout-payment-section .section-head { min-height: 48px; padding: 7px 9px; background: #e8edf2; }
.checkout-payment-presets { padding: 9px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; background: #f7f8fa; border-top: 1px solid #cbd2d8; border-bottom: 1px solid #c3cbd2; }
.checkout-payment-preset { min-height: 58px; padding: 8px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px solid; border-radius: 3px; cursor: pointer; font: inherit; transition: border-color .12s ease, box-shadow .12s ease, filter .12s ease; }
.checkout-payment-preset span { font-size: 14px; font-weight: 900; letter-spacing: .02em; }
.checkout-payment-preset small { font-size: 10px; font-weight: 600; opacity: .82; }
.checkout-payment-preset.is-cash { color: #235d3c; background: #eaf6ee; border-color: #9fc9ae; }
.checkout-payment-preset.is-qr { color: #245983; background: #eaf2f9; border-color: #9fbed8; }
.checkout-payment-preset.is-mixed { color: #79520e; background: #fff4d9; border-color: #d9bd76; }
.checkout-payment-preset:hover:not(:disabled) { filter: brightness(.98); }
.checkout-payment-preset.is-active { border-width: 2px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 0 0 2px rgba(56,108,159,.12); }
.checkout-payment-preset:disabled { cursor: not-allowed; opacity: .45; filter: grayscale(.45); }
.checkout-payment-empty { margin: 8px; padding: 13px 12px; color: #5a6671; background: #f5f7f9; border: 1px dashed #b7c0c9; text-align: center; font-size: 11px; }
.checkout-payment-empty[hidden] { display: none; }
.checkout-section-heading { display: flex; align-items: center; gap: 8px; }
.checkout-section-heading h3 { margin: 0; font-size: 14px; }
.checkout-section-heading p { margin: 1px 0 0; font-size: 11px; }
.checkout-payment-header { display: grid; grid-template-columns: 1.2fr .85fr 1.05fr 86px; gap: 7px; padding: 5px 8px; color: #53606c; background: #f2f4f6; border-top: 1px solid #cbd2d8; border-bottom: 1px solid #c3cbd2; font-size: 11px; font-weight: 700; }
#payment-rows { margin: 0; padding: 7px; display: grid; gap: 6px; }
.payment-row { display: grid; grid-template-columns: 1.2fr .85fr 1.05fr 86px; gap: 7px; align-items: end; padding: 0; border: 0; background: transparent; }
.payment-row label { color: #596570; font-size: 10px; font-weight: 700; }
.payment-row label > .form-control { margin-top: 3px; }
.payment-cell { min-width: 0; }
.payment-extra-cell { min-height: 38px; display: flex; align-items: end; gap: 6px; }
.payment-extra-cell > label { width: 100%; min-width: 0; }
.payment-extra-cell > label[hidden] { display: none !important; }
.payment-extra-empty { width: 100%; height: 38px; display: flex; align-items: center; justify-content: center; color: #89939d; background: #f5f7f8; border: 1px solid #d0d6db; font-size: 12px; }
.payment-extra-empty[hidden] { display: none !important; }
.payment-action-cell { min-height: 38px; display: flex; align-items: end; }
.payment-row .form-control { height: 38px; font-size: 13px; }
.payment-row [data-pay-amount],
.payment-row [data-pay-received] { font-size: 15px; font-weight: 700; text-align: right; }
.payment-row .table-action { width: 100%; min-height: 38px; justify-content: center; }
.checkout-side-panel { padding: 10px; border: 1px solid #aeb8c2; background: #f7f8f9; }
.checkout-side-head { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.checkout-side-head strong { display: block; font-size: 14px; }
.checkout-side-head small { display: block; color: #66717c; font-size: 11px; }
.checkout-summary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.checkout-summary-grid > div { min-height: 84px; padding: 12px 12px 10px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid #b6c1cb; border-radius: 2px; }
.checkout-summary-card span { font-size: 11px; font-weight: 700; }
.checkout-summary-card strong { margin-top: 10px; font-size: 26px; line-height: 1; }
.checkout-summary-card.is-sale { color: #244f7c; background: #edf3fb; border-color: #bfd1ea; }
.checkout-summary-card.is-sale span { color: #476c92; }
.checkout-summary-card.is-paid { color: #1f5e3f; background: #edf7ef; border-color: #bfd7c3; }
.checkout-summary-card.is-paid span { color: #4b7d61; }
.checkout-summary-card.is-balance { color: #8a5f0f; background: #fff6df; border-color: #e6d08a; }
.checkout-summary-card.is-balance span { color: #9a762d; }
.checkout-summary-card.is-change { color: #1e6760; background: #ecf7f5; border-color: #bad8d2; }
.checkout-summary-card.is-change span { color: #4a837d; }
.checkout-side-note { margin-top: 10px; padding: 9px 10px; color: #5a6671; background: #eef2f5; border: 1px solid #ccd3d9; font-size: 11px; }
.checkout-note-secondary { background: #f3f5f7; border-color: #c4cbd2; }
.checkout-note-secondary .checkout-block-title { margin-bottom: 7px; }
.checkout-note { min-height: 62px; resize: vertical; }
.checkout-optional-badge { min-width: 54px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; color: #596570; background: #e5e9ed; border: 1px solid #b6bec6; border-radius: 2px; font-size: 10px; font-weight: 700; }
.checkout-error { margin: 0; padding: 0 2px; }
.checkout-error:empty { display: none; }
.checkout-submit { min-width: 220px; font-size: 12px; }

/* Separación visible entre el contenido y el scrollbar del lado izquierdo. */
.checkout-main-scroll::-webkit-scrollbar { width: 10px; }
.checkout-main-scroll::-webkit-scrollbar-track { background: #edf1f4; border-left: 1px solid #c8d0d7; }
.checkout-main-scroll::-webkit-scrollbar-thumb { background: #9da9b4; border: 2px solid #edf1f4; }
.checkout-main-scroll::-webkit-scrollbar-thumb:hover { background: #7f8d99; }

@media (max-width: 980px) {
    .app-modal-checkout .modal-body { overflow-y: auto; }
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-main,
    .checkout-aside { max-height: none; overflow: visible; }
    .checkout-main-scroll { padding-right: 0; overflow: visible; scrollbar-gutter: auto; }
    .checkout-main-content,
    .checkout-aside-content { min-height: 0; }
    .checkout-payment-presets { grid-template-columns: 1fr; }
    .checkout-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .checkout-payment-header { display: none; }
    .payment-row { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 8px; border: 1px solid #c0c8cf; }
    .payment-row .table-action { grid-column: auto; width: auto; justify-self: start; }
}

/* Comprobante */
.receipt-preview { max-width: 390px; margin: auto; color: #1d241f; font-size: 11px; }
.receipt-preview header,
.receipt-preview footer { display: grid; gap: 3px; text-align: center; }
.receipt-preview header strong { font-size: 16px; }
.receipt-preview header small,
.receipt-preview header span,
.receipt-preview footer { color: #69747e; }
.receipt-info,
.receipt-payments { margin: 13px 0; display: grid; gap: 4px; }
.receipt-preview table { width: 100%; border-collapse: collapse; }
.receipt-preview th,
.receipt-preview td { padding: 7px 3px; border-bottom: 1px dashed #bfc8c1; text-align: left; }
.receipt-preview th:last-child,
.receipt-preview td:last-child { text-align: right; }
.receipt-totals { margin: 13px 0; display: grid; gap: 5px; text-align: right; }
.receipt-totals span { display: flex; justify-content: space-between; }
.receipt-totals > strong { padding-top: 7px; border-top: 1px solid #c6cdd3; font-size: 17px; }

@media (max-width: 1220px) {
    .pos-page { min-width: 1080px; }
    .pos-workspace { min-width: 1080px; grid-template-columns: 350px 730px; }
    .pos-cart-summary { grid-template-columns: .62fr .62fr 1.2fr .9fr .9fr 1.32fr; }
}
@media (max-width: 980px) {
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-payment-presets { grid-template-columns: 1fr; }
    .checkout-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .checkout-payment-header { display: none; }
    .payment-row { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 8px; border: 1px solid #c0c8cf; }
    .payment-row .table-action { width: auto; justify-self: start; }
}


/* ===== Correcciones finales POS: líneas, botones y modal ===== */
.pos-ticket-table tbody tr > td {
    border-bottom: 1px solid #bcc7d1 !important;
}
.pos-ticket-table tbody tr:last-child > td {
    border-bottom: 1px solid #bcc7d1 !important;
}
.pos-ticket-table tbody tr:hover > td {
    background: #e7f0f8 !important;
}
.pos-clear-cart {
    min-width: 94px;
    color: #8f2525 !important;
    background: #fbe3e3 !important;
    border-color: #cf8c8c !important;
    font-weight: 800 !important;
}
.pos-clear-cart:hover:not(:disabled) {
    color: #781b1b !important;
    background: #f5cfcf !important;
    border-color: #bd7070 !important;
}
.pos-clear-cart .pos-clear-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}
.pos-fullscreen-button {
    width: 38px;
    min-width: 38px;
    height: 34px;
    padding: 0;
    color: #2f5f93;
    background: #f5f7f9;
    border: 1px solid #9da9b4;
}
.pos-fullscreen-button:hover {
    color: #fff;
    background: #2f6ca8;
    border-color: #245580;
}
.pos-fullscreen-button svg {
    width: 17px;
    height: 17px;
    display: block;
}
.modal-close-button {
    width: 30px !important;
    min-width: 30px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    color: #2b333a !important;
    background: #f5f6f7 !important;
    border: 1px solid #929da8 !important;
    font-size: 22px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
}
.modal-close-button:hover {
    color: #fff !important;
    background: #b04444 !important;
    border-color: #843131 !important;
}
/* ===== Usuario conectado estatico Â· barra superior ===== */
.desktop-user-static {
    height: 100%;
    min-width: 150px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    color: #20262c;
    background: #eef1f4;
    border-left: 1px solid #c0c7ce;
    font-size: 13px;
    white-space: nowrap;
    cursor: default;
    user-select: none;
}
.desktop-user-static-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    color: #315f91;
    background: #e2ebf4;
    border: 1px solid #b6c8da;
    border-radius: 3px;
}
.desktop-user-static-icon svg {
    width: 16px;
    height: 16px;
}
.desktop-user-static strong {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 700;
}
@media (max-width: 1180px) {
    .desktop-user-static {
        min-width: 128px;
        padding: 0 10px;
    }
}

/* ============================================================
   LicoFULL 1.4.1 — Primera configuración e intercambio de datos
   ============================================================ */
.is-hidden { display: none !important; }

.setup-page {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    padding: 22px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #d8dde3;
    color: #20262c;
    font-family: inherit;
}
.setup-brand {
    width: min(1040px, 100%);
    min-height: 50px;
    margin: 0 auto 12px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: #eaf0f5;
    border: 1px solid #89949f;
    box-shadow: inset 0 1px #fff, 0 1px 2px rgba(0,0,0,.12);
}
.setup-brand .brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #225c43;
    border: 1px solid #174431;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 800;
}
.setup-brand strong, .setup-brand span { display: block; }
.setup-brand strong { font-size: 15px; }
.setup-brand span { margin-top: 1px; color: #65707a; font-size: 10px; }
.setup-page > .card {
    width: min(1040px, 100%);
    margin: 0 auto;
    border: 1px solid #909ba6;
    border-radius: 3px;
    box-shadow: 0 3px 12px rgba(28,35,42,.15), inset 0 1px #fff;
}
.setup-welcome { padding: 30px; }
.setup-welcome .eyebrow, .setup-card .eyebrow {
    margin: 0 0 4px;
    color: #28654b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.setup-welcome h1 { margin: 0 0 7px; font-size: 23px; }
.setup-welcome > p:not(.eyebrow) { margin: 0; color: #606a74; font-size: 12px; }
.setup-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.setup-choice {
    min-height: 150px;
    padding: 18px;
    display: grid;
    grid-template-columns: 42px 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 13px;
    text-align: left;
    color: #222a31;
    background: #f8f9fa;
    border: 1px solid #a8b1bb;
    border-radius: 3px;
    box-shadow: inset 0 1px #fff;
    cursor: pointer;
}
.setup-choice:hover { background: #edf4ef; border-color: #4f7b65; }
.setup-choice-icon { grid-row: 1 / span 2; width: 42px; height: 42px; display: grid; place-items: center; background: #dce9e2; border: 1px solid #aec8b9; border-radius: 3px; color: #225c43; }
.setup-choice-icon svg { width: 21px; height: 21px; }
.setup-choice strong { align-self: end; font-size: 15px; }
.setup-choice small { margin-top: 4px; color: #65707a; font-size: 11px; line-height: 1.45; }
.setup-card { padding: 0; overflow: hidden; }
.setup-card-head { padding: 9px 11px; display: flex; align-items: flex-start; gap: 10px; background: #e5eaf0; border-bottom: 1px solid #9da7b1; }
.setup-card-head h2 { margin: 0; font-size: 17px; }
.setup-card-head p:not(.eyebrow) { margin: 2px 0 0; color: #66717c; font-size: 10px; }
.setup-form { padding: 13px; }
.setup-form fieldset { margin: 0 0 11px; padding: 11px; border: 1px solid #b6bec7; background: #fbfbfc; }
.setup-form legend { padding: 0 6px; color: #2d363e; font-size: 11px; font-weight: 800; }
.setup-radio-row, .setup-check-grid { display: grid; gap: 7px 14px; }
.setup-radio-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setup-check-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.setup-radio-row label, .setup-check-grid label { padding: 8px; display: flex; align-items: center; gap: 7px; background: #f1f3f5; border: 1px solid #c3cad1; border-radius: 2px; font-size: 11px; }
.setup-check-grid small { display: block; color: #6b747d; }
.setup-actions { padding-top: 7px; display: flex; justify-content: flex-end; gap: 7px; }
.setup-package-info { margin: 8px 0; padding: 10px; display: grid; gap: 3px; background: #eef3f0; border: 1px solid #b5c5bb; font-size: 11px; }
.setup-success { padding: 32px; text-align: center; }
.setup-success-icon { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; color: #fff; background: #236247; border-radius: 50%; }
.setup-success-icon svg { width: 25px; height: 25px; }
.setup-success h2 { margin: 0 0 6px; font-size: 21px; }
.setup-success p { color: #606a74; font-size: 12px; }
.setup-success dl { width: min(520px, 100%); margin: 18px auto; border: 1px solid #b6bec7; }
.setup-success dl div { padding: 8px 10px; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid #d2d7dc; text-align: left; }
.setup-success dl div:last-child { border-bottom: 0; }
.setup-success dt { color: #65707a; font-size: 10px; }
.setup-success dd { margin: 0; font-size: 11px; font-weight: 700; }
.setup-warning { padding: 8px; background: #fff5cf; border: 1px solid #dac568; color: #685510 !important; }

.transfer-section { margin-bottom: 10px; }
.transfer-section h4 { margin: 0 0 4px; font-size: 12px; }
.transfer-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 10px; }
.transfer-panel { padding: 10px; border: 1px solid #b6bec7; background: #f9fafb; }
.transfer-form { margin-top: 8px; }
.muted-copy.compact { margin: 3px 0 7px; padding: 0; font-size: 10px; }
.transfer-checks { display: grid; gap: 5px; }
.transfer-checks label { padding: 7px 8px; display: grid; grid-template-columns: 16px 1fr; align-items: start; column-gap: 6px; background: #f0f2f4; border: 1px solid #c4cbd2; font-size: 10px; }
.transfer-checks input { grid-column: 1; grid-row: 1 / span 2; margin-top: 1px; }
.transfer-checks strong { grid-column: 2; font-size: 11px; }
.transfer-checks small { grid-column: 2; color: #68727b; font-size: 9px; }
.transfer-actions, .transfer-export-buttons { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.transfer-note { margin-top: 9px; padding: 8px 9px; color: #4e5962; background: #edf1f4; border: 1px solid #bdc6ce; font-size: 10px; line-height: 1.45; }
.transfer-preview { margin-top: 8px; padding: 8px; min-height: 42px; background: #fff; border: 1px solid #c5cbd1; font-size: 10px; overflow: auto; }
.transfer-preview > p { margin: 0; color: #68727b; }
.analysis-summary { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.analysis-summary span { padding: 4px 6px; background: #eef1f4; border: 1px solid #c7cdd3; }
.analysis-summary .ok { background: #e6f2ea; border-color: #b4d0be; color: #25573d; }
.analysis-summary .bad { background: #f9e5e5; border-color: #d9adad; color: #8b2f2f; }
.analysis-table { max-height: 240px; }
.analysis-table .data-table { min-width: 760px; }
.analysis-table .row-error td { background: #fff1f1; }
.import-result { display: grid; gap: 5px; }
.import-result > strong { color: #225c43; }
.import-result ul { margin: 2px 0 0 16px; padding: 0; }
.full-restore-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.package-valid { display: grid; gap: 2px; color: #275d43; }
.package-valid span { color: #5e6962; }

@media (max-width: 780px) {
    .setup-page { padding: 10px; }
    .setup-choice-grid, .transfer-grid, .full-restore-grid, .setup-check-grid, .setup-radio-row { grid-template-columns: 1fr; }
    .setup-welcome { padding: 18px; }
}

/* === VALIDACION CAMPOS REQUERIDOS / INVALIDOS === */
input:required:invalid,
select:required:invalid,
textarea:required:invalid,
.form-control:required:invalid,
.form-select:required:invalid,
input.form-control:invalid,
select.form-control:invalid,
textarea.form-control:invalid,
input.form-select:invalid,
select.form-select:invalid,
textarea.form-select:invalid {
    border-color: #d96b76 !important;
    box-shadow: none !important;
    background-image: none !important;
}

input:required:invalid:focus,
select:required:invalid:focus,
textarea:required:invalid:focus,
.form-control:required:invalid:focus,
.form-select:required:invalid:focus,
input.form-control:invalid:focus,
select.form-control:invalid:focus,
textarea.form-control:invalid:focus,
input.form-select:invalid:focus,
select.form-select:invalid:focus,
textarea.form-select:invalid:focus {
    border-color: #c95764 !important;
    box-shadow: 0 0 0 2px rgba(217, 107, 118, 0.18) !important;
    outline: none !important;
}

input:required:invalid::placeholder,
textarea:required:invalid::placeholder,
.form-control:required:invalid::placeholder {
    color: #b06c72 !important;
}

input[type="checkbox"]:required:invalid,
input[type="radio"]:required:invalid {
    outline: 2px solid rgba(217, 107, 118, 0.45);
    outline-offset: 2px;
}



/* === ESTADO DE VALIDACION DE PAQUETES === */
.btn-validation-ok,
.btn-validation-ok:disabled {
    color: #fff;
    background: #2f7d4f;
    border-color: #245f3d;
    opacity: 1;
    cursor: default;
    box-shadow: inset 0 1px rgba(255,255,255,.18);
}
.btn-validation-ok svg { width: 16px; height: 16px; }
.package-valid strong { display: inline-flex; align-items: center; gap: 5px; }
.package-valid strong svg { width: 14px; height: 14px; }

/* ========================================================================
   LICOFULL UX-1 · FUNDAMENTOS GLOBALES
   Legibilidad, foco, controles, tablas, modales, errores y notificaciones.
   No reorganiza navegación ni módulos funcionales.
   ======================================================================== */
:root {
    --control-height: 38px;
    --ux-focus: #1769aa;
    --ux-focus-ring: rgba(23, 105, 170, .22);
}

body { font-size: 13px; }

/* Controles de uso diario: más fáciles de leer y seleccionar sin perder densidad. */
.btn {
    min-height: 38px;
    padding: 0 13px;
    gap: 7px;
    font-size: 13px;
    line-height: 1.15;
}
.btn-small { min-height: 34px; font-size: 12px; }
.btn-icon { width: 38px; min-width: 38px; padding: 0; }
.btn svg { width: 16px; height: 16px; }

.form-label { font-size: 13px; line-height: 1.25; }
.form-control {
    min-height: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 13px;
    line-height: 1.25;
}
.form-textarea { min-height: 82px; height: auto; padding-top: 8px; padding-bottom: 8px; line-height: 1.4; }
.field-help { margin-top: 4px; font-size: 11px; line-height: 1.4; }
.form-error { min-height: 18px; margin-top: 5px; font-size: 12px; line-height: 1.4; }
.field-error { display: block; margin-top: 4px; color: #9a3030; font-size: 12px; font-weight: 600; line-height: 1.35; }
.field-error:empty { display: none; }
.form-field.has-error .form-label { color: #8f2d2d; }
.form-field.has-error .form-control,
.form-control[aria-invalid="true"] { border-color: #a63b3b !important; box-shadow: 0 0 0 2px rgba(166,59,59,.15) !important; }

/* Foco inequívoco para teclado sin sustituir el estilo clásico. */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--ux-focus);
    outline-offset: 2px;
}
.form-control:focus-visible {
    outline: 0;
    border-color: var(--ux-focus);
    box-shadow: 0 0 0 3px var(--ux-focus-ring);
}

/* Jerarquía compartida de páginas. */
.page-toolbar { min-height: 58px; padding: 8px 10px; gap: 10px; }
.page-toolbar h2, .page-toolbar-copy h2 { font-size: 18px !important; }
.page-toolbar p, .page-toolbar-copy p { font-size: 13px !important; line-height: 1.35 !important; }
.toolbar-actions { gap: 6px; }
.card-head { min-height: 40px; padding: 7px 10px; }
.card-head h3, .section-head h3 { font-size: 14px; }
.section-head p, .info-banner span { font-size: 12px; }
.detail-grid span { font-size: 11px; }
.detail-grid strong { font-size: 13px; }

/* Estados legibles por texto + forma; el color es apoyo, no la única señal. */
.badge {
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
}
.badge-success { border: 1px solid #9ac5a9; }
.badge-warning { border: 1px solid #d2b96b; }
.badge-danger { border: 1px solid #d6a0a0; }
.badge-info { border: 1px solid #9dbed4; }
.badge-muted { border: 1px solid #c4cbd0; }

/* Tablas siguen siendo densas, pero dejan de usar texto de 9–10 px como lectura normal. */
.data-table { font-size: 13px; }
.data-table th { height: 36px; padding: 7px 9px; font-size: 12px; line-height: 1.25; }
.data-table td { min-height: 36px; padding: 7px 9px; font-size: 13px; line-height: 1.35; }
.data-table td > small { margin-top: 2px; font-size: 11px; line-height: 1.3; }
.data-table code { font-size: 11px; }
.table-actions, .inline-actions { gap: 4px; }
.table-action { min-height: 32px; padding: 0 8px; gap: 5px; font-size: 12px; }
.table-action svg { width: 14px; height: 14px; }
.admin-filters { min-height: 56px; padding: 8px 10px; gap: 8px; }
.admin-filters form { gap: 6px; }
.records-count { font-size: 12px; }
.pagination { min-height: 46px; padding: 6px 10px; font-size: 12px; }

/* Modales: lectura cómoda, viewport seguro, foco atrapado y cierre deliberado si hay cambios. */
.modal-backdrop { padding: 12px; }
.app-modal {
    max-height: calc(100vh - 24px);
    font-size: 13px;
}
.app-modal-small { width: min(640px, calc(100vw - 24px)); }
.app-modal-large { width: min(920px, calc(100vw - 24px)); }
.app-modal-wide { width: min(1180px, calc(100vw - 24px)); }
.modal-head { min-height: 54px; padding: 8px 10px 8px 13px; }
.modal-head h2 { font-size: 17px; line-height: 1.2; }
.modal-head p { margin-top: 3px; font-size: 12px; line-height: 1.3; }
.modal-head .btn-icon { min-height: 38px; width: 38px; }
.modal-body { padding: 14px; }
.modal-foot { min-height: 56px; padding: 8px 10px; gap: 7px; }
.modal-foot .btn { min-height: 38px; }
.confirmation-copy { margin: 3px 0; font-size: 13px; line-height: 1.55; }

.modal-discard-guard {
    position: absolute;
    inset: 0;
    z-index: 5;
    padding: 16px;
    display: grid;
    place-items: center;
    background: rgba(25, 31, 37, .55);
}
.discard-dialog {
    width: min(520px, 100%);
    padding: 16px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px 12px;
    color: #20262c;
    background: #fff;
    border: 1px solid #6e7882;
    border-radius: 3px;
    box-shadow: 0 10px 32px rgba(0,0,0,.3);
}
.discard-dialog-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #704c00;
    background: #fff0bd;
    border: 1px solid #d0ad4d;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 800;
}
.discard-dialog-copy h3 { margin: 1px 0 4px; font-size: 16px; }
.discard-dialog-copy p { margin: 0; color: #5d6670; font-size: 13px; line-height: 1.45; }
.discard-dialog-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 7px; padding-top: 4px; }

/* Notificaciones: tiempo y tamaño suficientes para lectura normal. */
.toast-region { width: min(430px, calc(100vw - 20px)); gap: 6px; }
.toast { padding: 10px 11px; gap: 9px; }
.toast strong { font-size: 13px; line-height: 1.25; }
.toast p { margin-top: 2px; font-size: 12px; line-height: 1.45; }
.toast-close { min-width: 32px; min-height: 32px; font-size: 18px; }

/* Legibilidad de chrome de escritorio sin cambiar aún su arquitectura de información. */
.desktop-module-tab { font-size: 13px; }
.desktop-subtabs-label { font-size: 11px; }
.desktop-subtab { font-size: 12px; }
.desktop-statusbar { font-size: 11px; }

@media (max-width: 1100px) {
    .page-toolbar { align-items: flex-start !important; }
    .page-toolbar p, .page-toolbar-copy p { max-width: 62ch; }
    .admin-filters { align-items: flex-start; flex-wrap: wrap; }
    .records-count { padding-top: 4px; }
}

@media (max-height: 760px) {
    .modal-backdrop { padding: 8px; }
    .app-modal { max-height: calc(100vh - 16px); }
    .modal-body { padding: 11px 13px; }
    .modal-head { min-height: 50px; }
    .modal-foot { min-height: 52px; }
}

/* ========================================================================
   LICOFULL UX-2 · NAVEGACIÓN + INICIO
   Menos áreas principales, subtabs contextuales e Inicio orientado a decisión.
   ======================================================================== */

/* Navegación: ocho áreas de negocio visibles, sin volver a un menú móvil/SaaS. */
.desktop-module-scroll {
    gap: 4px;
    padding: 6px 8px 0;
}
.desktop-module-tab {
    min-width: 92px;
    min-height: 40px;
    padding: 0 14px;
    gap: 8px;
    font-size: 13px;
}
.desktop-module-tab[data-area="administracion"] { min-width: 132px; }
.desktop-module-tab svg { width: 18px; height: 18px; }
.desktop-subtab-strip { min-height: 37px; padding-left: 10px; }
.desktop-subtabs-label { padding-right: 12px; color: #4f5963; }
.desktop-subtab { min-height: 31px; padding: 0 13px; font-size: 12px; }

/* La barra inferior deja de repetir usuario, rol, módulo, fecha y sucursal. */
.desktop-statusbar { min-height: 28px; }
.status-ready { font-weight: 600; }

/* Inicio: panel de decisión, no tablero de ocho métricas decorativas. */
.home-page { min-width: 0; }
.home-toolbar { min-height: 66px; }
.home-toolbar .page-toolbar-copy h2 { font-size: 21px !important; }
.home-toolbar .page-toolbar-copy p { font-size: 13px !important; }
.home-toolbar-actions { display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; }
.home-primary-action { min-height: 42px; padding-inline: 15px; font-size: 14px; }
.home-primary-action kbd { margin-left: 5px; }

.home-decision-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 9px;
}
.home-decision-card {
    position: relative;
    min-width: 0;
    min-height: 116px;
    padding: 13px 14px 12px 13px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    gap: 0 11px;
    color: #20262c;
    text-decoration: none;
    background: #f8f9fa;
    border: 1px solid #9fa9b3;
    border-left: 5px solid #6a7681;
    border-radius: 3px;
    box-shadow: inset 0 1px #fff;
}
a.home-decision-card:hover { background: #fff; border-color: #74808b; }
a.home-decision-card:focus-visible { outline-offset: 2px; }
.home-decision-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #42515f;
    background: #e5e9ed;
    border: 1px solid #bcc4cb;
    border-radius: 3px;
}
.home-decision-icon svg { width: 24px; height: 24px; }
.home-decision-copy { min-width: 0; display: flex; flex-direction: column; }
.home-decision-label { color: #555f69; font-size: 13px; font-weight: 700; }
.home-decision-value {
    margin-top: 3px;
    overflow: hidden;
    color: #182129;
    font-size: 26px;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-decision-detail { margin-top: 5px; color: #5b6670; font-size: 12px; line-height: 1.3; }
.home-decision-open {
    grid-column: 2;
    align-self: end;
    margin-top: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    color: #315f8b;
    font-size: 12px;
    font-weight: 700;
}
.home-decision-open svg { width: 15px; height: 15px; }
.home-decision-card.tone-primary { border-left-color: #2f67a1; }
.home-decision-card.tone-primary .home-decision-icon { color: #234f7b; background: #e2ebf5; border-color: #9fb6cd; }
.home-decision-card.tone-success { border-left-color: #287342; }
.home-decision-card.tone-success .home-decision-icon { color: #215f37; background: #e2f0e6; border-color: #a7c8b1; }
.home-decision-card.tone-warning { border-left-color: #a66b12; }
.home-decision-card.tone-warning .home-decision-icon { color: #775016; background: #fff0cf; border-color: #d7b66f; }
.home-decision-card.tone-danger { border-left-color: #b23b3b; }
.home-decision-card.tone-danger .home-decision-icon { color: #8d3030; background: #f6e1e1; border-color: #d4a0a0; }

.home-work-grid {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .8fr);
    gap: 9px;
}
.home-panel { min-width: 0; overflow: hidden; }
.home-panel-head { min-height: 58px; align-items: center; }
.home-panel-head > div { min-width: 0; }
.home-panel-head h3 { margin: 0; font-size: 15px; }
.home-panel-head p { margin: 3px 0 0; color: #606a74; font-size: 12px; line-height: 1.3; }
.home-panel .card-body { padding: 8px; }

.home-alert-list, .home-activity-list { display: grid; gap: 6px; }
.home-alert-row {
    min-width: 0;
    min-height: 58px;
    padding: 7px 8px;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    color: #252c33;
    text-decoration: none;
    background: #fafbfc;
    border: 1px solid #c2c9d0;
    border-radius: 2px;
}
a.home-alert-row:hover { background: #fff; border-color: #8f9aa5; }
.home-alert-state {
    min-height: 25px;
    padding: 5px 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    border: 1px solid #a7afb7;
    border-radius: 2px;
}
.home-alert-state.state-danger { color: #7e2828; background: #f8e2e2; border-color: #d3a0a0; }
.home-alert-state.state-warning { color: #6e4c09; background: #fff0c8; border-color: #d6b46a; }
.home-alert-state.state-info { color: #28567e; background: #e4eef7; border-color: #a6bdd2; }
.home-alert-copy { min-width: 0; }
.home-alert-copy strong { display: block; font-size: 13px; line-height: 1.25; }
.home-alert-copy span { display: block; margin-top: 2px; color: #606a74; font-size: 12px; line-height: 1.3; }
.home-alert-open { display: inline-flex; align-items: center; gap: 2px; color: #315f8b; font-size: 12px; font-weight: 700; }
.home-alert-open svg { width: 14px; height: 14px; }

.home-clear-state, .home-empty-activity {
    min-height: 118px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #50605a;
    background: #f7faf8;
    border: 1px solid #bdcbc1;
    border-radius: 2px;
}
.home-clear-state svg, .home-empty-activity svg { width: 28px; height: 28px; flex: 0 0 auto; }
.home-clear-state strong { display: block; color: #285b39; font-size: 14px; }
.home-clear-state span, .home-empty-activity span { display: block; margin-top: 3px; font-size: 12px; line-height: 1.35; }

.home-activity-row {
    min-width: 0;
    min-height: 55px;
    padding: 7px 8px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    background: #fafbfc;
    border: 1px solid #c9cfd5;
    border-radius: 2px;
}
.home-activity-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #4f5f6d;
    background: #e8ebee;
    border: 1px solid #c4cbd1;
    border-radius: 2px;
}
.home-activity-icon svg { width: 18px; height: 18px; }
.home-activity-copy { min-width: 0; }
.home-activity-copy strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.home-activity-copy span { display: block; margin-top: 2px; color: #66717b; font-size: 11px; }
.home-activity-value { padding-left: 8px; font-size: 12px; white-space: nowrap; }

@media (max-width: 1180px) {
    .desktop-module-tab { min-width: 84px; padding-inline: 11px; }
    .desktop-module-tab[data-area="administracion"] { min-width: 118px; }
    .home-work-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1000px) {
    .desktop-module-tab { min-width: 78px; padding-inline: 9px; gap: 6px; }
    .desktop-module-tab[data-area="administracion"] { min-width: 112px; }
    .desktop-module-tab svg { width: 16px; height: 16px; }
    .home-decision-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-height: 760px) {
    .home-decision-card { min-height: 104px; padding-block: 10px; }
    .home-decision-value { font-size: 23px; }
    .home-panel-head { min-height: 52px; }
    .home-alert-row, .home-activity-row { min-height: 50px; }
}

/* ========================================================================
   LICOFULL UX-3 · POS
   Flujo dominante BUSCAR → AGREGAR → COBRAR, historial separado y 1024×768.
   ======================================================================== */

/* El POS ocupa el viewport disponible sin imponer un lienzo más ancho que 1024. */
.pos-page {
    min-width: 0;
    min-height: 0;
    height: calc(100vh - 12px);
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
}
.pos-toolbar {
    min-width: 0;
    min-height: 58px;
    padding: 7px 9px;
    align-items: center !important;
}
.pos-toolbar-title { min-width: 150px; }
.pos-toolbar h2 { font-size: 19px !important; }
.pos-toolbar p { margin-top: 2px !important; font-size: 12px !important; font-weight: 700; }
.pos-toolbar .toolbar-actions { min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.pos-toolbar .btn { min-height: 36px; }
.pos-toolbar .btn-secondary kbd { margin-left: 3px; }
.pos-operator-chip,
.pos-cash-chip { min-height: 38px; }
.pos-operator-chip small { font-size: 10px; }
.pos-operator-chip strong { font-size: 12px; }
.pos-cash-chip strong { font-size: 12px; }
.pos-cash-chip span { font-size: 10px; }
.pos-cash-chip.is-open strong { color: #1f653c; }
.pos-cash-chip.is-closed strong { color: #8c2929; }

/* Venta actual e Historial son contextos separados. */
.pos-view-switcher {
    min-width: 0;
    min-height: 44px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #e7ebef;
    border: 1px solid #9faab5;
    border-radius: 2px;
}
.pos-view-tab,
.pos-quick-lookup-button {
    min-height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #3c4751;
    background: #f6f7f8;
    border: 1px solid #aeb7c0;
    border-radius: 2px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.pos-view-tab svg,
.pos-quick-lookup-button svg { width: 17px; height: 17px; }
.pos-view-tab > span {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #607180;
    border-radius: 11px;
    font-size: 11px;
}
.pos-view-tab.is-active {
    color: #173f68;
    background: #fff;
    border-color: #5e88ad;
    box-shadow: inset 0 -3px #2f6ca8;
}
.pos-view-tab.is-active > span { background: #2f6ca8; }
.pos-quick-lookup-button { margin-left: auto; color: #234f7b; background: #edf4fa; border-color: #9bbbd6; }
.pos-quick-lookup-button:hover { background: #e0edf7; border-color: #6d9bc1; }
.pos-quick-lookup-button kbd { margin-left: 3px; }
.pos-view-panel { min-width: 0; min-height: 0; overflow: hidden; }
.pos-view-panel[hidden] { display: none !important; }

/* Estado de caja deliberado cuando la venta está bloqueada. */
.pos-cash-warning {
    width: 100%;
    min-height: 48px;
    margin-bottom: 7px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #7c2929;
    background: #fff0ee;
    border: 1px solid #d59a94;
    border-left: 5px solid #ad3434;
    border-radius: 2px;
    text-align: left;
    cursor: pointer;
}
.pos-cash-warning svg { width: 20px; height: 20px; flex: 0 0 auto; }
.pos-cash-warning span { min-width: 0; flex: 1 1 auto; display: grid; }
.pos-cash-warning strong { font-size: 13px; }
.pos-cash-warning small { margin-top: 2px; font-size: 12px; }
.pos-cash-warning b { color: #7c2929; font-size: 12px; white-space: nowrap; }

/* Dos columnas operativas adaptables; la derecha recibe prioridad visual. */
.pos-workspace {
    min-width: 0;
    width: 100%;
    height: 100%;
    grid-template-columns: minmax(300px, .72fr) minmax(0, 1.55fr);
    gap: 7px;
}
.pos-view-panel[data-pos-view-panel="sale"]:not([hidden]) {
    display: flex;
    flex-direction: column;
}
.pos-view-panel[data-pos-view-panel="sale"] .pos-workspace { min-height: 0; flex: 1 1 auto; }
.pos-catalog-panel,
.pos-cart-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
}

/* Búsqueda: primer control inequívoco del flujo. */
.pos-search-label {
    min-height: 40px;
    padding: 7px 9px 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #f7f8f9;
    border-bottom: 1px solid #c4cbd1;
}
.pos-search-label strong { color: #213e5c; font-size: 13px; letter-spacing: .025em; }
.pos-search-label span { margin-top: 2px; color: #606c77; font-size: 11px; }
.pos-search-bar {
    flex-basis: 54px;
    min-height: 54px;
    padding: 6px 9px;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 8px;
    background: #fff;
    border-bottom: 2px solid #6d9bc1;
}
.pos-search-bar svg { width: 20px; height: 20px; }
.pos-search-bar input { font-size: 16px; font-weight: 700; }
.pos-search-bar kbd { padding: 3px 6px; font-size: 10px; }
.pos-catalog-meta {
    min-height: 31px;
    padding: 6px 8px;
    align-items: center;
    font-size: 10px;
}
.pos-catalog-meta strong { color: #243748; font-size: 12px; }

/* Catálogo compacto y legible incluso en la columna estrecha de 1024. */
.pos-product-card.pos-product-row {
    min-width: 0;
    min-height: 64px;
    grid-template-columns: 42px minmax(0, 1fr) 68px 78px;
}
.pos-product-image { min-height: 62px; }
.pos-product-copy { padding: 6px; }
.pos-product-copy strong { font-size: 12px; }
.pos-product-copy small { font-size: 10px; }
.pos-product-stock,
.pos-product-price { padding: 5px; }
.pos-product-stock small,
.pos-product-price small { font-size: 9px; }
.pos-product-stock strong { font-size: 10px; }
.pos-product-price strong { font-size: 13px; }

/* Ticket: sólo seis columnas operativas; código y stock pasan bajo Producto. */
.pos-cart-head { min-height: 50px; padding: 6px 8px; }
.pos-ticket-label { padding: 5px 7px; font-size: 10px; }
.pos-ticket-heading h3 { font-size: 16px !important; }
.pos-ticket-heading small { font-size: 11px; }
.pos-customer-summary {
    min-height: 46px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f6f7f8;
    border-bottom: 1px solid #b8c1c9;
}
.pos-customer-summary > div { min-width: 0; display: flex; align-items: center; gap: 7px; }
.pos-customer-summary svg { width: 18px; height: 18px; color: #4e6d89; }
.pos-customer-summary span { min-width: 0; display: grid; }
.pos-customer-summary small { color: #69747e; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.pos-customer-summary strong { overflow: hidden; margin-top: 1px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.pos-customer-quick {
    flex: 0 0 auto;
    min-height: 70px;
    padding: 7px 9px 9px;
    grid-template-columns: 1.35fr .65fr;
}
.pos-customer-quick[hidden] { display: none !important; }
.pos-customer-quick label { font-size: 11px; }
.pos-customer-quick .form-control { height: 36px; font-size: 13px; }
.pos-ticket-content { padding: 7px 8px 6px; }
.pos-ticket-table { width: 100%; min-width: 580px; table-layout: fixed; font-size: 12px; }
.pos-ticket-table th { height: 34px; padding: 6px 5px; font-size: 11px; }
.pos-ticket-table td { height: 52px; padding: 5px; }
.pos-ticket-table th:nth-child(1) { width: 34%; }
.pos-ticket-table th:nth-child(2) { width: 11%; }
.pos-ticket-table th:nth-child(3) { width: 14%; }
.pos-ticket-table th:nth-child(4) { width: 11%; }
.pos-ticket-table th:nth-child(5) { width: 17%; }
.pos-ticket-table th:nth-child(6) { width: 13%; }
.pos-ticket-product { min-width: 0; }
.pos-ticket-product strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.pos-ticket-product > small {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #66717b;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pos-ticket-product .night-line { display: flex; align-items: center; gap: 3px; color: #8a610c; }
.pos-ticket-product .night-line svg { width: 11px; height: 11px; }
.pos-ticket-table .pos-ticket-input { width: 62px; height: 34px; padding: 0 5px; font-size: 12px; }
.pos-ticket-table input[data-cart-discount] { width: 62px; padding: 0 16px 0 5px; }
.pos-ticket-price { color: #33404c; white-space: nowrap; }
.pos-ticket-line-total { color: #183f67; font-size: 13px; white-space: nowrap; }
.pos-ticket-muted { color: #89929b; }
.pos-remove-line { min-width: 0; min-height: 32px; padding: 0 7px; }

/* Resumen y cobro: menos celdas, TOTAL y COBRAR dominantes. */
.pos-cart-summary {
    margin: 0 8px 7px;
    grid-template-columns: .72fr 1fr 1fr 1fr 1.45fr;
}
.pos-cart-summary:not(.has-discount) { grid-template-columns: .8fr 1.1fr 1.1fr 1.55fr; }
.pos-summary-cell { min-height: 66px; padding: 8px; }
.pos-summary-cell span { font-size: 10px; }
.pos-summary-cell strong { font-size: 14px; }
.pos-global-discount { gap: 6px; }
.pos-global-discount .form-control { width: 56px; min-width: 56px; height: 34px; font-size: 12px; }
.pos-grand-total strong { font-size: clamp(25px, 2.4vw, 34px); }
.pos-charge-button {
    flex: 0 0 62px;
    min-height: 62px;
    width: calc(100% - 16px);
    margin: 0 8px 8px;
    padding: 0 13px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    background: #245f98;
    border-color: #174c7d;
    font-size: 16px;
    font-weight: 900;
}
.pos-charge-button > span { display: inline-flex; align-items: center; gap: 7px; }
.pos-charge-button > span svg { width: 20px; height: 20px; }
.pos-charge-button > strong { justify-self: end; font-size: 24px; letter-spacing: .01em; }
.pos-charge-button kbd { font-size: 11px; }
.pos-charge-button:disabled { opacity: .55; }

/* Historial separado de la venta actual. */
.pos-sales-history.pos-view-panel:not([hidden]) {
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.pos-history-head {
    min-height: 66px;
    padding: 8px 10px;
    align-items: center;
}
.pos-history-head h3 { font-size: 16px; }
.pos-history-head p { margin: 3px 0 0; color: #626e78; font-size: 12px; }
.pos-history-head .inline-actions { flex-wrap: wrap; justify-content: flex-end; }
.pos-sales-history .table-scroll { min-height: 0; max-height: none; flex: 1 1 auto; }
.pos-sales-history .data-table { font-size: 12px; }

/* Consulta rápida: precio y stock legibles sin tocar el ticket. */
.pos-lookup-form { margin-bottom: 10px; }
.pos-lookup-search {
    margin-top: 4px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
}
.pos-lookup-search > svg { width: 20px; height: 20px; color: #2f6ca8; }
.pos-lookup-search .form-control { height: 44px; font-size: 15px; font-weight: 700; }
.pos-lookup-search .btn { min-height: 44px; }
.pos-lookup-body { min-height: 150px; }
.pos-lookup-hint {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #5c6873;
    background: #f6f8f9;
    border: 1px dashed #b7c1ca;
}
.pos-lookup-hint kbd { font-size: 12px; }
.pos-lookup-results { display: grid; gap: 7px; }
.pos-lookup-result {
    min-height: 78px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px 145px;
    align-items: stretch;
    gap: 8px;
    background: #fff;
    border: 1px solid #b7c0c8;
    border-radius: 2px;
}
.pos-lookup-product { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.pos-lookup-product strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.pos-lookup-product small { margin-top: 4px; color: #66717b; font-size: 11px; }
.pos-lookup-price,
.pos-lookup-stock { padding: 7px 9px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid #c9d0d6; }
.pos-lookup-price span,
.pos-lookup-stock span { color: #66717b; font-size: 10px; font-weight: 800; }
.pos-lookup-price strong { margin-top: 3px; color: #174d78; font-size: 24px; }
.pos-lookup-stock strong { margin-top: 3px; color: #235f3c; font-size: 16px; }
.pos-lookup-price small { margin-top: 3px; display: flex; align-items: center; gap: 3px; color: #855b0a; font-size: 10px; }
.pos-lookup-price small svg { width: 11px; height: 11px; }
.pos-lookup-error { min-height: 80px; padding: 12px; display: flex; align-items: center; }

/* Cobro: selección de forma de pago más inequívoca. */
.checkout-payment-preset { min-height: 66px; }
.checkout-payment-preset span { font-size: 16px; }
.checkout-payment-preset small { font-size: 11px; }
.checkout-payment-preset.is-active { border-width: 3px; box-shadow: inset 0 0 0 1px #fff, 0 0 0 2px rgba(47,108,168,.18); }
.checkout-submit { min-width: 250px; min-height: 42px; font-size: 14px; font-weight: 800; }

@media (max-width: 1180px) {
    .pos-workspace { grid-template-columns: minmax(300px, .68fr) minmax(0, 1.5fr); }
    .pos-product-card.pos-product-row { grid-template-columns: 38px minmax(0, 1fr) 62px 72px; }
    .pos-product-copy { padding-inline: 5px; }
    .pos-product-stock, .pos-product-price { padding-inline: 4px; }
    .pos-ticket-table { min-width: 560px; }
    .pos-toolbar p { display: none; }
}

@media (max-width: 1040px) {
    .desktop-shell.pos-mode .desktop-workspace { padding: 5px; }
    .pos-page { height: calc(100vh - 10px); gap: 5px; }
    .pos-toolbar { min-height: 54px; padding: 5px 7px; }
    .pos-toolbar-title { min-width: 125px; }
    .pos-toolbar h2 { font-size: 17px !important; }
    .pos-toolbar .toolbar-actions { gap: 4px; }
    .pos-operator-chip { display: none; }
    .pos-cash-chip { padding-inline: 7px; }
    .pos-view-switcher { min-height: 40px; padding-block: 3px; }
    .pos-view-tab, .pos-quick-lookup-button { min-height: 32px; padding-inline: 9px; font-size: 12px; }
    .pos-workspace { grid-template-columns: 300px minmax(0, 1fr); gap: 5px; }
    .pos-product-card.pos-product-row { grid-template-columns: 36px minmax(0, 1fr) 58px 68px; }
    .pos-product-image { min-height: 58px; }
    .pos-product-stock strong { font-size: 9px; }
    .pos-product-price strong { font-size: 12px; }
    .pos-ticket-content { padding-inline: 6px; }
    .pos-ticket-table { min-width: 540px; }
    .pos-ticket-table th:nth-child(1) { width: 32%; }
    .pos-ticket-table th:nth-child(6) { width: 15%; }
    .pos-cart-summary { margin-inline: 6px; }
    .pos-charge-button { width: calc(100% - 12px); margin-inline: 6px; }
}

@media (max-height: 760px) {
    .pos-toolbar { min-height: 50px; }
    .pos-view-switcher { min-height: 38px; }
    .pos-search-label { min-height: 34px; padding-block: 4px; }
    .pos-search-label span { display: none; }
    .pos-search-bar { min-height: 48px; flex-basis: 48px; }
    .pos-catalog-meta { min-height: 27px; padding-block: 4px; }
    .pos-product-card.pos-product-row { min-height: 56px; }
    .pos-product-image { min-height: 54px; }
    .pos-cart-head { min-height: 44px; }
    .pos-customer-summary { min-height: 40px; }
    .pos-ticket-table td { height: 46px; }
    .pos-summary-cell { min-height: 58px; padding-block: 6px; }
    .pos-grand-total strong { font-size: 25px; }
    .pos-charge-button { flex-basis: 56px; min-height: 56px; }
    .pos-history-head { min-height: 58px; }
}

/* ===== LICOFULL UX-4 · CAJA =====
   Prioriza estado del turno, conteo deliberado y separación Caja actual / Historial. */
.cash-view-tabs {
    width: 100%;
    margin-bottom: 0;
}
.cash-view-tabs button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
}
.cash-tab-state {
    min-height: 20px;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #9aa4ae;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}
.cash-tab-state.is-open {
    color: #245f3b;
    background: #edf7f0;
    border-color: #78a889;
}
.cash-tab-state.is-closed {
    color: #862e2e;
    background: #fff0ef;
    border-color: #c98c87;
}
.cash-view-tabs button.active .cash-tab-state {
    color: inherit;
    background: rgba(255,255,255,.82);
}
[data-cash-panel][hidden] { display: none !important; }
[data-cash-panel="current"],
[data-cash-panel="history"] { min-width: 0; }
.cash-history-head p {
    margin: 3px 0 0;
    color: #5f6b75;
    font-size: 11px;
}
.cash-history .table-scroll { max-height: calc(100vh - 245px); }

.cash-empty-card {
    min-height: 210px;
    border-left: 5px solid #a73939;
}
.cash-empty-card .eyebrow { color: #8d3131; }
.cash-empty-card h2 { font-size: 22px; }
.cash-empty-card p { max-width: 650px; font-size: 13px; line-height: 1.45; }
.cash-open-primary {
    min-width: 190px;
    min-height: 50px;
    padding-inline: 20px;
    font-size: 15px;
    font-weight: 900;
}
.cash-session-head {
    min-height: 88px;
    border-left: 5px solid #4d8b63;
}
.cash-session-identity { min-width: 0; }
.cash-session-identity h2 { margin-top: 5px; font-size: 20px; }
.cash-status {
    min-height: 25px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #75a487;
    border-radius: 2px;
    color: #205d38;
    background: #eef8f1;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .025em;
}
.cash-status svg { width: 14px; height: 14px; }
.cash-session-actions { justify-content: flex-end; }
.cash-session-actions .btn { min-height: 40px; }
.cash-session-actions .btn-danger { min-width: 126px; font-weight: 800; }
.cash-kpi-card.cash-kpi-primary {
    background: #edf4fb;
    border-color: #7296b6;
    box-shadow: inset 0 3px #3f719f;
}
.cash-kpi-card.cash-kpi-primary .cash-kpi-copy span { color: #315b80; }
.cash-kpi-card.cash-kpi-primary .cash-kpi-copy strong { color: #173f63; font-size: 24px; }
.cash-kpi-card.cash-kpi-primary .cash-kpi-icon { color: rgba(42,95,143,.2); }

.cash-count-list { margin: 10px 0 12px; gap: 7px; }
.cash-count-row {
    min-height: 68px;
    padding: 9px 10px;
    grid-template-columns: minmax(0, 1fr) 170px;
    border-color: #adb7c0;
    background: #f8f9fa;
}
.cash-count-method strong { font-size: 13px; }
.cash-count-method small { margin-top: 4px; font-size: 11px; }
.cash-count-input { display: grid; gap: 3px; }
.cash-count-input > small {
    color: #5c6873;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}
.cash-count-input .form-control {
    min-height: 42px;
    font-size: 16px;
    font-weight: 800;
    text-align: right;
}
.cash-count-expected.is-blind { display: none; }
.cash-count-blind-help { color: #5d6872; }
.cash-blind-banner,
.cash-close-warning {
    padding: 9px 10px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border: 1px solid #b4bec7;
    border-left: 5px solid #567c9d;
    background: #f2f6f9;
}
.cash-blind-banner svg,
.cash-close-warning svg { width: 20px; height: 20px; flex: 0 0 auto; }
.cash-blind-banner strong,
.cash-blind-banner span,
.cash-close-warning strong,
.cash-close-warning span { display: block; }
.cash-blind-banner strong,
.cash-close-warning strong { font-size: 12px; }
.cash-blind-banner span,
.cash-close-warning span { margin-top: 2px; font-size: 11px; line-height: 1.4; }
.cash-close-warning {
    margin-top: 9px;
    color: #792e2e;
    background: #fff3f1;
    border-color: #d2a09b;
    border-left-color: #ae3d3d;
}
.cash-count-summary {
    margin-top: 9px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid #9eaab4;
    background: #eef1f4;
}
.cash-count-summary > div {
    min-height: 65px;
    padding: 8px 10px;
    display: grid;
    align-content: center;
    gap: 4px;
    border-right: 1px solid #b6bfc7;
}
.cash-count-summary > div:last-child { border-right: 0; }
.cash-count-summary span {
    color: #5d6872;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}
.cash-count-summary strong { color: #233342; font-size: 20px; }
.cash-count-summary.is-blind [data-summary-expected] strong { color: #67727c; font-size: 15px; }
.cash-count-summary [data-summary-difference].is-concealed strong { color: #67727c; font-size: 15px; }
#count-difference.is-negative { color: #a12e2e; }
#count-difference.is-positive { color: #8a5b09; }
#count-difference.is-zero { color: #22613a; }

@media (max-width: 1080px) {
    .cash-session-head { align-items: flex-start; }
    .cash-session-actions { max-width: 430px; flex-wrap: wrap; }
    .cash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cash-history-head { align-items: flex-start; }
}
@media (max-width: 760px) {
    .cash-empty-card { grid-template-columns: 1fr; text-align: left; }
    .cash-empty-icon { margin: 0; }
    .cash-open-primary { width: 100%; }
    .cash-session-head { flex-direction: column; }
    .cash-session-actions { width: 100%; max-width: none; }
    .cash-session-actions .btn { flex: 1 1 150px; }
    .cash-count-row { grid-template-columns: 1fr; }
    .cash-count-summary { grid-template-columns: 1fr; }
    .cash-count-summary > div { border-right: 0; border-bottom: 1px solid #b6bfc7; }
    .cash-count-summary > div:last-child { border-bottom: 0; }
}
@media (max-height: 780px) and (min-width: 900px) {
    .cash-session-head { min-height: 76px; padding-block: 8px; }
    .cash-kpi-card { min-height: 80px; }
    .cash-kpi-card.cash-kpi-primary .cash-kpi-copy strong { font-size: 21px; }
    .cash-dashboard-grid { gap: 7px; }
    .cash-dashboard-grid .card-head { min-height: 42px; }
    .cash-dashboard-grid .card-body { padding: 7px; }
}


/* ===== LICOFULL UX-5 · INVENTARIO + PRODUCTOS =====
   Reduce acciones simultáneas y aplica divulgación progresiva sin perder densidad. */
.toolbar-actions kbd {
    margin-left: 4px;
    padding: 1px 4px;
    border: 1px solid currentColor;
    border-radius: 2px;
    background: rgba(255,255,255,.72);
    font-size: 9px;
    font-family: inherit;
}
.btn-primary kbd { color: #1f4f79; }
.inventory-adjust-button,
.inventory-adjust-action { border-color: #ba8b42 !important; color: #7d5315 !important; background: #fff8e8 !important; }
.table-action-menu { position: relative; display: inline-block; }
.table-action-menu > summary { list-style: none; cursor: pointer; user-select: none; }
.table-action-menu > summary::-webkit-details-marker { display: none; }
.table-action-menu[open] > summary { border-color: #70879b; background: #e8eef3; }
.table-action-menu-panel {
    position: static;
    margin-top: 3px;
    min-width: 170px;
    padding: 4px;
    display: grid;
    gap: 2px;
    border: 1px solid #8f9aa4;
    background: #fff;
    box-shadow: 0 5px 14px rgba(24,35,44,.18);
}
.table-action-menu-panel button {
    min-height: 34px;
    padding: 0 9px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: #28333c;
    font: inherit;
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}
.table-action-menu-panel button:hover,
.table-action-menu-panel button:focus-visible { background: #edf3f7; outline: none; }
.table-action-menu-panel button.danger { color: #9a3030; }
.inventory-row-actions, .product-row-actions { flex-wrap: nowrap; }

.progressive-section {
    margin-top: 4px;
    border: 1px solid #aeb7c0;
    background: #f7f8f9;
}
.progressive-section > summary {
    min-height: 48px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    background: #e9edf1;
}
.progressive-section > summary::-webkit-details-marker { display: none; }
.progressive-section > summary span,
.progressive-section > summary strong,
.progressive-section > summary small { display: block; }
.progressive-section > summary strong { font-size: 13px; }
.progressive-section > summary small { margin-top: 2px; color: #5f6a74; font-size: 10px; }
.progressive-section > summary em { color: #315f88; font-size: 11px; font-style: normal; font-weight: 800; white-space: nowrap; }
.progressive-section[open] > summary { border-bottom: 1px solid #aeb7c0; }
.progressive-section.has-required-fields > summary { box-shadow: inset 4px 0 #b27a24; }
.progressive-section[open] > summary em { font-size: 0; }
.progressive-section[open] > summary em::after { content: "Ocultar ▴"; font-size: 11px; }
.progressive-section-body { padding: 10px; }
.auto-code-hint, .product-price-readonly {
    min-height: 54px;
    padding: 7px 10px;
    display: grid;
    grid-template-columns: auto auto minmax(180px, 1fr);
    align-items: center;
    justify-content: start;
    gap: 9px;
    border: 1px solid #b5bec7;
    background: #f4f6f8;
}
.auto-code-hint span, .product-price-readonly span { color: #59656f; font-size: 11px; font-weight: 700; }
.auto-code-hint strong, .product-price-readonly strong { font-size: 14px; }
.auto-code-hint small, .product-price-readonly small { color: #66717b; font-size: 10px; }
.product-price-cell strong, .product-price-cell small, .product-stock-cell strong, .product-stock-cell small { display: block; }
.product-price-cell strong { color: #175b37; font-size: 14px; }
.product-price-cell small { margin-top: 3px; color: #65717b; font-size: 10px; }
.product-stock-cell strong { font-size: 13px; }
.product-stock-cell small { margin-top: 3px; font-size: 10px; font-weight: 700; }
.product-stock-cell.is-ok small { color: #28623d; }
.product-stock-cell.is-low small { color: #875d14; }
.product-stock-cell.is-empty small { color: #9b3030; }
.product-price-action { font-weight: 800; }
.product-priority-table th:nth-child(1) { min-width: 240px; }
.product-priority-table th:last-child { min-width: 215px; }

@media (max-width: 1120px) {
    .product-priority-table th:last-child { min-width: 190px; }
    .product-row-actions .table-action { padding-inline: 6px; }
}
@media (max-width: 760px) {
    .auto-code-hint, .product-price-readonly { grid-template-columns: 1fr; gap: 2px; }
    .inventory-row-actions, .product-row-actions { flex-wrap: wrap; }
}

/* ========================================================================
   LICOFULL 2.1.7 · ESTABILIDAD MODAL DE PRODUCTOS / CONTROLES SWITCH
   Corrige una zona clicable invisible de ancho completo y evita capas CSS
   cercanas al límite entero de Chromium en los diálogos de escritorio.
   ======================================================================== */

/* Un switch sólo debe responder sobre el control y su texto, no sobre toda
   la fila disponible del formulario. El input sigue siendo accesible por
   teclado y el foco se representa sobre el control visual. */
.switch-control {
    position: relative;
    width: max-content;
    max-width: 100%;
    align-self: flex-start;
    display: inline-flex;
    cursor: pointer;
}
.switch-control input {
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    pointer-events: none;
}
.switch-control:focus-within span {
    outline: 2px solid #2874ba;
    outline-offset: 2px;
}

/* El bloque de precios tiene su propia geometría. Activar precio nocturno
   expande un panel estable en vez de ocultar/mostrar celdas sueltas del grid. */
.product-price-section {
    min-width: 0;
    border: 1px solid #aeb7c0;
    background: #fff;
}
.product-price-section > .form-section-title {
    margin: 0;
    border: 0;
    border-bottom: 1px solid #aeb7c0;
}
.product-price-grid { padding: 10px; }
.product-night-price-fields {
    padding: 9px;
    border: 1px solid #b8c2cb;
    background: #f6f8fa;
}
.product-night-price-fields[hidden] { display: none !important; }

/* El root ya crea un stacking context suficiente. Valores moderados evitan
   depender de z-index próximos al máximo de Chromium y mantienen el orden:
   aplicación < modal < ayuda < toast. */
#modal-root {
    z-index: 20000 !important;
    isolation: auto !important;
}
#modal-root .modal-backdrop {
    z-index: 20000 !important;
    backdrop-filter: none !important;
}
#modal-root .app-modal { z-index: 1 !important; }
.shortcut-help-backdrop { z-index: 21000 !important; }
.toast-region { z-index: 22000 !important; }

/* ===== HOTFIX UX 2.1.8 · MENÚS DE ACCIONES EN TABLAS =====
   Los menús de fila flotan sobre la tabla: nunca deben aumentar la altura
   de una fila, desplazar registros ni deformar la página al abrirse. */
.table-action-menu { vertical-align: middle; }
.table-action-menu-panel {
    position: fixed;
    z-index: 19000;
    margin: 0;
    max-width: calc(100vw - 16px);
    max-height: min(280px, calc(100vh - 16px));
    overflow: auto;
    visibility: hidden;
}
.table-action-menu.is-positioned > .table-action-menu-panel { visibility: visible; }
.table-action-menu-panel button svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

/* ===== LICOFULL UX-6 · CLIENTES + CRÉDITOS =====
   Formularios condicionales, acciones progresivas y vencimientos cognitivos. */
.client-form [data-field-name="tipoPersona"] { max-width: 440px; }
.client-type-guidance {
    min-height: 48px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #afbbc5;
    border-left: 4px solid #73559b;
    background: #f4f1f8;
}
.client-type-guidance strong { min-width: 125px; font-size: 13px; }
.client-type-guidance span { color: #56616a; font-size: 11px; }
.client-more-section { margin-top: 2px; }
.client-more-grid { padding: 0; }
.client-credit-disabled { color: #66717a; font-size: 11px; font-weight: 700; }
.client-balance { display: block; color: #8b3a32; font-size: 14px; }
.client-credit-overview,
.client-statement-summary,
.debt-detail-summary {
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid #aeb8c1;
    background: #f7f9fa;
}
.client-credit-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.client-credit-overview > div,
.client-statement-summary > div,
.debt-detail-summary > div {
    min-width: 0;
    padding: 9px 11px;
    border-right: 1px solid #c8d0d6;
}
.client-credit-overview > div:last-child,
.client-statement-summary > div:last-child,
.debt-detail-summary > div:last-child { border-right: 0; }
.client-credit-overview span,
.client-statement-summary span,
.debt-detail-summary span {
    display: block;
    color: #59656e;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}
.client-credit-overview strong,
.client-statement-summary strong,
.debt-detail-summary strong { display: block; margin-top: 3px; font-size: 16px; }
.client-statement-summary .has-overdue strong { color: #9a3030; }
.client-credit-form .form-field.is-disabled { opacity: .55; }
.operation-warning {
    padding: 8px 10px;
    display: flex;
    gap: 8px;
    border: 1px solid #d1aa67;
    background: #fff7e7;
    color: #705019;
}
.operation-warning strong { white-space: nowrap; }
.client-statement-table td small,
.debt-table td small,
.debt-detail-summary small,
.debt-due-cell small { display: block; margin-top: 3px; color: #66717a; font-size: 10px; }

.debt-page .debt-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.debt-primary-stat .stat-value { font-size: 21px; }
.debt-table th:first-child { min-width: 165px; }
.debt-table th:nth-child(2) { min-width: 130px; }
.debt-table th:nth-child(6) { min-width: 128px; }
.debt-table th:last-child { min-width: 155px; }
.debt-balance-cell strong { font-size: 14px; }
.debt-row-overdue .debt-balance-cell strong { color: #98362f; }
.due-label {
    display: inline-flex;
    min-height: 24px;
    padding: 2px 7px;
    align-items: center;
    border: 1px solid #aeb8c1;
    background: #f4f6f7;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.due-danger { border-color: #d19a96 !important; background: #fff0ef !important; color: #8e302b !important; }
.due-warning { border-color: #d6b06d !important; background: #fff8e7 !important; color: #76551d !important; }
.due-success { border-color: #92bea0 !important; background: #edf8f0 !important; color: #28623d !important; }
.due-neutral { color: #58636c; }
.debt-actions { flex-wrap: nowrap; }
.debt-pay-action {
    min-width: 78px;
    border-color: #3a719f !important;
    background: #edf5fb !important;
    color: #1f557f !important;
    font-weight: 800;
}
.debt-payment-balance {
    margin-bottom: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #9cb0c2;
    background: #eef4f8;
}
.debt-payment-balance span { color: #52616d; font-size: 11px; font-weight: 800; }
.debt-payment-balance strong { font-size: 20px; }
.debt-payment-submit { min-width: 145px; }
.debt-detail-summary .debt-balance-card { background: #eef4f8; }
.debt-detail-meta {
    margin: -3px 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #5f6a73;
    font-size: 11px;
}

@media (max-width: 1120px) {
    .debt-table th:first-child { min-width: 145px; }
    .debt-table th:nth-child(2) { min-width: 115px; }
    .debt-actions .table-action { padding-inline: 6px; }
    .client-statement-summary,
    .debt-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-statement-summary > div:nth-child(2),
    .debt-detail-summary > div:nth-child(2) { border-right: 0; }
    .client-statement-summary > div:nth-child(-n+2),
    .debt-detail-summary > div:nth-child(-n+2) { border-bottom: 1px solid #c8d0d6; }
}
@media (max-width: 900px) {
    .debt-page .debt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-type-guidance { align-items: flex-start; flex-direction: column; gap: 2px; }
    .client-credit-overview { grid-template-columns: 1fr; }
    .client-credit-overview > div { border-right: 0; border-bottom: 1px solid #c8d0d6; }
    .client-credit-overview > div:last-child { border-bottom: 0; }
}

/* ===== LICOFULL UX-7 · COMPRAS + PROVEEDORES + CUENTAS POR PAGAR =====
   Compras como documento interactivo, proveedores operativos y pagos priorizados. */
.purchase-form { display: grid; gap: 10px; }
.purchase-document-section,
.purchase-summary {
    min-width: 0;
    padding: 11px;
    border: 1px solid #aeb8c1;
    background: #f8f9fa;
    box-shadow: inset 0 1px #fff;
}
.purchase-step-title {
    min-height: 38px;
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 9px;
}
.purchase-step-title > span {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid #a66d25;
    background: #f6e9d6;
    color: #744714;
    font-size: 13px;
    font-weight: 900;
}
.purchase-step-title > div { min-width: 0; flex: 1 1 auto; }
.purchase-step-title h3 { margin: 0; font-size: 14px; }
.purchase-step-title p { margin: 2px 0 0; color: #5c6871; font-size: 10px; line-height: 1.35; }
.purchase-step-title .btn { flex: 0 0 auto; }
.purchase-header-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.purchase-lines-section { overflow: visible; }
.purchase-lines-head,
.purchase-line {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 86px 112px 86px 112px 34px;
    gap: 7px;
    align-items: center;
}
.purchase-lines-head {
    min-height: 28px;
    padding: 0 7px;
    border: 1px solid #aeb8c1;
    border-bottom: 0;
    background: #e6ebef;
    color: #4f5a63;
    font-size: 10px;
    font-weight: 800;
}
.purchase-lines-head span:nth-child(n+2):nth-child(-n+5) { text-align: right; }
#purchase-lines {
    border: 1px solid #aeb8c1;
    background: #fff;
}
.purchase-line {
    padding: 7px;
    border-bottom: 1px solid #d2d8dd;
}
.purchase-line:last-child { border-bottom: 0; }
.purchase-line .form-control { min-width: 0; height: 38px; }
.purchase-line-total {
    display: block;
    min-width: 0;
    text-align: right;
    font-size: 13px;
    white-space: nowrap;
}
.purchase-line-remove { min-width: 32px; width: 32px; padding-inline: 0; justify-content: center; }
.purchase-product-picker { position: relative; min-width: 0; }
.purchase-product-search.is-selected {
    border-color: #6d8ca6;
    background: #f0f6fa;
    font-weight: 700;
}
.purchase-product-results {
    position: absolute;
    z-index: 40;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow: auto;
    border: 1px solid #8e9ca8;
    background: #fff;
    box-shadow: 0 5px 14px rgba(30, 40, 48, .22);
}
.purchase-product-results button {
    width: 100%;
    min-height: 45px;
    padding: 6px 9px;
    display: block;
    border: 0;
    border-bottom: 1px solid #d7dde1;
    background: #fff;
    color: #20272c;
    text-align: left;
    cursor: pointer;
}
.purchase-product-results button:last-child { border-bottom: 0; }
.purchase-product-results button:hover,
.purchase-product-results button:focus-visible { background: #eef4f8; outline: none; }
.purchase-product-results strong,
.purchase-product-results small { display: block; }
.purchase-product-results strong { font-size: 12px; }
.purchase-product-results small { margin-top: 2px; color: #63707a; font-size: 10px; }
.purchase-product-empty { padding: 9px; color: #68737c; font-size: 11px; }
.purchase-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 10px;
    align-items: start;
}
.purchase-credit-fields { margin-bottom: 9px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.purchase-payment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.purchase-payment-grid .is-readonly-total {
    border-color: #8ba0b2;
    background: #edf3f7;
    color: #1e4f75;
    font-weight: 900;
}
.purchase-summary { position: sticky; top: 0; background: #f5f1ea; border-color: #bd9b6e; }
.purchase-summary dl { margin: 0; }
.purchase-summary dl > div {
    min-height: 33px;
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #d4c6b3;
}
.purchase-summary dt { color: #5a6065; font-size: 11px; font-weight: 700; }
.purchase-summary dd { margin: 0; font-size: 13px; font-weight: 800; white-space: nowrap; }
.purchase-summary .purchase-summary-total {
    min-height: 46px;
    border-block: 2px solid #9e7947;
}
.purchase-summary-total dt,
.purchase-summary-total dd { color: #4f3211; font-size: 18px; font-weight: 900; }
.purchase-summary-balance dd { color: #8a3a2e; font-size: 16px; }
.purchase-summary-note {
    margin-top: 9px;
    padding: 7px 9px;
    border: 1px solid #c9b287;
    background: #fff9ed;
    color: #6e5429;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
}
.purchase-submit { min-width: 155px; }
.purchase-history-table th:first-child { min-width: 120px; }
.purchase-history-table th:nth-child(2) { min-width: 155px; }

.supplier-form [data-field-name="tipoPersona"] { max-width: 440px; }
.supplier-type-guidance {
    min-height: 48px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #b9aa95;
    border-left: 4px solid #b47628;
    background: #fbf5ec;
}
.supplier-type-guidance strong { min-width: 130px; font-size: 13px; }
.supplier-type-guidance span { color: #5c646b; font-size: 11px; }
.supplier-more-section { margin-top: 2px; }
.supplier-more-grid { padding: 0; }
.supplier-balance { display: block; color: #8b3a32; font-size: 14px; }
.supplier-balance.is-clear { color: #326244; }
.supplier-credit-overview,
.supplier-statement-summary {
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid #aeb8c1;
    background: #f8f9fa;
}
.supplier-credit-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.supplier-credit-overview > div,
.supplier-statement-summary > div {
    min-width: 0;
    padding: 9px 11px;
    border-right: 1px solid #c8d0d6;
}
.supplier-credit-overview > div:last-child,
.supplier-statement-summary > div:last-child { border-right: 0; }
.supplier-credit-overview span,
.supplier-statement-summary span {
    display: block;
    color: #59656e;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}
.supplier-credit-overview strong,
.supplier-statement-summary strong { display: block; margin-top: 3px; font-size: 16px; }
.supplier-statement-summary .has-overdue strong { color: #9a3030; }
.supplier-statement-table td small { display: block; margin-top: 3px; color: #66717a; font-size: 10px; }

.payables-priority-table th:first-child { min-width: 180px; }
.payables-priority-table th:nth-child(2) { min-width: 112px; }
.payables-priority-table th:nth-child(3) { min-width: 132px; }
.payables-priority-table th:nth-child(4) { min-width: 125px; }
.payables-priority-table th:last-child { min-width: 178px; }
.payables-priority-table .debt-pay-action { min-width: 112px; }

@media (max-width: 1120px) {
    .purchase-lines-head,
    .purchase-line { grid-template-columns: minmax(220px, 1fr) 72px 96px 72px 96px 32px; gap: 5px; }
    .purchase-line { padding: 6px; }
    .purchase-header-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .purchase-lower-grid { grid-template-columns: minmax(0, 1.15fr) minmax(270px, .85fr); }
    .payables-priority-table th:first-child { min-width: 155px; }
    .payables-priority-table th:last-child { min-width: 165px; }
}

@media (max-width: 900px) {
    .purchase-lower-grid { grid-template-columns: 1fr; }
    .purchase-summary { position: static; }
    .supplier-type-guidance { align-items: flex-start; flex-direction: column; gap: 2px; }
    .supplier-credit-overview,
    .supplier-statement-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .supplier-credit-overview > div:nth-child(2),
    .supplier-statement-summary > div:nth-child(2) { border-right: 0; }
}

/* ===== LICOFULL UX-7.1 · SISTEMA GLOBAL DE NOTIFICACIONES INFERIORES =====
   Regla oficial: si LicoFULL tiene algo operativo que decir, se mira abajo. */
.main-area.desktop-main-area { flex-direction: column; }

.notification-region {
    flex: 0 0 auto;
    min-width: 0;
    background: #eef1f4;
}
.notification-region[hidden] { display: none !important; }
.notification-region-page {
    width: 100%;
    padding: 5px 9px;
    border-top: 1px solid #9ca6af;
    box-shadow: inset 0 1px #fff;
}
.notification-region-modal {
    width: 100%;
    padding: 6px 10px;
    border-top: 1px solid #aab3bc;
    background: #e7ebef;
}
.system-notification {
    min-width: 0;
    min-height: 42px;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
    color: #20262c;
    background: #fff;
    border: 1px solid #87929d;
    border-left-width: 5px;
    box-shadow: inset 0 1px rgba(255,255,255,.75);
    font-size: 13px;
    line-height: 1.35;
}
.system-notification-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}
.system-notification-copy { min-width: 0; display: block; overflow-wrap: anywhere; }
.system-notification-copy strong { display: block; margin-bottom: 1px; font-size: 12px; }
.system-notification-copy > span { display: block; }
.system-notification-close {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #4e5963;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: 20px;
    line-height: 1;
}
.system-notification-close:hover { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.18); }
.system-notification-close:focus-visible { outline: 2px solid #1b72c5; outline-offset: 1px; }
.system-notification-error { color: #782b2b; background: #fae7e7; border-color: #c17a7a; border-left-color: #a83232; }
.system-notification-warning { color: #704f08; background: #fff4cf; border-color: #d2b35f; border-left-color: #a57400; }
.system-notification-info { color: #24577e; background: #e7f1f9; border-color: #89abc5; border-left-color: #2e628f; }
.system-notification-success { color: #28613c; background: #e5f3e9; border-color: #8eb99a; border-left-color: #287342; }
.system-notification-error .system-notification-icon,
.system-notification-warning .system-notification-icon,
.system-notification-info .system-notification-icon,
.system-notification-success .system-notification-icon { background: rgba(255,255,255,.7); }

/* Los targets legacy conservan su contrato JS, pero ya no ocupan geometría:
   MutationObserver los refleja en la franja oficial del modal. */
.legacy-notification-source { display: none !important; }

/* El contenedor antiguo queda sólo como fallback para estados previos al shell
   (sesión expirada/login). Ya no renderiza toasts apilados. */
#toast-region:empty { display: none; }
#toast-region:not(:empty) {
    position: fixed;
    z-index: 22000 !important;
    left: 50%;
    right: auto;
    top: auto;
    bottom: 12px;
    width: min(640px, calc(100vw - 24px));
    transform: translateX(-50%);
    display: block;
}

@media (max-width: 1100px) {
    .notification-region-page { padding-inline: 7px; }
    .notification-region-modal { padding: 5px 8px; }
    .system-notification { min-height: 40px; font-size: 12px; }
}
@media (max-height: 760px) {
    .notification-region-modal { padding-block: 4px; }
    .system-notification { min-height: 38px; padding-block: 4px; }
}
.notification-region-embedded {
    width: 100%;
    margin: 6px 0 8px;
    padding: 0;
    background: transparent;
}
.notification-region-embedded .system-notification { width: 100%; }

/* ===== LICOFULL UX-7.2 · NOTIFICACIÓN INTEGRADA EN MODAL-FOOT =====
   Refinamiento visual de UX-7.1: el aviso comparte el footer con las acciones,
   iguala la altura nominal de los botones y aumenta la legibilidad del texto. */
.system-notification-copy > span {
    font-weight: 700;
}

.modal-foot {
    justify-content: flex-start;
    align-items: center;
}
.modal-foot-actions {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}
.notification-region-modal {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 0;
    border-top: 0;
    background: transparent;
}
.notification-region-modal.is-active {
    margin-right: 3px;
}
.notification-region-modal .system-notification {
    min-height: 38px;
    padding: 3px 6px;
    grid-template-columns: 26px minmax(0, 1fr) 30px;
    gap: 6px;
    line-height: 1.25;
}
.notification-region-modal .system-notification-icon {
    width: 26px;
    height: 26px;
    font-size: 15px;
}
.notification-region-modal .system-notification-close {
    width: 30px;
    min-width: 30px;
    height: 30px;
    font-size: 18px;
}
.modal-foot[hidden] { display: none !important; }
.modal-foot-notification-only {
    min-height: 54px;
}
.modal-foot-notification-only .notification-region-modal {
    margin-right: 0;
}

@media (max-width: 1100px) {
    .modal-foot-actions { gap: 5px; }
    .notification-region-modal { padding: 0; }
    .notification-region-modal .system-notification {
        min-height: 38px;
        font-size: 12px;
    }
}

@media (max-height: 760px) {
    .notification-region-modal { padding-block: 0; }
    .notification-region-modal .system-notification {
        min-height: 38px;
        padding-block: 3px;
    }
}


/* ========================================================================
   LICOFULL UX-8 · GASTOS + FINANZAS
   Prioriza registrar el egreso, desplaza categorías a configuración
   secundaria y expone el resumen financiero existente sin abrir UX-9.
   ======================================================================== */
.expense-list-card { overflow: visible; }
.expense-list-head {
    min-height: 50px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #b2bbc4;
    background: #eef1f4;
}
.expense-list-head > div:first-child { min-width: 0; }
.expense-list-head strong { display: block; font-size: 14px; }
.expense-list-head span { display: block; margin-top: 2px; color: #5b6670; font-size: 11px; line-height: 1.3; }
.expense-list-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.expense-list-head-actions .records-count { margin: 0; white-space: nowrap; }
.expense-filters { padding: 8px 10px; border-bottom: 1px solid #c0c7ce; background: #f7f8f9; }
.expense-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(120px, .78fr)) auto;
    align-items: end;
    gap: 7px;
}
.expense-filter-grid .form-field { min-width: 0; }
.expense-filter-grid .form-label { margin-bottom: 3px; font-size: 11px; font-weight: 700; }
.expense-filter-actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.expense-stats .stat-card { min-width: 0; }
.expense-top-category .stat-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.expense-top-category small { display: block; margin-top: 3px; color: #4f5b65; font-size: 11px; font-weight: 700; }
.expense-priority-table th:first-child { min-width: 250px; }
.expense-priority-table th:nth-child(2) { min-width: 145px; }
.expense-priority-table th:nth-child(3) { min-width: 105px; }
.expense-priority-table th:last-child { width: 78px; }
.expense-priority-table td:first-child strong,
.expense-priority-table td:first-child small { display: block; }
.expense-priority-table td:first-child strong { font-size: 13px; }
.expense-priority-table td:first-child small { margin-top: 2px; color: #606c76; font-size: 10px; }
.expense-table-amount { font-size: 14px; font-weight: 800; white-space: nowrap; }
.expense-form .form-section-title { margin-top: 0; }
.expense-amount-input { font-size: 16px; font-weight: 800; text-align: right; }
.expense-more-section { margin-top: 2px; }
.expense-document-guidance {
    min-height: 34px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    color: #4f5c67;
    border: 1px solid #c0c7ce;
    background: #f4f6f8;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}
.expense-more-section.has-required-fields .expense-document-guidance { color: #704f08; border-color: #d2b35f; background: #fff4cf; }
.expense-detail-hero {
    min-height: 76px;
    margin-bottom: 10px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 14px;
    border: 1px solid #aeb7c0;
    border-left: 5px solid var(--module-accent, #2f5f93);
    background: #f5f7f8;
}
.expense-detail-hero > span { color: #59656f; font-size: 11px; font-weight: 700; }
.expense-detail-hero > strong { grid-row: 2; font-size: 24px; line-height: 1.05; }
.expense-detail-hero > .badge { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.expense-detail-grid { margin-top: 0; }

.finance-summary-filters {
    padding: 8px;
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 7px;
    border: 1px solid #b5bec7;
    background: #f3f5f7;
}
.finance-summary-filters .form-field { min-width: 150px; }
.finance-summary-filters .form-label { margin-bottom: 3px; font-size: 11px; font-weight: 700; }
.finance-summary-content { margin-top: 10px; min-height: 180px; }
.finance-summary-layout { display: grid; gap: 9px; }
.finance-result {
    min-height: 92px;
    padding: 11px 13px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 16px;
    border: 1px solid #9da8b2;
    border-left: 6px solid #477456;
    background: #f3f7f4;
}
.finance-result.is-negative { border-left-color: #9f3a3a; background: #fbf1f1; }
.finance-result > span { font-size: 12px; font-weight: 800; }
.finance-result > strong { grid-row: 1 / span 2; grid-column: 2; font-size: 28px; line-height: 1; white-space: nowrap; }
.finance-result > small { color: #55616b; font-size: 11px; font-weight: 700; }
.finance-summary-group { border: 1px solid #b2bbc4; background: #fff; }
.finance-summary-group > header { padding: 7px 9px; border-bottom: 1px solid #c3cad1; background: #edf0f3; }
.finance-summary-group > header strong,
.finance-summary-group > header span { display: block; }
.finance-summary-group > header strong { font-size: 13px; }
.finance-summary-group > header span { margin-top: 1px; color: #5f6a74; font-size: 10px; }
.finance-metric-grid { padding: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.finance-metric {
    min-height: 72px;
    padding: 8px 9px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    border: 1px solid #c1c8cf;
    background: #f8f9fa;
}
.finance-metric > span { color: #55616b; font-size: 10px; font-weight: 800; }
.finance-metric > strong { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; font-size: 18px; line-height: 1.1; white-space: nowrap; }
.finance-metric > small { margin-top: 4px; color: #66717b; font-size: 10px; line-height: 1.25; }
.finance-metric.is-negative strong,
.finance-metric.is-expense strong { color: #8d3030; }
.finance-metric.is-positive strong { color: #28613c; }
.finance-metric.is-warning strong { color: #76530b; }
.finance-summary-note {
    min-height: 38px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #5f4a15;
    border: 1px solid #d0b56d;
    background: #fff7df;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}
.finance-summary-note svg { width: 18px; height: 18px; flex: 0 0 18px; }

@media (max-width: 1280px) {
    .expense-filter-grid { grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(125px, .8fr)); }
    .expense-filter-actions { justify-self: start; }
}
@media (max-width: 1100px) {
    .expense-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .expense-filter-search { grid-column: span 2; }
    .expense-list-head { align-items: flex-start; }
    .expense-priority-table th:first-child { min-width: 220px; }
    .finance-metric-grid { grid-template-columns: repeat(3, minmax(145px, 1fr)); overflow-x: auto; }
}
@media (max-width: 760px) {
    .expense-list-head { flex-direction: column; }
    .expense-list-head-actions { width: 100%; justify-content: space-between; }
    .expense-filter-grid { grid-template-columns: 1fr; }
    .expense-filter-search { grid-column: auto; }
    .expense-filter-actions { flex-wrap: wrap; }
    .finance-summary-filters { display: grid; grid-template-columns: 1fr; }
    .finance-summary-filters .form-field { min-width: 0; }
    .finance-result { grid-template-columns: 1fr; }
    .finance-result > strong { grid-column: 1; grid-row: auto; font-size: 24px; }
    .finance-metric-grid { grid-template-columns: 1fr; overflow: visible; }
}

/* ===== LICOFULL UX-9 · REPORTES ORIENTADOS A DECISIONES ===== */
.report-page-ux9 { min-width: 0; }
.report-toolbar { align-items: center; }
.report-toolbar-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.report-workspace {
    min-width: 0;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}
.report-nav {
    min-width: 0;
    padding: 8px;
    overflow: hidden;
}
.report-nav-group + .report-nav-group { margin-top: 10px; padding-top: 9px; border-top: 1px solid #c9d0d6; }
.report-nav-group h3 {
    margin: 0 0 5px;
    padding: 0 5px;
    color: #5d6872;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
}
.report-nav-item {
    width: 100%;
    min-height: 43px;
    margin: 0 0 3px;
    padding: 6px 8px;
    display: block;
    color: #26323c;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-left: 4px solid transparent;
    border-radius: 2px;
    cursor: pointer;
}
.report-nav-item > span { display: block; font-size: 13px; font-weight: 800; line-height: 1.2; }
.report-nav-item > small {
    display: block;
    margin-top: 2px;
    color: #66727d;
    font-size: 10px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.report-nav-item:hover { background: #f1f4f6; border-color: #cbd2d8; }
.report-nav-item.active {
    color: #173f65;
    background: #e8f1f8;
    border-color: #a7bfd3;
    border-left-color: #2e6694;
}
.report-nav-item.active > small { color: #3f607c; }
.report-main { min-width: 0; }
.report-current-head {
    min-height: 67px;
    margin-bottom: 7px;
    padding: 8px 10px 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #f8f9fa;
    border: 1px solid #b8c0c8;
    border-left: 4px solid var(--module-accent, #2f5f93);
}
.report-current-head h2 { margin: 1px 0 2px; font-size: 18px; line-height: 1.2; }
.report-current-head p { margin: 0; max-width: 760px; color: #5f6973; font-size: 12px; line-height: 1.35; }
.report-current-group { color: #496579; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.report-period {
    flex: 0 0 auto;
    max-width: 260px;
    padding: 5px 8px;
    color: #41505c;
    background: #eef1f3;
    border: 1px solid #c8ced3;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    text-align: right;
}
.report-page-ux9 .report-filter-card { margin-bottom: 8px; padding: 8px; }
.report-page-ux9 .report-filters { display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.report-filter-controls { min-width: 0; display: flex; align-items: end; flex-wrap: wrap; gap: 7px; }
.report-filter-field { min-width: 142px; }
.report-filter-top { min-width: 125px; }
.report-filter-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.report-check {
    min-height: 38px;
    min-width: 155px;
    padding: 4px 7px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #2e3943;
    background: #f7f8f9;
    border: 1px solid #c3cbd2;
    border-radius: 2px;
    cursor: pointer;
}
.report-check input { width: 17px; height: 17px; flex: 0 0 auto; }
.report-check span { min-width: 0; display: block; }
.report-check strong { display: block; font-size: 12px; line-height: 1.1; }
.report-check small { display: block; margin-top: 1px; color: #68737c; font-size: 9px; line-height: 1.15; }
.report-kpi-grid {
    min-width: 0;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}
.report-kpi { min-width: 0; min-height: 75px; }
.report-kpi > span { font-size: 10px; line-height: 1.2; }
.report-kpi > strong { margin-top: 5px; display: block; font-size: 18px; line-height: 1.15; overflow-wrap: anywhere; }
.report-kpi > small { margin-top: 3px; display: block; color: #68737c; font-size: 10px; }
.report-kpi-primary { background: #edf4fa; border-color: #8fb1cb; border-top-color: #27618d; }
.report-kpi-primary > strong { color: #174e78; font-size: 20px; }
.report-page-ux9 .report-card { margin-top: 8px; }
.report-page-ux9 .report-card .card-head { min-height: 39px; }
.report-page-ux9 .report-card .card-head > div p { margin: 1px 0 0; color: #68737c; font-size: 10px; }
.report-two-column { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.report-summary-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.report-summary-grid .report-card { margin-top: 0; }
.report-metric-grid { padding: 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.report-metric-grid > div { min-width: 0; padding: 6px 7px; background: #f7f8f9; border: 1px solid #d1d6da; }
.report-metric-grid span { display: block; color: #606b74; font-size: 10px; line-height: 1.2; }
.report-metric-grid strong { display: block; margin-top: 3px; color: #26323b; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.report-data-table { min-width: 100%; }
.report-empty-inline { padding: 14px 10px; color: #65717a; font-size: 12px; text-align: center; }
.report-finance-note {
    margin: 8px 0 0;
    padding: 7px 9px;
    color: #5b4a18;
    background: #fff7dc;
    border: 1px solid #d9c176;
    font-size: 11px;
    line-height: 1.35;
}

@media (max-width: 1180px) {
    .report-workspace { grid-template-columns: 195px minmax(0, 1fr); gap: 8px; }
    .report-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .report-nav-item > small { display: none; }
    .report-nav-item { min-height: 36px; }
    .report-current-head p { max-width: 580px; }
    .report-page-ux9 .report-filters { align-items: stretch; flex-direction: column; }
    .report-filter-actions { justify-content: flex-end; }
}

@media (max-width: 900px) {
    .report-workspace { display: block; }
    .report-nav { margin-bottom: 7px; display: flex; gap: 6px; overflow-x: auto; }
    .report-nav-group { flex: 0 0 auto; min-width: 150px; }
    .report-nav-group + .report-nav-group { margin-top: 0; padding-top: 0; padding-left: 6px; border-top: 0; border-left: 1px solid #c9d0d6; }
    .report-current-head { align-items: flex-start; flex-direction: column; gap: 5px; }
    .report-period { max-width: none; text-align: left; }
    .report-two-column, .report-summary-grid { grid-template-columns: 1fr; }
    .report-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ===== LICOFULL UX-10 · ADMINISTRACIÓN ===== */
.system-workspace {
    min-width: 0;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}
.system-nav {
    min-width: 0;
    padding: 7px;
    display: grid;
    gap: 4px;
    border: 1px solid #b8c0c8;
    background: #eef1f3;
}
.system-nav-item {
    width: 100%;
    min-height: 46px;
    padding: 7px 9px;
    display: block;
    text-align: left;
    color: #29323a;
    background: #f8f9fa;
    border: 1px solid transparent;
    cursor: pointer;
}
.system-nav-item > span { display: block; font-size: 13px; font-weight: 800; line-height: 1.2; }
.system-nav-item > small { display: block; margin-top: 2px; color: #65717b; font-size: 11px; line-height: 1.2; }
.system-nav-item:hover { border-color: #aeb8c1; background: #fff; }
.system-nav-item.active { color: #164f7d; border-color: #7da7c8; background: #e7f1f8; box-shadow: inset 3px 0 #2e6f9e; }
.system-nav-item.danger > span { color: #8b2e2e; }
.system-nav-item.danger.active { border-color: #c28e8e; background: #f9eaea; box-shadow: inset 3px 0 #a83b3b; }
.system-section { min-width: 0; display: grid; gap: 10px; }
.system-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.system-overview-card { min-height: 104px; padding: 11px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; gap: 4px 10px; align-items: center; }
.system-overview-card > strong { font-size: 13px; }
.system-overview-card > span { color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.system-overview-card > .btn { grid-column: 2; grid-row: 1 / span 2; }

.checklist-control {
    min-width: 0;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    border: 1px solid #aeb7c0;
    background: #f8f9fa;
}
.checklist-option {
    min-height: 36px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d1d6db;
    background: #fff;
    cursor: pointer;
}
.checklist-option:hover { border-color: #98a9b7; background: #f3f7fa; }
.checklist-option input { width: 18px; height: 18px; flex: 0 0 auto; }
.checklist-option span { min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.permissions-quick-actions .permissions-bulk-action { opacity: .82; }

.company-form { display: grid; gap: 10px; padding: 10px; }
.company-form-section { min-width: 0; border: 1px solid #c1c8ce; background: #fbfcfc; }
.company-form-section > header { padding: 8px 10px; border-bottom: 1px solid #d2d7dc; background: #eef1f3; }
.company-form-section > header h3 { margin: 0; font-size: 14px; }
.company-form-section > header p { margin: 2px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.35; }
.company-form-section > .form-grid { padding: 10px; }
.company-form > .form-actions { padding: 0; }

.audit-event-cell strong, .audit-event-cell small { display: block; }
.audit-event-cell strong { font-size: 13px; line-height: 1.3; }
.audit-event-cell small { margin-top: 2px; color: var(--text-muted); font-size: 10px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.audit-human-summary { padding: 11px; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; border: 1px solid #aebdca; background: #eef5fa; }
.audit-human-icon { width: 38px; height: 38px; display: grid; place-items: center; color: #245d87; border: 1px solid #8ca9bf; background: #fff; }
.audit-human-icon svg { width: 20px; height: 20px; }
.audit-human-summary h3 { margin: 0; font-size: 15px; line-height: 1.3; }
.audit-human-summary p { margin: 4px 0 0; font-size: 12px; }
.audit-context-grid { margin-top: 9px; }
.audit-technical-details { margin-top: 10px; border: 1px solid #c0c7ce; background: #f8f9fa; }
.audit-technical-details > summary { min-height: 38px; padding: 8px 10px; display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.audit-technical-body { padding: 10px; border-top: 1px solid #d2d7dc; background: #fff; }

@media (max-width: 1100px) {
    .system-workspace { grid-template-columns: 190px minmax(0, 1fr); }
    .system-nav-item > small { display: none; }
    .system-nav-item { min-height: 38px; }
}
@media (max-width: 900px) {
    .system-workspace { grid-template-columns: 1fr; }
    .system-nav { display: flex; gap: 5px; overflow-x: auto; }
    .system-nav-item { flex: 0 0 auto; width: auto; min-width: 128px; }
    .system-overview-grid { grid-template-columns: 1fr; }
    .checklist-control { grid-template-columns: 1fr; }
}
@media (max-height: 760px) {
    .system-nav-item { min-height: 36px; padding-block: 5px; }
    .system-section { gap: 7px; }
    .system-overview-card { min-height: 84px; }
}

/* ===== LICOFULL UX-10 · ADMINISTRACIÓN =====
   Administración prioriza tareas humanas; Configuración/Sistema queda para UX-11. */
.users-permissions-page .permissions-page-card { padding: 10px; overflow: visible; }
.permissions-page-intro {
    min-height: 46px;
    margin-bottom: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #b8c3cc;
    background: #eef4f8;
}
.permissions-page-intro strong { font-size: 14px; }
.permissions-page-intro span { color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.users-permissions-page .permissions-manager { gap: 9px; }
.users-permissions-page .permissions-role-summary { min-height: 46px; padding: 7px 9px; }
.users-permissions-page .permissions-role-summary > div { min-width: 0; }
.users-permissions-page .permissions-role-summary strong,
.users-permissions-page .permissions-role-summary span { display: block; }
.users-permissions-page .permissions-role-summary strong { font-size: 14px; }
.users-permissions-page .permissions-role-summary span { margin-top: 2px; font-size: 11px; }
.permission-recommendation-state {
    flex: 0 0 auto;
    padding: 4px 7px;
    border: 1px solid #b7bec5;
    background: #fff;
    font-size: 11px !important;
    font-weight: 750;
}
.permission-recommendation-state.is-recommended { color: #245d38 !important; border-color: #94b7a0; background: #e9f4ec; }
.permission-recommendation-state.is-custom { color: #79580b !important; border-color: #ccb66f; background: #fff6d9; }
.users-permissions-page .permission-group-head { min-height: 52px; padding: 8px 10px; }
.users-permissions-page .permission-group-head h3 { font-size: 14px; }
.users-permissions-page .permission-group-head p { font-size: 11px; line-height: 1.3; }
.users-permissions-page .permission-option { min-height: 48px; padding: 7px 9px; }
.users-permissions-page .permission-option strong { font-size: 13px; }
.users-permissions-page .permission-option small { font-size: 10px; }

.company-form-details > summary {
    min-height: 52px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    list-style: none;
    cursor: pointer;
    background: #eef1f3;
}
.company-form-details > summary::-webkit-details-marker { display: none; }
.company-form-details > summary strong,
.company-form-details > summary small { display: block; }
.company-form-details > summary strong { font-size: 14px; }
.company-form-details > summary small { margin-top: 2px; color: var(--text-muted); font-size: 11px; line-height: 1.35; }
.company-form-details .details-indicator { font-size: 16px; transition: transform .15s ease; }
.company-form-details[open] .details-indicator { transform: rotate(180deg); }
.company-form-details[open] > summary { border-bottom: 1px solid #d2d7dc; }
.company-logo-preview {
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 1px solid #c1c8ce;
    background: #fbfcfc;
}
.company-logo-preview > span { font-size: 12px; font-weight: 800; }
.company-logo-preview > div { min-height: 58px; display: flex; align-items: center; }
.company-logo-preview img { max-width: 180px; max-height: 58px; object-fit: contain; }

.payment-behavior-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.payment-behavior-tags span {
    padding: 2px 6px;
    border: 1px solid #b8c1c9;
    background: #f4f6f7;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.audit-table .audit-event-cell { min-width: 250px; }
.audit-event-cell small { margin-top: 3px; font-size: 11px; font-family: inherit; }
.audit-table th:last-child,
.audit-table td:last-child { width: 92px; }
.audit-technical-details > summary:focus-visible { outline: 2px solid #1b72c5; outline-offset: -2px; }

@media (max-width: 1100px) {
    .users-permissions-page .permissions-toolbar { grid-template-columns: minmax(170px, .7fr) minmax(210px, 1fr); }
    .users-permissions-page .permissions-quick-actions { grid-column: 1 / -1; }
    .users-permissions-page .permission-options { grid-template-columns: 1fr; }
    .users-permissions-page .permission-option:nth-child(odd) { border-right: 0; }
    .company-logo-preview { grid-template-columns: 130px minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .permissions-page-intro,
    .users-permissions-page .permissions-role-summary { align-items: flex-start; flex-direction: column; }
    .permission-recommendation-state { flex: 0 1 auto; }
    .company-logo-preview { grid-template-columns: 1fr; }
}

/* ===== LICOFULL UX-11 · CONFIGURACIÓN / SISTEMA =====
   Sistema prioriza tareas humanas y deja detalle técnico bajo divulgación progresiva. */
.system-settings-page .ops-section,
.system-settings-page .ops-health {
    padding: 12px;
}
.system-settings-page .ops-section > header,
.system-settings-page .ops-health-head {
    margin-bottom: 10px;
}
.system-settings-page .ops-section h3,
.system-settings-page .ops-health h3 {
    font-size: 15px;
    line-height: 1.25;
}
.system-settings-page .ops-section p,
.system-settings-page .ops-health p,
.system-settings-page .field-help,
.system-settings-page .muted-copy {
    font-size: 12px;
    line-height: 1.4;
}
.system-health-card .ops-health-head > div { min-width: 0; }
.system-health-card .ops-health-head h3 { margin-top: 6px; }
.system-health-card .ops-health-head p { margin: 3px 0 0; color: var(--text-muted); }
.system-health-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.system-health-kpis > div { min-width: 0; }
.system-health-kpis strong { overflow-wrap: anywhere; }
.system-health-warning {
    margin-top: 8px;
    padding: 8px 10px;
    color: #624a12;
    border: 1px solid #d5bd75;
    background: #fff7dc;
}
.system-health-warning > strong { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.system-health-warning svg { width: 16px; height: 16px; flex: 0 0 auto; }
.system-health-warning ul { margin: 6px 0 0 20px; padding: 0; font-size: 12px; line-height: 1.4; }
.system-technical-status,
.system-advanced-details,
.system-restore-details,
.session-technical,
.system-error-tech {
    border: 1px solid #c2c9cf;
    background: #f8f9fa;
}
.system-technical-status { margin-top: 8px; }
.system-technical-status > summary,
.system-advanced-details > summary,
.system-restore-details > summary,
.session-technical > summary,
.system-error-tech > summary {
    min-height: 36px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.system-technical-grid {
    padding: 9px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    border-top: 1px solid #d1d6da;
    background: #fff;
}
.system-technical-grid > div { min-width: 0; }
.system-technical-grid span,
.system-technical-grid strong { display: block; }
.system-technical-grid span { color: var(--text-muted); font-size: 11px; }
.system-technical-grid strong { margin-top: 2px; font-size: 12px; overflow-wrap: anywhere; }
.system-overview-head { padding: 2px 2px 0; }
.system-overview-head h3 { margin: 0; font-size: 15px; }
.system-overview-head p { margin: 2px 0 0; color: var(--text-muted); font-size: 12px; }
.system-overview-card {
    min-height: 94px;
    padding: 10px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    gap: 9px;
}
.system-overview-card > div:nth-child(2) { min-width: 0; }
.system-overview-card > div:nth-child(2) strong,
.system-overview-card > div:nth-child(2) span { display: block; }
.system-overview-card > div:nth-child(2) strong { font-size: 13px; }
.system-overview-card > div:nth-child(2) span { margin-top: 2px; color: var(--text-muted); font-size: 12px; line-height: 1.3; }
.system-overview-card > .btn { grid-column: auto; grid-row: auto; }
.system-overview-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #245d87;
    border: 1px solid #a9bdcc;
    background: #eef5fa;
}
.system-overview-icon svg { width: 18px; height: 18px; }
.system-config-form { gap: 9px; }
.system-form-group {
    min-width: 0;
    border: 1px solid #c1c8ce;
    background: #fbfcfc;
}
.system-form-group > header {
    padding: 8px 10px;
    border-bottom: 1px solid #d2d7dc;
    background: #eef1f3;
}
.system-form-group > header strong,
.system-form-group > header span { display: block; }
.system-form-group > header strong { font-size: 13px; }
.system-form-group > header span { margin-top: 2px; color: var(--text-muted); font-size: 11px; line-height: 1.35; }
.system-form-group > .form-grid { padding: 10px; }
.input-with-unit { min-width: 0; display: flex; align-items: stretch; }
.input-with-unit .form-control { min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-with-unit > span {
    min-width: 46px;
    padding: 0 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4d5963;
    background: #eef1f3;
    border: 1px solid #aeb7c0;
    border-left: 0;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.system-primary-switch {
    padding: 9px 10px;
    border: 1px solid #b7c5d0;
    background: #eef5fa;
}
.system-primary-switch .switch-control { width: fit-content; }
.system-primary-switch .field-help { margin-top: 4px; display: block; }
.system-details-body {
    padding: 9px;
    border-top: 1px solid #d1d6da;
    background: #fff;
}
.system-maintenance-note {
    min-height: 66px;
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid #b7c5d0;
    background: #eef5fa;
}
.system-maintenance-note strong { font-size: 12px; }
.system-maintenance-note span { margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.system-step-title {
    margin: 8px 0 6px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}
.system-step-title:first-child { margin-top: 0; }
.system-step-title > span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #2e6f9e;
    font-size: 13px;
    font-weight: 900;
}
.system-step-title h4 { margin: 0; font-size: 13px; }
.system-step-title p { margin: 1px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.3; }
.system-transfer-core { margin-bottom: 7px; }
.system-transfer-card .system-advanced-details { margin: 8px 0; }
.system-export-panel > h4 { font-size: 14px; }
.system-restore-details { margin-top: 9px; border-color: #c7a3a3; background: #fff7f7; }
.system-restore-details > summary { min-height: 40px; color: #7b3131; }
.system-restore-details > summary svg { width: 16px; height: 16px; }
.system-restore-body { padding: 10px; border-top: 1px solid #d9baba; background: #fff; }
.system-restore-warning {
    margin-bottom: 9px;
    padding: 9px 10px;
    border: 1px solid #d5b1b1;
    background: #fbecec;
}
.system-restore-warning strong,
.system-restore-warning span { display: block; }
.system-restore-warning strong { color: #7b2e2e; font-size: 12px; }
.system-restore-warning span { margin-top: 3px; font-size: 11px; line-height: 1.4; }
.system-backup-list td > strong,
.system-backup-list td > small { display: block; }
.system-backup-list td > small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.session-technical,
.system-error-tech { margin-top: 4px; border: 0; background: transparent; }
.session-technical > summary,
.system-error-tech > summary { min-height: 26px; padding: 2px 0; color: #315d7a; font-size: 10px; }
.session-technical small,
.system-error-tech code { display: block; margin-top: 3px; color: #59646d; font-size: 10px; overflow-wrap: anywhere; }
.system-error-summary strong,
.system-error-summary small { display: block; }
.system-error-summary strong { font-size: 12px; line-height: 1.35; }
.system-error-summary small { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.system-record-count { display: block; margin-top: 4px; color: #59646d; font-size: 11px; font-weight: 700; }
.system-danger-explainer {
    margin: 10px 12px 0;
    padding: 9px 10px;
    border: 1px solid #d2b3b3;
    background: #fff5f5;
}
.system-danger-explainer strong,
.system-danger-explainer span { display: block; }
.system-danger-explainer strong { color: #7c3030; font-size: 12px; }
.system-danger-explainer span { margin-top: 3px; font-size: 11px; line-height: 1.4; }

@media (max-width: 1180px) {
    .system-health-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .system-technical-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .system-overview-card { grid-template-columns: 32px minmax(0, 1fr) auto; }
    .system-overview-icon { width: 32px; height: 32px; }
}
@media (max-width: 1024px) {
    .system-settings-page .ops-section,
    .system-settings-page .ops-health { padding: 10px; }
    .system-overview-grid { grid-template-columns: 1fr; }
    .system-overview-card { min-height: 76px; }
    .system-form-group > .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .transfer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .system-health-kpis,
    .system-technical-grid,
    .system-form-group > .form-grid { grid-template-columns: 1fr; }
    .system-overview-card { grid-template-columns: 32px minmax(0, 1fr); }
    .system-overview-card > .btn { grid-column: 1 / -1; justify-self: stretch; }
}

/* ===== LICOFULL UX-11.1 · ENRUTAMIENTO DE PAQUETES .LICOFULL ===== */
.system-package-routing {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #c79b3a;
    background: #fff7df;
}
.system-package-routing > div { min-width: 0; display: grid; gap: 3px; }
.system-package-routing strong { font-size: 13px; color: #5f4308; }
.system-package-routing span { font-size: 12px; line-height: 1.4; color: #5d5140; }
.system-package-routing .btn { flex: 0 0 auto; }
@media (max-width: 1024px) {
    .system-package-routing { align-items: stretch; flex-direction: column; }
    .system-package-routing .btn { align-self: flex-start; }
}

/* ========================================================================
   LICOFULL UX-12 · PULIDO Y VALIDACIÓN FINAL
   Cierre transversal: legibilidad secundaria, controles explícitos, estado
   ocupado accesible y resistencia a overflow sin rediseñar módulos.
   ======================================================================== */

/* Ningún texto auxiliar operativo debe volver a los 8–10 px heredados. */
#app-root small {
    font-size: 11px;
    line-height: 1.35;
}
.cash-tab-state,
.cash-count-input > small,
.cash-count-summary span,
.toolbar-actions kbd,
.report-current-group,
.report-kpi > span,
.report-metric-grid span,
.finance-metric > span,
.pos-lookup-price > span,
.pos-lookup-stock > span {
    font-size: 11px;
}
@media (max-width: 1040px) {
    .pos-product-stock strong { font-size: 11px; }
}

/* Estado ocupado común: visible, accesible y sin estilos inline. */
.boot-spinner-inline {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border-width: 2px;
}
button[aria-busy="true"] { cursor: progress; }

/* Los contenedores flex/grid pueden encogerse antes de forzar overflow global. */
.desktop-workspace,
.page-container,
.page-toolbar,
.page-toolbar > *,
.toolbar-actions,
.card,
.admin-card,
.operations-page,
.report-page,
.settings-page {
    min-width: 0;
}
.table-wrap,
.table-scroll {
    min-width: 0;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* Divulgación progresiva: área de activación cómoda y foco inequívoco. */
details:not(.table-action-menu) > summary { min-height: 34px; }
details:not(.table-action-menu) > summary:focus-visible {
    outline: 2px solid var(--ux-focus);
    outline-offset: -2px;
}
