/* ========================================================================== 
   Sistema de Ventas · Tema profesional v41
   Capa visual corporativa: sidebar claro, topbar compacta, formularios,
   listados, dashboard y modales. No altera la lógica funcional.
   ========================================================================== */

:root {
    --ui-primary: #2d176f;
    --ui-primary-strong: #211052;
    --ui-primary-soft: #f0edfa;
    --ui-accent: #ec1764;
    --ui-blue: #1677ff;
    --ui-success: #12a96b;
    --ui-warning: #e58a12;
    --ui-danger: #d92d20;
    --ui-bg: #f4f7fc;
    --light-color: #f4f7fc;
    --dark-color: #191d2b;
    --ui-panel: #ffffff;
    --ui-panel-soft: #f8f9fc;
    --ui-border: #e4e6ee;
    --ui-border-strong: #d7dae5;
    --ui-text: #191d2b;
    --ui-muted: #697386;
    --ui-muted-2: #9199a8;
    --ui-radius: 10px;
    --ui-radius-sm: 7px;
    --ui-shadow: 0 3px 14px rgba(30, 35, 55, .045);
    --ui-shadow-lg: 0 18px 50px rgba(26, 30, 48, .16);
    --sidebar-width: 276px;
    --topbar-height: 64px;
}

html,
body {
    background: var(--light-color, var(--ui-bg));
}

/*
 * Base tipográfica profesional v38: Montserrat, 15 px y 24 px de interlineado.
 * Poppins se reserva para títulos y elementos de jerarquía visual.
 */
body {
    color: #777;
    font-family: "Montserrat", sans-serif;
    line-height: 24px;
    margin: 0;
    font-size: 15px !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.app-layout {
    min-height: 100vh;
    overflow-x: hidden;
    color: #777;
    background: var(--light-color, var(--ui-bg));
    font-family: var(--font-body, "Montserrat", sans-serif);
    font-size: 15px !important;
    line-height: 24px;
}

body.guest-layout {
    color: #777;
    background: var(--light-color, var(--ui-bg));
    font-family: var(--font-body, "Montserrat", sans-serif);
    font-size: 15px !important;
    line-height: 24px;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

h1, h2, h3, h4, h5, h6,
.brand-copy strong,
.topbar-context strong,
.dashboard-welcome h1,
.dashboard-action-section > h2,
.app-modal-header h2 {
    font-family: var(--font-display, "Poppins", sans-serif);
}

/* ---------- Sidebar claro, sobrio y corporativo ---------- */
.sidebar {
    width: var(--sidebar-width);
    color: #32364a;
    background: #fff;
    border-right: 1px solid var(--ui-border);
    box-shadow: none;
}

.sidebar-brand {
    min-height: 72px;
    padding: 0 18px;
    color: var(--ui-text);
    border-bottom: 1px solid var(--ui-border);
    background: #fff;
}

.sidebar-brand:hover {
    background: #fbfbfd;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    color: #fff;
    background: var(--ui-primary);
    box-shadow: none;
    font-size: .72rem;
}

.brand-copy strong {
    color: #171a26;
    font-size: .92rem;
    font-weight: 800;
}

.brand-copy span {
    color: #8a91a1;
    font-size: .68rem;
}

.sidebar-nav {
    padding: 14px 10px 22px;
    scrollbar-color: #d1d5df transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #d1d5df;
}

.sidebar-category {
    margin-top: 15px;
    padding: 6px 12px 6px;
    color: #a0a6b3;
    font-size: .61rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.sidebar-category:first-child {
    margin-top: 0;
}

.sidebar-direct-link,
.sidebar-group > summary {
    min-height: 42px;
    gap: 11px;
    padding: 8px 11px;
    border-radius: 7px;
    color: #25293b;
    font-size: .84rem;
    font-weight: 650;
}

.sidebar-direct-link:hover,
.sidebar-group > summary:hover {
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
}

.sidebar-direct-link.is-active {
    color: #fff;
    background: var(--ui-primary);
    box-shadow: none;
}

.sidebar-group.is-current > summary {
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
}

.nav-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
    stroke-width: 1.75;
}

.sidebar-chevron {
    width: 14px;
    height: 14px;
    color: #969cab;
}

.sidebar-submenu {
    margin: 3px 0 7px 18px;
    padding: 3px 0 3px 17px;
    border-left: 1px solid #e5e2ef;
}

.sidebar-submenu-link {
    min-height: 34px;
    padding: 6px 9px;
    border-radius: 6px;
    color: #61697b;
    font-size: .79rem;
    font-weight: 550;
}

.sidebar-submenu-link:hover {
    color: var(--ui-primary);
    background: #f8f6fc;
}

.sidebar-submenu-link.is-active {
    color: #fff;
    background: var(--ui-primary);
    font-weight: 700;
}

.submenu-dot {
    width: 4px;
    height: 4px;
    background: #b9bec9;
}

.sidebar-submenu-link.is-active .submenu-dot {
    background: #fff;
    box-shadow: none;
}

.sidebar-footer {
    min-height: 58px;
    margin: 0 10px 10px;
    padding: 9px 11px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #fafafd;
}

.sidebar-footer-mark {
    width: 31px;
    height: 31px;
    border-radius: 7px;
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
}

.sidebar-footer-copy strong {
    color: #33384a;
    font-size: .72rem;
}

.sidebar-footer-copy small {
    color: #979dac;
    font-size: .64rem;
}

/* ---------- Topbar ---------- */
.app-main {
    margin-left: var(--sidebar-width);
}

.app-topbar {
    height: var(--topbar-height);
    padding: 0 20px;
    gap: 18px;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid var(--ui-border);
    box-shadow: none;
}

.topbar-left {
    gap: 12px;
}

.topbar-context {
    gap: 0;
}

.topbar-kicker {
    color: #9aa0ad;
    font-size: .6rem;
    letter-spacing: .10em;
}

.topbar-context strong {
    color: #252938;
    font-size: .91rem;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.topbar-quick-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.topbar-quick-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--ui-border);
    border-radius: 7px;
    color: #373b4c;
    background: #f8f8fb;
    font-size: .74rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}

.topbar-quick-link:hover {
    color: var(--ui-primary);
    border-color: #d8d0ea;
    background: #f3effa;
}

.topbar-action-icon {
    width: 16px;
    height: 16px;
}

.environment-pill {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border: 1px solid #e7d8e1;
    border-radius: 7px;
    color: #8d1747;
    background: #fff6fa;
}

.environment-pill > i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ui-accent);
    box-shadow: 0 0 0 3px rgba(236,23,100,.10);
}

.environment-pill > span {
    display: grid;
    gap: 0;
}

.environment-pill strong {
    font-size: .66rem;
    line-height: 1.1;
}

.environment-pill small {
    color: #a35a78;
    font-size: .56rem;
    line-height: 1.15;
}

.user-menu > summary {
    min-height: 42px;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 7px;
}

.user-menu > summary:hover,
.user-menu[open] > summary {
    background: #f6f6f9;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border: 1px solid #ded9ec;
    border-radius: 8px;
    color: var(--ui-primary);
    background: #f1eef8;
    font-size: .75rem;
}

.user-summary-copy strong {
    max-width: 170px;
    color: #282c3b;
    font-size: .75rem;
}

.user-summary-copy small {
    color: #989eaa;
    font-size: .63rem;
}

.user-menu-panel {
    width: 244px;
    padding: 7px;
    border-color: var(--ui-border);
    border-radius: 9px;
    box-shadow: var(--ui-shadow-lg);
}

.user-menu-panel > a,
.user-menu-panel button {
    min-height: 38px;
    border-radius: 6px;
    font-size: .77rem;
}

.user-menu-panel > a:hover,
.user-menu-panel button:hover {
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
}

/* ---------- Área de contenido ---------- */
.app-content {
    width: min(100%, 1640px);
    padding: 24px 24px 48px;
}

.app-content .page-head {
    min-height: 54px;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
}

.app-content .page-head h1 {
    margin: 0 0 3px;
    color: #202432;
    font-size: 1.25rem;
    font-weight: 750;
    letter-spacing: -.015em;
}

.app-content .page-head p,
.app-content .muted {
    color: var(--ui-muted);
    font-size: .8rem;
    line-height: 1.45;
}

.app-content .page-head > a:not(.button) {
    color: var(--ui-primary);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}

/* ---------- Botones ---------- */
.app-content .button,
.app-modal .button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #fff;
    background: var(--ui-primary);
    box-shadow: none;
    font-size: .76rem;
    font-weight: 750;
    line-height: 1;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}

.app-content .button:hover,
.app-modal .button:hover {
    transform: none;
    box-shadow: none;
    background: var(--ui-primary-strong);
}

.app-content .button.secondary,
.app-modal .button.secondary {
    color: #3c4252;
    border-color: var(--ui-border-strong);
    background: #fff;
}

.app-content .button.secondary:hover,
.app-modal .button.secondary:hover {
    color: var(--ui-primary);
    border-color: #cec5e2;
    background: #f8f6fc;
}

.app-content .button.danger {
    background: var(--ui-danger);
}

/* ---------- Formularios / filtros ---------- */
.app-content .form-grid,
.app-content .search,
.app-modal-grid {
    color: #353a4a;
}

.app-content .form-grid label,
.app-content .form-field,
.app-modal-grid label,
.app-modal-grid .form-field {
    gap: 5px;
    color: #3a3f4f;
    font-size: .76rem;
    font-weight: 650;
}

.app-content input:not([type="checkbox"]):not([type="radio"]),
.app-content select,
.app-content textarea,
.app-modal input:not([type="checkbox"]):not([type="radio"]),
.app-modal select,
.app-modal textarea {
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #d7dae3;
    border-radius: 6px;
    color: #232735;
    background: #fff;
    font: 400 14px/1.4 var(--font-body, "Montserrat", sans-serif);
    box-shadow: none;
    transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}

.app-content textarea,
.app-modal textarea {
    min-height: 66px;
    resize: vertical;
}

.app-content input:focus,
.app-content select:focus,
.app-content textarea:focus,
.app-modal input:focus,
.app-modal select:focus,
.app-modal textarea:focus {
    outline: 0;
    border-color: #8b7ab7;
    box-shadow: 0 0 0 3px rgba(45,23,111,.09);
}

.app-content input::placeholder,
.app-modal input::placeholder,
.app-content textarea::placeholder,
.app-modal textarea::placeholder {
    color: #a4aab6;
}

.app-content .search {
    min-height: 58px;
    margin: 0 0 14px;
    padding: 10px;
    align-items: center;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
}

.app-content .search input,
.app-content .search select {
    min-height: 36px;
}

/* ---------- Tarjetas y tablas ---------- */
.app-content .card,
.app-content .metric {
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    background: #fff;
    box-shadow: var(--ui-shadow);
}

.app-content .card {
    padding: 18px;
}

.app-content .card h2 {
    color: #282c39;
    font-size: .9rem;
    font-weight: 750;
}

.app-content .table-wrap {
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    box-shadow: none;
}

.app-content .table-wrap th,
.app-content table th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--ui-border);
    color: #4a5060;
    background: #fafafd;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .025em;
    text-transform: none;
}

.app-content .table-wrap td,
.app-content table td {
    padding: 10px 12px;
    border-bottom-color: #eceef3;
    color: #353a49;
    font-size: .76rem;
    line-height: 1.35;
}

.app-content td small {
    margin-top: 2px;
    color: #8a91a0;
    font-size: .68rem;
}

.app-content .table-wrap tbody tr:hover {
    background: #faf9fd;
}

.app-content .badge {
    padding: 4px 7px;
    border-radius: 5px;
    font-size: .65rem;
    font-weight: 750;
}

.pagination {
    gap: 4px;
}

.pagination a {
    min-width: 32px;
    min-height: 30px;
    display: grid;
    place-items: center;
    padding: 4px 7px;
    border-color: var(--ui-border);
    border-radius: 6px;
    color: #555b6c;
    background: #fff;
    font-size: .72rem;
    text-decoration: none;
}

.pagination a.active {
    border-color: var(--ui-primary);
    background: var(--ui-primary);
}

/* ---------- Form sections ---------- */
.form-section {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.form-section + .form-section {
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid #ececf2;
}

.form-section > legend {
    width: 100%;
    margin: 0 0 11px;
    padding: 0;
    color: #292d3b;
    font-size: .77rem;
    font-weight: 800;
}

.form-section > legend small {
    margin-left: 6px;
    color: #969cab;
    font-size: .65rem;
    font-weight: 500;
}

.form-section-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px 13px;
}

.form-section-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-section-grid .full {
    grid-column: 1 / -1;
}

.form-section-grid .span-2 {
    grid-column: span 2;
}

.entity-active-check,
.customer-active-check {
    min-height: 36px;
    padding: 7px 9px;
    display: flex !important;
    align-items: center;
    gap: 7px !important;
    border: 1px solid #e1e3e9;
    border-radius: 6px;
    background: #fafafd;
    font-size: .72rem !important;
}

.entity-active-check input,
.customer-active-check input,
.app-content .check input,
.app-modal .check input {
    width: 15px !important;
    height: 15px;
    min-height: 0 !important;
    margin: 0;
    accent-color: var(--ui-primary);
}

.field-action-row {
    grid-template-columns: minmax(0,1fr) 36px;
    gap: 6px;
}

.field-create-button {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    border: 1px solid #d8d3e4;
    border-radius: 6px;
    color: var(--ui-primary);
    background: #f5f2fb;
    font-size: 1.05rem;
}

.field-create-button:hover {
    border-color: #c7bddc;
    background: #ede8f7;
    transform: none;
}

/* ---------- Modales compactos ---------- */
.app-modal {
    width: min(860px, calc(100vw - 36px));
    max-width: 860px;
    max-height: min(86vh, 760px);
    border: 1px solid #e2e3e9;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(22,24,39,.24);
}

.app-modal::backdrop {
    background: rgba(25, 26, 34, .43);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.app-modal-panel {
    max-height: min(86vh, 760px);
}

.app-modal-header {
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--ui-border);
    background: #fff;
}

.app-modal-header h2 {
    margin: 1px 0 3px;
    color: #232735;
    font-size: 1.05rem;
    font-weight: 750;
}

.app-modal-header p {
    max-width: 680px;
    color: #7e8595;
    font-size: .72rem;
    line-height: 1.4;
}

.modal-eyebrow {
    color: var(--ui-primary);
    font-size: .58rem;
    letter-spacing: .08em;
}

.modal-close {
    width: 31px;
    height: 31px;
    border-color: transparent;
    border-radius: 6px;
    color: #9aa0ad;
    font-size: 1.35rem;
}

.modal-close:hover {
    border-color: #e3e4e9;
    background: #f7f7f9;
}

.app-modal-grid {
    padding: 16px 20px;
    gap: 12px;
}

.entity-modal-wide,
.product-modal {
    width: min(900px, calc(100vw - 36px));
    max-width: 900px;
}

.entity-modal-compact {
    width: min(520px, calc(100vw - 36px));
    max-width: 520px;
}

.entity-modal-grid,
.product-modal-grid,
.compact-grid {
    grid-template-columns: 1fr;
}

.app-modal .form-section-grid {
    gap: 10px 12px;
}

.app-modal-footer {
    padding: 11px 20px;
    gap: 8px;
    border-top: 1px solid var(--ui-border);
    background: #fafafd;
}

.app-modal-footer .button {
    min-width: 96px;
}

.async-save-button {
    min-width: 120px !important;
}

.modal-form-alert {
    margin: 12px 20px 0;
    padding: 9px 11px;
    border-radius: 6px;
    font-size: .74rem;
}

.app-toast {
    right: 18px;
    bottom: 18px;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: .76rem;
}

/* ---------- Dashboard moderno ---------- */
.dashboard-shell {
    display: grid;
    gap: 18px;
}

.dashboard-welcome {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 4px 2px 0;
}

.dashboard-welcome h1 {
    margin: 0 0 3px;
    color: #202432;
    font-size: clamp(1.65rem, 2.4vw, 2rem);
    font-weight: 800;
    letter-spacing: -.025em;
}

.dashboard-welcome p {
    margin: 0;
    color: #676e7e;
    font-size: .88rem;
}

.dashboard-role-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #e0d9ee;
    border-radius: 7px;
    color: var(--ui-primary);
    background: #f7f4fc;
    font-size: .68rem;
    font-weight: 750;
}

.dashboard-role-pill i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ui-primary);
}

.dashboard-action-section {
    display: grid;
    gap: 9px;
}

.dashboard-action-section > h2 {
    margin: 0;
    padding-left: 2px;
    color: #343847;
    font-size: .76rem;
    font-weight: 800;
}

.dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-action-card {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    color: #353949;
    background: #fff;
    box-shadow: var(--ui-shadow);
    text-decoration: none;
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.dashboard-action-card:hover {
    border-color: #d5cce7;
    box-shadow: 0 6px 18px rgba(31, 28, 51, .07);
    transform: translateY(-1px);
}

.dashboard-action-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: var(--ui-primary);
    background: #faf8fd;
}

.dashboard-action-icon svg {
    width: 17px;
    height: 17px;
}

.dashboard-action-card.tone-pink .dashboard-action-icon { color: var(--ui-accent); background: #fff7fa; }
.dashboard-action-card.tone-blue .dashboard-action-icon { color: var(--ui-blue); background: #f6faff; }
.dashboard-action-card.tone-green .dashboard-action-icon { color: var(--ui-success); background: #f5fdf9; }
.dashboard-action-card.tone-orange .dashboard-action-icon { color: #f07b16; background: #fff9f4; }

.dashboard-action-copy {
    min-width: 0;
    flex: 1;
}

.dashboard-action-copy strong {
    display: block;
    overflow: hidden;
    color: #333747;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dashboard-action-copy small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #969cab;
    font-size: .64rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dashboard-action-arrow {
    color: #a2a7b3;
    font-size: 1rem;
}

.dashboard-status-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #fff;
}

.dashboard-status-strip strong {
    display: block;
    margin-bottom: 1px;
    font-size: .76rem;
}

.dashboard-status-strip p {
    margin: 0;
    color: #808797;
    font-size: .68rem;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 10px;
    margin: 0;
}

.dashboard-metrics .metric {
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 14px;
}

.dashboard-metrics .metric span {
    color: #7e8595;
    font-size: .66rem;
    font-weight: 650;
}

.dashboard-metrics .metric strong {
    color: #262a38;
    font-size: 1.18rem;
    font-weight: 800;
}

.dashboard-metrics .metric small {
    color: #a0a6b2;
    font-size: .62rem;
}

.dashboard-analytics-grid {
    gap: 12px;
}

/* ---------- Alertas ---------- */
.app-content .alert {
    padding: 10px 12px;
    border-radius: 7px;
    box-shadow: none;
    font-size: .76rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .topbar-quick-link span,
    .environment-pill small {
        display: none;
    }

    .topbar-quick-link {
        width: 36px;
        padding: 0;
    }

    .environment-pill {
        min-width: 38px;
        justify-content: center;
    }

    .dashboard-action-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 1120px) {
    .app-main {
        margin-left: 0;
    }

    .app-content {
        padding: 20px 18px 42px;
    }
}

@media (max-width: 840px) {
    .environment-pill {
        display: none;
    }

    .form-section-grid,
    .form-section-grid.cols-2,
    .app-modal .form-section-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .form-section-grid .span-2 {
        grid-column: 1 / -1;
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 700px) {
    .topbar-quick-actions {
        display: none;
    }

    .app-content {
        padding: 18px 12px 36px;
    }

    .app-content .page-head {
        align-items: flex-start;
    }

    .app-content .search {
        padding: 9px;
    }

    .form-section-grid,
    .form-section-grid.cols-2,
    .app-modal .form-section-grid {
        grid-template-columns: 1fr;
    }

    .form-section-grid .span-2 {
        grid-column: auto;
    }

    .app-modal,
    .entity-modal-wide,
    .product-modal,
    .entity-modal-compact {
        width: 100vw;
        max-width: none;
        max-height: 100dvh;
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .app-modal-panel {
        max-height: 100dvh;
        height: 100dvh;
    }

    .app-modal-header {
        padding: 14px 15px 12px;
    }

    .app-modal-grid {
        padding: 14px 15px;
    }

    .app-modal-footer {
        padding: 10px 15px;
    }

    .dashboard-welcome {
        flex-direction: column;
    }

    .dashboard-action-grid,
    .dashboard-metrics {
        grid-template-columns: 1fr;
    }
}

/* ---------- Navegación interna de modales ---------- */
.modal-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 20px;
    border-bottom: 1px solid var(--ui-border);
    background: #fff;
    overflow-x: auto;
    scrollbar-width: none;
}

.modal-tabs::-webkit-scrollbar {
    display: none;
}

.modal-tab {
    min-height: 38px;
    padding: 9px 11px 8px;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #7b8292;
    background: transparent;
    font: 650 .72rem/1 Inter, "Segoe UI", Arial, sans-serif;
    white-space: nowrap;
    cursor: pointer;
}

.modal-tab:hover {
    color: var(--ui-primary);
}

.modal-tab.is-active {
    color: var(--ui-primary);
    border-bottom-color: var(--ui-primary);
}

.app-modal [data-modal-tab-panel] {
    display: none;
}

.app-modal [data-modal-tab-panel].is-active {
    display: block;
}

.app-modal [data-modal-tab-panel].form-section + [data-modal-tab-panel].form-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

@media (max-width: 700px) {
    .modal-tabs {
        padding: 0 15px;
    }
}

.app-modal .form-section > legend {
    display: none;
}

/* ---------- Acceso / login coherente con el tema ---------- */
.guest-layout {
    background: #f5f6fa;
}

.guest-topbar {
    height: 64px;
    padding: 0 5vw;
    color: var(--ui-text);
    background: #fff;
    border-bottom: 1px solid var(--ui-border);
}

.guest-brand {
    color: var(--ui-text);
}

.guest-brand strong {
    color: #202432;
}

.guest-brand small {
    color: #9097a6;
}

.guest-content {
    padding-top: 34px;
}

.guest-layout .auth-card {
    width: min(100%, 430px);
    padding: 30px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(31, 35, 52, .08);
}

.guest-layout .auth-card h1 {
    margin: 4px 0 8px;
    color: #202432;
    font-size: 2rem;
    letter-spacing: -.025em;
}

.guest-layout .auth-card .form-stack {
    gap: 14px;
    margin-top: 22px;
}

.guest-layout .auth-card .form-stack label {
    gap: 6px;
    color: #3a3f50;
    font-size: .78rem;
}

.guest-layout .auth-card .form-stack input {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #d7dae3;
    border-radius: 7px;
    font-size: .82rem;
}

.guest-layout .auth-card .form-stack input:focus {
    outline: 0;
    border-color: #8b7ab7;
    box-shadow: 0 0 0 3px rgba(45,23,111,.09);
}

.guest-layout .auth-card .button {
    min-height: 40px;
    border-radius: 7px;
    background: var(--ui-primary);
    box-shadow: none;
    font-size: .8rem;
}


/* ---------- v38 · Escala tipográfica profesional y equilibrada ---------- */
.app-shell,
.app-content,
.sidebar,
.app-topbar,
.app-modal,
.user-menu-panel {
    font-family: var(--font-body, "Montserrat", sans-serif);
}

.app-content {
    color: #777;
    font-size: 15px;
    line-height: 24px;
}

.app-content p,
.app-content li,
.app-content td,
.app-content label,
.app-content small,
.app-modal p,
.app-modal label,
.app-modal small {
    line-height: 22px;
}

.app-content .page-head h1,
.app-content .card h2,
.app-modal-header h2,
.dashboard-welcome h1,
.dashboard-action-section > h2 {
    color: var(--dark-color, var(--ui-text));
}

.app-content input:not([type="checkbox"]):not([type="radio"]),
.app-content select,
.app-content textarea,
.app-modal input:not([type="checkbox"]):not([type="radio"]),
.app-modal select,
.app-modal textarea {
    font-family: var(--font-body, "Montserrat", sans-serif);
    font-size: 14px;
    line-height: 20px;
}

.app-content .button,
.app-modal .button,
.topbar-quick-link,
.sidebar-direct-link,
.sidebar-group > summary,
.sidebar-submenu-link {
    font-family: var(--font-body, "Montserrat", sans-serif);
}

.app-content table th,
.app-content table td {
    font-size: 14px;
}

.app-content table td {
    color: #777;
}

.app-content table th {
    color: #3d4250;
}

/* ========================================================================== 
   v38 · Legibilidad, proporción y densidad visual profesional
   La interfaz abandona la escala excesivamente pequeña de 13 px y utiliza
   una jerarquía de lectura pensada para jornadas largas de operación.
   ========================================================================== */

:root {
    --ui-font-xs: 12px;
    --ui-font-sm: 13px;
    --ui-font-md: 14px;
    --ui-font-base: 15px;
    --ui-font-lg: 16px;
    --ui-font-xl: 18px;
    --ui-title-sm: 20px;
    --ui-title-md: 24px;
    --ui-title-lg: 30px;
    --ui-line-base: 24px;
    --sidebar-width: 286px;
    --topbar-height: 68px;
}

body,
body.app-layout,
body.guest-layout {
    font-size: var(--ui-font-base) !important;
    line-height: var(--ui-line-base);
    color: #626978;
}

/* Texto normal: más oscuro que el #777 original para lectura sostenida. */
.app-content,
.app-modal,
.sidebar,
.app-topbar,
.user-menu-panel {
    font-size: var(--ui-font-base);
}

.app-content p,
.app-content li,
.app-content label,
.app-modal p,
.app-modal label {
    font-size: var(--ui-font-md);
    line-height: 1.55;
}

.app-content small,
.app-modal small {
    font-size: var(--ui-font-sm);
    line-height: 1.45;
}

/* Sidebar: legible sin convertirse en una navegación pesada. */
.sidebar-brand {
    min-height: 78px;
    padding-inline: 20px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    font-size: 12px;
}

.brand-copy strong {
    font-size: 15px;
    line-height: 1.25;
}

.brand-copy span {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.3;
}

.sidebar-nav {
    padding: 15px 12px 24px;
}

.sidebar-category {
    margin-top: 16px;
    padding: 7px 12px 6px;
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: .11em;
}

.sidebar-direct-link,
.sidebar-group > summary {
    min-height: 46px;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 650;
}

.nav-icon {
    width: 19px;
    height: 19px;
}

.sidebar-submenu {
    margin-left: 19px;
    padding-left: 18px;
}

.sidebar-submenu-link {
    min-height: 39px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.35;
}

.sidebar-footer {
    min-height: 64px;
    padding: 10px 12px;
}

.sidebar-footer-copy strong {
    font-size: 12px;
}

.sidebar-footer-copy small {
    font-size: 11px;
}

/* Topbar con mayor presencia, sin desperdiciar altura. */
.app-topbar {
    min-height: var(--topbar-height);
    padding-inline: 24px;
}

.topbar-kicker {
    font-size: 11px;
}

.topbar-context strong {
    font-size: 15px;
}

.topbar-quick-link {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 13px;
}

.environment-pill {
    min-height: 40px;
    padding: 6px 11px;
}

.environment-pill strong {
    font-size: 12px;
}

.environment-pill small {
    font-size: 11px;
}

.user-menu > summary {
    min-height: 46px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.user-summary-copy strong {
    font-size: 13px;
}

.user-summary-copy small {
    font-size: 12px;
}

.user-menu-panel > a,
.user-menu-panel button {
    min-height: 42px;
    font-size: 13px;
}

/* Área de trabajo: respiración equilibrada y títulos claros. */
.app-content {
    width: min(100%, 1680px);
    padding: 28px 30px 54px;
    color: #626978;
    font-size: var(--ui-font-base);
    line-height: var(--ui-line-base);
}

.app-content .page-head {
    min-height: 62px;
    margin-bottom: 18px;
}

.app-content .page-head h1 {
    margin-bottom: 5px;
    font-size: var(--ui-title-md);
    line-height: 1.25;
    font-weight: 750;
}

.app-content .page-head p,
.app-content .muted {
    font-size: 14px;
    line-height: 1.55;
}

.app-content .page-head > a:not(.button) {
    font-size: 14px;
}

/* Controles: texto grande, altura contenida y aspecto ERP moderno. */
.app-content .button,
.app-modal .button {
    min-height: 40px;
    padding: 9px 15px;
    border-radius: 7px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
}

.app-content .form-grid label,
.app-content .form-field,
.app-modal-grid label,
.app-modal-grid .form-field {
    gap: 6px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
}

.app-content input:not([type="checkbox"]):not([type="radio"]),
.app-content select,
.app-content textarea,
.app-modal input:not([type="checkbox"]):not([type="radio"]),
.app-modal select,
.app-modal textarea {
    min-height: 40px;
    padding: 8px 11px;
    font-family: var(--font-body, "Montserrat", sans-serif);
    font-size: 14px;
    line-height: 20px;
}

.app-content textarea,
.app-modal textarea {
    min-height: 78px;
}

.app-content .search {
    min-height: 66px;
    margin-bottom: 18px;
    padding: 12px;
    gap: 10px;
}

.app-content .search input,
.app-content .search select {
    min-height: 40px;
}

/* Tarjetas y tablas: densidad media, no microscópica ni sobredimensionada. */
.app-content .card {
    padding: 20px;
}

.app-content .card h2 {
    font-size: 17px;
    line-height: 1.35;
}

.app-content .table-wrap th,
.app-content table th {
    padding: 12px 13px;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 750;
}

.app-content .table-wrap td,
.app-content table td {
    padding: 12px 13px;
    color: #515867;
    font-size: 14px;
    line-height: 1.45;
}

.app-content td small {
    font-size: 12px;
    line-height: 1.4;
}

.app-content .badge {
    padding: 5px 8px;
    font-size: 12px;
}

.pagination a {
    min-width: 35px;
    min-height: 34px;
    font-size: 13px;
}

/* Formularios por secciones. */
.form-section + .form-section {
    padding-top: 17px;
}

.form-section > legend {
    margin-bottom: 13px;
    font-size: 15px;
    line-height: 1.35;
}

.form-section > legend small {
    font-size: 12px;
}

.form-section-grid {
    gap: 13px 15px;
}

.entity-active-check,
.customer-active-check {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13px !important;
}

.field-action-row {
    grid-template-columns: minmax(0,1fr) 40px;
}

.field-create-button {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 19px;
}

/* Modales: mejor lectura sin volver a controles gigantes. */
.app-modal {
    width: min(900px, calc(100vw - 44px));
    max-width: 900px;
}

.entity-modal-wide,
.product-modal {
    width: min(940px, calc(100vw - 44px));
    max-width: 940px;
}

.entity-modal-compact {
    width: min(560px, calc(100vw - 44px));
    max-width: 560px;
}

.app-modal-header {
    padding: 18px 22px 16px;
}

.app-modal-header h2 {
    font-size: 20px;
    line-height: 1.3;
}

.app-modal-header p {
    font-size: 13px;
    line-height: 1.5;
}

.modal-eyebrow {
    font-size: 11px;
}

.modal-close {
    width: 34px;
    height: 34px;
    font-size: 22px;
}

.modal-tabs {
    padding-inline: 22px;
}

.modal-tab {
    min-height: 43px;
    padding: 11px 13px 10px;
    font: 650 13px/1.2 var(--font-body, "Montserrat", sans-serif);
}

.app-modal-grid {
    padding: 18px 22px;
    gap: 14px;
}

.app-modal .form-section-grid {
    gap: 12px 14px;
}

.app-modal-footer {
    padding: 13px 22px;
}

.modal-form-alert,
.app-toast {
    font-size: 13px;
    line-height: 1.45;
}

/* Dashboard: jerarquía visual más segura y agradable. */
.dashboard-shell {
    gap: 22px;
}

.dashboard-welcome {
    gap: 20px;
    padding-top: 5px;
}

.dashboard-welcome h1 {
    margin-bottom: 5px;
    font-size: clamp(28px, 2.2vw, 34px);
    line-height: 1.2;
}

.dashboard-welcome p {
    font-size: 15px;
    line-height: 1.5;
}

.dashboard-role-pill {
    padding: 8px 11px;
    font-size: 12px;
}

.dashboard-action-section {
    gap: 11px;
}

.dashboard-action-section > h2 {
    font-size: 14px;
}

.dashboard-action-grid {
    gap: 12px;
}

.dashboard-action-card {
    min-height: 82px;
    gap: 13px;
    padding: 14px 15px;
}

.dashboard-action-icon {
    width: 40px;
    height: 40px;
}

.dashboard-action-icon svg {
    width: 19px;
    height: 19px;
}

.dashboard-action-copy strong {
    font-size: 14px;
    line-height: 1.35;
}

.dashboard-action-copy small {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.35;
}

.dashboard-action-arrow {
    font-size: 18px;
}

.dashboard-status-strip {
    padding: 14px 16px;
}

.dashboard-status-strip strong {
    font-size: 14px;
}

.dashboard-status-strip p {
    font-size: 13px;
}

.dashboard-metrics {
    gap: 12px;
}

.dashboard-metrics .metric {
    min-height: 104px;
    padding: 16px;
}

.dashboard-metrics .metric span {
    font-size: 13px;
}

.dashboard-metrics .metric strong {
    font-size: 22px;
    line-height: 1.2;
}

.dashboard-metrics .metric small {
    font-size: 12px;
}

.app-content .alert {
    padding: 11px 13px;
    font-size: 14px;
    line-height: 1.5;
}

/* Acceso: mantener proporción con la aplicación. */
.guest-layout .auth-card h1 {
    font-size: 30px;
}

.guest-layout .auth-card .form-stack label {
    font-size: 14px;
}

.guest-layout .auth-card .form-stack input {
    min-height: 42px;
    font-size: 14px;
}

.guest-layout .auth-card .button {
    min-height: 42px;
    font-size: 14px;
}

@media (max-width: 1120px) {
    :root {
        --sidebar-width: 286px;
    }

    .app-content {
        padding: 24px 20px 46px;
    }
}

@media (max-width: 700px) {
    body,
    body.app-layout,
    body.guest-layout {
        font-size: 14px !important;
    }

    .app-content {
        padding: 20px 14px 38px;
    }

    .app-content .page-head h1 {
        font-size: 22px;
    }

    .app-modal-header h2 {
        font-size: 19px;
    }

    .modal-tabs {
        padding-inline: 15px;
    }

    .modal-tab {
        font-size: 13px;
    }
}


/* ==========================================================================
   v39 — Navegación y accesos rápidos con peso visual equilibrado
   ========================================================================== */

/* Menú principal y submenú comparten exactamente la misma escala tipográfica.
   El estado activo se comunica mediante color/fondo, nunca mediante negrita. */
.sidebar-direct-link,
.sidebar-group > summary,
.sidebar-submenu-link {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 400;
}

.sidebar-direct-link.is-active,
.sidebar-group.is-current > summary,
.sidebar-submenu-link.is-active {
    font-weight: 400;
}

/* Los accesos rápidos muestran una sola idea por tarjeta: el título. */
.dashboard-action-card {
    min-height: 74px;
    padding: 13px 16px;
}

.dashboard-action-copy {
    display: flex;
    min-width: 0;
    align-items: center;
}

.dashboard-action-title {
    display: block;
    color: var(--ui-text);
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 400;
}

/* Compatibilidad defensiva con vistas cacheadas de versiones anteriores. */
.dashboard-action-copy strong {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 400;
}

.dashboard-action-copy small {
    display: none;
}


/* ==========================================================================
   v40 — Sistema tipográfico Poppins + superficie #EDEFF5
   Escala inspirada en la referencia visual aportada por el usuario.
   La jerarquía se aplica de forma consistente a dashboard, navegación,
   listados, formularios, tablas, tarjetas, reportes y modales.
   ========================================================================== */

:root {
    --light-color: #F4F7FC;
    --ui-bg: #F4F7FC;
    --ui-text: #120736;
    --ui-muted: #6f7481;
    --ui-muted-2: #969baa;
    --font-body: "Poppins", "Segoe UI", Arial, sans-serif;
    --font-display: "Poppins", "Segoe UI", Arial, sans-serif;

    --type-nav-size: 15px;
    --type-body-size: 14px;
    --type-card-size: 13px;
    --type-section-size: 13px;
    --type-subtitle-size: 16px;
    --type-page-size: 24px;
    --type-display-size: 32px;
}

html,
body,
body.app-layout,
body.guest-layout {
    margin: 0;
    color: #120736;
    background: #EDEFF5 !important;
    font-family: "Poppins", sans-serif !important;
    font-size: var(--type-body-size) !important;
    font-weight: 400;
    line-height: 22px;
}

body.app-layout,
.app-shell,
.app-main,
.app-content {
    background: #EDEFF5;
}

/* Todo control interactivo comparte la misma familia. */
button,
input,
select,
textarea,
optgroup,
option,
table,
.app-content,
.app-modal,
.sidebar,
.app-topbar,
.user-menu-panel {
    font-family: "Poppins", sans-serif !important;
}

/* ---------- Sidebar: 15/22, peso regular tanto en menú como submenú ---------- */
.sidebar {
    background: #fff;
}

.sidebar-direct-link,
.sidebar-group > summary,
.sidebar-submenu-link {
    font-family: "Poppins", sans-serif !important;
    font-size: var(--type-nav-size) !important;
    font-weight: 400 !important;
    line-height: 22px !important;
    letter-spacing: 0;
}

.sidebar-direct-link.is-active,
.sidebar-group.is-current > summary,
.sidebar-submenu-link.is-active,
.sidebar-group[open] > summary {
    font-weight: 400 !important;
}

.sidebar-category {
    font-family: "Poppins", sans-serif !important;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    letter-spacing: .08em;
}

.brand-copy strong {
    font-family: "Poppins", sans-serif !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
}

.brand-copy span {
    font-family: "Poppins", sans-serif !important;
    font-size: 11px;
    font-weight: 400;
    line-height: 16px;
}

.sidebar-footer-copy strong {
    font-size: 12px;
    font-weight: 500;
}

.sidebar-footer-copy small {
    font-size: 11px;
    font-weight: 400;
}

/* ---------- Topbar: una sola jerarquía limpia ---------- */
.app-topbar {
    background: rgba(255,255,255,.98);
}

.topbar-kicker {
    display: none;
}

.topbar-context strong {
    color: #120736;
    font-family: "Poppins", sans-serif !important;
    font-size: var(--type-page-size);
    font-weight: 400;
    line-height: 32px;
    letter-spacing: 0;
}

.topbar-quick-link,
.environment-pill,
.user-summary-copy,
.user-menu-panel > a,
.user-menu-panel button {
    font-family: "Poppins", sans-serif !important;
}

.topbar-quick-link {
    font-size: 13px;
    font-weight: 500;
}

.user-summary-copy strong {
    font-size: 13px;
    font-weight: 500;
}

.user-summary-copy small {
    font-size: 11px;
    font-weight: 400;
}

/* ---------- Páginas internas ---------- */
.app-content {
    color: #120736;
}

.app-content .page-head h1,
.app-content .hero h1,
.app-content .hero.compact h1 {
    color: #212529;
    font-family: "Poppins", sans-serif !important;
    font-size: var(--type-page-size);
    font-weight: 500;
    line-height: 32px;
    letter-spacing: 0;
}

.app-content .page-head p,
.app-content .hero p,
.app-content .muted {
    font-family: "Poppins", sans-serif !important;
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
}

.app-content .section-head h2,
.app-content .card h2,
.app-content .card h3 {
    color: #212529;
    font-family: "Poppins", sans-serif !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.app-content .section-head p,
.app-content .card p,
.app-content .card li {
    font-family: "Poppins", sans-serif !important;
    font-size: 13px;
    line-height: 22px;
}

/* ---------- Formularios y filtros ---------- */
.app-content .form-grid label,
.app-content .form-field,
.app-content .form-field > label,
.app-modal-grid label,
.app-modal-grid .form-field,
.app-modal-grid .form-field > label,
.form-section > legend {
    color: #303341;
    font-family: "Poppins", sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 20px;
}

.app-content input:not([type="checkbox"]):not([type="radio"]),
.app-content select,
.app-content textarea,
.app-modal input:not([type="checkbox"]):not([type="radio"]),
.app-modal select,
.app-modal textarea {
    min-height: 40px;
    color: #120736;
    font-family: "Poppins", sans-serif !important;
    font-size: 14px !important;
    font-weight: 400;
    line-height: 22px;
}

.app-content input::placeholder,
.app-content textarea::placeholder,
.app-modal input::placeholder,
.app-modal textarea::placeholder {
    color: #9aa0ad;
    font-family: "Poppins", sans-serif !important;
    font-weight: 400;
}

.app-content .search {
    background: #fff;
}

/* ---------- Botones ---------- */
.app-content .button,
.app-modal .button {
    min-height: 40px;
    font-family: "Poppins", sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 20px;
}

/* ---------- Tablas y paginación ---------- */
.app-content .table-wrap,
.app-content .card,
.app-content .metric {
    background: #fff;
}

.app-content .table-wrap th,
.app-content table th {
    color: #303341;
    font-family: "Poppins", sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 20px;
    letter-spacing: 0;
}

.app-content .table-wrap td,
.app-content table td {
    color: #120736;
    font-family: "Poppins", sans-serif !important;
    font-size: 13px !important;
    font-weight: 400;
    line-height: 22px;
}

.app-content td small {
    font-family: "Poppins", sans-serif !important;
    font-size: 11px;
    font-weight: 400;
    line-height: 18px;
}

.app-content .badge,
.pagination a {
    font-family: "Poppins", sans-serif !important;
    font-size: 12px;
    font-weight: 500;
}

/* ---------- Dashboard: escala exacta de la referencia ---------- */
.dashboard-welcome h1 {
    margin: 0 0 4px;
    color: #212529;
    font-family: "Poppins", sans-serif !important;
    font-size: var(--type-display-size) !important;
    font-weight: 700 !important;
    line-height: 38px !important;
    letter-spacing: 0;
}

.dashboard-welcome p {
    margin: 0;
    color: #212529;
    font-family: "Poppins", sans-serif !important;
    font-size: var(--type-subtitle-size) !important;
    font-weight: 500 !important;
    line-height: 19px !important;
}

.dashboard-action-section > h2 {
    color: #212529;
    font-family: "Poppins", sans-serif !important;
    font-size: var(--type-section-size) !important;
    font-weight: 700 !important;
    line-height: 22px !important;
}

.dashboard-action-card {
    min-height: 82px;
    background: #fff;
}

.dashboard-action-title,
.dashboard-action-copy strong {
    color: #120736;
    font-family: "Poppins", sans-serif !important;
    font-size: var(--type-card-size) !important;
    font-weight: 400 !important;
    line-height: 22px !important;
}

.dashboard-action-copy small {
    display: none !important;
}

.dashboard-status-strip strong,
.dashboard-metrics .metric span {
    font-family: "Poppins", sans-serif !important;
    font-size: 13px;
    font-weight: 600;
}

.dashboard-status-strip p,
.dashboard-metrics .metric small {
    font-family: "Poppins", sans-serif !important;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
}

.dashboard-metrics .metric strong {
    font-family: "Poppins", sans-serif !important;
    font-size: 22px;
    font-weight: 600;
    line-height: 28px;
}

/* ---------- Modales ---------- */
.app-modal-header h2 {
    color: #212529;
    font-family: "Poppins", sans-serif !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    line-height: 28px;
}

.app-modal-header p {
    font-family: "Poppins", sans-serif !important;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
}

.modal-eyebrow,
.modal-tab,
.app-modal-footer,
.app-toast,
.modal-form-alert {
    font-family: "Poppins", sans-serif !important;
}

.modal-tab {
    font-size: 13px;
    font-weight: 500;
}

.app-toast,
.modal-form-alert {
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
}

/* ---------- Mensajes / estados / elementos auxiliares ---------- */
.app-content .alert {
    font-family: "Poppins", sans-serif !important;
    font-size: 13px;
    font-weight: 400;
    line-height: 22px;
}

.empty-state {
    font-family: "Poppins", sans-serif !important;
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
}

/* ---------- Login y pantallas públicas ---------- */
.guest-layout .auth-card,
.guest-layout .auth-card input,
.guest-layout .auth-card button,
.guest-layout .auth-card label {
    font-family: "Poppins", sans-serif !important;
}

.guest-layout .auth-card h1 {
    color: #212529;
    font-size: 30px;
    font-weight: 600;
    line-height: 38px;
}

.guest-layout .auth-card label,
.guest-layout .auth-card input,
.guest-layout .auth-card .button {
    font-size: 14px;
}

/* La superficie exterior es siempre la solicitada, sin depender de la página. */
@media (min-width: 1px) {
    html,
    body,
    body.app-layout,
    body.guest-layout,
    .app-main,
    .app-content {
        background-color: #EDEFF5 !important;
    }
}

@media (max-width: 700px) {
    html,
    body,
    body.app-layout,
    body.guest-layout {
        font-size: 14px !important;
    }

    .topbar-context strong {
        font-size: 20px;
        line-height: 28px;
    }

    .dashboard-welcome h1 {
        font-size: 28px !important;
        line-height: 34px !important;
    }

    .dashboard-welcome p {
        font-size: 15px !important;
        line-height: 20px !important;
    }
}

/* ========================================================================== 
   v41 — Dashboard con iconografía más intensa y superficies más redondeadas
   ========================================================================== */
:root {
    --dash-pink: #ff006e;
    --dash-pink-soft: #fff4f8;
    --dash-orange: #ff7a00;
    --dash-orange-soft: #fff8f1;
    --dash-green: #00bd68;
    --dash-green-soft: #f2fff8;
    --dash-blue: #0078ff;
    --dash-blue-soft: #f3f8ff;
    --ui-radius: 12px;
    --ui-radius-sm: 9px;
}

/* Tarjetas de acceso rápido: esquinas más suaves como la referencia. */
.dashboard-action-card {
    border: 1px solid #e1e5ee !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(27, 35, 58, .035) !important;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background-color .16s ease;
}

.dashboard-action-card:hover {
    border-color: #d5dae6 !important;
    box-shadow: 0 8px 22px rgba(27, 35, 58, .07) !important;
    transform: translateY(-1px);
}

/* Círculo e icono: más contraste y presencia sin aumentar el ruido visual. */
.dashboard-action-icon {
    width: 42px !important;
    height: 42px !important;
    border-width: 1.5px !important;
    background: #fff !important;
}

.dashboard-action-icon svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2.05 !important;
}

.dashboard-action-arrow {
    font-size: 23px !important;
    line-height: 1 !important;
    font-weight: 400 !important;
    opacity: 1 !important;
}

.dashboard-action-card.tone-pink .dashboard-action-icon,
.dashboard-action-card.tone-pink .dashboard-action-arrow {
    color: var(--dash-pink) !important;
}
.dashboard-action-card.tone-pink .dashboard-action-icon { background: var(--dash-pink-soft) !important; }

.dashboard-action-card.tone-orange .dashboard-action-icon,
.dashboard-action-card.tone-orange .dashboard-action-arrow {
    color: var(--dash-orange) !important;
}
.dashboard-action-card.tone-orange .dashboard-action-icon { background: var(--dash-orange-soft) !important; }

.dashboard-action-card.tone-green .dashboard-action-icon,
.dashboard-action-card.tone-green .dashboard-action-arrow {
    color: var(--dash-green) !important;
}
.dashboard-action-card.tone-green .dashboard-action-icon { background: var(--dash-green-soft) !important; }

.dashboard-action-card.tone-blue .dashboard-action-icon,
.dashboard-action-card.tone-blue .dashboard-action-arrow {
    color: var(--dash-blue) !important;
}
.dashboard-action-card.tone-blue .dashboard-action-icon { background: var(--dash-blue-soft) !important; }

/* El mismo lenguaje de radio se replica en superficies funcionales internas. */
.app-content .card,
.app-content .metric,
.app-content .table-wrap,
.dashboard-status-strip,
.app-modal-panel {
    border-radius: 12px !important;
}

.app-content input:not([type="checkbox"]):not([type="radio"]),
.app-content select,
.app-content textarea,
.app-modal input:not([type="checkbox"]):not([type="radio"]),
.app-modal select,
.app-modal textarea {
    border-radius: 8px !important;
}

.app-content .button,
.app-modal .button {
    border-radius: 8px !important;
}


/* ==========================================================================
   v44 — Registro de producto: tres precios, costo normalizado y stock inicial
   ========================================================================== */
.product-cost-panel {
    display: grid;
    gap: 16px;
    padding: 16px;
    border: 1px solid #dfe4ed;
    border-radius: 12px;
    background: #f8f9fc;
}

.product-cost-grid {
    display: grid;
    grid-template-columns: 1.15fr .9fr 1.05fr;
    gap: 12px;
    align-items: end;
}

.product-money-output {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid #d6dce7;
    border-radius: 8px;
    background: #fff;
    color: #120736;
    font-size: 14px;
}

.product-money-output output {
    font-size: 15px;
    font-weight: 600;
}

.product-pricing-table-wrap {
    overflow-x: auto;
    border: 1px solid #dfe4ed;
    border-radius: 10px;
    background: #fff;
}

.product-pricing-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
}

.product-pricing-table th,
.product-pricing-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf0f5;
    vertical-align: middle;
}

.product-pricing-table thead th {
    background: #f0f2f7;
    color: #212529;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.product-pricing-table tbody th {
    color: #120736;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.product-pricing-table tbody th small {
    display: block;
    color: #8a93a5;
    font-size: 11px;
    font-weight: 400;
}

.product-pricing-table tbody tr:last-child th,
.product-pricing-table tbody tr:last-child td {
    border-bottom: 0;
}

.product-pricing-table input {
    min-width: 110px;
    margin: 0 !important;
}

.pricing-cost {
    color: #4d5668;
    white-space: nowrap;
}

.pricing-cost strong {
    color: #120736;
    font-weight: 500;
}

.price-input-wrap {
    display: grid;
    grid-template-columns: auto minmax(100px, 1fr);
    align-items: center;
    gap: 7px;
}

.price-input-wrap > span {
    color: #7a8395;
}

.product-pricing-help,
.product-initial-stock-note {
    margin: 0;
    color: #7d8799;
    font-size: 12px;
    line-height: 18px;
}

.product-stock-meta {
    margin-top: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-initial-stock {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding: 15px 16px;
    border: 1px solid #dfe4ed;
    border-radius: 12px;
    background: #fff;
}

.product-initial-stock-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.product-initial-stock-head > div,
.product-initial-stock-info {
    display: grid;
    gap: 3px;
}

.product-initial-stock-head strong,
.product-initial-stock-info strong {
    color: #212529;
    font-size: 14px;
    font-weight: 600;
}

.product-initial-stock-head span:not(.badge),
.product-initial-stock-info span {
    color: #7d8799;
    font-size: 12px;
    line-height: 18px;
}

.product-initial-serials textarea {
    min-height: 88px;
}

.product-price-list {
    display: grid;
    gap: 2px;
    white-space: nowrap;
}

.product-price-list span {
    color: #120736;
    font-size: 13px;
}

.product-price-list small {
    display: inline-block;
    min-width: 22px;
    color: #8a93a5;
    font-size: 10px;
    font-weight: 600;
}

.pos-price-level {
    min-width: 190px;
    display: grid;
    gap: 3px;
    color: #5c6576;
    font-size: 11px;
    font-weight: 500;
}

.pos-price-level select {
    min-height: 40px;
    border-radius: 8px !important;
    background: #fff;
    color: #120736;
    font-size: 13px;
}

@media (max-width: 1050px) {
    .product-cost-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .product-cost-grid,
    .product-stock-meta {
        grid-template-columns: 1fr;
    }

    .product-cost-panel,
    .product-initial-stock {
        padding: 12px;
    }

    .pos-price-level {
        min-width: 100%;
    }
}

/* ================================================================
   v45 · Captura guiada de series según el stock inicial
   ================================================================ */
.product-initial-serials {
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid #dfe4ed;
    border-radius: 10px;
    background: #f8f9fc;
}

.product-initial-serials:not(.is-hidden) {
    display: flex;
}

.product-initial-serials-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.product-initial-serials-copy strong {
    color: #212529;
    font-size: 13px;
    font-weight: 600;
}

.product-initial-serials-copy span,
.product-series-control-actions small {
    color: #7d8799;
    font-size: 12px;
    line-height: 18px;
}

.product-series-open-button,
.product-series-control-button {
    min-width: 145px;
    white-space: nowrap;
}

.product-series-control {
    display: grid;
    align-content: start;
    gap: 8px;
}

.product-series-control-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-left: 23px;
}

.product-series-dialog {
    width: min(760px, calc(100vw - 36px));
    max-width: 760px;
    max-height: min(82vh, 690px);
    padding: 0;
    overflow: hidden;
    border: 1px solid #dde2eb;
    border-radius: 14px;
    color: #120736;
    background: #fff;
    box-shadow: 0 24px 75px rgba(18, 7, 54, .22);
}

.product-series-dialog::backdrop {
    background: rgba(24, 27, 37, .48);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.product-series-dialog-panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    max-height: min(82vh, 690px);
    background: #fff;
}

.product-series-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px 15px;
    border-bottom: 1px solid #e6e9f0;
}

.product-series-dialog-header h2 {
    margin: 2px 0 3px;
    color: #212529;
    font: 500 20px/28px Poppins, sans-serif;
}

.product-series-dialog-header p {
    margin: 0;
    color: #788195;
    font: 400 12px/18px Poppins, sans-serif;
}

.product-series-dialog-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 13px 20px;
    border-bottom: 1px solid #e9ecf2;
    background: #f7f8fb;
}

.product-series-dialog-summary > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.product-series-dialog-summary span {
    color: #7c8598;
    font: 400 11px/16px Poppins, sans-serif;
}

.product-series-dialog-summary strong {
    color: #212529;
    font: 500 13px/19px Poppins, sans-serif;
}

.product-series-dialog-summary .product-series-available {
    color: #00a85a;
}

.product-series-dialog-error {
    margin: 12px 20px 0;
    padding: 9px 11px;
    border: 1px solid #ffc9d8;
    border-radius: 8px;
    color: #b4234d;
    background: #fff4f7;
    font: 500 12px/18px Poppins, sans-serif;
}

.product-series-table-wrap {
    min-height: 0;
    overflow: auto;
    padding: 14px 20px 4px;
}

.product-series-table-head,
.product-series-row {
    display: grid;
    grid-template-columns: 46px minmax(220px, 1fr) 130px 120px;
    align-items: center;
    gap: 0;
}

.product-series-table-head {
    position: sticky;
    top: -14px;
    z-index: 2;
    min-height: 38px;
    border: 1px solid #e1e5ec;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    color: #212529;
    background: #eef1f5;
    font: 600 12px/18px Poppins, sans-serif;
}

.product-series-table-head span,
.product-series-row > span,
.product-series-row > input {
    min-width: 0;
}

.product-series-table-head span {
    padding: 9px 10px;
}

.product-series-row {
    min-height: 48px;
    border: 1px solid #e1e5ec;
    border-bottom: 0;
    background: #fff;
}

.product-series-row:last-child {
    border-bottom: 1px solid #e1e5ec;
    border-radius: 0 0 8px 8px;
}

.product-series-row > * {
    padding: 6px 9px;
}

.product-series-row-number {
    color: #81899a;
    text-align: center;
    font: 500 12px/18px Poppins, sans-serif;
}

.product-series-row input[data-series-input] {
    width: calc(100% - 16px);
    min-height: 36px;
    margin: 5px 8px;
    padding: 7px 10px;
    border: 1px solid #d7dce6;
    border-radius: 7px;
    color: #120736;
    background: #f8f9fc;
    font: 400 13px/20px Poppins, sans-serif;
    outline: none;
}

.product-series-row input[data-series-input]:focus {
    border-color: #4c2aae;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(76, 42, 174, .10);
}

.product-series-row input[data-series-input].is-error {
    border-color: #ff006e;
    background: #fff7fa;
    box-shadow: 0 0 0 3px rgba(255, 0, 110, .08);
}

.product-series-status {
    color: #009e55;
    font: 500 12px/18px Poppins, sans-serif;
}

.product-series-date {
    color: #657086;
    font: 400 12px/18px Poppins, sans-serif;
}

.product-series-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 20px;
    border-top: 1px solid #e6e9f0;
    background: #fff;
}

.product-series-dialog-footer > div {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.product-series-dialog-hint {
    color: #81899a;
    font: 400 11px/17px Poppins, sans-serif;
}

.product-series-dialog .button {
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 8px;
    font: 500 13px/20px Poppins, sans-serif;
}

@media (max-width: 700px) {
    .product-initial-serials:not(.is-hidden),
    .product-series-dialog-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .product-series-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 12px;
    }

    .product-series-dialog-panel {
        max-height: calc(100dvh - 20px);
    }

    .product-series-dialog-summary {
        grid-template-columns: 1fr;
    }

    .product-series-table-wrap {
        overflow-x: auto;
    }

    .product-series-table-head,
    .product-series-row {
        min-width: 610px;
    }

    .product-series-dialog-footer > div {
        justify-content: flex-end;
    }
}

/* ============================================================
   v46 · Gestión sólida de series mediante modales
   ============================================================ */
.inventory-series-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid #dce2ec;
    border-radius: 12px;
    background: #f8faff;
}
.inventory-series-control-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.inventory-series-control-copy strong {
    color: #212529;
    font-size: 14px;
    font-weight: 600;
}
.inventory-series-control-copy span {
    color: #667085;
    font-size: 13px;
}
.inventory-series-control.is-complete {
    border-color: #a7e8c8;
    background: #f4fff9;
}
.inventory-series-button { white-space: nowrap; }

.inventory-series-dialog,
.sale-series-dialog {
    width: min(760px, calc(100vw - 32px));
    max-width: none;
    max-height: min(86vh, 760px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    color: #120736;
    box-shadow: 0 24px 70px rgba(18, 7, 54, .20);
}
.inventory-series-dialog::backdrop,
.sale-series-dialog::backdrop {
    background: rgba(20, 25, 40, .46);
    backdrop-filter: blur(1px);
}
.inventory-series-dialog-panel,
.sale-series-dialog-panel {
    display: flex;
    flex-direction: column;
    max-height: min(86vh, 760px);
}
.inventory-series-dialog-header,
.sale-series-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #e7eaf0;
}
.inventory-series-dialog-header h2,
.sale-series-dialog-header h2 {
    margin: 2px 0 3px;
    font: 500 20px/28px Poppins, sans-serif;
    color: #212529;
}
.inventory-series-dialog-header p,
.sale-series-dialog-header p {
    margin: 0;
    color: #697386;
    font-size: 13px;
}
.inventory-series-dialog-summary,
.sale-series-dialog-summary {
    display: grid;
    grid-template-columns: minmax(180px, 1.6fr) repeat(2, minmax(105px, .7fr));
    gap: 10px;
    padding: 14px 22px;
    background: #f7f8fb;
    border-bottom: 1px solid #e7eaf0;
}
.sale-series-dialog-summary { grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(90px, .62fr)); }
.inventory-series-dialog-summary > div,
.sale-series-dialog-summary > div {
    display: grid;
    gap: 2px;
}
.inventory-series-dialog-summary span,
.sale-series-dialog-summary span {
    color: #8a94a6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.inventory-series-dialog-summary strong,
.sale-series-dialog-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #212529;
    font-size: 13px;
    font-weight: 600;
}
.inventory-series-dialog-error,
.sale-series-dialog-error {
    margin: 14px 22px 0;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fff5f5;
    color: #b42318;
    font-size: 13px;
}
.inventory-series-search,
.sale-series-search {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 22px 0;
    padding: 0 12px;
    min-height: 40px;
    border: 1px solid #d7ddea;
    border-radius: 9px;
    background: #fff;
    color: #7d8799;
}
.inventory-series-search input,
.sale-series-search input {
    width: 100%;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    min-height: 38px !important;
}
.inventory-series-editor,
.sale-series-list {
    flex: 1;
    min-height: 180px;
    max-height: 430px;
    overflow: auto;
    padding: 14px 22px 18px;
}
.inventory-series-entry-list {
    display: grid;
    gap: 8px;
}
.inventory-series-entry-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 96px;
    align-items: center;
    gap: 10px;
}
.inventory-series-entry-number {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0f2f7;
    color: #697386;
    font-size: 12px;
    font-weight: 600;
}
.inventory-series-entry-row input {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d7ddea;
    border-radius: 8px;
    padding: 8px 11px;
    font: 400 14px/20px Poppins, sans-serif;
}
.inventory-series-entry-row input:focus {
    outline: 0;
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px rgba(50, 21, 143, .08);
}
.inventory-series-entry-row input.is-error { border-color: #ef4444; background: #fff7f7; }
.inventory-series-entry-status {
    color: #00a85a;
    font-size: 12px;
    font-weight: 500;
}
.inventory-series-choice,
.sale-series-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 9px 12px;
    margin-bottom: 7px;
    border: 1px solid #e0e5ee;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.inventory-series-choice:hover,
.sale-series-option:hover {
    border-color: #b9b0dc;
    background: #fbfaff;
}
.inventory-series-choice.is-selected,
.sale-series-option.is-selected {
    border-color: var(--ui-primary);
    background: #f8f6ff;
    box-shadow: 0 0 0 2px rgba(50, 21, 143, .06);
}
.sale-series-option.is-blocked { opacity: .55; cursor: not-allowed; background: #f7f8fa; }
.inventory-series-choice.is-filtered,
.sale-series-option.is-filtered { display: none; }
.inventory-series-choice input,
.sale-series-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.inventory-series-choice-mark,
.sale-series-checkmark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 1.5px solid #cbd3df;
    border-radius: 7px;
    color: transparent;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
}
.inventory-series-choice.is-selected .inventory-series-choice-mark,
.sale-series-option.is-selected .sale-series-checkmark {
    border-color: var(--ui-primary);
    background: var(--ui-primary);
    color: #fff;
}
.inventory-series-choice-copy,
.sale-series-option-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}
.inventory-series-choice-copy strong,
.sale-series-option-copy strong {
    color: #212529;
    font-size: 14px;
    font-weight: 500;
    overflow-wrap: anywhere;
}
.inventory-series-choice-copy small,
.sale-series-option-copy small {
    color: #8a94a6;
    font-size: 12px;
}
.inventory-series-empty,
.sale-series-empty {
    padding: 28px 18px;
    border: 1px dashed #cfd6e2;
    border-radius: 10px;
    color: #7d8799;
    text-align: center;
    background: #fafbfc;
}
.inventory-series-dialog-footer,
.sale-series-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    border-top: 1px solid #e7eaf0;
    background: #fff;
}
.inventory-series-dialog-footer > span,
.sale-series-dialog-footer > span {
    color: #8a94a6;
    font-size: 12px;
}
.inventory-series-dialog-footer > div,
.sale-series-dialog-footer > div {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.sale-series-picker {
    display: grid;
    gap: 5px;
    min-width: 150px;
}
.sale-series-button {
    width: 100%;
    min-height: 38px;
    padding: 7px 11px;
    white-space: nowrap;
}
.sale-series-summary {
    color: #7a8496;
    font-size: 11px;
    line-height: 15px;
}
.sale-series-picker.is-complete .sale-series-summary { color: #008f4c; }
.sale-series-picker.is-incomplete:not(.is-hidden) .sale-series-summary { color: #a15c00; }

@media (max-width: 720px) {
    .inventory-series-control,
    .inventory-series-dialog-footer,
    .sale-series-dialog-footer { align-items: stretch; flex-direction: column; }
    .inventory-series-button { width: 100%; }
    .inventory-series-dialog-summary,
    .sale-series-dialog-summary { grid-template-columns: 1fr 1fr; }
    .inventory-series-entry-row { grid-template-columns: 32px minmax(0, 1fr); }
    .inventory-series-entry-status { display: none; }
    .inventory-series-dialog-footer > div,
    .sale-series-dialog-footer > div { width: 100%; }
    .inventory-series-dialog-footer .button,
    .sale-series-dialog-footer .button { flex: 1; }
}

/* =========================================================
   v48 · Compras - composición operativa profesional
   ========================================================= */
.purchase-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 18px;
    padding: 2px 2px 0;
}
.purchase-page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.purchase-page-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid #ded8f3;
    border-radius: 12px;
    background: #fff;
    color: var(--ui-primary);
}
.purchase-page-title h1 {
    margin: 0;
    color: #120736;
    font: 500 22px/28px Poppins, sans-serif;
}
.purchase-page-title p {
    margin: 2px 0 0;
    color: #7d8799;
    font: 400 12px/18px Poppins, sans-serif;
}
.purchase-back-link {
    color: var(--ui-primary);
    font: 500 13px/20px Poppins, sans-serif;
    text-decoration: none;
}
.purchase-back-link:hover { text-decoration: underline; }

.purchase-workspace { gap: 16px; }
.purchase-document-card,
.purchase-modern-card,
.purchase-total-card {
    border: 1px solid #e2e6ee;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(18, 7, 54, .035);
}
.purchase-document-card { padding: 0; overflow: hidden; }
.purchase-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 20px 14px;
    border-bottom: 1px solid #eceff4;
}
.purchase-card-heading-compact { padding: 0 0 13px; }
.purchase-card-heading-compact:not(:last-child) { border-bottom: 1px solid #eceff4; margin-bottom: 16px; }
.purchase-card-heading h2,
.purchase-section-head h2 {
    margin: 1px 0 0;
    color: #120736;
    font: 500 17px/23px Poppins, sans-serif;
}
.purchase-section-kicker {
    display: block;
    color: #8a94a6;
    font: 500 10px/15px Poppins, sans-serif;
    letter-spacing: .085em;
}
.purchase-tax-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #e0e4ec;
    border-radius: 9px;
    background: #f9fafc;
    color: #596275;
    font: 400 12px/18px Poppins, sans-serif;
    cursor: pointer;
}
.purchase-tax-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--ui-primary); }
.purchase-header-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.7fr) minmax(120px, .72fr) minmax(130px, .8fr) minmax(150px, .9fr) minmax(150px, .9fr);
    gap: 14px 16px;
    padding: 18px 20px 20px;
}
.purchase-field {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    margin: 0;
    color: #120736;
    font: 400 13px/19px Poppins, sans-serif;
}
.purchase-field input,
.purchase-field select,
.purchase-field textarea,
.purchase-supplier-control select {
    width: 100%;
    min-height: 40px;
    margin: 0;
    border: 1px solid #d7ddea;
    border-radius: 8px;
    background: #f6f7fa;
    color: #120736;
    padding: 8px 11px;
    font: 400 13px/20px Poppins, sans-serif;
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.purchase-field input:focus,
.purchase-field select:focus,
.purchase-field textarea:focus,
.purchase-supplier-control select:focus {
    outline: 0;
    border-color: #7664b5;
    box-shadow: 0 0 0 3px rgba(50, 21, 143, .07);
    background: #fff;
}
.purchase-supplier-field { grid-column: span 2; }
.purchase-supplier-control { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; }
.purchase-entity-add {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
    background: var(--ui-primary);
    color: #fff;
    border: 1px solid var(--ui-primary);
    font-size: 19px;
}
.purchase-entity-add:hover { background: #271072; border-color: #271072; }
.purchase-exchange-field { position: relative; }
.purchase-help {
    position: absolute;
    top: 0;
    right: 1px;
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #120736;
    color: #fff;
    font: 600 10px/16px Poppins, sans-serif;
    cursor: help;
}
.purchase-notes-field { grid-column: span 2; }
.purchase-notes-field input { min-height: 40px; }

.purchase-modern-card { padding: 18px 20px; }
.purchase-section-head { align-items: center; margin-bottom: 14px; }
.purchase-section-head p { margin: 3px 0 0; font-size: 12px; }
.purchase-section-head .section-actions { align-items: center; }
.purchase-section-head .button { min-height: 38px; padding: 8px 14px; }
.purchase-table-wrap {
    border: 1px solid #e5e8ef;
    border-radius: 11px;
    overflow: auto;
    background: #fff;
}
.purchase-lines { margin: 0; border-collapse: separate; border-spacing: 0; }
.purchase-lines thead th {
    background: #f5f6f9;
    color: #343b4b;
    border-bottom: 1px solid #e5e8ef;
    font: 500 12px/18px Poppins, sans-serif;
    white-space: nowrap;
}
.purchase-lines tbody td { border-bottom: 1px solid #edf0f4; padding-top: 11px; padding-bottom: 11px; }
.purchase-lines tbody tr:last-child td { border-bottom: 0; }
.purchase-lines select,
.purchase-lines input,
.purchase-lines textarea {
    min-height: 38px;
    border-color: #d9dee8;
    border-radius: 8px;
    background: #f8f9fb;
    font-size: 13px;
}
.purchase-lines textarea { min-height: 56px; }

.purchase-modern-bottom {
    grid-template-columns: minmax(0, 1.5fr) minmax(290px, .7fr);
    gap: 16px;
}
.purchase-payment-card { padding: 18px 20px; }
.purchase-payment-grid {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(210px, 1fr) minmax(240px, 1.25fr);
    gap: 14px;
}
.purchase-payment-reference { grid-column: auto; }
.purchase-cash-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 9px 11px;
    border: 1px solid #cfeedd;
    border-radius: 9px;
    background: #f3fcf7;
    color: #16784a;
    font: 400 12px/18px Poppins, sans-serif;
}
.purchase-cash-status > span { width: 8px; height: 8px; border-radius: 50%; background: #00bd68; }
.purchase-total-card { padding: 18px 20px; }
.purchase-total-card .grand-total {
    margin-top: 4px;
    color: #120736;
    font-size: 17px;
    font-weight: 600;
}
.purchase-total-card .grand-total dd { color: var(--ui-primary); }
.purchase-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin: 0 -2px -2px;
    padding: 12px 2px 3px;
    background: linear-gradient(180deg, rgba(237,239,245,0), #edeff5 30%);
}
.purchase-form-actions .button { min-width: 132px; min-height: 40px; }

@media (max-width: 1280px) {
    .purchase-header-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .purchase-field-document-type { grid-column: span 2; }
    .purchase-supplier-field { grid-column: span 2; }
    .purchase-notes-field { grid-column: span 2; }
    .purchase-payment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .purchase-payment-reference { grid-column: span 2; }
}
@media (max-width: 900px) {
    .purchase-page-head { align-items: flex-start; }
    .purchase-page-title p { display: none; }
    .purchase-header-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .purchase-field-document-type,
    .purchase-supplier-field,
    .purchase-notes-field { grid-column: span 2; }
    .purchase-modern-bottom { grid-template-columns: 1fr; }
    .purchase-section-head { align-items: flex-start; flex-direction: column; }
    .purchase-section-head .section-actions { width: 100%; }
}
@media (max-width: 600px) {
    .purchase-page-icon { width: 38px; height: 38px; flex-basis: 38px; }
    .purchase-page-title h1 { font-size: 19px; }
    .purchase-document-card,
    .purchase-modern-card,
    .purchase-total-card { border-radius: 11px; }
    .purchase-card-heading,
    .purchase-header-grid,
    .purchase-modern-card,
    .purchase-payment-card,
    .purchase-total-card { padding-left: 14px; padding-right: 14px; }
    .purchase-card-heading { align-items: flex-start; flex-direction: column; }
    .purchase-header-grid,
    .purchase-payment-grid { grid-template-columns: 1fr; }
    .purchase-field-document-type,
    .purchase-supplier-field,
    .purchase-notes-field,
    .purchase-payment-reference { grid-column: auto; }
    .purchase-form-actions .button { min-width: 0; flex: 1; }
}


/* ======================================================================
   v49 · Selectores buscables consistentes (clientes / proveedores / compra)
   ====================================================================== */
.app-search-select {
    position: relative;
    width: 100%;
    min-width: 0;
}
.app-search-select-native {
    position: absolute !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 1px !important;
    min-height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.app-search-select-input {
    width: 100%;
    height: 40px;
    min-width: 0;
    padding: 8px 38px 8px 12px !important;
    border: 1px solid #cfd5e2 !important;
    border-radius: 8px !important;
    background: #f4f6fa !important;
    color: #120736 !important;
    font: 400 13px/20px "Poppins", sans-serif !important;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.app-search-select-input:hover { border-color: #b9c1d1 !important; }
.app-search-select-input:focus {
    border-color: #5b38a4 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(91,56,164,.11) !important;
}
.app-search-select-input::placeholder { color: #98a1b3; opacity: 1; }
.app-search-select-chevron {
    position: absolute;
    top: 50%;
    right: 12px;
    z-index: 2;
    color: #7c8598;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-54%);
}
.app-search-select-popup {
    position: fixed;
    z-index: 2200;
    overflow: hidden;
    border: 1px solid #d7dce7;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(27,23,56,.18), 0 4px 12px rgba(27,23,56,.08);
    color: #120736;
    font-family: "Poppins", sans-serif;
}
.app-search-select-popup.is-hidden { display: none !important; }
.app-search-select-head {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(100px,150px);
    gap: 12px;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-bottom: 1px solid #e2e6ef;
    background: #f4f6fa;
    color: #43495b;
    font: 600 11px/16px "Poppins", sans-serif;
    text-transform: uppercase;
    letter-spacing: .025em;
}
.app-search-select-head span:last-child { text-align: right; }
.app-search-select-results {
    max-height: 330px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.app-search-select-result {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(100px,150px);
    gap: 12px;
    align-items: center;
    min-height: 56px;
    padding: 8px 14px;
    border: 0;
    border-bottom: 1px solid #edf0f5;
    background: #fff;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .12s ease;
}
.app-search-select-result:last-child { border-bottom: 0; }
.app-search-select-result:hover,
.app-search-select-result.is-active { background: #f7f5fd; }
.app-search-select-result-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.app-search-select-result-main strong {
    overflow: hidden;
    color: #17142d;
    font: 500 13px/18px "Poppins", sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-search-select-result-main small {
    overflow: hidden;
    color: #7a8395;
    font: 400 11px/16px "Poppins", sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-search-select-result-code {
    color: #4d5365;
    font: 500 12px/18px "Poppins", sans-serif;
    text-align: right;
    white-space: nowrap;
}
.app-search-select-empty {
    padding: 18px 14px;
    color: #7c8596;
    font: 400 12px/18px "Poppins", sans-serif;
    text-align: center;
}
.purchase-product-cell { min-width: 330px; }
.purchase-product-cell .app-search-select-input { background: #fff !important; }
.purchase-supplier-control .app-search-select-input,
.pos-customer-field .app-search-select-input { border-radius: 8px 0 0 8px !important; }

@media (max-width: 700px) {
    .app-search-select-head,
    .app-search-select-result { grid-template-columns: minmax(0,1fr) 92px; }
    .app-search-select-result-code { font-size: 11px; }
    .purchase-product-cell { min-width: 280px; }
}

/* ======================================================================
   v50 · Compras al contado / crédito / crédito con cuotas
   ====================================================================== */
.purchase-condition-row {
    display: grid;
    grid-template-columns: minmax(220px, .72fr) minmax(280px, 1.6fr);
    gap: 16px;
    align-items: end;
    margin: 2px 0 16px;
}
.purchase-condition-help {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #e0e4ec;
    border-radius: 9px;
    background: #f7f8fb;
    color: #677085;
    font: 400 12px/18px "Poppins", sans-serif;
}
.purchase-credit-config {
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid #e1e5ee;
    border-radius: 11px;
    background: #fafbfe;
}
.purchase-credit-grid {
    display: grid;
    grid-template-columns: minmax(150px, .6fr) minmax(180px, .75fr) minmax(260px, 1.6fr);
    gap: 14px;
    align-items: end;
}
.purchase-credit-date-note {
    min-height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    padding: 7px 11px;
    border: 1px solid #e4e7ef;
    border-radius: 8px;
    background: #fff;
}
.purchase-credit-date-note strong {
    color: #1d2230;
    font: 500 12px/17px "Poppins", sans-serif;
}
.purchase-credit-date-note span {
    color: #7a8293;
    font: 400 11px/16px "Poppins", sans-serif;
}
.purchase-installment-preview {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed #d5d9e5;
    border-radius: 8px;
    background: #fff;
    color: #626b7f;
    font: 400 12px/19px "Poppins", sans-serif;
}
.purchase-installment-preview strong { color: #231b47; font-weight: 500; }
.purchase-cash-status-inline {
    margin: 0;
    white-space: nowrap;
}
.purchase-field.is-disabled,
.purchase-field:has(input:disabled) {
    opacity: .62;
}

@media (max-width: 1050px) {
    .purchase-condition-row { grid-template-columns: 1fr; }
    .purchase-credit-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .purchase-credit-date-note { grid-column: span 2; }
}
@media (max-width: 620px) {
    .purchase-credit-grid { grid-template-columns: 1fr; }
    .purchase-credit-date-note { grid-column: auto; }
    .purchase-cash-status-inline { white-space: normal; }
}

/* ======================================================================
   v51 · Listados profesionales, acciones por fila y seguridad de catálogo
   ====================================================================== */
.compact-page-head {
    min-height: 48px !important;
    margin-bottom: 12px !important;
}
.page-title-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.page-title-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    border: 1px solid #dce1eb;
    border-radius: 9px;
    color: #241060;
    background: #fff;
    font: 600 18px/1 "Poppins", sans-serif;
}
.catalog-primary-actions { gap: 8px; }
.data-grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #e6e9f0;
}
.app-content .button.compact {
    min-height: 34px;
    padding: 7px 12px;
    font-weight: 500;
}
.professional-data-card {
    padding: 0 !important;
    overflow: visible;
    border-radius: 14px !important;
    border-color: #dfe3eb !important;
    box-shadow: 0 4px 16px rgba(25, 31, 45, .025) !important;
}
.professional-table-wrap {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
}
.professional-data-card.professional-table-wrap {
    overflow-x: auto;
}
.professional-table {
    width: 100%;
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}
.professional-table thead th {
    height: 44px;
    padding: 10px 12px !important;
    color: #111827 !important;
    background: #fbfcfe !important;
    border-bottom: 1px solid #e2e6ed !important;
    font: 600 13px/18px "Poppins", sans-serif !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
}
.professional-table tbody td {
    min-height: 50px;
    padding: 11px 12px !important;
    color: #1f2533 !important;
    border-bottom: 1px solid #e6e9ef !important;
    font: 400 13px/19px "Poppins", sans-serif !important;
    vertical-align: middle;
}
.professional-table tbody tr:last-child td { border-bottom: 0 !important; }
.professional-table tbody tr:hover { background: #fafbfe; }
.professional-table tbody tr.is-inactive-row { background: #fcfcfd; }
.professional-table tbody tr.is-inactive-row td:not(.table-actions-column) { color: #8b92a2 !important; }
.professional-table td strong { color: #111827; font-weight: 500; }
.professional-table td small { display: block; margin-top: 2px; color: #8991a0; font: 400 11px/16px "Poppins", sans-serif; }
.professional-table .serial-caption { color: #7d56c2; }
.product-name-column { min-width: 260px; }
.product-list-name { font-size: 13px; }
.align-right { text-align: right; }
.align-center { text-align: center; }
.table-actions-column { width: 52px; min-width: 52px; text-align: center; }
.product-price-stack {
    min-width: 146px;
    white-space: nowrap;
}
.product-price-stack span {
    display: block;
    color: #23283a;
    font-variant-numeric: tabular-nums;
}
.product-price-stack b {
    display: inline-block;
    min-width: 22px;
    color: #85799f;
    font-size: 10px;
    font-weight: 600;
}
.table-quick-button {
    min-width: 36px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 8px;
    border: 0;
    border-radius: 7px;
    color: #fff !important;
    text-decoration: none;
    font: 500 13px/1 "Poppins", sans-serif;
    box-shadow: none;
}
.table-quick-button.history { background: #33158f; }
.table-quick-button.history:hover { background: #28106f; }
.table-quick-button.stock { background: #13a8f3; }
.table-quick-button.stock:hover { background: #078bd0; }
.table-quick-button .stock-number {
    min-width: 13px;
    color: inherit;
    font-size: 11px;
    font-weight: 600;
}

.data-grid-filters {
    display: grid;
    grid-template-columns: minmax(300px, 1.6fr) minmax(180px, .55fr) auto;
    gap: 12px;
    align-items: end;
    max-height: 150px;
    padding: 12px 16px;
    border-bottom: 1px solid #e6e9f0;
    opacity: 1;
    overflow: hidden;
    transition: max-height .18s ease, padding .18s ease, opacity .14s ease;
}
.data-grid-filters.is-collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
    opacity: 0;
    pointer-events: none;
}
.data-grid-filters label {
    display: grid;
    gap: 5px;
    color: #4d5565;
    font: 500 12px/17px "Poppins", sans-serif;
}
.data-grid-filters .filter-actions { display: flex; gap: 7px; }
.professional-search { border-radius: 12px !important; }

.grid-column-menu { position: relative; }
.grid-column-popover {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 70;
    width: 210px;
    max-height: 330px;
    overflow: auto;
    padding: 8px;
    border: 1px solid #dde1e9;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(27, 32, 48, .14);
}
.grid-column-popover label {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 7px;
    color: #3d4352;
    font: 400 12px/17px "Poppins", sans-serif;
    cursor: pointer;
}
.grid-column-popover label:hover { background: #f6f7fa; }
.grid-column-popover input { width: 15px !important; min-height: 15px !important; }

.table-action-menu { position: relative; display: inline-block; }
.table-action-trigger {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    color: #394050;
    background: #edf0f4;
    font: 700 22px/1 "Poppins", sans-serif;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}
.table-action-trigger:hover,
.table-action-trigger[aria-expanded="true"] {
    color: #241060;
    background: #e4def5;
}
.table-action-popover {
    position: fixed;
    z-index: 10050;
    width: 218px;
    padding: 7px;
    border: 1px solid #dde1e8;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(27, 31, 45, .18);
}
.table-action-popover form { margin: 0; }
.table-action-item {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    color: #515868 !important;
    background: transparent;
    font: 400 13px/18px "Poppins", sans-serif;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
}
.table-action-item:hover { color: #241060 !important; background: var(--ui-primary-soft); }
.table-action-item.is-danger { color: #ff0b62 !important; }
.table-action-item.is-danger:hover { background: #fff0f5; }
.table-action-item.is-disabled,
.table-action-item:disabled {
    color: #b0b5c0 !important;
    background: transparent;
    cursor: not-allowed;
}
.table-action-icon {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    flex: 0 0 18px;
    color: currentColor;
    font: 500 15px/1 "Poppins", sans-serif;
}
.table-action-icon[data-action-icon="edit"]::before { content: "✎"; }
.table-action-icon[data-action-icon="history"]::before { content: "↶"; }
.table-action-icon[data-action-icon="stock"]::before { content: "⌕"; }
.table-action-icon[data-action-icon="disable"]::before { content: "⊘"; }
.table-action-icon[data-action-icon="enable"]::before { content: "✓"; }
.table-action-icon[data-action-icon="delete"]::before { content: "⌫"; }
.table-action-icon[data-action-icon="view"]::before { content: "◉"; }
.table-action-icon[data-action-icon="document"]::before { content: "▤"; }
.table-action-icon[data-action-icon="payment"]::before { content: "$"; }
.table-action-icon[data-action-icon="serial"]::before { content: "#"; }
.table-action-icon[data-action-icon="dot"]::before { content: "•"; }

@media (max-width: 900px) {
    .data-grid-filters { grid-template-columns: 1fr 1fr; }
    .data-grid-filters .filter-actions { grid-column: span 2; }
}
@media (max-width: 620px) {
    .data-grid-toolbar { align-items: stretch; }
    .data-grid-filters { grid-template-columns: 1fr; }
    .data-grid-filters .filter-actions { grid-column: auto; }
    .grid-column-popover { width: min(260px, 82vw); }
}

/* v56 · Cotizaciones comerciales y descuento global */
.quotation-form {
    display: grid;
    gap: 16px;
}
.quotation-header-card,
.quotation-lines-card,
.quotation-bottom-grid > .card,
.quotation-totals {
    border: 1px solid #e1e5ee;
    border-radius: 14px;
    box-shadow: 0 7px 22px rgba(26, 31, 47, .035);
}
.quotation-headline,
.quotation-lines-card .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.quotation-headline h2,
.quotation-lines-card h2,
.quotation-bottom-grid h2,
.quotation-totals h2 {
    margin: 2px 0 0;
    font-size: 18px;
    line-height: 25px;
    font-weight: 500;
}
.quotation-header-grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) minmax(155px, .8fr) minmax(155px, .8fr);
    gap: 14px;
    align-items: end;
}
.quotation-header-grid label,
.quotation-header-grid .form-field > label {
    color: #292541;
    font-size: 13px;
    font-weight: 500;
}
.quotation-header-grid input,
.quotation-header-grid select,
.quotation-bottom-grid textarea,
.quotation-lines input,
.quotation-lines select {
    min-height: 40px;
    margin-top: 6px;
    border-radius: 8px;
}
.quotation-customer-field { grid-column: span 2; }
.quotation-lines-card .section-head p { margin: 3px 0 0; }
.quotation-lines th { white-space: nowrap; }
.quotation-lines td:first-child { min-width: 310px; }
.quotation-lines td:nth-child(2) { width: 125px; }
.quotation-lines td:nth-child(3) { width: 165px; }
.quotation-lines td:nth-child(4) { width: 160px; }
.quotation-lines td:nth-child(5) { width: 120px; text-align: right; }
.quotation-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr);
    gap: 16px;
    align-items: start;
}
.quotation-bottom-grid textarea { width: 100%; resize: vertical; }
.quotation-totals dl { margin: 10px 0 0; }
.quotation-actions {
    position: sticky;
    bottom: 0;
    z-index: 25;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 12px 0 4px;
    background: linear-gradient(to bottom, rgba(237,239,245,0), #edeff5 30%);
}
.pos-quotation-source {
    margin: 0 0 14px;
    padding: 10px 13px;
    border: 1px solid #cfe9da;
    border-radius: 10px;
    background: #f1fbf5;
    color: #187046;
    font-size: 12px;
}
.pos-global-discount-field input { text-align: right; }

@media (max-width: 1200px) {
    .quotation-header-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .quotation-customer-field { grid-column: span 2; }
}
@media (max-width: 820px) {
    .quotation-header-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quotation-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
    .quotation-headline,
    .quotation-lines-card .section-head { align-items: flex-start; flex-direction: column; }
    .quotation-header-grid { grid-template-columns: 1fr; }
    .quotation-customer-field { grid-column: auto; }
    .quotation-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .quotation-actions .button { text-align: center; }
}

/* v57 · Selector de descuento global en Cotizaciones. */
.quotation-global-discount-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    align-items: end;
}
.quotation-global-discount-control small {
    grid-column: 1 / -1;
    color: #7b8192;
    line-height: 1.35;
}
.quotation-global-discount-control input { text-align: right; }
@media (max-width: 580px) {
    .quotation-global-discount-control { grid-template-columns: 1fr; }
    .quotation-global-discount-control small { grid-column: auto; }
}

/* v61 · Anticipos comerciales y configuración de garantías. */
.quotation-advance-summary,
.advance-tax-note,
.product-warranty-config {
    border-radius: 12px;
}
.quotation-advance-summary .metric-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.quotation-advance-modal-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}
.quotation-advance-modal-summary > div {
    padding: 12px 14px;
    border: 1px solid #e3e6ef;
    border-radius: 10px;
    background: #f8f9fc;
}
.quotation-advance-modal-summary span,
.quotation-advance-modal-summary strong {
    display: block;
}
.quotation-advance-modal-summary span {
    margin-bottom: 4px;
    color: #7b8192;
    font-size: 12px;
}
.quotation-advance-modal-summary strong {
    color: #24154f;
    font-size: 16px;
    font-weight: 600;
}
.advance-tax-note {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #f0dca4;
    background: #fffaf0;
    color: #735b20;
}
.product-warranty-config {
    padding: 13px 14px;
    border: 1px solid #e1e5ee;
    background: #fafbfe;
}
.product-warranty-toggle {
    margin: 0;
}
.product-warranty-fields {
    display: grid;
    grid-template-columns: minmax(130px, .7fr) minmax(220px, 1.3fr);
    gap: 10px 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e6e8ef;
}
.product-warranty-fields > small {
    grid-column: 1 / -1;
    color: #7b8192;
    line-height: 1.45;
}
.product-warranty-fields.is-hidden { display: none; }
.table-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}
@media (max-width: 720px) {
    .quotation-advance-modal-summary,
    .quotation-advance-summary .metric-grid.compact,
    .product-warranty-fields { grid-template-columns: 1fr; }
    .product-warranty-fields > small { grid-column: auto; }
}
.quotation-advance-items {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #e3e6ef;
    border-radius: 10px;
    background: #fff;
}
.quotation-advance-items > strong { color: #292541; font-size: 13px; }
.quotation-advance-items-list { display: grid; gap: 7px; margin-top: 9px; }
.quotation-advance-items-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 7px; border-top: 1px solid #f0f1f5; }
.quotation-advance-items-list span { min-width: 0; color: #54586a; }
.quotation-advance-items-list span small { color: #8b90a0; }
.quotation-advance-items-list strong { white-space: nowrap; color: #24154f; font-weight: 500; }

/* ==========================================================
   v62 · Anticipos y flujo post-cotización
   ========================================================== */
.advance-create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .7fr);
    gap: 18px;
    align-items: start;
}
.advance-create-main,
.advance-preview-card { border-radius: 14px; }
.advance-create-main { padding: 22px; }
.advance-preview-card { position: sticky; top: 92px; padding: 22px; }
.advance-quotation-picker { position: relative; margin-top: 16px; }
.advance-quotation-picker label { display: block; }
.advance-quotation-results {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 360px;
    overflow: auto;
    padding: 7px;
    border: 1px solid #dfe3ec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(31, 35, 54, .14);
}
.advance-quotation-option {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 11px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #171530;
    text-align: left;
    cursor: pointer;
}
.advance-quotation-option:hover,
.advance-quotation-option:focus { background: #f5f2ff; outline: none; }
.advance-quotation-option span,
.advance-quotation-option strong,
.advance-quotation-option small { display: block; }
.advance-quotation-option strong { font-weight: 500; }
.advance-quotation-option small { margin-top: 2px; color: #858b9c; font-size: 12px; }
.advance-quotation-option > span:last-child { text-align: right; white-space: nowrap; }
.advance-selected-summary,
.advance-modal-metrics-v62 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.advance-selected-summary > div,
.advance-modal-metrics-v62 > div {
    padding: 12px 13px;
    border: 1px solid #e2e5ee;
    border-radius: 11px;
    background: #fafbfe;
}
.advance-selected-summary span,
.advance-selected-summary strong,
.advance-modal-metrics-v62 span,
.advance-modal-metrics-v62 strong { display: block; }
.advance-selected-summary span,
.advance-modal-metrics-v62 span { margin-bottom: 4px; color: #7c8293; font-size: 12px; }
.advance-selected-summary strong,
.advance-modal-metrics-v62 strong { color: #292541; font-size: 14px; font-weight: 500; }
.advance-selected-summary .is-balance,
.advance-modal-metrics-v62 .is-balance { border-color: #d8cff5; background: var(--ui-primary-soft); }
.advance-selected-summary .is-balance strong,
.advance-modal-metrics-v62 .is-balance strong { color: var(--ui-primary); font-size: 16px; }
.advance-payment-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid #eceef3; }
.advance-payment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.advance-quick-amounts { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.advance-quick-amounts span { color: #777d8d; font-size: 12px; }
.advance-quick-amounts button {
    border: 1px solid #d9ddea;
    border-radius: 999px;
    padding: 6px 10px;
    background: #fff;
    color: var(--ui-primary);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.advance-quick-amounts button:hover { border-color: #b9aae6; background: var(--ui-primary-soft); }
.advance-preview-list { margin: 18px 0; }
.advance-preview-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px solid #eceef3; }
.advance-preview-list dt { color: #73798a; }
.advance-preview-list dd { margin: 0; color: #292541; font-weight: 500; }
.advance-preview-list .grand-total { padding-top: 14px; border-top: 2px solid var(--ui-primary); border-bottom: 0; }
.advance-preview-list .grand-total dt,
.advance-preview-list .grand-total dd { color: var(--ui-primary); font-size: 17px; font-weight: 700; }
.advance-preview-card > .button { width: 100%; margin-top: 16px; }

.quotation-advance-dialog-v62 { width: min(920px, calc(100vw - 28px)); }
.advance-modal-panel-v62 { padding: 0; overflow: hidden; }
.advance-modal-header-v62 { padding: 20px 22px 16px; border-bottom: 1px solid #eceef3; }
.advance-modal-metrics-v62 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 22px 0; }
.advance-modal-content-v62 { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr); gap: 16px; padding: 16px 22px 22px; }
.advance-modal-products-v62 { margin: 0; min-height: 100%; }
.advance-modal-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.advance-modal-section-title small { color: #8a8f9e; }
.advance-modal-form-v62 { padding: 14px; border: 1px solid #e4e7ef; border-radius: 12px; background: #fbfcfe; }
.advance-after-payment-v62 { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 13px 0; padding: 11px 12px; border-radius: 9px; background: var(--ui-primary-soft); color: var(--ui-primary); }
.advance-after-payment-v62 strong { font-size: 16px; }
.advance-modal-form-v62 .form-actions { margin-top: 12px; }

@media (max-width: 1040px) {
    .advance-create-layout { grid-template-columns: 1fr; }
    .advance-preview-card { position: static; }
    .advance-selected-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .advance-selected-summary,
    .advance-modal-metrics-v62,
    .advance-payment-grid { grid-template-columns: 1fr 1fr; }
    .advance-modal-content-v62 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .advance-selected-summary,
    .advance-modal-metrics-v62,
    .advance-payment-grid { grid-template-columns: 1fr; }
    .advance-create-main,
    .advance-preview-card { padding: 16px; }
}

/* === Avances v63: modales profesionales y gestión rápida desde listado === */
.quotation-advance-dialog-v63 { width: min(980px, calc(100vw - 26px)); }
.advance-modal-panel-v63 { padding: 0; overflow: hidden; }
.advance-modal-header-v63 { padding: 22px 24px 18px; border-bottom: 1px solid #eceef3; }
.advance-modal-header-v63 h2 { margin-bottom: 6px; }
.advance-modal-header-v63 p { margin: 0; color: #6f7687; }
.advance-modal-metrics-v63 { margin: 16px 24px 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.advance-modal-content-v63,
.advance-list-detail-grid-v63 {
    display: grid;
    grid-template-columns: minmax(250px, .85fr) minmax(0, 1.15fr);
    gap: 16px;
    padding: 16px 24px 24px;
}
.advance-modal-sidecard-v63 {
    margin: 0;
    border: 1px solid #e7eaf1;
    background: linear-gradient(180deg, #fcfcff 0%, #f8f9fd 100%);
}
.advance-modal-sidecard-v63 h3 { margin-bottom: 10px; color: #292541; }
.advance-preview-list.compact { margin: 0; }
.advance-preview-list.compact > div { padding: 10px 0; }
.advance-document-hero-v63 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 18px 24px 0;
}
.advance-document-hero-v63 article {
    padding: 14px 15px;
    border-radius: 14px;
    border: 1px solid #e3e6ef;
    background: #fafbfe;
}
.advance-document-hero-v63 article span,
.advance-document-hero-v63 article strong { display: block; }
.advance-document-hero-v63 article span { color: #7a8192; font-size: 12px; margin-bottom: 6px; }
.advance-document-hero-v63 article strong { color: #2a2541; font-size: 15px; font-weight: 700; }
.advance-document-hero-v63 .is-balance { border-color: #d8cff5; background: var(--ui-primary-soft); }
.advance-document-hero-v63 .is-balance strong { color: var(--ui-primary); font-size: 18px; }
.advance-document-form-v63 { padding: 16px 24px 24px; }
.advance-document-grid-v63 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.advance-document-preview-v63 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.advance-document-preview-v63 > div {
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid #e4e7ef;
    background: #fbfcfe;
}
.advance-document-preview-v63 span,
.advance-document-preview-v63 strong { display: block; }
.advance-document-preview-v63 span { color: #7c8293; font-size: 12px; margin-bottom: 4px; }
.advance-document-preview-v63 strong { color: #292541; font-size: 14px; font-weight: 600; }
.advance-document-preview-v63 .is-balance { border-color: #d8cff5; background: var(--ui-primary-soft); }
.advance-document-preview-v63 .is-balance strong { color: var(--ui-primary); font-size: 16px; }
.advance-list-dialog-v63::backdrop,
.quotation-advance-dialog-v63::backdrop { background: rgba(26, 20, 43, 0.48); }
.advance-list-quick-actions-v63 { display: grid; gap: 10px; margin-top: 14px; }
.advance-list-quick-actions-v63 .button { text-align: center; }
.advance-detail-hero-v63 { padding-top: 16px; }

@media (max-width: 980px) {
    .advance-document-hero-v63,
    .advance-document-preview-v63,
    .advance-modal-metrics-v63 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .advance-modal-content-v63,
    .advance-list-detail-grid-v63 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .advance-modal-header-v63,
    .advance-document-form-v63 { padding-left: 16px; padding-right: 16px; }
    .advance-modal-content-v63,
    .advance-list-detail-grid-v63 { padding: 14px 16px 16px; }
    .advance-document-hero-v63,
    .advance-modal-metrics-v63 { padding-left: 16px; padding-right: 16px; }
    .advance-document-grid-v63,
    .advance-document-preview-v63,
    .advance-document-hero-v63,
    .advance-modal-metrics-v63 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   v64 — Anticipos: dialogs válidos, compactos, centrados y con scroll interno
   ========================================================================== */
.advance-dialog-v64 {
    width: min(960px, calc(100vw - 40px)) !important;
    max-width: 960px !important;
    max-height: min(88vh, 780px) !important;
    margin: auto !important;
    padding: 0 !important;
    border: 1px solid #e2e5ec !important;
    border-radius: 16px !important;
    background: #fff !important;
    color: #211c35;
    overflow: hidden !important;
    box-shadow: 0 28px 90px rgba(26, 20, 43, .28) !important;
}
.advance-dialog-v64::backdrop {
    background: rgba(28, 25, 43, .48) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.advance-dialog-shell-v64 {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(88vh, 780px);
    background: #fff;
    overflow: hidden;
}
.advance-dialog-header-v64 {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex: 0 0 auto;
    padding: 20px 24px 17px !important;
    background: #fff !important;
    border-bottom: 1px solid #eceef3 !important;
}
.advance-dialog-header-v64 > div { min-width: 0; }
.advance-dialog-header-v64 .modal-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--ui-primary);
    font-size: 11px;
    line-height: 16px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.advance-dialog-header-v64 h2 {
    margin: 0 !important;
    color: #211c35 !important;
    font-size: 21px !important;
    line-height: 1.3 !important;
    font-weight: 650 !important;
}
.advance-dialog-header-v64 p {
    margin: 4px 0 0 !important;
    max-width: 720px;
    color: #747b8d !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}
.advance-dialog-header-v64 .modal-close {
    flex: 0 0 36px;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid #e4e6ed;
    border-radius: 9px !important;
    background: #fafbfc;
    color: #7f8696;
    font-size: 22px;
    line-height: 1;
}
.advance-dialog-header-v64 .modal-close:hover { background: #f3f4f7; color: #2f2945; }
.advance-dialog-scroll-v64 {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 24px 22px;
    background: #f8f9fc;
}
.advance-kpis-v64 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 16px;
}
.advance-kpis-three-v64 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.advance-kpis-v64 article {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #e2e5ed;
    border-radius: 12px;
    background: #fff;
}
.advance-kpis-v64 span,
.advance-kpis-v64 strong { display: block; }
.advance-kpis-v64 span { margin-bottom: 5px; color: #7e8493; font-size: 12px; }
.advance-kpis-v64 strong { color: #27223d; font-size: 15px; font-weight: 650; }
.advance-kpis-v64 .is-primary { border-color: #d7cdf5; background: var(--ui-primary-soft); }
.advance-kpis-v64 .is-primary strong { color: var(--ui-primary); font-size: 17px; }
.advance-detail-grid-v64,
.advance-payment-layout-v64 {
    display: grid;
    grid-template-columns: minmax(260px, .82fr) minmax(0, 1.38fr);
    gap: 16px;
    align-items: stretch;
}
.advance-panel-v64,
.advance-summary-card-v64,
.advance-payment-form-v64,
.advance-document-form-v64 {
    margin: 0;
    padding: 17px;
    border: 1px solid #e2e5ed;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(26, 20, 43, .02);
}
.advance-panel-title-v64,
.advance-form-title-v64 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.advance-panel-title-v64 h3,
.advance-form-title-v64 h3 {
    margin: 0;
    color: #29243e;
    font-size: 15px;
    font-weight: 650;
}
.advance-panel-title-v64 small,
.advance-panel-title-v64 > span:not(.badge) { color: #8a90a0; font-size: 12px; }
.advance-detail-list-v64 { margin: 0; }
.advance-detail-list-v64 > div {
    display: grid;
    grid-template-columns: minmax(100px, .75fr) minmax(0, 1.25fr);
    gap: 14px;
    align-items: start;
    padding: 9px 0;
    border-bottom: 1px solid #eff1f5;
}
.advance-detail-list-v64 > div:last-child { border-bottom: 0; }
.advance-detail-list-v64 dt { color: #7b8190; font-size: 13px; }
.advance-detail-list-v64 dd { margin: 0; color: #28233e; font-size: 13px; font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.advance-payment-history-v64 { display: grid; gap: 0; }
.advance-payment-history-v64 > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid #eff1f5;
}
.advance-payment-history-v64 > div:last-child { border-bottom: 0; }
.advance-payment-history-v64 span { min-width: 0; }
.advance-payment-history-v64 span:last-child { text-align: right; white-space: nowrap; }
.advance-payment-history-v64 strong,
.advance-payment-history-v64 small { display: block; }
.advance-payment-history-v64 strong { color: #2a2540; font-size: 12px; font-weight: 600; }
.advance-payment-history-v64 small { margin-top: 2px; color: #8a90a0; font-size: 11px; }
.advance-payment-history-v64 a { display: inline-block; margin-top: 3px; color: var(--ui-primary); font-size: 11px; font-weight: 600; text-decoration: none; }
.advance-projected-balance-v64 {
    margin-top: 14px;
    padding: 12px 13px;
    border: 1px solid #d9cff6;
    border-radius: 11px;
    background: var(--ui-primary-soft);
}
.advance-projected-balance-v64 span,
.advance-projected-balance-v64 strong { display: block; }
.advance-projected-balance-v64 span { margin-bottom: 3px; color: #756d8d; font-size: 12px; }
.advance-projected-balance-v64 strong { color: var(--ui-primary); font-size: 18px; font-weight: 700; }
.advance-payment-form-v64 { display: block; }
.advance-payment-fields-v64 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.advance-payment-fields-v64 label,
.advance-document-fields-v64 label { color: #373247; font-size: 13px !important; font-weight: 500 !important; }
.advance-payment-fields-v64 textarea { min-height: 68px !important; resize: vertical; }
.advance-cash-status-v64,
.advance-document-chip-v64 {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.advance-cash-status-v64.is-open { border: 1px solid #cce8d8; background: #f1faf5; color: #187047; }
.advance-cash-status-v64.is-closed { border: 1px solid #f0d9a6; background: #fff9ed; color: #8a651d; }
.advance-document-chip-v64 { border: 1px solid #d9cff6; background: var(--ui-primary-soft); color: var(--ui-primary); }
.advance-quick-amounts-v64 { margin-top: 12px; }
.advance-form-actions-v64 {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eceef3;
}
.advance-form-actions-v64 .button { min-width: 132px; text-align: center; }
.advance-dialog-footer-v64 {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 24px;
    border-top: 1px solid #eceef3;
    background: #fff;
}
.advance-dialog-footer-v64 > div { display: flex; gap: 9px; flex-wrap: wrap; }
.advance-document-form-v64 { margin-top: 0; }
.advance-document-fields-v64 { grid-template-columns: minmax(260px, 1.3fr) minmax(160px, .7fr) minmax(180px, .8fr); gap: 12px 14px; }
.advance-document-summary-v64 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.advance-document-summary-v64 > div {
    padding: 11px 12px;
    border: 1px solid #e4e7ef;
    border-radius: 10px;
    background: #fafbfe;
}
.advance-document-summary-v64 span,
.advance-document-summary-v64 strong { display: block; }
.advance-document-summary-v64 span { margin-bottom: 3px; color: #7b8190; font-size: 11px; }
.advance-document-summary-v64 strong { color: #28233e; font-size: 13px; font-weight: 600; }
.advance-document-summary-v64 .is-primary { border-color: #d7cdf5; background: var(--ui-primary-soft); }
.advance-document-summary-v64 .is-primary strong { color: var(--ui-primary); font-size: 15px; }

@media (max-width: 900px) {
    .advance-kpis-v64,
    .advance-kpis-three-v64 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .advance-detail-grid-v64,
    .advance-payment-layout-v64 { grid-template-columns: 1fr; }
    .advance-document-fields-v64 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .advance-document-fields-v64 label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
    .advance-dialog-v64 { width: calc(100vw - 20px) !important; max-height: 92vh !important; }
    .advance-dialog-shell-v64 { max-height: 92vh; }
    .advance-dialog-header-v64 { padding: 16px !important; }
    .advance-dialog-scroll-v64 { padding: 14px; }
    .advance-kpis-v64,
    .advance-kpis-three-v64,
    .advance-payment-fields-v64,
    .advance-document-fields-v64,
    .advance-document-summary-v64 { grid-template-columns: 1fr; }
    .advance-document-fields-v64 label:first-child { grid-column: auto; }
    .advance-dialog-footer-v64 { align-items: stretch; flex-direction: column; padding: 12px 14px; }
    .advance-dialog-footer-v64 > div { display: grid; width: 100%; }
    .advance-dialog-footer-v64 .button { width: 100%; text-align: center; }
    .advance-form-actions-v64 { display: grid; grid-template-columns: 1fr 1fr; }
    .advance-form-actions-v64 .button { min-width: 0; }
}

/* Compatibilidad del expediente de anticipo creado en v63: aplica el mismo
   lenguaje visual v64 aunque la vista conserve clases históricas. */
.quotation-advance-dialog-v63 {
    padding: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
}
.advance-modal-panel-v63 { background: #fff !important; }
.advance-modal-header-v63 {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    background: #fff !important;
}
.advance-modal-header-v63 .modal-close { flex: 0 0 auto; }

/* === v65 · Series administradas directamente desde Sucursales === */
.branch-list-card-v65 { overflow: visible; }
.branch-table-v65 .branch-name-v65 { display: block; color: #211b3a; font-weight: 600; }
.branch-table-v65 td small { display: block; margin-top: 3px; color: #848a9b; }
.branch-edit-trigger-v65 { display: inline-grid; place-items: center; text-decoration: none; }
.branch-series-button-v65 {
    display: inline-flex;
    min-width: 104px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border: 0;
    border-radius: 9px;
    padding: 8px 13px;
    background: #fff3df;
    color: #b65b00;
    font: inherit;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.branch-series-button-v65 span { font-weight: 650; }
.branch-series-button-v65 small { margin: 0 !important; color: #b97834 !important; font-size: 10.5px; }
.branch-series-button-v65:hover,
.branch-series-button-v65:focus-visible {
    outline: none;
    transform: translateY(-1px);
    background: #ffe9c5;
    box-shadow: 0 7px 18px rgba(185, 103, 16, .14);
}

.branch-series-dialog-v65 {
    width: min(1120px, calc(100vw - 28px));
    max-width: 1120px;
    max-height: min(820px, calc(100vh - 28px));
    margin: auto;
    padding: 0;
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 18px;
    background: #fff;
    color: #211b3a;
    box-shadow: 0 28px 80px rgba(30, 24, 48, .28);
    overflow: hidden;
}
.branch-series-dialog-v65::backdrop { background: rgba(31, 26, 48, .48); backdrop-filter: blur(2px); }
.branch-series-panel-v65 { display: flex; max-height: min(820px, calc(100vh - 28px)); flex-direction: column; background: #fff; }
.branch-series-header-v65 {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    flex: 0 0 auto;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #eceef4;
    background: #fff;
}
.branch-series-header-v65 h2 { margin: 4px 0 5px; font-size: 24px; line-height: 1.2; color: #211b3a; }
.branch-series-header-v65 p { margin: 0; color: #777e90; font-size: 13px; }
.branch-series-header-v65 .modal-close { flex: 0 0 auto; }
.branch-series-stats-v65 {
    display: grid;
    grid-template-columns: 170px 170px minmax(240px, 1fr);
    gap: 11px;
    flex: 0 0 auto;
    padding: 14px 24px 0;
    background: #fff;
}
.branch-series-stats-v65 > div {
    padding: 12px 14px;
    border: 1px solid #e5e8f0;
    border-radius: 12px;
    background: #fafbfe;
}
.branch-series-stats-v65 span,
.branch-series-stats-v65 strong { display: block; }
.branch-series-stats-v65 span { margin-bottom: 4px; color: #858b9b; font-size: 11.5px; }
.branch-series-stats-v65 strong { color: #27213e; font-size: 15px; font-weight: 650; }
.branch-series-stats-v65 .is-primary { border-color: #dacff6; background: var(--ui-primary-soft); }
.branch-series-stats-v65 .is-primary strong { color: var(--ui-primary); }
.branch-series-body-v65 {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(290px, .75fr);
    gap: 16px;
    min-height: 0;
    padding: 16px 24px 20px;
    overflow: auto;
    background: #fff;
}
.branch-series-list-v65,
.branch-series-editor-v65 {
    min-width: 0;
    border: 1px solid #e7eaf1;
    border-radius: 14px;
    background: #fff;
}
.branch-series-list-v65 { overflow: hidden; }
.branch-series-section-head-v65 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 16px 13px;
    border-bottom: 1px solid #eceef4;
    background: #fbfcfe;
}
.branch-series-section-head-v65 h3,
.branch-series-editor-head-v65 h3 { margin: 0; color: #292342; font-size: 16px; }
.branch-series-section-head-v65 p { margin: 4px 0 0; color: #858b9b; font-size: 11.5px; line-height: 1.45; }
.branch-series-table-wrap-v65 { overflow: auto; max-height: 445px; }
.branch-series-table-inner-v65 { width: 100%; border-collapse: collapse; min-width: 680px; }
.branch-series-table-inner-v65 th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 12px;
    border-bottom: 1px solid #e7eaf1;
    background: #fff;
    color: #656c7e;
    font-size: 11px;
    font-weight: 650;
    text-align: left;
    white-space: nowrap;
}
.branch-series-table-inner-v65 td { padding: 11px 12px; border-bottom: 1px solid #edf0f5; vertical-align: middle; font-size: 12px; }
.branch-series-table-inner-v65 tbody tr:last-child td { border-bottom: 0; }
.branch-series-table-inner-v65 td strong,
.branch-series-table-inner-v65 td small { display: block; }
.branch-series-table-inner-v65 td small { margin-top: 3px; color: #8a90a0; font-size: 10.5px; }
.branch-series-code-v65 {
    display: inline-flex;
    min-width: 58px;
    justify-content: center;
    border-radius: 7px;
    padding: 5px 8px;
    background: #f0edfb;
    color: var(--ui-primary);
    font-weight: 700;
    letter-spacing: .03em;
}
.branch-series-row-actions-v65 { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.branch-series-row-actions-v65 form { margin: 0; }
.branch-series-edit-v65,
.branch-series-status-v65 {
    border: 1px solid #dde1ea;
    border-radius: 7px;
    padding: 6px 8px;
    background: #fff;
    color: #3a344e;
    font: inherit;
    font-size: 10.5px;
    cursor: pointer;
}
.branch-series-edit-v65:hover { border-color: #c8bced; background: var(--ui-primary-soft); color: var(--ui-primary); }
.branch-series-status-v65.is-disable { color: #ad3e55; }
.branch-series-status-v65.is-enable { color: #14744a; }
.branch-series-editor-v65 { align-self: start; padding: 16px; background: #fbfcfe; }
.branch-series-editor-head-v65 { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.branch-series-editor-reset-v65 { border: 0; background: transparent; color: #6b5aa5; font: inherit; font-size: 11px; cursor: pointer; }
.branch-series-form-v65 { display: grid; gap: 12px; }
.branch-series-form-v65 label:not(.check) { display: grid; gap: 6px; color: #4f5568; font-size: 11.5px; font-weight: 550; }
.branch-series-form-v65 input,
.branch-series-form-v65 select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #dfe3ec;
    border-radius: 9px;
    padding: 8px 10px;
    background: #fff;
    color: #27213e;
    font: inherit;
}
.branch-series-form-v65 input:focus,
.branch-series-form-v65 select:focus { outline: 0; border-color: #8f78ce; box-shadow: 0 0 0 3px rgba(87, 52, 157, .09); }
.branch-series-form-v65 input[readonly],
.branch-series-form-v65 select:disabled { background: #f0f2f6; color: #6e7483; cursor: not-allowed; }
.branch-series-form-v65 label small { color: #8a90a0; font-size: 10.5px; font-weight: 400; line-height: 1.4; }
.branch-series-active-check-v65 { margin-top: 1px; }
.branch-series-format-note-v65,
.branch-series-lock-note-v65 {
    border-radius: 9px;
    padding: 10px 11px;
    font-size: 10.8px;
    line-height: 1.45;
}
.branch-series-format-note-v65 { border: 1px solid #e1daf7; background: #f7f4ff; color: #5e5186; }
.branch-series-lock-note-v65 { border: 1px solid #f1d9a8; background: #fff8e8; color: #805c13; }
.branch-series-form-actions-v65 { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-top: 2px; }
.branch-series-form-actions-v65 .button { justify-content: center; }
.branch-series-footer-v65 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex: 0 0 auto;
    padding: 13px 24px 16px;
    border-top: 1px solid #eceef4;
    background: #fbfcfe;
}
.branch-series-footer-v65 p { margin: 0; color: #777e90; font-size: 11px; line-height: 1.4; }
.branch-series-footer-v65 strong { color: #4d445f; }

@media (max-width: 940px) {
    .branch-series-body-v65 { grid-template-columns: 1fr; }
    .branch-series-editor-v65 { align-self: stretch; }
    .branch-series-stats-v65 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .branch-series-dialog-v65 { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 14px; }
    .branch-series-panel-v65 { max-height: calc(100vh - 16px); }
    .branch-series-header-v65 { padding: 17px 16px 14px; }
    .branch-series-header-v65 h2 { font-size: 20px; }
    .branch-series-stats-v65 { grid-template-columns: 1fr 1fr; padding: 12px 16px 0; }
    .branch-series-stats-v65 .is-primary { grid-column: 1 / -1; }
    .branch-series-body-v65 { padding: 12px 16px 16px; }
    .branch-series-section-head-v65 { align-items: flex-start; flex-direction: column; }
    .branch-series-footer-v65 { align-items: stretch; flex-direction: column; padding: 12px 16px 15px; }
    .branch-series-form-actions-v65 { grid-template-columns: 1fr; }
}

/* === v67 · Series preexistentes sin sucursal === */
.branch-unassigned-series-v67 {
    display: grid;
    grid-template-columns: minmax(220px, .9fr) minmax(0, 1.6fr);
    gap: 16px;
    margin: 14px 26px 0;
    padding: 14px 16px;
    border: 1px solid #e6defc;
    border-radius: 14px;
    background: #faf8ff;
}
.branch-unassigned-series-v67 strong { display: block; margin: 2px 0 4px; color: #2b1a62; }
.branch-unassigned-series-v67 p { margin: 0; color: #73798a; font-size: 12px; line-height: 1.45; }
.branch-unassigned-series-list-v67 { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.branch-unassigned-series-chip-v67 {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas: "type series" "type action";
    align-items: center;
    gap: 0 9px;
    min-width: 150px;
    padding: 9px 11px;
    border: 1px solid #d9cef8;
    border-radius: 11px;
    background: #fff;
    color: #302459;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.branch-unassigned-series-chip-v67:hover,
.branch-unassigned-series-chip-v67:focus-visible { border-color: #6b45c6; box-shadow: 0 0 0 3px rgba(80, 44, 160, .08); outline: none; }
.branch-unassigned-series-chip-v67 > span { grid-area: type; color: #747b8c; font-size: 11px; }
.branch-unassigned-series-chip-v67 > strong { grid-area: series; margin: 0; font-size: 14px; color: var(--ui-primary); }
.branch-unassigned-series-chip-v67 > small { grid-area: action; color: #6b45c6; font-size: 10.5px; }
.branch-unassigned-series-chip-v67.is-locked { opacity: .55; cursor: not-allowed; }
@media (max-width: 840px) {
    .branch-unassigned-series-v67 { grid-template-columns: 1fr; margin-left: 16px; margin-right: 16px; }
    .branch-unassigned-series-list-v67 { justify-content: flex-start; }
}

/* === v68 · Servicio técnico profesional === */
.service-page-head-v68 { align-items: center; }
.service-pending-v68 { border-left: 3px solid #f59e0b; }
.service-orders-v68 { margin-top: 18px; }

.service-intake-dialog {
    width: min(930px, calc(100vw - 34px));
    max-width: 930px;
    max-height: calc(100vh - 34px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: transparent;
    box-shadow: 0 28px 80px rgba(27, 20, 54, .24);
    overflow: hidden;
}
.service-intake-dialog::backdrop { background: rgba(25, 22, 36, .48); backdrop-filter: blur(1.5px); }
.service-intake-modal {
    width: 100%;
    max-height: calc(100vh - 34px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #fff;
    color: #211b36;
}
.service-intake-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 17px;
    border-bottom: 1px solid #e7e9f0;
    background: #fff;
}
.service-intake-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--ui-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.service-intake-header h2 { margin: 0; font-size: 22px; line-height: 1.2; color: #211b36; }
.service-intake-header p { margin: 6px 0 0; color: #73798a; font-size: 13px; }
.service-intake-close {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #9499a8;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}
.service-intake-close:hover { background: #f3f4f8; color: var(--ui-primary); }
.service-intake-scroll { min-height: 0; overflow-y: auto; padding: 18px 24px 8px; scrollbar-gutter: stable; }
.service-source-banner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
    margin-bottom: 16px;
    padding: 11px 13px;
    border: 1px solid #d9cff9;
    border-radius: 12px;
    background: #f8f5ff;
}
.service-source-banner span { color: #6e6486; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.service-source-banner strong { color: var(--ui-primary); font-size: 13px; }
.service-source-banner small { grid-column: 1 / -1; margin-top: 3px; color: #777187; }
.service-intake-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .75fr);
    gap: 14px 18px;
}
.service-field,
.service-general-grid label,
.service-management-grid label,
.service-notes-grid label,
.service-product-picker label {
    display: grid;
    gap: 6px;
    color: #2e2944;
    font-size: 13px;
    font-weight: 500;
}
.service-description-field { grid-column: 1 / -1; }
.service-intake-modal input:not([type="checkbox"]):not([type="radio"]),
.service-intake-modal select,
.service-intake-modal textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d9dde8;
    border-radius: 9px;
    background: #f8f9fc;
    padding: 9px 11px;
    color: #29243f;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.service-intake-modal textarea { resize: vertical; line-height: 1.45; }
.service-intake-modal input:focus,
.service-intake-modal select:focus,
.service-intake-modal textarea:focus {
    border-color: #8f78cf;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(53, 16, 120, .08);
}
.service-intake-modal input[readonly] { color: #73798a; background: #f0f2f7; }
.service-readonly-field {
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid #d9dde8;
    border-radius: 9px;
    background: #f3f4f8;
}
.service-readonly-field strong,
.service-readonly-field small { display: block; }
.service-readonly-field strong { color: #29243f; font-size: 13px; }
.service-readonly-field small { margin-top: 2px; color: #7c8291; font-size: 11px; }
.service-customer-add { min-height: 42px; }

.service-intake-tabs {
    display: flex;
    align-items: end;
    gap: 4px;
    margin-top: 16px;
    border-bottom: 1px solid #e8eaf0;
}
.service-intake-tabs button {
    appearance: none;
    border: 0;
    border-radius: 10px 10px 0 0;
    padding: 10px 18px 9px;
    background: transparent;
    color: #73809c;
    font: inherit;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
}
.service-intake-tabs button:hover { color: var(--ui-primary); background: #f7f6fa; }
.service-intake-tabs button.is-active { color: var(--ui-primary); background: #f0f1f5; font-weight: 500; }
.service-intake-panel { padding: 17px 4px 10px; }
.service-intake-panel[hidden] { display: none !important; }
.service-general-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 20px;
}
.service-general-grid label small { color: #8a8f9f; font-size: 11px; font-weight: 400; }
.service-money-input { position: relative; }
.service-money-input > span {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #73798a;
    font-size: 12px;
    pointer-events: none;
}
.service-money-input input { padding-left: 33px !important; text-align: right; }
.service-type-section { margin-top: 16px; }
.service-field-label { display: block; margin-bottom: 8px; color: #2e2944; font-size: 13px; font-weight: 600; }
.service-type-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.service-type-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid #dde1eb;
    border-radius: 10px;
    background: #fff;
    color: #302a47;
    font-size: 12px;
    cursor: pointer;
}
.service-type-option:has(input:checked) { border-color: #9f88dd; background: var(--ui-primary-soft); color: var(--ui-primary); }
.service-type-option input { width: 15px; height: 15px; accent-color: var(--ui-primary); }
.service-type-option:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.service-management-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
    padding-top: 15px;
    border-top: 1px solid #eceef3;
}
.service-management-grid label { font-size: 11px; color: #6f7586; }

.service-notes-toolbar,
.service-products-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 13px;
}
.service-notes-toolbar strong,
.service-products-heading strong { display: block; color: #30294a; font-size: 14px; }
.service-notes-toolbar small,
.service-products-heading small { display: block; margin-top: 3px; color: #838999; font-size: 11px; }
.service-notes-toolbar > span { padding: 5px 9px; border-radius: 999px; background: var(--ui-primary-soft); color: var(--ui-primary); font-size: 10px; font-weight: 600; }
.service-notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.service-note-help { margin-top: 14px; padding: 11px 13px; border-radius: 10px; background: #f5f6f9; color: #697082; font-size: 12px; }
.service-note-help strong { color: #353048; }

.service-product-picker { margin-bottom: 14px; }
.service-product-table-wrap { overflow-x: auto; border: 1px solid #e5e8ef; border-radius: 11px; }
.service-product-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.service-product-table th { padding: 10px 11px; background: #fafbfc; border-bottom: 1px solid #e6e8ef; color: #2e2944; text-align: left; font-weight: 600; white-space: nowrap; }
.service-product-table td { padding: 11px; border-bottom: 1px solid #eceef3; color: #454054; vertical-align: middle; }
.service-product-table tbody tr:last-child td { border-bottom: 0; }
.service-product-table td strong,
.service-product-table td small { display: block; }
.service-product-table td small { margin-top: 2px; color: #8a8f9e; }
.service-product-empty td { padding: 28px !important; color: #8c91a0 !important; text-align: center; }
.service-inline-qty { width: 88px !important; min-height: 34px !important; padding: 6px 8px !important; }

.service-intake-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    padding: 14px 24px 17px;
    border-top: 1px solid #e7e9f0;
    background: #fff;
}
.service-intake-total { margin-right: auto; text-align: right; }
.service-intake-total span { display: block; color: #7a8090; font-size: 11px; }
.service-intake-total strong { display: block; margin-top: 2px; color: var(--ui-primary); font-size: 21px; font-weight: 600; }
.service-intake-actions { display: flex; gap: 9px; }
.service-intake-actions .button { min-width: 96px; }

@media (max-width: 980px) {
    .service-management-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .service-type-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .service-intake-dialog { width: calc(100vw - 18px); max-height: calc(100vh - 18px); border-radius: 14px; }
    .service-intake-modal { max-height: calc(100vh - 18px); }
    .service-intake-header { padding: 17px 16px 13px; }
    .service-intake-scroll { padding: 14px 16px 6px; }
    .service-intake-top-grid,
    .service-general-grid,
    .service-notes-grid { grid-template-columns: 1fr; }
    .service-description-field { grid-column: auto; }
    .service-management-grid { grid-template-columns: 1fr 1fr; }
    .service-intake-tabs button { padding: 9px 12px; font-size: 15px; }
    .service-intake-footer { align-items: stretch; padding: 12px 16px 15px; flex-direction: column; }
    .service-intake-total { text-align: left; }
    .service-intake-actions { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
    .service-management-grid,
    .service-type-options { grid-template-columns: 1fr; }
}

/* === v70 · Servicio técnico: equipo único + repuestos/reemplazos === */
.service-equipment-product-field { grid-column: 1 / -1; display: grid; gap: 6px; }
.service-equipment-product-field > small { color: #858b9b; font-size: 11px; font-weight: 400; }
.service-condition-field { grid-column: 1 / -1; }
.service-products-optional {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
    font-size: 10px;
    font-weight: 600;
}
.service-part-builder {
    display: grid;
    grid-template-columns: minmax(220px, 1.7fr) minmax(145px, .8fr) minmax(150px, .9fr) minmax(105px, .55fr) minmax(125px, .65fr);
    gap: 11px 12px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid #e5e8ef;
    border-radius: 12px;
    background: #fafbfc;
}
.service-part-builder label,
.service-part-builder-product {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: #2e2944;
    font-size: 12px;
    font-weight: 500;
}
.service-part-builder-product { grid-column: span 1; }
.service-part-builder-series { grid-column: 1 / span 3; }
.service-part-builder-notes { grid-column: 4 / span 2; }
.service-part-builder-action { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.service-part-builder-action .button { min-width: 170px; }
.service-part-builder-error {
    grid-column: 1 / -1;
    padding: 9px 11px;
    border: 1px solid #f1c7c7;
    border-radius: 9px;
    background: #fff4f4;
    color: #9b2c2c;
    font-size: 11px;
}
.service-products-help {
    margin-top: 11px;
    color: #7a8090;
    font-size: 11px;
}
.service-part-remove {
    width: 30px;
    height: 30px;
    border: 1px solid #eadfe9;
    border-radius: 8px;
    background: #fff;
    color: #a3415f;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.service-part-remove:hover { background: #fff4f7; border-color: #e5b8c7; }
.service-product-table td .badge { white-space: nowrap; }

@media (max-width: 980px) {
    .service-part-builder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .service-part-builder-product,
    .service-part-builder-series,
    .service-part-builder-notes { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .service-condition-field,
    .service-equipment-product-field { grid-column: auto; }
    .service-part-builder { grid-template-columns: 1fr; }
    .service-part-builder-product,
    .service-part-builder-series,
    .service-part-builder-notes,
    .service-part-builder-action { grid-column: auto; }
    .service-part-builder-action .button { width: 100%; }
}

.service-planned-parts .service-planned-serials{min-width:190px;min-height:54px;resize:vertical}.service-planned-parts .button.small{padding:.55rem .8rem;white-space:nowrap}.service-planned-pendiente{background:#fff7dc;color:#7a5800}.service-planned-consumido{background:#e9f8ef;color:#1e6940}.service-planned-cancelado{background:#f1f2f5;color:#68707c}

/* === v71 · Guías de remisión: listado y formulario profesional === */
.gre-page { color: #2d3140; }
.gre-page .gre-page-head { justify-content: space-between; gap: 18px; }
.gre-page .gre-page-head > div:first-child { min-width: 0; }
.gre-page .gre-page-head h1 { font-size: 1.23rem; }
.gre-page .gre-page-head p { max-width: 820px; }
.gre-page-actions { display: flex; align-items: center; gap: 9px; }
.gre-config-alert { margin-bottom: 14px; }

/* Listado */
.gre-list-card { padding: 0 !important; overflow: hidden; }
.gre-list-toolbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 17px;
    border-bottom: 1px solid #eceef3;
}
.gre-list-toolbar > div { display: flex; align-items: center; gap: 12px; }
.gre-list-count { color: #7a8190; font-size: 12px; font-weight: 550; }
.gre-list-help { color: #858c9a; font-size: 11px; font-weight: 650; }
.gre-filter-panel {
    display: none;
    grid-template-columns: minmax(260px, 1.5fr) minmax(190px, .7fr) auto;
    align-items: end;
    gap: 12px;
    padding: 14px 17px;
    border-bottom: 1px solid #eceef3;
    background: #fafbfc;
}
.gre-filter-panel.is-open { display: grid; }
.gre-filter-panel label { display: grid; gap: 5px; color: #555c6c; font-size: 11px; font-weight: 650; }
.gre-filter-actions { display: flex; align-items: center; gap: 8px; }
.gre-list-table-wrap { overflow-x: auto; }
.gre-list-table { width: 100%; min-width: 1080px; border-collapse: collapse; }
.gre-list-table th {
    padding: 12px 10px !important;
    background: #fff !important;
    color: #242937 !important;
    font-size: 11px !important;
    font-weight: 750 !important;
    white-space: nowrap;
}
.gre-list-table td { padding: 13px 10px !important; vertical-align: top; }
.gre-list-table tbody tr:hover { background: #fcfcfe; }
.gre-list-table tbody tr:last-child td { border-bottom: 0; }
.gre-date-cell { white-space: nowrap; color: #353b4a !important; }
.gre-client-cell { min-width: 250px; max-width: 360px; }
.gre-client-cell strong,
.gre-number-cell strong { display: block; color: #272c3a; font-size: 12px; font-weight: 650; }
.gre-client-cell small,
.gre-number-cell small { display: block; margin-top: 4px !important; color: #747c8e !important; line-height: 1.4; }
.gre-number-cell { min-width: 125px; white-space: nowrap; }
.gre-muted-value { color: #a2a8b4; }
.gre-status {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
}
.gre-status-accepted { color: #0f9c63; background: #dff8ed; }
.gre-status-rejected { color: #fff; background: #252a31; }
.gre-status-error { color: #b42318; background: #feeceb; }
.gre-status-pending { color: #6c4a05; background: #fff1c9; }
.gre-status-cancelled { color: #6b7280; background: #eef0f3; }
.gre-status-draft { color: #4c5568; background: #eef1f6; }
.gre-downloads { display: flex; flex-wrap: wrap; gap: 5px; min-width: 135px; }
.gre-downloads a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 28px;
    padding: 5px 8px;
    border-radius: 6px;
    color: #fff;
    background: #149ce3;
    font-size: 10px;
    font-weight: 750;
    text-decoration: none;
}
.gre-downloads a:hover { background: #0c82c2; }
.gre-downloads.is-empty { color: #a1a7b2; }
.gre-action-warning { background: #f57c00 !important; }
.gre-action-warning:hover { background: #dd6f00 !important; }
.gre-empty-row { padding: 34px !important; color: #878e9d !important; text-align: center; }
.gre-pagination { margin-top: 14px; }

/* Formulario */
.gre-create-page { --gre-gap: 14px; }
.gre-form { display: grid; gap: 14px; }
.gre-main-card,
.gre-section-card { padding: 18px !important; }
.gre-primary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 13px 14px;
}
.gre-primary-grid > label,
.gre-primary-grid > .form-field,
.gre-related-grid label,
.gre-location-card label,
.gre-transport-panel label,
.gre-item-builder label,
.gre-item-builder .form-field {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    color: #3c4251;
    font-size: 11px;
    font-weight: 650;
}
.gre-primary-grid > label { grid-column: span 1; }
.gre-primary-grid .gre-client-field { grid-column: span 2; }
.gre-primary-grid .gre-wide-field { grid-column: span 2; }
.gre-description-field { grid-column: span 2 !important; }
.gre-observations-field { grid-column: span 3 !important; }
.gre-client-field small { color: #8a919f; font-size: 10px; font-weight: 450; line-height: 1.35; }
.gre-client-field .field-action-row { display: grid; grid-template-columns: minmax(0,1fr) 40px; gap: 7px; }
.gre-client-field .field-create-button { min-height: 36px; }

.gre-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf0f4;
}
.gre-section-heading > div { min-width: 0; }
.gre-section-kicker {
    display: block;
    margin-bottom: 2px;
    color: var(--ui-primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.gre-section-heading h2 { margin: 0 !important; color: #282d3b !important; font-size: 14px !important; font-weight: 700 !important; }
.gre-section-heading p { margin: 3px 0 0; color: #858c9c; font-size: 10.5px; line-height: 1.45; }
.gre-related-grid { display: grid; grid-template-columns: minmax(190px, .6fr) minmax(320px, 1.4fr); gap: 14px; }

.gre-location-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.gre-location-card,
.gre-data-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid #e4e7ee;
    border-radius: 10px;
    background: #fafbfc;
}
.gre-location-title { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.gre-location-title > span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--ui-primary);
    font-size: 10px;
    font-weight: 750;
}
.gre-location-title strong { color: #2d3240; font-size: 12px; }
.gre-location-fields { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; margin-top: 10px; }

.gre-transport-panel[hidden] { display: none !important; }
.gre-transport-grid.public { display: grid; grid-template-columns: minmax(180px, .55fr) minmax(320px, 1.45fr); gap: 14px; }
.gre-private-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .7fr); gap: 14px; }
.gre-data-card { background: #fff; }
.gre-data-card-head { margin-bottom: 11px; padding-bottom: 9px; border-bottom: 1px solid #edf0f4; }
.gre-data-card-head span,
.gre-data-card-head strong { display: block; }
.gre-data-card-head span { color: #8a91a0; font-size: 9.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.gre-data-card-head strong { margin-top: 2px; color: #2d3240; font-size: 12px; }
.gre-driver-grid { display: grid; grid-template-columns: 145px minmax(120px, .7fr) minmax(200px, 1.4fr) minmax(135px, .7fr); gap: 10px; }
.gre-data-note { margin: 9px 0 0; color: #8b92a1; font-size: 10px; }

.gre-items-counter {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
    font-size: 10px;
    font-weight: 700;
}
.gre-source-items { display: grid; gap: 10px; }
.gre-source-items[hidden] { display: none !important; }
.gre-manual-items[hidden] { display: none !important; }
.gre-item-builder {
    display: grid;
    grid-template-columns: minmax(250px, 1.45fr) minmax(230px, 1.25fr) 95px 105px;
    gap: 11px 12px;
    margin-bottom: 13px;
    padding: 14px;
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    background: #fafbfc;
}
.gre-product-picker-field { grid-column: span 1; }
.gre-item-series-field { grid-column: span 3; }
.gre-item-add-action { display: flex; align-items: end; justify-content: flex-end; }
.gre-item-add-action .button { min-width: 165px; }
.gre-items-table-wrap { border: 1px solid #e4e7ee; border-radius: 9px; overflow-x: auto; }
.gre-items-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.gre-items-table th { background: #f8f9fb !important; }
.gre-items-table td { vertical-align: middle; }
.gre-items-table td strong,
.gre-items-table td small { display: block; }
.gre-items-table td small { margin-top: 3px !important; color: #9198a6 !important; }
.gre-items-empty td { padding: 26px !important; color: #8d94a3 !important; text-align: center; }
.gre-remove-item {
    width: 30px;
    height: 30px;
    border: 1px solid #eadde2;
    border-radius: 7px;
    color: #a33b58;
    background: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.gre-remove-item:hover { border-color: #e3b8c5; background: #fff4f7; }
.gre-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 12px 16px;
    border: 1px solid #e2e5ec;
    border-radius: 10px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 -8px 22px rgba(31, 35, 50, .045);
    backdrop-filter: blur(7px);
}
.gre-form-actions .button { min-width: 120px; }

@media (max-width: 1280px) {
    .gre-primary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .gre-primary-grid .gre-client-field,
    .gre-primary-grid .gre-wide-field,
    .gre-description-field,
    .gre-observations-field { grid-column: span 2 !important; }
    .gre-driver-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gre-item-builder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gre-product-picker-field,
    .gre-item-series-field { grid-column: span 2; }
}
@media (max-width: 900px) {
    .gre-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gre-location-grid,
    .gre-private-grid,
    .gre-transport-grid.public { grid-template-columns: 1fr; }
    .gre-filter-panel { grid-template-columns: 1fr 1fr; }
    .gre-filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .gre-page .gre-page-head,
    .gre-section-heading,
    .gre-list-toolbar { align-items: stretch; flex-direction: column; }
    .gre-page-actions,
    .gre-page-actions .button,
    .gre-section-heading > .button { width: 100%; }
    .gre-primary-grid,
    .gre-related-grid,
    .gre-location-fields,
    .gre-driver-grid,
    .gre-item-builder,
    .gre-filter-panel { grid-template-columns: 1fr; }
    .gre-primary-grid .gre-client-field,
    .gre-primary-grid .gre-wide-field,
    .gre-description-field,
    .gre-observations-field,
    .gre-product-picker-field,
    .gre-item-series-field { grid-column: auto !important; }
    .gre-form-actions { position: static; display: grid; grid-template-columns: 1fr 1fr; }
    .gre-form-actions .button { min-width: 0; }
}

/* === v72 · Configuración de empresa y credenciales SUNAT === */
.company-settings-page {
    --settings-blue: #078dca;
    --settings-blue-strong: #087bb3;
    --settings-ink: #252b3a;
    --settings-muted: #737b8d;
    --settings-border: #e2e6ed;
    color: var(--settings-ink);
}
.company-settings-head { margin-bottom: 16px; }
.company-settings-head h1 { margin: 3px 0 4px; font-size: 1.28rem; }
.company-settings-head p { max-width: 850px; margin: 0; }
.settings-page-kicker {
    color: var(--settings-blue-strong);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.company-settings-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.company-settings-head-actions .button { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.company-settings-head-actions > a:not(.button) { margin-left: 3px; font-size: 11px; font-weight: 700; }

.settings-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.settings-column { display: grid; gap: 16px; min-width: 0; }
.app-content .settings-panel {
    padding: 0 !important;
    overflow: hidden;
    border-color: var(--settings-border);
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(34, 46, 68, .055);
}
.settings-panel-header {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--settings-blue), var(--settings-blue-strong));
}
.settings-panel-header > div { min-width: 0; }
.app-content .settings-panel-header h2 {
    margin: 1px 0 0 !important;
    color: #fff !important;
    font-size: 13px !important;
    line-height: 1.25;
    font-weight: 750 !important;
}
.settings-panel-eyebrow {
    display: block;
    color: rgba(255,255,255,.78);
    font-size: 8.5px;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.settings-header-meta {
    flex: 0 0 auto;
    color: #fff;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
}
.settings-status {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,.13);
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}
.settings-status.is-ok::before,
.settings-status.is-pending::before,
.settings-status.is-error::before {
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}
.settings-status.is-ok { color: #eafff5; }
.settings-status.is-pending { color: #fff7d1; }
.settings-status.is-error { color: #ffe5e5; }

.settings-panel-body { padding: 15px 14px 13px; }
.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 12px;
}
.settings-field {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    color: #42495a;
    font-size: 10.5px;
    font-weight: 650;
}
.settings-field small,
.settings-help,
.settings-subsection-title small,
.settings-switch-row small,
.settings-certificate-summary small {
    color: #858d9c;
    font-size: 9.5px;
    font-weight: 450;
    line-height: 1.45;
}
.settings-span-2 { grid-column: 1 / -1; }
.company-settings-page .settings-field input:not([type="checkbox"]):not([type="radio"]),
.company-settings-page .settings-field select {
    min-height: 34px;
    padding: 6px 9px;
    border-color: #d8dde6;
    border-radius: 5px;
    font-size: 11px;
    background: #fbfcfe;
}
.company-settings-page .settings-field input[type="file"] {
    min-height: 36px;
    padding: 5px 7px;
    background: #fff;
}
.company-settings-page .settings-field input:focus,
.company-settings-page .settings-field select:focus {
    border-color: #48a9d5;
    box-shadow: 0 0 0 3px rgba(7,141,202,.1);
}
.settings-help { margin: 0 0 12px; }

.settings-subsection {
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid #edf0f4;
}
.settings-subsection-title { margin-bottom: 10px; }
.settings-subsection-title strong { display: block; color: #303646; font-size: 11.5px; }
.settings-subsection-title small { display: block; margin-top: 2px; }
.settings-logo-row { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(260px, 1.1fr); gap: 12px; align-items: stretch; }
.settings-logo-box {
    min-height: 96px;
    display: grid;
    place-items: center;
    padding: 9px;
    overflow: hidden;
    border: 1px solid #dce1e9;
    border-radius: 6px;
    background: #fff;
}
.settings-logo-box img { max-width: 100%; max-height: 80px; object-fit: contain; }
.settings-logo-placeholder { color: #9aa1af; font-size: 10px; font-weight: 700; }
.settings-logo-controls { display: grid; align-content: center; gap: 8px; }
.settings-check { display: flex; align-items: center; gap: 7px; color: #636b7b; font-size: 10px; font-weight: 600; }

.settings-panel-actions {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 14px -14px -13px;
    padding: 8px 12px;
    border-top: 1px solid #edf0f4;
    background: #fafbfc;
}
.settings-panel-actions .button { min-height: 31px; padding: 6px 12px; border-radius: 5px; font-size: 10px; }
.settings-inline-link { margin-right: auto; color: #176d9b; font-size: 10px; font-weight: 750; }

.settings-switch-row {
    min-height: 47px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid #e2e6ed;
    border-radius: 7px;
    background: #fafbfc;
    color: #404757;
    cursor: pointer;
}
.settings-switch-row > input { flex: 0 0 auto; }
.settings-switch-row > span { display: grid; gap: 1px; min-width: 0; }
.settings-switch-row strong { font-size: 10.5px; font-weight: 750; }
.settings-switch-row small { display: block; }
.settings-switch-wide { margin-top: 11px; }
.settings-switch-stack { display: grid; gap: 8px; margin-top: 11px; }
.settings-switch-stack .settings-switch-wide { margin-top: 0; }
.settings-switch-warning { border-color: #eeddb0; background: #fffaf0; }
.settings-switch-warning strong { color: #7d5a09; }

.settings-certificate-summary {
    min-height: 68px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 11px 14px;
    border-bottom: 1px solid #edf0f4;
    background: #fbfcfd;
}
.settings-certificate-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--settings-blue);
    font-size: 15px;
    font-weight: 850;
}
.settings-certificate-summary strong { display: block; color: #303645; font-size: 10.5px; overflow-wrap: anywhere; }
.settings-certificate-summary small { display: block; margin-top: 2px; }
.settings-certificate-summary .settings-error-text { color: #b42318; font-weight: 600; }
.settings-certificate-form { padding-top: 13px; }

@media (max-width: 1180px) {
    .settings-dashboard-grid { grid-template-columns: 1fr; }
    .settings-company-panel { order: 0; }
}
@media (max-width: 720px) {
    .company-settings-head { align-items: stretch; }
    .company-settings-head-actions { width: 100%; }
    .company-settings-head-actions .button { flex: 1; text-align: center; }
    .settings-form-grid,
    .settings-logo-row { grid-template-columns: 1fr; }
    .settings-span-2 { grid-column: auto; }
    .settings-panel-header { align-items: flex-start; }
    .settings-header-meta { white-space: normal; text-align: right; }
    .settings-panel-actions { align-items: stretch; flex-direction: column-reverse; }
    .settings-panel-actions .button,
    .settings-inline-link { width: 100%; text-align: center; }
}

/* === v73 · RUC único de empresa y SOL condicionado a PRODUCCIÓN === */
.settings-production-sol {
    margin-top: 14px;
    padding: 13px;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #f8fbfe;
}
.settings-production-sol[hidden] { display: none !important; }
.settings-production-sol .settings-subsection-title { margin-bottom: 10px; }
.settings-production-sol .settings-subsection-title strong { font-size: 12px; }
.settings-emitter-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -2px 0 12px;
    padding: 8px 10px;
    border: 1px solid #e3e8ef;
    border-radius: 7px;
    background: #f8fafc;
    color: #737b8d;
    font-size: 9.5px;
}
.settings-emitter-context strong {
    color: #303646;
    font-size: 10.5px;
    letter-spacing: .02em;
}
@media (max-width: 720px) {
    .settings-emitter-context { align-items: flex-start; flex-direction: column; }
}

/* ======================================================================
   v74 · Lenguaje visual unificado para tablas y paneles
   ----------------------------------------------------------------------
   Las tablas de cualquier módulo heredan la misma jerarquía visual del
   catálogo de Productos.  La regla se aplica en el contenido principal y
   en modales sin obligar a duplicar clases en más de cien tablas.
   ====================================================================== */
:where(.app-content, .app-modal) table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    font-variant-numeric: tabular-nums;
}

:where(.app-content, .app-modal) table thead th {
    height: 44px;
    padding: 10px 12px !important;
    color: #111827 !important;
    background: #fbfcfe !important;
    border-bottom: 1px solid #e2e6ed !important;
    font: 600 13px/18px "Poppins", sans-serif !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap;
    vertical-align: middle;
}

:where(.app-content, .app-modal) table tbody td {
    padding: 11px 12px !important;
    color: #1f2533 !important;
    background: #fff;
    border-bottom: 1px solid #e6e9ef !important;
    font: 400 13px/19px "Poppins", sans-serif !important;
    vertical-align: middle;
}

:where(.app-content, .app-modal) table tbody tr:hover > td {
    background: #fafbfe;
}

:where(.app-content, .app-modal) table tbody tr:last-child > td {
    border-bottom-color: transparent !important;
}

:where(.app-content, .app-modal) table tfoot th,
:where(.app-content, .app-modal) table tfoot td {
    padding: 11px 12px !important;
    color: #171b29 !important;
    background: #fbfcfe !important;
    border-top: 1px solid #e2e6ed !important;
    border-bottom: 0 !important;
    font: 600 13px/19px "Poppins", sans-serif !important;
}

:where(.app-content, .app-modal) table td small {
    display: block;
    margin-top: 2px;
    color: #8991a0 !important;
    font: 400 11px/16px "Poppins", sans-serif !important;
}

/* Contenedor estándar para las tablas históricas que todavía usan table-wrap. */
.app-content .table-wrap,
.app-modal .table-wrap {
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid #dfe3eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(25, 31, 45, .025);
}

.app-content .card.table-wrap,
.app-modal .card.table-wrap {
    border-color: #dfe3eb;
}

.app-content .card.table-wrap > h2,
.app-modal .card.table-wrap > h2 {
    margin: 0 0 14px;
    color: #202532;
    font-size: 15px;
    font-weight: 600;
    line-height: 22px;
}

/* Las tablas profesionales existentes conservan su ancho específico. */
:where(.app-content, .app-modal) .professional-table {
    border-collapse: separate;
    border-spacing: 0;
}

/*
 * Separación estructural de paneles.
 * .card + .card mantiene separación en flujo normal, pero dentro de un grid
 * ese margen desplazaba la segunda columna. En grids el espacio lo controla
 * exclusivamente gap para conservar alineación superior perfecta.
 */
.app-content [class*="grid"] > .card + .card,
.app-content [class*="grid"] > section.card + section.card,
.app-content [class*="grid"] > article.card + article.card {
    margin-top: 0 !important;
}

.app-content .detail-grid {
    gap: 22px;
    margin-top: 22px;
    align-items: start;
}

.app-content .detail-grid > .card {
    min-width: 0;
    margin-top: 0 !important;
}

.app-content :is(.detail-grid, .stats-grid, .metric-grid, .cash-summary-grid, .purchase-bottom-grid) +
:is(.detail-grid, .stats-grid, .metric-grid, .card) {
    margin-top: 22px;
}

.app-content .card + :is(.detail-grid, .stats-grid, .metric-grid, .cash-summary-grid, .purchase-bottom-grid) {
    margin-top: 22px;
}

/* Evita que paneles contiguos parezcan una sola pieza cuando están en columnas. */
.app-content .detail-grid > :is(.card, section, article) {
    border-radius: 14px;
}

@media (max-width: 850px) {
    .app-content .detail-grid {
        gap: 16px;
        margin-top: 16px;
    }
    .app-content :is(.detail-grid, .stats-grid, .metric-grid, .cash-summary-grid, .purchase-bottom-grid) +
    :is(.detail-grid, .stats-grid, .metric-grid, .card),
    .app-content .card + :is(.detail-grid, .stats-grid, .metric-grid, .cash-summary-grid, .purchase-bottom-grid) {
        margin-top: 16px;
    }
}

/* v75 · Listados comerciales con filtros avanzados y devoluciones ordenadas */
.app-content .list-filter-card {
    margin: 16px 0 18px;
    overflow: hidden;
}
.app-content .list-filter-card .data-grid-toolbar > div:first-child {
    display: grid;
    gap: 2px;
}
.app-content .list-filter-card .data-grid-toolbar strong {
    color: #171b29;
    font: 600 14px/20px "Poppins", sans-serif;
}
.app-content .list-filter-card .data-grid-toolbar small {
    color: #7d8494;
    font: 400 11px/17px "Poppins", sans-serif;
}
.app-content .advanced-filter-grid {
    grid-template-columns: repeat(4, minmax(165px, 1fr));
    max-height: 560px;
    padding: 16px;
    gap: 13px 14px;
    background: #fcfdff;
}
.app-content .advanced-filter-grid.is-collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}
.app-content .advanced-filter-grid label {
    min-width: 0;
    color: #3f4654;
    font-weight: 550;
}
.app-content .advanced-filter-grid input,
.app-content .advanced-filter-grid select {
    width: 100%;
    min-width: 0;
    min-height: 39px;
    padding: 8px 10px;
    border: 1px solid #d7dce6;
    border-radius: 8px;
    background: #fff;
    color: #202532;
    font: 400 12px/18px "Poppins", sans-serif;
}
.app-content .advanced-filter-grid input:focus,
.app-content .advanced-filter-grid select:focus {
    outline: 3px solid rgba(51, 21, 143, .08);
    border-color: #8978bd;
}
.app-content .advanced-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    align-items: center;
    padding-top: 2px;
}
.app-content .advanced-filter-actions .button {
    min-width: 112px;
}
.app-content .filter-help {
    grid-column: 1 / -1;
    margin: -2px 0 0;
    color: #8a91a0;
    font: 400 11px/17px "Poppins", sans-serif;
}

.app-content .return-section-card {
    margin-top: 18px;
    overflow: hidden;
}
.app-content .return-section-head {
    margin: 0;
    padding: 17px 18px 15px;
    border-bottom: 1px solid #e6e9f0;
    background: #fff;
}
.app-content .return-section-head > div:first-child {
    display: grid;
    gap: 2px;
}
.app-content .return-section-head h2 {
    margin: 0;
    color: #181d2a;
    font: 600 15px/22px "Poppins", sans-serif;
}
.app-content .return-section-head p {
    margin: 0;
    font-size: 12px;
}
.app-content .section-kicker {
    color: #5d45a2;
    font: 650 10px/15px "Poppins", sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.app-content .record-count {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid #e0e4ec;
    border-radius: 999px;
    background: #f8f9fc;
    color: #626a79;
    font: 500 11px/16px "Poppins", sans-serif;
}
.app-content .return-professional-table {
    min-width: 980px;
}
.app-content .return-professional-table td strong {
    font-weight: 550;
}

@media (max-width: 1180px) {
    .app-content .advanced-filter-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
}
@media (max-width: 850px) {
    .app-content .advanced-filter-grid { grid-template-columns: repeat(2, minmax(145px, 1fr)); }
}
@media (max-width: 620px) {
    .app-content .list-filter-card .data-grid-toolbar { align-items: stretch; flex-direction: column; }
    .app-content .advanced-filter-grid { grid-template-columns: 1fr; max-height: 900px; }
    .app-content .advanced-filter-actions { grid-column: auto; }
    .app-content .advanced-filter-actions .button { flex: 1; min-width: 0; }
    .app-content .filter-help { grid-column: auto; }
    .app-content .return-section-head { align-items: flex-start; flex-direction: column; }
}

/* v76 · Paneles operativos, filtros tributarios y listados especializados */
.app-content .workspace-panel-card {
    margin-top: 18px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e1e5ed;
    box-shadow: 0 8px 24px rgba(32, 36, 48, .035);
}
.app-content .workspace-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #e7eaf0;
    background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
}
.app-content .workspace-panel-head > div:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.app-content .workspace-panel-head h2 {
    margin: 0;
    color: #171c28;
    font: 600 16px/23px "Poppins", sans-serif;
}
.app-content .workspace-panel-head p {
    max-width: 920px;
    margin: 0;
    color: #747c8c;
    font-size: 12px;
}
.app-content .workspace-panel-body {
    display: grid;
    gap: 16px;
    padding: 18px 20px 20px;
    background: #fff;
}
.app-content .workspace-panel-body > :first-child { margin-top: 0; }
.app-content .workspace-panel-body > :last-child { margin-bottom: 0; }
.app-content .workspace-inline-controls {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.app-content .workspace-date-query {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1 1 520px;
}
.app-content .workspace-date-query label {
    display: grid;
    gap: 6px;
    min-width: 220px;
    color: #414958;
    font: 550 12px/18px "Poppins", sans-serif;
}
.app-content .workspace-date-query input,
.app-content .workspace-panel-card .workspace-form-grid input,
.app-content .workspace-panel-card .workspace-form-grid select,
.app-content .workspace-panel-card .workspace-form-grid textarea {
    min-height: 41px;
    border: 1px solid #d8dde6;
    border-radius: 8px;
    background: #fff;
}
.app-content .workspace-date-query input {
    min-width: 220px;
    padding: 8px 11px;
}
.app-content .workspace-panel-card .workspace-form-grid {
    gap: 14px 16px;
    margin: 0;
}
.app-content .workspace-panel-card .workspace-form-grid label {
    color: #414958;
    font-weight: 550;
}
.app-content .workspace-panel-card .form-actions {
    align-self: end;
}
.app-content .module-subsection-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px 12px;
    border-top: 1px solid #e7eaf0;
    border-bottom: 1px solid #e7eaf0;
    background: #fafbfe;
}
.app-content .module-subsection-head > div {
    display: grid;
    gap: 2px;
}
.app-content .module-subsection-head strong {
    color: #202532;
    font: 600 13px/19px "Poppins", sans-serif;
}
.app-content .module-subsection-head small {
    color: #858c99;
    font: 400 11px/16px "Poppins", sans-serif;
}
.app-content .professional-check-row {
    display: flex !important;
    align-items: flex-start;
    gap: 10px !important;
    min-height: 58px;
    padding: 11px 12px;
    border: 1px solid #e0e4eb;
    border-radius: 9px;
    background: #fbfcfe;
}
.app-content .professional-check-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    min-height: 0 !important;
    margin-top: 2px;
}
.app-content .professional-check-row span {
    display: grid;
    gap: 1px;
}
.app-content .professional-check-row strong {
    color: #333947;
    font: 600 12px/17px "Poppins", sans-serif;
}
.app-content .professional-check-row small {
    color: #858c99;
    font: 400 10px/15px "Poppins", sans-serif;
}
.app-content .detraction-profile-form textarea {
    min-height: 78px;
    resize: vertical;
}
.app-content .return-section-card + .list-filter-card,
.app-content .return-section-card + .workspace-panel-card,
.app-content .list-filter-card + .return-section-card,
.app-content .workspace-panel-card + .list-filter-card,
.app-content .metric-grid + .workspace-panel-card {
    margin-top: 18px;
}
.app-content .professional-table .align-right,
.app-content .align-right { text-align: right; }

@media (max-width: 850px) {
    .app-content .workspace-panel-head { flex-direction: column; }
    .app-content .workspace-inline-controls,
    .app-content .workspace-date-query { align-items: stretch; }
    .app-content .workspace-date-query label,
    .app-content .workspace-date-query input { width: 100%; min-width: 0; }
    .app-content .workspace-inline-controls > form { width: 100%; }
    .app-content .workspace-inline-controls .button { width: 100%; }
}

@media (max-width: 620px) {
    .app-content .workspace-panel-head,
    .app-content .workspace-panel-body { padding-left: 15px; padding-right: 15px; }
    .app-content .module-subsection-head { padding-left: 15px; padding-right: 15px; }
}

/* v81 - flujo BETA rápido desde comprobantes */
.electronic-quick-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}
.beta-quick-send-form { margin: 0; display: inline-flex; }
.beta-send-button { min-height: 34px; padding: .45rem .72rem; white-space: nowrap; }
.beta-send-button:disabled { opacity: .68; cursor: wait; }
.quick-file-link {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: .3rem .55rem;
    border: 1px solid var(--border, #d8deea);
    border-radius: 8px;
    background: #fff;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}
.quick-file-link:hover { text-decoration: none; background: var(--surface-soft, #f6f8fb); }
.beta-quick-note { margin-bottom: 1rem; }
.beta-one-step-card { max-width: 860px; }
@media (max-width: 900px) {
    .electronic-quick-actions { align-items: flex-start; flex-direction: column; }
    .beta-send-button { width: 100%; }
}

/* v87 · Indicador único del ambiente SUNAT y descargas rápidas. */
.environment-pill.is-beta {
    border-color: #f43f5e;
    background: #e11d48;
    color: #fff;
    box-shadow: 0 8px 18px rgba(225, 29, 72, .16);
}
.environment-pill.is-beta > i { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.environment-pill.is-beta small { color: rgba(255,255,255,.88); }
.environment-pill.is-production {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 163, 74, .16);
}
.environment-pill.is-production > i { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.environment-pill.is-production small { color: rgba(255,255,255,.9); }
.environment-pill.is-beta strong,
.environment-pill.is-production strong { color: #fff; font-weight: 800; }

.electronic-downloads {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.document-download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid #d8deea;
    border-radius: 8px;
    background: #fff;
    color: var(--ui-primary, #35158a);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}
.document-download-link:hover { border-color: #c7bce2; background: #f5f1fb; text-decoration: none; }
.document-download-link.is-disabled { color: #adb4c2; background: #f7f8fa; cursor: not-allowed; opacity: .68; }

.sale-print-dialog .sale-completion-panel { max-width: 720px; }

@media (max-width: 820px) {
    .electronic-downloads { align-items: stretch; }
    .document-download-link { min-width: 42px; }
}

/* v90 · Flujo visual simple para anulaciones electrónicas. */
.cancellation-dialog .sale-completion-panel{max-width:720px}
.cancellation-dialog-body label{display:grid;gap:8px;font-weight:700}
.cancellation-dialog-body textarea{width:100%;resize:vertical;min-height:96px}
.cancellation-pending-badge{background:#fff0b8!important;color:#8a5400!important}
.cancellation-final-badge{background:#ffd9dd!important;color:#9f1c2f!important}
.inline-status-link{display:inline-block;margin-top:5px;font-size:.82rem;font-weight:700;text-decoration:none}
.inline-status-link:hover{text-decoration:underline}
.cancellation-ledger-table td{vertical-align:middle}
.cancellation-ledger-table td:nth-child(4){font-variant-numeric:tabular-nums}
.cancellation-status-pendiente{background:#fff0b8!important;color:#8a5400!important}
.cancellation-status-enviado,.cancellation-status-procesando{background:#dff1ff!important;color:#075985!important}
.cancellation-status-aceptado{background:#d7f7e2!important;color:#126b36!important}
.cancellation-status-rechazado,.cancellation-status-error{background:#ffd9dd!important;color:#9f1c2f!important}
.cancellation-row.cancellation-aceptado{border-bottom-color:#65c78c}
.cancellation-row.cancellation-rechazado,.cancellation-row.cancellation-error{border-bottom-color:#e88c98}
@media(max-width:900px){.cancellation-ledger-table{min-width:980px}}

/* v91 · Anulaciones: separar claramente motivo y estado tributario */
.cancellation-ledger-table .cancellation-reason {
    display: block;
    max-width: 28rem;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

/* ==========================================================
   v98 · Refinamiento visual solicitado
   ========================================================== */

/* Dashboard: accesos rápidos más delgados y compactos. */
.dashboard-action-grid {
    gap: 10px !important;
}
.dashboard-action-card {
    min-height: 66px !important;
    gap: 11px !important;
    padding: 9px 13px !important;
    border-radius: 12px !important;
}
.dashboard-action-icon {
    width: 36px !important;
    height: 36px !important;
}
.dashboard-action-icon svg {
    width: 18px !important;
    height: 18px !important;
}
.dashboard-action-arrow {
    font-size: 20px !important;
}

/* Comprobantes: archivos tributarios como botones azules consistentes. */
.tax-document-ledger-table .document-download-link:not(.is-disabled) {
    min-width: 46px;
    min-height: 32px;
    border-color: #1fa7e8 !important;
    border-radius: 6px;
    background: #1fa7e8 !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(31, 167, 232, .14);
}
.tax-document-ledger-table .document-download-link:not(.is-disabled):hover {
    border-color: #138fc9 !important;
    background: #138fc9 !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(19, 143, 201, .18);
}
.tax-document-ledger-table .document-download-link.is-disabled {
    border-color: #e0e4eb !important;
    background: #f1f3f6 !important;
    color: #b0b6c2 !important;
    box-shadow: none;
}

/* Un comprobante cuya baja ya fue aceptada se identifica en toda la fila. */
.tax-document-ledger-table .tax-document-row.is-annulled > td,
.tax-document-ledger-table .tax-document-row.is-annulled > td strong,
.tax-document-ledger-table .tax-document-row.is-annulled > td small,
.tax-document-ledger-table .tax-document-row.is-annulled > td .muted,
.tax-document-ledger-table .tax-document-row.is-annulled > td a:not(.document-download-link) {
    color: #f01446 !important;
}
.tax-document-ledger-table .tax-document-row.is-annulled {
    border-bottom-color: rgba(240, 20, 70, .5);
}
.tax-document-ledger-table .tax-document-row.is-annulled .cancellation-final-badge {
    border: 1px solid #ffc4d0;
    background: #ffe4e9 !important;
    color: #d70d3c !important;
}
/* Los botones de descarga mantienen azul incluso dentro de una fila anulada. */
.tax-document-ledger-table .tax-document-row.is-annulled .document-download-link:not(.is-disabled) {
    color: #fff !important;
}
.tax-document-ledger-table .tax-document-row.is-annulled .document-download-link.is-disabled {
    color: #b0b6c2 !important;
}

/* v101 · UBIGEO jerárquico para clientes y proveedores */
.ubigeo-cascade-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 14px;
    align-items: start;
}

.ubigeo-cascade-grid > label {
    min-width: 0;
}

.ubigeo-cascade-grid select,
.ubigeo-cascade-grid input {
    width: 100%;
}

.ubigeo-cascade-grid [data-ubigeo-code-display][readonly] {
    background: color-mix(in srgb, var(--surface-soft, #f6f7fb) 88%, white 12%);
    color: var(--muted, #6f7788);
    cursor: default;
}

.field-help {
    display: block;
    margin-top: 5px;
    color: var(--muted, #7a8292);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

@media (max-width: 900px) {
    .ubigeo-cascade-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .ubigeo-cascade-grid {
        grid-template-columns: 1fr;
    }
}


/* v102 · Limpieza visual UBIGEO: sin campos redundantes en modo Perú */
/* Los <label> del formulario tienen display propio; por eso se fuerza el atributo hidden
   para que el fallback internacional no aparezca debajo del selector SUNAT/INEI en Perú. */
.ubigeo-cascade-grid [hidden] {
    display: none !important;
}

/* v103 · Dirección profesional reutilizable para Clientes y Proveedores */
.entity-address-book {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.entity-address-card {
    position: relative;
    min-width: 0;
    padding: 0;
}

.entity-address-card + .entity-address-card {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--ui-border, #e2e6ee);
}

.entity-address-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
}

.entity-address-card-head strong {
    color: var(--ui-primary, #351987);
    font-size: .74rem;
    font-weight: 800;
}

.entity-address-remove {
    appearance: none;
    border: 0;
    background: transparent;
    color: #d92d20;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
}

.entity-address-remove:hover { text-decoration: underline; }
.entity-address-remove.is-hidden { display: none !important; }

.entity-address-layout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 16px;
    align-items: start;
}

.entity-address-layout > label {
    grid-column: span 2;
    min-width: 0;
}

.entity-address-layout .entity-address-country { grid-column: span 1; }
.entity-address-layout .entity-address-ubigeo { grid-column: span 3; min-width: 0; }
.entity-address-layout .full { grid-column: 1 / -1; }
.entity-address-layout [hidden],
.entity-address-book [hidden] { display: none !important; }

.entity-address-foreign {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
}

.required-mark { color: #f01446; }

.entity-address-add-wrap {
    display: flex;
    justify-content: center;
    padding-top: 2px;
}

.entity-address-add {
    min-width: 170px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

/* Selector UBIGEO de una sola entrada, con navegación Departamento > Provincia > Distrito. */
.ubigeo-picker {
    position: relative;
    margin-top: 6px;
}

.ubigeo-picker-trigger {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #cfd7e4;
    border-radius: 7px;
    background: #fff;
    color: #292d3b;
    text-align: left;
    cursor: pointer;
}

.ubigeo-picker-trigger:hover,
.ubigeo-picker.is-open .ubigeo-picker-trigger {
    border-color: #4d9cff;
    box-shadow: 0 0 0 2px rgba(77, 156, 255, .08);
}

.ubigeo-picker-trigger [data-ubigeo-display] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .78rem;
    font-weight: 600;
}

.ubigeo-picker-trigger [data-ubigeo-display].is-placeholder {
    color: #a1a9b7;
    font-weight: 500;
}

.ubigeo-picker-chevron {
    flex: 0 0 auto;
    color: #98a2b3;
    font-size: 1rem;
    line-height: 1;
    transform: translateY(-1px);
}

.ubigeo-picker.is-open .ubigeo-picker-chevron { transform: rotate(180deg); }

.ubigeo-picker-panel {
    position: absolute;
    z-index: 80;
    top: calc(100% + 6px);
    right: 0;
    width: min(900px, calc(100vw - 72px));
    min-width: min(680px, calc(100vw - 72px));
    display: grid;
    grid-template-columns: .9fr 1fr 1.35fr;
    overflow: hidden;
    border: 1px solid #dde3ec;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(20, 29, 46, .18);
}

.ubigeo-picker-column {
    min-width: 0;
    max-height: 290px;
    overflow-y: auto;
    padding: 6px 0;
    border-right: 1px solid #e4e8ef;
}

.ubigeo-picker-column:last-child { border-right: 0; }

.ubigeo-picker-option {
    width: 100%;
    min-height: 37px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 15px;
    border: 0;
    background: transparent;
    color: #596273;
    font-size: .75rem;
    font-weight: 550;
    text-align: left;
    cursor: pointer;
}

.ubigeo-picker-option:hover { background: #f5f8fc; color: #252a38; }
.ubigeo-picker-option.is-active { color: #3c93f7; font-weight: 800; background: #f7fbff; }
.ubigeo-picker-option-arrow { color: #3c93f7; font-size: 1.15rem; font-weight: 400; }

@media (max-width: 760px) {
    .entity-address-layout { grid-template-columns: 1fr; }
    .entity-address-layout > label,
    .entity-address-layout .entity-address-country,
    .entity-address-layout .entity-address-ubigeo,
    .entity-address-layout .full { grid-column: 1; }
    .entity-address-foreign { grid-template-columns: 1fr; }
    .ubigeo-picker-panel {
        position: fixed;
        left: 16px;
        right: 16px;
        top: 22vh;
        width: auto;
        min-width: 0;
        max-height: 58vh;
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    .ubigeo-picker-column { max-height: 190px; border-right: 0; border-bottom: 1px solid #e4e8ef; }
    .ubigeo-picker-column:last-child { border-bottom: 0; }
}

/* Ajuste de composición del modal v103 para reproducir el flujo de referencia. */
.address-book-modal {
    width: min(960px, calc(100vw - 36px));
    max-width: 960px;
}
.entity-address-section > legend { display: none; }
.entity-address-card:first-child > .entity-address-card-head { display: none; }

/* v105 · Ajustes visuales UBIGEO + controles de consulta ApiPeruDev. */
.entity-address-ubigeo > label {
    display: inline-flex !important;
    align-items: baseline;
    gap: 4px;
    width: auto;
    margin: 0;
    line-height: 1.35;
}

.entity-address-ubigeo > label .required-mark {
    display: inline !important;
    position: static !important;
    margin: 0;
    line-height: inherit;
    vertical-align: baseline;
}

/* El selector debe tener la misma escala tipográfica que los inputs del formulario (14px). */
.ubigeo-picker-trigger,
.ubigeo-picker-trigger [data-ubigeo-display],
.ubigeo-picker-option {
    font-size: 14px !important;
}

.ubigeo-picker-trigger [data-ubigeo-display] {
    line-height: 1.45;
}

.ubigeo-picker-option {
    min-height: 40px;
    line-height: 1.35;
}

.apiperu-document-control,
.apiperu-exchange-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
}

.apiperu-document-control > input,
.apiperu-exchange-control > input {
    min-width: 0;
    margin-top: 0 !important;
}

.apiperu-document-button,
.apiperu-exchange-button {
    min-height: 38px;
    margin: 0;
    padding: 0 13px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
}

.apiperu-field-status {
    display: block;
    min-height: 16px;
    margin-top: 5px;
    color: var(--muted, #7a8292);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.apiperu-field-status.is-success { color: #067647; }
.apiperu-field-status.is-error { color: #b42318; }

@media (max-width: 640px) {
    .apiperu-document-control,
    .apiperu-exchange-control {
        grid-template-columns: 1fr;
    }
    .apiperu-document-button,
    .apiperu-exchange-button { width: 100%; }
}

/* v107 · Configuración central de tipo de cambio */
.exchange-rate-page{display:grid;gap:18px}.exchange-rate-head{align-items:flex-start}.exchange-rate-head p{max-width:850px}.exchange-rate-grid{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);gap:18px}.exchange-rate-current-card,.exchange-rate-converter-card,.exchange-rate-history-card{padding:20px}.exchange-rate-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}.exchange-rate-card-head h2{margin:3px 0 0;font-size:20px}.exchange-rate-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:16px}.exchange-rate-values article{border:1px solid var(--line,#e2e8f0);border-radius:12px;background:#fafbfe;padding:16px}.exchange-rate-values span,.exchange-rate-values small{display:block;color:#718096}.exchange-rate-values strong{display:block;margin:4px 0;font-size:30px;line-height:1.05;color:#17213b;font-variant-numeric:tabular-nums}.exchange-rate-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px;margin:0 0 18px;padding:14px;border-radius:10px;background:#f8fafc}.exchange-rate-meta div{display:flex;justify-content:space-between;gap:12px}.exchange-rate-meta dt{color:#7b8498}.exchange-rate-meta dd{margin:0;font-weight:600;text-align:right}.exchange-rate-sync{display:grid;grid-template-columns:minmax(180px,.7fr) auto;align-items:end;gap:12px}.exchange-rate-sync label,.exchange-rate-manual label,.exchange-converter label{display:grid;gap:6px;font-weight:600}.exchange-rate-note{margin:12px 0 0}.exchange-converter{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:end;gap:12px;margin:12px 0 14px}.exchange-converter-arrow{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:#f2f0fb;color:#351783;font-size:18px}.money-field{display:grid;grid-template-columns:auto 1fr;align-items:center;border:1px solid var(--line,#dfe4ed);border-radius:9px;overflow:hidden;background:#fff}.money-field span{padding:0 10px;color:#667085}.money-field input{border:0!important;border-radius:0!important;box-shadow:none!important}.exchange-rate-manual{margin-top:18px;border-top:1px solid var(--line,#e4e8ef);padding-top:14px}.exchange-rate-manual summary{cursor:pointer;font-weight:700;color:#351783}.exchange-rate-manual form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}.exchange-rate-manual .button{grid-column:1/-1;justify-self:start}.exchange-rate-history-card .workspace-panel-head{margin-bottom:12px}.product-exchange-hint{font-size:11px!important;font-weight:500!important;line-height:1.25;margin-top:4px}.status-badge.pending{background:#fff5d9;color:#8a5b00}.status-badge.accepted{background:#ddf8e9;color:#147846}
@media (max-width:900px){.exchange-rate-grid{grid-template-columns:1fr}.exchange-rate-values,.exchange-rate-meta{grid-template-columns:1fr}.exchange-rate-sync{grid-template-columns:1fr}.exchange-converter{grid-template-columns:1fr}.exchange-converter-arrow{transform:rotate(90deg);justify-self:center}.exchange-rate-manual form{grid-template-columns:1fr}}

/* ========================================================================== 
   v108 — Productos: costo compacto y columnas de compra opcionales
   ========================================================================== */
.catalog-primary-actions form {
    margin: 0;
    display: flex;
    align-items: center;
}

.product-purchase-price {
    white-space: nowrap;
    font-weight: 500;
    color: #273043;
}

#products-table {
    min-width: 1120px;
}


/* v109 — PEN no requiere TC: ocultar la acción USD y conservar la cabecera compacta. */
.apiperu-exchange-button[hidden] {
    display: none !important;
}

/* v112 · Administración de usuarios alineada con los listados profesionales. */
.user-admin-table-card { margin-top: 12px; }
.user-admin-table td:first-child { min-width: 240px; }
.user-admin-table td:first-child > small,
.user-admin-table td:nth-child(4) > small { display: block; margin-top: 3px; }
.user-admin-table .security-super { margin: 6px 0 0; }
.user-session-count {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    min-height: 30px;
    padding: 3px 9px;
    border-radius: 8px;
    background: #f1eff9;
    color: var(--ui-primary);
    font-weight: 700;
}

/* v118 · Importación profesional de productos desde Excel. */
.product-import-modal { width: min(620px, calc(100vw - 36px)); max-width: 620px; }
.product-import-content { display: grid; gap: 16px; padding: 18px 20px 20px; }
.product-import-field { display: grid; gap: 7px; color: #29243a; font-size: 13px; font-weight: 700; }
.product-import-field small { color: #858a98; font-size: 11px; font-weight: 500; }
.product-import-upload { display: grid; justify-items: center; gap: 8px; padding: 18px; border: 1px dashed #d5d1e2; border-radius: 10px; background: #faf9fd; }
.product-import-upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.product-import-file-button { margin: 0; min-width: 220px; cursor: pointer; }
.product-import-file-name { max-width: 100%; color: #74798a; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-import-template-link { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid #ded9eb; border-radius: 9px; color: #2f177d; background: #fff; text-decoration: none; }
.product-import-template-link > span:first-child { font-size: 21px; line-height: 1; }
.product-import-template-link strong, .product-import-template-link small { display: block; }
.product-import-template-link strong { font-size: 13px; }
.product-import-template-link small { margin-top: 2px; color: #858a98; font-size: 10.5px; }
.product-import-template-link:hover { border-color: #cbbfe5; background: #f9f7fd; }
.product-import-help { padding: 12px 14px; border-radius: 9px; background: #f6f7fa; color: #616777; font-size: 11px; line-height: 1.5; }
.product-import-help strong { display: block; margin-bottom: 4px; color: #393345; font-size: 12px; }
.product-import-help ul { margin: 0; padding-left: 18px; }
@media (max-width: 620px) { .product-import-content { padding: 14px 16px 18px; } .product-import-file-button { width: 100%; min-width: 0; } }


/* v128 · Filtros de ventas uniformes y contador de páginas */
.app-content .sales-filter-grid .sales-filter-search {
    grid-column: span 2;
}
.app-content .table-page-counter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 12px 0 0;
    padding: 7px 10px;
    border: 1px solid #e1e5ed;
    border-radius: 8px;
    background: #fff;
    color: #747b8b;
    font: 500 11px/16px "Poppins", sans-serif;
    font-variant-numeric: tabular-nums;
}
.app-content .table-page-counter strong {
    color: #252a36;
    font-weight: 650;
}
.app-content .table-page-counter + .pagination {
    margin-top: 8px;
}
@media (max-width: 850px) {
    .app-content .sales-filter-grid .sales-filter-search { grid-column: span 2; }
}
@media (max-width: 620px) {
    .app-content .sales-filter-grid .sales-filter-search { grid-column: auto; }
}

/* v130 · SIRE profesional y compras USD con salida de caja flexible. */
.sire-page-head { align-items:flex-start; gap:18px; }
.sire-page-kicker,.sire-section-kicker { display:block; margin-bottom:4px; color:#7b8191; font-size:10px; font-weight:750; letter-spacing:.08em; }
.sire-head-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.sire-connection-pill { display:inline-flex; align-items:center; gap:7px; min-height:38px; padding:7px 11px; border:1px solid #e3e6ed; border-radius:9px; background:#fff; color:#606878; font-size:11px; font-weight:650; white-space:nowrap; }
.sire-connection-pill > span,.sire-status > span { width:7px; height:7px; border-radius:50%; background:#a0a6b2; }
.sire-connection-pill.is-ready { border-color:#cfeadd; background:#f3fbf7; color:#147648; }
.sire-connection-pill.is-ready > span { background:#23a565; }
.sire-connection-pill.is-pending { border-color:#f0dfb6; background:#fffaf0; color:#8a651a; }
.sire-connection-pill.is-pending > span { background:#d89a21; }
.sire-alert { margin-bottom:16px; }
.sire-metric-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.sire-metric-card { display:flex; align-items:center; gap:12px; min-height:92px; padding:16px; border:1px solid #e2e5ec; border-radius:12px; background:#fff; box-shadow:0 4px 15px rgba(31,35,48,.035); }
.sire-metric-icon { display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; border-radius:10px; background:#f3f1fa; color:#3a1c8f; font-size:17px; font-weight:750; }
.sire-metric-card strong,.sire-metric-card span,.sire-metric-card small { display:block; }
.sire-metric-card strong { color:#171b2a; font-size:23px; line-height:1; font-variant-numeric:tabular-nums; }
.sire-metric-card div > span { margin-top:5px; color:#34394a; font-size:12px; font-weight:650; }
.sire-metric-card small { margin-top:2px; color:#8a90a0; font-size:10px; }
.sire-workflow-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr); gap:16px; margin-bottom:16px; }
.sire-period-card,.sire-guide-card { padding:20px; }
.sire-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:16px; }
.sire-card-head h2 { margin:0; font-size:18px; }
.sire-card-head p { margin:5px 0 0; max-width:760px; font-size:11px; }
.sire-step-badge { display:inline-flex; align-items:center; min-height:30px; padding:5px 10px; border-radius:999px; background:#f2effa; color:#3a1c8f; font-size:10px; font-weight:700; white-space:nowrap; }
.sire-period-form { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(190px,.65fr) auto; gap:12px; align-items:end; }
.sire-period-form label { display:grid; gap:6px; color:#34394a; font-size:11px; font-weight:650; }
.sire-period-form label small { color:#9096a4; font-size:9.5px; font-weight:500; }
.sire-primary-action { min-height:42px; white-space:nowrap; }
.sire-process-steps { display:grid; gap:10px; margin:0; padding:0; list-style:none; }
.sire-process-steps li { display:grid; grid-template-columns:28px 1fr; gap:9px; align-items:start; }
.sire-process-steps li > span { display:grid; place-items:center; width:28px; height:28px; border-radius:8px; background:#f4f5f8; color:#3a1c8f; font-size:10px; font-weight:750; }
.sire-process-steps strong,.sire-process-steps small { display:block; }
.sire-process-steps strong { color:#34394a; font-size:11px; }
.sire-process-steps small { margin-top:2px; color:#8c92a1; font-size:9.5px; line-height:1.4; }
.sire-filter-card { margin-bottom:16px; }
.sire-filter-grid { grid-template-columns:1.25fr .8fr 1fr auto; }
.sire-table-card { padding:0; overflow:hidden; }
.sire-table-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:17px 18px 12px; }
.sire-table-heading h2 { margin:0; font-size:16px; }
.sire-table-heading p { margin:3px 0 0; font-size:10px; }
.sire-period-table td { vertical-align:middle; }
.sire-period-table td strong,.sire-period-table td small,.sire-period-table td .sire-book-code { display:block; }
.sire-period-table td small { margin-top:3px; color:#8a90a0; font-size:10px; }
.sire-period-label { font-size:13px; color:#202534; }
.sire-book-code { width:max-content; margin-top:5px; padding:2px 6px; border-radius:5px; background:#f4f5f8; color:#747b8b; font-size:9px; }
.sire-pending-copy { color:#73798a; font-size:11px; font-weight:650; }
.sire-status { display:inline-flex; align-items:center; gap:6px; min-height:27px; padding:4px 8px; border-radius:7px; font-size:9.5px; font-weight:700; white-space:nowrap; }
.sire-status.is-neutral { background:#f1f3f6; color:#646b79; }
.sire-status.is-info { background:#edf4ff; color:#265f9f; }
.sire-status.is-warning { background:#fff6df; color:#88601a; }
.sire-status.is-success { background:#eaf8f0; color:#177147; }
.sire-status.is-danger { background:#fff0f0; color:#aa3030; }
.sire-status.is-info > span { background:#4d83bd; }.sire-status.is-warning > span { background:#d49825; }.sire-status.is-success > span { background:#2ca36b; }.sire-status.is-danger > span { background:#ce4f4f; }
.purchase-cash-flex-note { grid-column:1/-1; display:grid; gap:5px; padding:11px 13px; border:1px solid #ddd9eb; border-radius:9px; background:#faf9fd; color:#555d6e; font-size:10.5px; line-height:1.45; }
.purchase-cash-flex-note strong { color:#302a42; font-size:11px; }
.purchase-cash-flex-note .purchase-cash-balances { color:#777e8e; font-variant-numeric:tabular-nums; }
.purchase-cash-flex-note.is-converting { border-color:#d8cfee; background:#f8f5ff; color:#492f8f; }
.purchase-cash-flex-note.is-insufficient { border-color:#efd2d2; background:#fff6f6; color:#9b3434; }
.purchase-payment-currency-note { margin-top:10px; }
@media (max-width:1100px){.sire-metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.sire-workflow-grid{grid-template-columns:1fr}.sire-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sire-period-form{grid-template-columns:1fr 1fr}.sire-primary-action{grid-column:1/-1;justify-self:start}}
@media (max-width:680px){.sire-metric-grid{grid-template-columns:1fr 1fr}.sire-head-actions{justify-content:flex-start}.sire-period-form,.sire-filter-grid{grid-template-columns:1fr}.sire-primary-action{width:100%}.sire-metric-card{min-height:82px;padding:13px}}
@media (max-width:460px){.sire-metric-grid{grid-template-columns:1fr}}


/* v131 · Captura de series en compras mediante botón y modal guiado. */
.purchase-series-picker {
    display: grid;
    gap: 5px;
    min-width: 150px;
}
.purchase-series-button {
    width: 100%;
    min-height: 38px;
    padding: 7px 11px;
    white-space: nowrap;
}
.purchase-series-summary {
    color: #7a8496;
    font-size: 11px;
    line-height: 15px;
}
.purchase-series-picker.is-complete .purchase-series-summary { color: #008f4c; }
.purchase-series-picker.is-incomplete:not(.is-hidden) .purchase-series-summary { color: #a15c00; }
.purchase-series-dialog-summary { grid-template-columns: minmax(210px, 1.55fr) repeat(2, minmax(100px, .7fr)); }
.purchase-series-entry-list {
    display: grid;
    gap: 9px;
    padding: 14px 22px 18px;
    overflow: auto;
}
.purchase-series-entry-row {
    display: grid;
    grid-template-columns: 34px minmax(120px, .75fr) minmax(220px, 1.5fr);
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #e2e6ee;
    border-radius: 10px;
    background: #fafbfc;
}
.purchase-series-entry-number {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #eeeafd;
    color: #351684;
    font-weight: 700;
    font-size: 12px;
}
.purchase-series-entry-copy { display: grid; gap: 1px; }
.purchase-series-entry-copy strong { color: #212529; font-size: 13px; }
.purchase-series-entry-copy small { color: #8a94a6; font-size: 11px; }
.purchase-series-entry-input {
    width: 100%;
    min-width: 0;
    height: 40px;
    text-transform: uppercase;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.purchase-series-entry-input.is-duplicate {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, .08);
}
@media (max-width: 720px) {
    .purchase-series-dialog-summary { grid-template-columns: 1fr 1fr; }
    .purchase-series-dialog-summary > div:first-child { grid-column: 1 / -1; }
    .purchase-series-entry-row { grid-template-columns: 34px 1fr; }
    .purchase-series-entry-input { grid-column: 1 / -1; }
}

/* ========================================================================== 
   v132 · Scrollbars visualmente ocultas
   Mantiene el desplazamiento por rueda, touchpad, teclado y tacto.
   ========================================================================== */
html,
body,
body.app-layout,
body.guest-layout,
body.app-layout *,
body.guest-layout * {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
body.app-layout::-webkit-scrollbar,
body.guest-layout::-webkit-scrollbar,
body.app-layout *::-webkit-scrollbar,
body.guest-layout *::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
}

/* Opt-out deliberado para un componente futuro que deba mostrar su scrollbar. */
.scrollbar-visible {
    -ms-overflow-style: auto;
    scrollbar-width: auto;
}

.scrollbar-visible::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* ==========================================================================
   v133 · Paleta profesional para tarjetas financieras y métricas
   Acentos sobrios sobre fondos suaves; mantiene el morado institucional.
   ========================================================================== */
:root {
    --metric-violet-bg: var(--ui-primary-soft);
    --metric-violet-border: #ded6f1;
    --metric-violet-accent: #4a2c84;
    --metric-blue-bg: #eef5fa;
    --metric-blue-border: #d5e4ee;
    --metric-blue-accent: #2f6b91;
    --metric-emerald-bg: #eef8f4;
    --metric-emerald-border: #d4e9df;
    --metric-emerald-accent: #2f775c;
    --metric-amber-bg: #fbf5e9;
    --metric-amber-border: #eadfc9;
    --metric-amber-accent: #94652d;
    --metric-rose-bg: #faf0f3;
    --metric-rose-border: #ead5dc;
    --metric-rose-accent: #955266;
    --metric-teal-bg: #eef7f7;
    --metric-teal-border: #d4e7e6;
    --metric-teal-accent: #357673;
    --metric-slate-bg: #f2f4f7;
    --metric-slate-border: #dde2e8;
    --metric-slate-accent: #596779;
    --metric-indigo-bg: #f1f2fa;
    --metric-indigo-border: #d9dcef;
    --metric-indigo-accent: #5862a2;
}

/* Base visual reutilizable para tarjetas de indicadores. */
.app-content :is(.cash-summary-grid > .card, .metric-grid > .metric, .dashboard-metrics > .metric, .report-primary-summary > article) {
    --metric-bg: var(--metric-violet-bg);
    --metric-border: var(--metric-violet-border);
    --metric-accent: var(--metric-violet-accent);
    position: relative;
    overflow: hidden;
    border-color: var(--metric-border);
    background: linear-gradient(135deg, #ffffff 0%, var(--metric-bg) 100%);
    box-shadow: inset 4px 0 0 var(--metric-accent), 0 5px 18px rgba(30, 35, 55, .045);
}

.app-content :is(.cash-summary-grid > .card, .metric-grid > .metric, .dashboard-metrics > .metric, .report-primary-summary > article)::after {
    content: "";
    position: absolute;
    width: 72px;
    height: 72px;
    right: -30px;
    top: -34px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--metric-accent) 8%, transparent);
    pointer-events: none;
}

.app-content :is(.cash-summary-grid > .card, .metric-grid > .metric, .dashboard-metrics > .metric) strong,
.app-content .cash-summary-grid > .card .amount-highlight,
.app-content .report-primary-summary > article strong {
    color: var(--metric-accent);
}

.app-content .cash-summary-grid > .card h2,
.app-content :is(.metric-grid > .metric, .dashboard-metrics > .metric) > span,
.app-content .report-primary-summary > article span {
    color: #303544;
}

.app-content .cash-summary-grid > .card small,
.app-content :is(.metric-grid > .metric, .dashboard-metrics > .metric) small {
    color: #737b8b;
}

/* Caja: PEN institucional, USD azul, ingresos verde, egresos rosa. */
.app-content .cash-summary-grid > .card:nth-child(1) {
    --metric-bg: var(--metric-violet-bg);
    --metric-border: var(--metric-violet-border);
    --metric-accent: var(--metric-violet-accent);
}
.app-content .cash-summary-grid > .card:nth-child(2) {
    --metric-bg: var(--metric-blue-bg);
    --metric-border: var(--metric-blue-border);
    --metric-accent: var(--metric-blue-accent);
}
.app-content .cash-summary-grid > .card:nth-child(3) {
    --metric-bg: var(--metric-emerald-bg);
    --metric-border: var(--metric-emerald-border);
    --metric-accent: var(--metric-emerald-accent);
}
.app-content .cash-summary-grid > .card:nth-child(4) {
    --metric-bg: var(--metric-rose-bg);
    --metric-border: var(--metric-rose-border);
    --metric-accent: var(--metric-rose-accent);
}

/* Reportes y dashboard: ciclo cromático controlado y repetible. */
.app-content :is(.metric-grid, .dashboard-metrics) > .metric:nth-child(8n + 1),
.app-content .report-primary-summary > article:nth-child(2n + 1) {
    --metric-bg: var(--metric-violet-bg);
    --metric-border: var(--metric-violet-border);
    --metric-accent: var(--metric-violet-accent);
}
.app-content :is(.metric-grid, .dashboard-metrics) > .metric:nth-child(8n + 2),
.app-content .report-primary-summary > article:nth-child(2n + 2) {
    --metric-bg: var(--metric-blue-bg);
    --metric-border: var(--metric-blue-border);
    --metric-accent: var(--metric-blue-accent);
}
.app-content :is(.metric-grid, .dashboard-metrics) > .metric:nth-child(8n + 3) {
    --metric-bg: var(--metric-emerald-bg);
    --metric-border: var(--metric-emerald-border);
    --metric-accent: var(--metric-emerald-accent);
}
.app-content :is(.metric-grid, .dashboard-metrics) > .metric:nth-child(8n + 4) {
    --metric-bg: var(--metric-amber-bg);
    --metric-border: var(--metric-amber-border);
    --metric-accent: var(--metric-amber-accent);
}
.app-content :is(.metric-grid, .dashboard-metrics) > .metric:nth-child(8n + 5) {
    --metric-bg: var(--metric-teal-bg);
    --metric-border: var(--metric-teal-border);
    --metric-accent: var(--metric-teal-accent);
}
.app-content :is(.metric-grid, .dashboard-metrics) > .metric:nth-child(8n + 6) {
    --metric-bg: var(--metric-rose-bg);
    --metric-border: var(--metric-rose-border);
    --metric-accent: var(--metric-rose-accent);
}
.app-content :is(.metric-grid, .dashboard-metrics) > .metric:nth-child(8n + 7) {
    --metric-bg: var(--metric-indigo-bg);
    --metric-border: var(--metric-indigo-border);
    --metric-accent: var(--metric-indigo-accent);
}
.app-content :is(.metric-grid, .dashboard-metrics) > .metric:nth-child(8n + 8) {
    --metric-bg: var(--metric-slate-bg);
    --metric-border: var(--metric-slate-border);
    --metric-accent: var(--metric-slate-accent);
}

/* En ventas, los dos KPI principales mantienen mayor presencia sin colores estridentes. */
.app-content .report-primary-summary > article {
    min-height: 120px;
    border-radius: 12px;
}
.app-content .report-primary-summary > article strong {
    font-weight: 750;
}

/* Evita que un estado negativo pierda su semántica visual. */
.app-content :is(.metric-grid, .dashboard-metrics) > .metric strong.is-negative,
.app-content :is(.metric-grid, .dashboard-metrics) > .metric .is-negative {
    color: var(--ui-danger) !important;
}

@media (prefers-reduced-motion: no-preference) {
    .app-content :is(.cash-summary-grid > .card, .metric-grid > .metric, .dashboard-metrics > .metric, .report-primary-summary > article) {
        transition: border-color .18s ease, box-shadow .18s ease;
    }
}

/* ======================================================================
   v136 · Selectores globales unificados
   Todos los select simples usan el mismo lenguaje visual del selector
   moderno: blanco, borde suave, foco violeta y opción activa gris azulado.
   ====================================================================== */
.app-search-select-input {
    height: 42px;
    padding: 9px 38px 9px 13px !important;
    border: 1px solid #c7cedc !important;
    border-radius: 9px !important;
    background: #fff !important;
    color: #302c3f !important;
    font-size: 13.5px !important;
    line-height: 20px !important;
    box-shadow: 0 1px 2px rgba(28, 32, 45, .025);
}
.app-search-select-input:hover {
    border-color: #aeb7c9 !important;
    background: #fff !important;
}
.app-search-select-input:focus {
    border-color: #7262a8 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(91, 56, 164, .12), 0 1px 2px rgba(28, 32, 45, .03) !important;
}
.app-search-select-input::-webkit-search-cancel-button { display: none; }
.app-search-select-chevron {
    right: 13px;
    color: #9aa3b3;
    font-size: 16px;
}
.app-search-select.is-disabled .app-search-select-input {
    cursor: not-allowed;
    background: #f4f6f9 !important;
    border-color: #d9dee7 !important;
    color: #949baa !important;
}
.app-search-select.is-disabled .app-search-select-chevron {
    color: #c2c8d2;
    cursor: not-allowed;
}
.app-search-select-popup {
    border-color: #d8dde6;
    box-shadow: 0 12px 28px rgba(34, 38, 54, .12), 0 2px 7px rgba(34, 38, 54, .05);
}
.app-search-select-result:hover,
.app-search-select-result.is-active {
    background: #d8dee9;
}
.app-search-select-result:hover .app-search-select-result-main strong,
.app-search-select-result.is-active .app-search-select-result-main strong {
    color: #4a5060;
}

/* Variante compacta usada para todos los select comunes del sistema. */
.app-search-select-compact { width: 100%; min-width: 0; }
.app-search-select-popup-compact {
    border-radius: 7px;
    background: #fff;
}
.app-search-select-popup-compact .app-search-select-head { display: none; }
.app-search-select-popup-compact .app-search-select-results {
    max-height: 310px;
    padding: 5px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}
.app-search-select-popup-compact .app-search-select-result {
    display: block;
    min-height: 40px;
    padding: 9px 14px;
    border-bottom: 0;
    border-radius: 0;
    font: 400 13.5px/22px "Poppins", sans-serif;
}
.app-search-select-popup-compact .app-search-select-result-main {
    display: block;
}
.app-search-select-popup-compact .app-search-select-result-main strong {
    display: block;
    color: #515766;
    font: 400 13.5px/22px "Poppins", sans-serif;
    white-space: normal;
}
.app-search-select-popup-compact .app-search-select-result-main small,
.app-search-select-popup-compact .app-search-select-result-code {
    display: none;
}
.app-search-select-popup-compact .app-search-select-result:hover,
.app-search-select-popup-compact .app-search-select-result.is-active {
    background: #d7dde8;
}
.app-search-select-popup-compact .app-search-select-result.is-selected:not(:hover):not(.is-active) {
    background: #fff;
}
.app-search-select-popup-compact .app-search-select-empty {
    padding: 12px 14px;
    text-align: left;
}

/* Conserva anchos mínimos que antes estaban aplicados al select nativo. */
.purchase-lines .app-search-select { min-width: 260px; }
.return-serial-table .app-search-select { min-width: 145px; }
.permission-row .app-search-select,
.report-filters .app-search-select,
.advanced-filter-grid .app-search-select,
.company-settings-page .settings-field .app-search-select,
.branch-series-form-v65 .app-search-select,
.quick-actions-fields .app-search-select,
.app-content .search .app-search-select {
    width: 100%;
}
@media (max-width: 850px) {
    .purchase-lines .app-search-select { min-width: 220px; }
    .return-serial-table .app-search-select { min-width: 125px; }
}

/* v151 · Listado de cajas y exportación de reportes */
.cash-list-head { align-items: center; }
.cash-list-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cash-list-card { padding-top: 18px; }
.cash-filter-toolbar { justify-content: flex-start; }
.cash-history-table-wrap { overflow-x: auto; }
.cash-history-table { min-width: 1180px; }
.cash-history-table th { white-space: nowrap; }
.cash-history-table td { vertical-align: top; }
.cash-history-table .cash-date-line { display: block; white-space: nowrap; }
.cash-history-table td small { display: block; margin-top: 2px; color: #626b7a; }
.cash-actions-heading { min-width: 500px; text-align: right; }
.cash-session-actions { min-width: 500px; }
.cash-action-row { display: flex; justify-content: flex-end; align-items: center; gap: 6px; flex-wrap: wrap; }
.cash-action-row + .cash-action-row { margin-top: 6px; }
.cash-mini-button,
.cash-action-button {
    border: 0;
    border-radius: 6px;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
    font-family: "Poppins", sans-serif;
    font-weight: 600;
}
.cash-mini-button {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.2;
    color: #fff !important;
}
.cash-action-button { min-height: 38px; }
.cash-action-primary { background: #2e1285 !important; color: #fff !important; }
.cash-btn-report { background: #33128b; }
.cash-btn-products { background: #553a9d; }
.cash-btn-income { background: #03b968; }
.cash-btn-close { background: #f58200; }
.cash-btn-detail { background: #2ca8eb; }
.cash-btn-electronic { background: #25a9e8; }
.cash-mini-button:hover,
.cash-action-button:hover { filter: brightness(.94); transform: translateY(-1px); }
.cash-export-menu { position: relative; display: inline-block; }
.cash-export-popover {
    position: fixed;
    z-index: 10070;
    width: 310px;
    max-height: min(430px, calc(100vh - 24px));
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #dde1e8;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(27, 31, 45, .19);
}
.cash-export-popover a {
    display: block;
    padding: 10px 11px;
    border-radius: 6px;
    color: #5b616d !important;
    font: 400 13px/18px "Poppins", sans-serif;
    text-decoration: none !important;
}
.cash-export-popover a:hover { background: #f0edf9; color: #27106e !important; }
.cash-export-menu [data-cash-export-trigger][aria-expanded="true"] { box-shadow: 0 0 0 2px rgba(76, 42, 150, .15); }
@media (max-width: 900px) {
    .cash-list-head-actions { width: 100%; justify-content: flex-start; }
    .cash-actions-heading, .cash-session-actions { min-width: 430px; }
}


/* v175 · Tooltip compacto de ayuda para campos de formulario. */
.app-field-help-source {
    display: none !important;
}

.app-field-help-tip {
    position: relative;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    margin-left: 6px;
    vertical-align: middle;
    border: 0;
    border-radius: 50%;
    background: #17306a;
    color: #fff;
    font: 700 11px/1 "Poppins", Inter, sans-serif;
    cursor: help;
    user-select: none;
    box-shadow: 0 1px 2px rgba(16, 32, 71, .18);
}

.app-field-help-icon {
    display: inline-grid;
    width: 100%;
    height: 100%;
    place-items: center;
}

.app-field-help-popover {
    position: absolute;
    right: -9px;
    bottom: calc(100% + 10px);
    z-index: 99999;
    width: max-content;
    max-width: min(310px, calc(100vw - 32px));
    padding: 9px 11px;
    border-radius: 4px;
    background: #292929;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    text-align: left;
    white-space: normal;
    box-shadow: 0 9px 24px rgba(0, 0, 0, .20);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
    pointer-events: none;
}

.app-field-help-popover::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 100%;
    border: 7px solid transparent;
    border-top-color: #292929;
}

.app-field-help-tip:hover .app-field-help-popover,
.app-field-help-tip:focus .app-field-help-popover,
.app-field-help-tip:focus-visible .app-field-help-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.app-field-label-with-help {
    position: relative;
}

.app-field-label-with-help > .app-field-help-tip--floating {
    position: absolute;
    top: 0;
    right: 0;
    margin-left: 0;
}

.app-field-scope-with-help {
    position: relative;
}

.app-field-scope-with-help > .app-field-help-tip--corner {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
}

@media (max-width: 680px) {
    .app-field-help-popover {
        max-width: min(270px, calc(100vw - 24px));
        font-size: 11.5px;
    }
}


/* ========================================================================== 
   v183 · Configuración general — panel administrativo sobrio y profesional
   ========================================================================== */
.general-settings-page{--gs-primary:var(--color-primary,#245f93);--gs-primary-soft:color-mix(in srgb,var(--gs-primary) 8%,#fff);--gs-border:#e2e8f0;--gs-muted:#667085;display:grid;gap:1rem}.general-settings-page .general-settings-head{min-height:54px;margin:0;display:flex;align-items:center;justify-content:space-between;gap:1rem}.general-settings-page .general-settings-head h1{margin:0;color:#172033;font-size:1.72rem;font-weight:760;line-height:1.15;letter-spacing:-.025em}.general-settings-page .general-settings-head .button{min-height:40px;padding:.65rem .9rem;border-radius:10px;font-size:.82rem;font-weight:750;box-shadow:none}.general-settings-page .general-settings-shell{display:grid;grid-template-columns:245px minmax(0,1fr);min-height:640px;margin:0;overflow:hidden;border:1px solid var(--gs-border);border-radius:16px;background:#fff;box-shadow:0 10px 30px rgba(15,23,42,.045)}
.general-settings-sidebar{padding:18px 12px;border-right:1px solid var(--gs-border);background:#f8fafc}.general-settings-sidebar__head{display:grid;gap:2px;padding:2px 12px 14px}.general-settings-sidebar__head span{color:#98a2b3;font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.09em}.general-settings-sidebar__head strong{color:#344054;font-size:.95rem;font-weight:780}.general-settings-page .general-settings-tabs{display:grid;gap:4px;overflow:visible;padding:0;background:transparent;border:0}.general-settings-page .general-settings-tabs a{display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;gap:10px;min-width:0;padding:9px 10px;border:1px solid transparent;border-radius:10px;color:#475467;text-decoration:none;background:transparent;transition:background .15s ease,border-color .15s ease,color .15s ease}.general-settings-page .general-settings-tabs a:hover{background:#fff;border-color:#e7ecf3;color:#27364d}.general-settings-page .general-settings-tabs a.active{margin:0;border-color:color-mix(in srgb,var(--gs-primary) 18%,#dfe7f0);background:#fff;color:var(--gs-primary);box-shadow:0 5px 14px rgba(15,23,42,.045)}.general-settings-tab-mark{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:#eef2f7;color:#667085;font-size:.62rem;font-weight:850;letter-spacing:.02em}.general-settings-tabs a.active .general-settings-tab-mark{background:var(--gs-primary-soft);color:var(--gs-primary)}.general-settings-tab-copy{min-width:0;display:grid;gap:1px}.general-settings-tab-copy strong{font-size:.82rem;font-weight:760;line-height:1.2}.general-settings-tab-copy small{display:none;color:#98a2b3;font-size:.66rem;line-height:1.25}
.general-settings-page .general-settings-content{min-width:0;padding:24px 26px 28px;background:#fff}.general-settings-page .general-settings-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;padding:0 0 18px;border-bottom:1px solid #edf0f4}.general-settings-section-label{display:block;margin-bottom:5px;color:var(--gs-primary);font-size:.66rem;font-weight:850;text-transform:uppercase;letter-spacing:.085em}.general-settings-page .general-settings-section-head h2{margin:0;color:#172033;font-size:1.42rem;font-weight:780;line-height:1.2;letter-spacing:-.018em}.general-settings-page .general-settings-section-head p{max-width:720px;margin:6px 0 0;color:var(--gs-muted);font-size:.82rem;line-height:1.55}.general-settings-page .general-settings-stage{min-height:30px;display:inline-flex;align-items:center;padding:0 10px;border:1px solid #d8e9df;border-radius:999px;background:#f1f9f4;color:#27724a;font-size:.69rem;font-weight:800;white-space:nowrap}
.general-settings-page .automation-settings-form{gap:14px;margin-top:18px}.general-settings-page .automation-master-card{display:grid;grid-template-columns:minmax(0,1fr) 205px;align-items:center;gap:20px;padding:18px 20px;border:1px solid #dce4ed;border-radius:13px;background:#fbfcfe;box-shadow:none}.general-settings-page .automation-master-card.is-enabled{border-color:color-mix(in srgb,var(--gs-primary) 24%,#dce4ed);background:linear-gradient(90deg,var(--gs-primary-soft),#fbfcfe 38%)}.general-settings-page .automation-master-copy .section-kicker{color:#98a2b3;font-size:.65rem;letter-spacing:.07em}.general-settings-page .automation-master-copy h3{margin:4px 0 5px;color:#25324a;font-size:1.02rem;font-weight:780;line-height:1.25}.general-settings-page .automation-master-copy p{max-width:750px;margin:0;color:#667085;font-size:.79rem;line-height:1.52}.general-settings-page .automation-master-switch{min-width:0;margin:0!important;padding:11px 12px!important;border:1px solid #e0e6ee;border-radius:10px;background:#fff}.general-settings-page .automation-master-switch strong{font-size:.82rem!important}.general-settings-page .automation-master-switch small{font-size:.7rem!important;line-height:1.35!important}.general-settings-page .automation-switch-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}.general-settings-page .automation-service-switch{min-height:76px;margin:0!important;padding:12px 13px!important;border:1px solid #e1e7ef;border-radius:11px;background:#fff;box-shadow:none}.general-settings-page .automation-service-switch:hover{border-color:#ccd7e4;background:#fcfdff}.general-settings-page .automation-service-switch strong{font-size:.81rem!important;line-height:1.35!important}.general-settings-page .automation-service-switch small{margin-top:2px;color:#7a8496;font-size:.7rem!important;line-height:1.42!important;font-weight:500}.general-settings-page .automation-actions{min-height:52px;margin-top:0;padding:12px 0 0;border-top:1px solid #edf0f4}.general-settings-page .automation-actions>span{max-width:690px;color:#7a8496;font-size:.72rem!important;line-height:1.45!important}.general-settings-page .automation-actions .button{min-height:40px;padding:.65rem .9rem;border-radius:9px;font-size:.78rem}
.general-settings-page .automation-health-panel{margin-top:22px;padding-top:20px;border-top:1px solid #edf0f4}.general-settings-page .automation-health-heading{align-items:center;margin-bottom:12px}.general-settings-page .automation-health-heading .section-kicker{color:#98a2b3;font-size:.64rem}.general-settings-page .automation-health-heading h3{margin:3px 0 2px;color:#25324a;font-size:1rem;font-weight:780}.general-settings-page .automation-health-heading p{margin:0;color:#7a8496;font-size:.75rem!important;line-height:1.45!important}.general-settings-page .automation-health-heading .button{min-height:38px;padding:.58rem .78rem;border-radius:9px;font-size:.74rem}.general-settings-page .automation-health-grid{gap:10px}.general-settings-page .automation-health-card{gap:10px;padding:14px;border:1px solid #e1e7ef;border-radius:11px;background:#fff;box-shadow:none}.general-settings-page .automation-health-title>span:first-child{font-size:.67rem!important;letter-spacing:.05em}.general-settings-page .automation-health-card>strong{color:#344054;font-size:.86rem!important}.general-settings-page .automation-health-card dl{gap:7px}.general-settings-page .automation-health-card dl>div{padding:8px 9px;border-radius:8px;background:#f8fafc}.general-settings-page .automation-health-card dt{font-size:.65rem!important}.general-settings-page .automation-health-card dd{font-size:.75rem!important}.general-settings-page .automation-metrics>div{padding:8px;border-radius:8px;background:#f8fafc}.general-settings-page .automation-metrics span{font-size:.62rem}.general-settings-page .automation-metrics strong{font-size:1rem}.general-settings-page .automation-integrations-grid{padding-top:18px;border-top:1px solid #edf0f4}
.general-settings-page .general-settings-service-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:16px}.general-settings-page .general-setting-status-card{gap:9px;padding:14px;border:1px solid #e1e7ef;border-radius:11px;background:#fff;box-shadow:none}.general-settings-page .general-setting-status-card>div span{font-size:.68rem}.general-settings-page .general-setting-status-card>div strong{font-size:.78rem}.general-settings-page .general-setting-status-card p{font-size:.72rem;line-height:1.45}.general-settings-page .general-setting-status-card>a{font-size:.72rem;color:var(--gs-primary)}
.general-settings-page .general-visual-settings-form,.general-settings-page .pdf-settings-form{margin-top:18px}.general-settings-page .general-visual-grid{gap:10px}.general-settings-page .general-visual-switch{min-height:72px;margin:0!important;padding:12px 13px!important;border:1px solid #e1e7ef!important;border-radius:11px!important;background:#fff!important;box-shadow:none!important}.general-settings-page .general-visual-switch strong{font-size:.8rem!important;line-height:1.35}.general-settings-page .general-visual-switch small{font-size:.7rem!important;line-height:1.42!important;color:#7a8496}.general-settings-page .general-settings-note{margin-top:14px;padding:12px 14px;border:1px solid #dfe7ef;border-radius:10px;background:#f8fafc}.general-settings-page .general-settings-note strong{color:#344054;font-size:.78rem}.general-settings-page .general-settings-note p{margin:3px 0 0;color:#667085;font-size:.72rem;line-height:1.5}.general-settings-page .general-visual-actions{margin-top:14px;padding-top:12px;border-top:1px solid #edf0f4}.general-settings-page .general-visual-actions .button{min-height:40px;border-radius:9px;font-size:.78rem}
.general-settings-page .pdf-settings-intro,.general-settings-page .pdf-options-panel{border-color:#e1e7ef;border-radius:12px;box-shadow:none}.general-settings-page .pdf-document-grid{gap:10px}.general-settings-page .pdf-document-card{border-color:#e1e7ef;border-radius:12px;box-shadow:none}.general-settings-page .pdf-document-card-head h3{font-size:.9rem}.general-settings-page .pdf-format-row{gap:12px}.general-settings-page .pdf-format-controls label{font-size:.72rem}.general-settings-page .pdf-format-controls select,.general-settings-page .pdf-copy-grid textarea{border-radius:9px}.general-settings-page .pdf-preview-actions .button,.general-settings-page .pdf-format-controls>.button{min-height:36px;padding:.52rem .7rem;border-radius:8px;font-size:.7rem}
.general-settings-page .general-settings-placeholder{min-height:420px;padding:3rem 2rem}.general-settings-page .general-settings-placeholder>span{padding:.35rem .65rem;background:#f2f5f8;color:#667085;font-size:.67rem}.general-settings-page .general-settings-placeholder h3{margin:14px 0 5px;color:#344054;font-size:1rem}.general-settings-page .general-settings-placeholder p{max-width:590px;color:#7a8496;font-size:.78rem;line-height:1.55}
@media(max-width:1180px){.general-settings-page .general-settings-shell{grid-template-columns:205px minmax(0,1fr)}.general-settings-page .general-settings-content{padding:22px}.general-settings-page .general-settings-service-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.general-settings-page .automation-master-card{grid-template-columns:1fr 185px}}
@media(max-width:900px){.general-settings-page .general-settings-shell{grid-template-columns:1fr}.general-settings-sidebar{padding:10px;border-right:0;border-bottom:1px solid var(--gs-border)}.general-settings-sidebar__head{display:none}.general-settings-page .general-settings-tabs{display:flex;gap:6px;overflow-x:auto;padding:0 0 2px;scrollbar-width:thin}.general-settings-page .general-settings-tabs a{flex:0 0 auto;grid-template-columns:28px auto;padding:7px 9px}.general-settings-tab-mark{width:28px;height:28px;border-radius:8px}.general-settings-tab-copy small{display:none}.general-settings-page .general-settings-content{padding:20px}.general-settings-page .automation-master-card{grid-template-columns:1fr}.general-settings-page .automation-switch-grid,.general-settings-page .automation-health-grid{grid-template-columns:1fr}}
@media(max-width:640px){.general-settings-page{gap:.75rem}.general-settings-page .general-settings-head{align-items:flex-start;flex-direction:column}.general-settings-page .general-settings-head h1{font-size:1.45rem}.general-settings-page .general-settings-content{padding:16px}.general-settings-page .general-settings-section-head{align-items:flex-start;flex-direction:column}.general-settings-page .general-settings-service-grid{grid-template-columns:1fr}.general-settings-page .automation-actions,.general-settings-page .automation-health-heading{align-items:stretch;flex-direction:column}.general-settings-page .automation-actions .button,.general-settings-page .automation-health-heading .button{width:100%}}


/* v305 · Normalización visual de vistas administrativas, seguridad y finanzas */
.app-content .workspace-page {
    display: grid;
    gap: 18px;
}
.app-content .workspace-page > :is(.page-head, .card, .metric-grid, .detail-grid, section) {
    margin-top: 0;
    margin-bottom: 0;
}
.app-content .workspace-page .page-head {
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 0;
}
.app-content .workspace-page .page-head > div:first-child {
    min-width: 0;
}
.app-content .workspace-page .page-head .actions,
.app-content .workspace-inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.app-content .workspace-page .page-head .button,
.app-content .workspace-inline-actions .button {
    min-height: 42px;
    border-radius: 10px;
}
.app-content .workspace-filter-card,
.app-content .workspace-table-card,
.app-content .workspace-empty-shell {
    margin-top: 0;
}
.app-content .workspace-panel-card.workspace-filter-card {
    overflow: hidden;
}
.app-content .workspace-panel-card .workspace-form-grid {
    align-items: end;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.app-content .workspace-panel-card .workspace-form-grid.compact-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.app-content .workspace-panel-card .workspace-form-grid label {
    min-width: 0;
}
.app-content .workspace-panel-card .workspace-form-grid input,
.app-content .workspace-panel-card .workspace-form-grid select,
.app-content .workspace-panel-card .workspace-form-grid textarea {
    width: 100%;
    min-width: 0;
    padding: 9px 11px;
}
.app-content .workspace-panel-card .workspace-form-grid textarea {
    min-height: 92px;
    resize: vertical;
}
.app-content .workspace-panel-card .workspace-form-grid .actions,
.app-content .workspace-panel-card .workspace-form-grid .form-actions {
    min-height: 41px;
    justify-content: flex-start;
    align-self: end;
}
.app-content .workspace-panel-card .workspace-form-grid .actions .button,
.app-content .workspace-panel-card .workspace-form-grid .form-actions .button {
    min-width: 128px;
}
.app-content .workspace-panel-card .workspace-form-grid .full {
    grid-column: 1 / -1;
}
.app-content .workspace-panel-body--footer {
    padding-top: 0;
}
.app-content .workspace-panel-card .module-subsection-head {
    border-top: 1px solid #e7eaf0;
}
.app-content .workspace-table-card {
    overflow: hidden;
}
.app-content .workspace-table-card .module-subsection-head {
    margin: 0;
}
.app-content .workspace-table-card .professional-table,
.app-content .workspace-table-card .professional-table-wrap,
.app-content .workspace-table-card.professional-table-wrap {
    margin-top: 0;
}
.app-content .workspace-table-card .professional-table thead th {
    white-space: nowrap;
}
.app-content .workspace-table-card .professional-table tbody td {
    vertical-align: middle;
}
.app-content .workspace-table-card .professional-table td .badge + small {
    margin-top: 6px;
}
.app-content .workspace-page .table-page-counter {
    margin-top: -4px;
}
.app-content .workspace-page .pagination {
    margin-top: -6px;
}
.app-content .workspace-page .empty-state {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 26px 18px;
    text-align: center;
}
.app-content .workspace-page .empty-state strong {
    color: #243041;
}
.app-content .workspace-page .empty-state span {
    max-width: 620px;
    color: #7a8597;
    line-height: 1.55;
}
.app-content .workspace-page .compact-empty {
    padding: 18px 12px;
}
.app-content .workspace-page .inline-form {
    display: inline-flex;
    margin: 0;
}
.app-content .workspace-page .table-inline-note {
    color: #7b8798;
    font-size: 12px;
    font-weight: 600;
}
.app-content .workspace-page .finance-metric-grid {
    margin: 0;
}
.app-content .workspace-page .finance-metric-grid .metric {
    box-shadow: 0 6px 18px rgba(15, 23, 42, .035);
}
.app-content .ops-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}
.app-content .ops-kpi-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid #e0e5ed;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}
.app-content .ops-kpi-card--accent {
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary-soft, #eef4fb) 72%, #fff), #fff);
}
.app-content .ops-kpi-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.app-content .ops-kpi-card__meta span,
.app-content .ops-kpi-card__meta a {
    color: #667085;
    font-size: 12px;
    line-height: 1.45;
}
.app-content .ops-kpi-card__meta span:first-child {
    color: #253041;
    font-weight: 700;
}
.app-content .ops-kpi-card strong {
    color: #182230;
    font-size: 1.85rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.app-content .ops-kpi-card small {
    color: #7b8798;
    font-size: 12px;
    line-height: 1.55;
}
.app-content .ops-secondary-grid {
    align-items: start;
}
.app-content .ops-alerts-card .workspace-panel-head {
    align-items: center;
}
.app-content .ops-alerts-card .workspace-panel-head a {
    white-space: nowrap;
}
.app-content .ops-alerts-card .workspace-panel-body {
    gap: 12px;
}
.app-content .ops-alerts-card .alert {
    margin: 0;
}
.app-content .inline-decision-form {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}
.app-content .inline-decision-form input {
    min-width: 0;
    min-height: 35px;
    padding: 7px 9px;
    border: 1px solid #d6dce6;
    border-radius: 8px;
    background: #fff;
}
.app-content .customer-statement-query-grid {
    grid-template-columns: minmax(0, 1fr) auto !important;
}
.app-content .accounts-payable-filter-grid,
.app-content .workspace-form-grid--sessions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.app-content .security-form-actions {
    justify-content: flex-end;
    width: 100%;
}
.app-content .security-form-actions .button {
    min-width: 150px;
}
.app-content .security-user-form .professional-check-row {
    min-height: 62px;
}
.app-content .security-user-form .permission-module {
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #fbfcfe;
}
.app-content .security-user-form .permission-module + .permission-module {
    margin-top: 12px;
}
.app-content .security-user-form .permission-module summary {
    padding: 14px 16px;
}
.app-content .security-user-form .permission-grid {
    gap: 10px;
    padding: 0 16px 16px;
}
.app-content .security-user-form .permission-row {
    min-height: 62px;
    border-radius: 10px;
}
.app-content .security-user-form .permission-row select {
    min-height: 40px;
    border-color: #d3dae6;
    border-radius: 8px;
}
.app-content .security-user-form .professional-table tbody td {
    vertical-align: middle;
}
.app-content .security-actions-grid > .workspace-panel-card {
    overflow: hidden;
}
.app-content .security-actions-grid .workspace-panel-body {
    gap: 14px;
}
.app-content .security-actions-grid .form-stack {
    margin-top: 0;
}
.app-content .workspace-page .table-actions-column .button.compact {
    min-width: 96px;
}

@media (max-width: 1024px) {
    .app-content .workspace-panel-card .workspace-form-grid.compact-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .app-content .inline-decision-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .app-content .workspace-page .page-head {
        align-items: stretch;
        flex-direction: column;
    }
    .app-content .workspace-page .page-head .actions,
    .app-content .workspace-inline-actions,
    .app-content .workspace-panel-card .workspace-form-grid .actions,
    .app-content .workspace-panel-card .workspace-form-grid .form-actions,
    .app-content .security-form-actions {
        width: 100%;
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }
    .app-content .workspace-page .page-head .actions .button,
    .app-content .workspace-inline-actions .button,
    .app-content .workspace-panel-card .workspace-form-grid .actions .button,
    .app-content .workspace-panel-card .workspace-form-grid .form-actions .button,
    .app-content .workspace-panel-card .workspace-form-grid .actions a,
    .app-content .workspace-panel-card .workspace-form-grid .form-actions a,
    .app-content .security-form-actions .button,
    .app-content .security-form-actions a {
        width: 100%;
        min-width: 0;
    }
    .app-content .workspace-panel-card .workspace-form-grid,
    .app-content .workspace-panel-card .workspace-form-grid.compact-form-grid,
    .app-content .customer-statement-query-grid,
    .app-content .accounts-payable-filter-grid,
    .app-content .workspace-form-grid--sessions {
        grid-template-columns: 1fr !important;
    }
    .app-content .ops-kpi-grid {
        grid-template-columns: 1fr;
    }
    .app-content .ops-kpi-card__meta {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* v306 · Filtros legibles en Transmisiones SUNAT */
.app-content .transmission-page { gap: 18px; }
.app-content .transmission-metric-grid { margin: 0; }
.app-content .transmission-filter-card { margin: 0; }
.app-content .transmission-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.8fr) minmax(170px, .8fr) minmax(180px, .9fr) minmax(150px, .65fr) minmax(150px, .65fr) auto;
    gap: 13px 14px;
    align-items: end;
}
.app-content .transmission-filter-grid label {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: #414958;
    font: 550 12px/18px "Poppins", sans-serif;
}
.app-content .transmission-filter-grid input,
.app-content .transmission-filter-grid select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #d8dde6;
    border-radius: 9px;
    background: #fff;
    color: #273142;
    font: inherit;
}
.app-content .transmission-filter-grid input:focus,
.app-content .transmission-filter-grid select:focus {
    outline: 3px solid color-mix(in srgb, var(--color-primary, #245f93) 12%, transparent);
    border-color: color-mix(in srgb, var(--color-primary, #245f93) 48%, #d8dde6);
}
.app-content .transmission-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    white-space: nowrap;
}
.app-content .transmission-filter-actions .button {
    min-height: 42px;
    padding-inline: 15px;
}
@media (max-width: 1280px) {
    .app-content .transmission-filter-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
    .app-content .transmission-filter-search { grid-column: span 2; }
}
@media (max-width: 850px) {
    .app-content .transmission-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .app-content .transmission-filter-search { grid-column: 1 / -1; }
    .app-content .transmission-filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
    .app-content .transmission-filter-grid { grid-template-columns: 1fr; }
    .app-content .transmission-filter-search,
    .app-content .transmission-filter-actions { grid-column: auto; }
    .app-content .transmission-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .app-content .transmission-filter-actions .button { width: 100%; }
}

/* v307 · Área de pagos Culqi por empresa */
.company-payments-page{display:grid;gap:18px}.company-payments-head{align-items:flex-end;margin:0}.company-payment-company-card{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 20px;border:1px solid var(--border,#dfe5ee);border-radius:16px;background:linear-gradient(135deg,#fff,#f8fbfc);box-shadow:0 8px 24px rgba(15,23,42,.035)}.company-payment-company-card__identity{display:flex;align-items:center;gap:14px;min-width:0}.company-payment-company-card__avatar{display:grid;place-items:center;width:48px;height:48px;flex:0 0 48px;border:1px solid #b8d7d1;border-radius:13px;background:#eff8f6;color:#1f6a60;font-weight:800}.company-payment-company-card__identity>div,.company-payment-company-card__environment{display:grid;gap:2px}.company-payment-company-card small,.company-payment-company-card span:not(.company-payment-company-card__avatar){color:#7a8597;font-size:12px}.company-payment-company-card strong{color:#1f2937}.company-payment-company-card__environment{text-align:right}.company-payment-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,.75fr);gap:18px;align-items:start}.company-payment-checkout-card,.company-payment-summary-card,.company-payment-help-card{margin:0}.company-payment-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:18px}.company-payment-card-head h2{margin:2px 0 4px;font-size:1.08rem}.company-payment-card-head p{margin:0;color:#748094;font-size:.83rem;line-height:1.55}.company-payment-form{display:grid;gap:16px}.company-payment-form label{display:grid;gap:7px;color:#384250;font-size:.8rem;font-weight:650}.company-payment-form input{width:100%;min-height:44px;padding:10px 12px;border:1px solid #d6dde8;border-radius:10px;background:#fff;font:inherit}.company-payment-form input:focus{outline:3px solid rgba(39,108,98,.12);border-color:#4c8f85}.company-payment-amount-field{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:stretch}.company-payment-amount-field>span{display:grid;place-items:center;border:1px solid #d6dde8;border-right:0;border-radius:10px 0 0 10px;background:#f7f9fb;color:#536173;font-weight:800}.company-payment-amount-field input{border-radius:0 10px 10px 0}.company-payment-form label>small,.company-payment-methods>small{color:#8791a2;font-size:.7rem;font-weight:400}.company-payment-methods{display:grid;gap:8px;padding:14px;border:1px solid #e1e6ee;border-radius:12px;background:#fafbfd}.company-payment-methods>span{color:#445064;font-size:.76rem;font-weight:750}.company-payment-methods>div{display:flex;gap:8px;flex-wrap:wrap}.company-payment-method-chip{display:inline-flex;align-items:center;min-height:30px;padding:5px 10px;border:1px solid #cfe3df;border-radius:999px;background:#eff8f6;color:#276c62;font-size:.72rem;font-weight:700}.company-payment-submit{min-height:46px;justify-self:start;min-width:180px}.company-payment-security-note{margin:0;color:#7b8798!important;font-size:.72rem!important;line-height:1.55}.company-payment-feedback{padding:11px 13px;border-radius:10px;font-size:.78rem;line-height:1.45}.company-payment-feedback.is-error{background:#fff1f1;color:#9b1c1c;border:1px solid #f2c7c7}.company-payment-feedback.is-info{background:#eef6fb;color:#245d7a;border:1px solid #cfe1ec}.company-payment-feedback.is-success{background:#edf9f3;color:#216b49;border:1px solid #c8e7d7}.company-payment-side{display:grid;gap:18px}.company-payment-summary-list{display:grid;margin:0}.company-payment-summary-list>div{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid #e9edf2}.company-payment-summary-list>div:last-child{border-bottom:0}.company-payment-summary-list dt{color:#6d7788;font-size:.78rem}.company-payment-summary-list dd{margin:0;color:#253041;font-weight:800;font-variant-numeric:tabular-nums}.company-payment-help-card strong{display:block;margin-bottom:7px}.company-payment-help-card p{margin:0!important;line-height:1.6}.company-payment-history-card{margin:0;overflow:hidden}.company-payment-history-table code{font-size:.72rem;overflow-wrap:anywhere;white-space:normal}.company-payment-history-table td:nth-child(2){min-width:210px}.company-payment-history-table td:nth-child(5){min-width:190px;max-width:280px}.company-payment-form input:disabled,.company-payment-submit:disabled{opacity:.62;cursor:not-allowed}
@media(max-width:950px){.company-payment-layout{grid-template-columns:1fr}.company-payment-side{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.company-payments-head,.company-payment-company-card{align-items:flex-start;flex-direction:column}.company-payment-company-card__environment{text-align:left}.company-payment-side{grid-template-columns:1fr}.company-payment-submit{width:100%}.company-payment-history-card{overflow:auto}.company-payment-history-table{min-width:800px}}

/* v308 · Reservas de venta y entregas pendientes */
.app-content .inventory-deliveries-page .metric-grid,
.app-content .inventory-delivery-detail-page .metric-grid{margin:0}
.app-content .inventory-deliveries-page .professional-table td,
.app-content .inventory-delivery-detail-page .professional-table td{vertical-align:middle}
.app-content .inventory-deliveries-page .status-pendiente{background:#fff7ed;color:#9a5710}
.app-content .inventory-deliveries-page .status-parcial{background:#eef4ff;color:#245f93}
.app-content .inventory-deliveries-page .status-entregado{background:#ecfdf3;color:#157347}
.app-content .inventory-deliveries-page .status-cancelado{background:#f2f4f7;color:#667085}
.app-content .serial-chip-list{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}
.app-content .inventory-delivery-detail-page .workspace-panel-card .workspace-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:760px){.app-content .inventory-delivery-detail-page .workspace-panel-card .workspace-form-grid{grid-template-columns:1fr}}

/* v310 · Modal compacto de envío por WhatsApp */
.app-content .whatsapp-share-dialog .whatsapp-share-panel {
    width: min(520px, calc(100vw - 32px));
}
.app-content .whatsapp-share-icon {
    background: color-mix(in srgb, #25d366 16%, #fff);
    color: #128c4a;
}
.app-content .whatsapp-share-body {
    display: grid;
    gap: 16px;
}
.app-content .whatsapp-share-reference {
    display: grid;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid #e2e7ee;
    border-radius: 11px;
    background: #f8fafc;
}
.app-content .whatsapp-share-reference > span {
    color: #7b8493;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .035em;
}
.app-content .whatsapp-share-reference > strong {
    color: #202735;
    font-size: 14px;
}
.app-content .whatsapp-share-reference > small {
    color: #7b8493;
    font-size: 12px;
}
.app-content .whatsapp-share-field {
    display: grid;
    gap: 7px;
    color: #344054;
    font-size: 13px;
    font-weight: 650;
}
.app-content .whatsapp-share-field > small {
    color: #7b8493;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
}
.app-content .whatsapp-phone-control {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
}
.app-content .whatsapp-country-prefix {
    display: grid;
    place-items: center;
    min-width: 58px;
    padding: 0 12px;
    border: 1px solid #d6dde7;
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: #f6f8fb;
    color: #344054;
    font-weight: 700;
}
.app-content .whatsapp-phone-control input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d6dde7;
    border-radius: 0 10px 10px 0;
    background: #fff;
    color: #1f2937;
    font: inherit;
}
.app-content .whatsapp-phone-control input:focus {
    outline: 3px solid color-mix(in srgb, var(--color-primary, #245f93) 12%, transparent);
    border-color: color-mix(in srgb, var(--color-primary, #245f93) 52%, #d6dde7);
}
.app-content .whatsapp-send-button {
    background: var(--color-primary, #245f93);
}
@media (max-width: 560px) {
    .app-content .whatsapp-share-footer .actions {
        width: 100%;
    }
    .app-content .whatsapp-share-footer .actions .button {
        flex: 1;
    }
}



/* v313 · Corrección visual del modal de WhatsApp en comprobantes */
.whatsapp-share-dialog,
.app-content .whatsapp-share-dialog {
    width: min(520px, calc(100vw - 32px));
    max-width: 520px;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}
.whatsapp-share-dialog::backdrop,
.app-content .whatsapp-share-dialog::backdrop {
    background: rgba(15, 18, 31, .55);
    backdrop-filter: blur(1.5px);
}
.whatsapp-share-dialog .whatsapp-share-panel,
.app-content .whatsapp-share-dialog .whatsapp-share-panel {
    width: 100%;
    max-width: none;
    margin: 0;
    display: block;
}
.whatsapp-share-dialog .sale-completion-header,
.app-content .whatsapp-share-dialog .sale-completion-header {
    align-items: flex-start;
}
.whatsapp-share-dialog .whatsapp-share-body,
.app-content .whatsapp-share-dialog .whatsapp-share-body {
    display: grid;
    gap: 16px;
}
.whatsapp-share-dialog .whatsapp-share-reference,
.app-content .whatsapp-share-dialog .whatsapp-share-reference {
    display: grid;
    gap: 3px;
    padding: 14px 16px;
    border: 1px solid #e2e7ee;
    border-radius: 12px;
    background: #f8fafc;
}
.whatsapp-share-dialog .whatsapp-share-field,
.app-content .whatsapp-share-dialog .whatsapp-share-field {
    display: grid;
    gap: 8px;
}
.whatsapp-share-dialog .whatsapp-share-footer,
.app-content .whatsapp-share-dialog .whatsapp-share-footer {
    justify-content: flex-end;
}
.whatsapp-share-dialog .whatsapp-share-footer > div:first-child,
.app-content .whatsapp-share-dialog .whatsapp-share-footer > div:first-child {
    display: none;
}
.whatsapp-share-dialog .whatsapp-share-footer .actions,
.app-content .whatsapp-share-dialog .whatsapp-share-footer .actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.whatsapp-share-dialog .whatsapp-share-footer .button,
.app-content .whatsapp-share-dialog .whatsapp-share-footer .button {
    min-width: 110px;
}
.whatsapp-share-dialog .whatsapp-phone-control,
.app-content .whatsapp-share-dialog .whatsapp-phone-control {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: stretch;
}
.whatsapp-share-dialog .whatsapp-country-prefix,
.app-content .whatsapp-share-dialog .whatsapp-country-prefix {
    min-width: 72px;
    border-radius: 10px 0 0 10px;
    font-weight: 800;
}
.whatsapp-share-dialog .whatsapp-phone-control input,
.app-content .whatsapp-share-dialog .whatsapp-phone-control input {
    min-height: 46px;
    border-radius: 0 10px 10px 0;
}
@media (max-width: 560px) {
    .whatsapp-share-dialog,
    .app-content .whatsapp-share-dialog {
        width: calc(100vw - 18px);
        max-width: none;
    }
    .whatsapp-share-dialog .whatsapp-share-footer .actions,
    .app-content .whatsapp-share-dialog .whatsapp-share-footer .actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .whatsapp-share-dialog .whatsapp-share-footer .button,
    .app-content .whatsapp-share-dialog .whatsapp-share-footer .button {
        min-width: 0;
        width: 100%;
    }
}

/* v311 · Alta de producto: datos SUNAT integrados en General */
.app-content .product-general-tax-block{margin-top:2px;padding:14px 16px 16px;border:1px solid #e1e6ee;border-radius:12px;background:#f9fbfe}.app-content .product-general-tax-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.app-content .product-general-tax-head>div{display:grid;gap:2px}.app-content .product-general-tax-head strong{color:#243041;font-size:13px;font-weight:700}.app-content .product-general-tax-head small{color:#7a8495;font-size:11px;line-height:1.45}.app-content .product-general-tax-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px}.app-content .product-general-tax-grid label{min-width:0}.app-content .product-general-tax-grid input,.app-content .product-general-tax-grid select{width:100%;min-width:0}@media(max-width:900px){.app-content .product-general-tax-grid{grid-template-columns:1fr 1fr}}@media(max-width:620px){.app-content .product-general-tax-grid{grid-template-columns:1fr}.app-content .product-general-tax-block{padding:13px 14px 14px}}

/* v314 · Visibilidad de importación de clientes y proveedores */
.app-content .compact-page-head > .actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.app-content .entity-import-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}.app-content .entity-import-trigger>span{font-size:14px;line-height:1}@media(max-width:760px){.app-content .compact-page-head>.actions{width:100%}.app-content .compact-page-head>.actions .button{flex:1;min-width:140px}}


/* v315 · Footer siempre visible en importaciones XLSX */
.product-import-modal .app-modal-panel {
    max-height: min(88vh, 760px);
    overflow: hidden;
}
.product-import-modal .import-modal-form {
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
}
.product-import-modal .product-import-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
.product-import-modal .app-modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: #fff;
    box-shadow: 0 -8px 22px rgba(15, 23, 42, .045);
}
.product-import-modal .import-modal-submit {
    min-width: 150px;
}
.product-import-modal .import-modal-submit:disabled {
    cursor: not-allowed;
    opacity: .55;
}
@media (max-width: 620px) {
    .product-import-modal .app-modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .product-import-modal .app-modal-footer .button {
        width: 100%;
        min-width: 0;
    }
}


/* v316 · Mejora visual del footer en modales de importación */
.product-import-modal {
    width: min(680px, calc(100vw - 24px));
    max-width: 680px;
    max-height: min(calc(100vh - 24px), 760px);
    padding: 0;
    overflow: hidden;
}
.product-import-modal .app-modal-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(calc(100vh - 24px), 760px);
    overflow: hidden;
}
.product-import-modal .app-modal-header {
    flex: 0 0 auto;
}
.product-import-modal .import-modal-form {
    min-height: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow: hidden;
}
.product-import-modal .product-import-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-bottom: 18px;
}
.product-import-modal .app-modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin-top: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #e4e8ef;
    box-shadow: 0 -12px 26px rgba(15, 23, 42, .06);
}
.product-import-modal .app-modal-footer .button {
    min-width: 160px;
    min-height: 46px;
    border-radius: 12px;
    font-weight: 700;
}
.product-import-modal .app-modal-footer .button.secondary {
    border-color: #d8deea;
    background: #fff;
    color: #2e3645;
}
.product-import-modal .app-modal-footer .button.secondary:hover {
    background: #f8fafc;
}
.product-import-modal .import-modal-submit {
    box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
}
.product-import-modal .import-modal-submit:disabled {
    box-shadow: none;
    opacity: .58;
}
@media (max-width: 620px) {
    .product-import-modal {
        width: calc(100vw - 14px);
        max-height: calc(100vh - 14px);
    }
    .product-import-modal .app-modal-panel {
        max-height: calc(100vh - 14px);
    }
    .product-import-modal .app-modal-footer {
        grid-template-columns: 1fr 1fr;
        display: grid;
        gap: 10px;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .product-import-modal .app-modal-footer .button {
        width: 100%;
        min-width: 0;
        min-height: 44px;
    }
}


/* v317 · Corrección definitiva de botones en modales de importación XLSX */
.product-import-modal,
.app-content .product-import-modal {
    width: min(680px, calc(100vw - 24px));
    max-width: 680px;
    height: min(84vh, 760px);
    max-height: min(84vh, 760px);
    padding: 0;
    overflow: hidden;
}
.product-import-modal .app-modal-panel,
.app-content .product-import-modal .app-modal-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}
.product-import-modal .app-modal-header,
.app-content .product-import-modal .app-modal-header {
    min-height: 0;
    flex: none;
}
.product-import-modal .import-modal-form,
.app-content .product-import-modal .import-modal-form {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
}
.product-import-modal .product-import-content,
.app-content .product-import-modal .product-import-content {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-bottom: 20px;
}
.product-import-modal .app-modal-footer,
.app-content .product-import-modal .app-modal-footer {
    position: relative;
    inset: auto;
    z-index: 5;
    margin: 0;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px 14px !important;
    border-top: 1px solid #e3e8ef;
    background: #fff;
    box-shadow: 0 -8px 20px rgba(15,23,42,.055);
}
.product-import-modal .app-modal-footer .button,
.app-content .product-import-modal .app-modal-footer .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 44px;
    margin: 0;
    border-radius: 10px;
}
.product-import-modal .import-modal-submit,
.app-content .product-import-modal .import-modal-submit {
    opacity: 1;
}
.product-import-modal .import-modal-submit:disabled,
.app-content .product-import-modal .import-modal-submit:disabled {
    opacity: .5;
    cursor: not-allowed;
}
@media (max-width: 620px) {
    .product-import-modal,
    .app-content .product-import-modal {
        width: calc(100vw - 12px);
        height: calc(100vh - 12px);
        max-height: calc(100vh - 12px);
    }
    .product-import-modal .app-modal-footer,
    .app-content .product-import-modal .app-modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 10px 12px 12px !important;
    }
    .product-import-modal .app-modal-footer .button,
    .app-content .product-import-modal .app-modal-footer .button {
        width: 100%;
        min-width: 0;
    }
}


/* v319 · Nivelación profesional de encabezados y filtros de catálogo */
.app-content .catalog-list-page > .compact-page-head {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    align-items: center;
    gap: 24px;
    min-height: 72px !important;
    margin: 0 0 16px !important;
}
.app-content .catalog-list-page > .compact-page-head .page-title-inline {
    align-items: center;
    min-width: 260px;
}
.app-content .catalog-list-page > .compact-page-head .page-title-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 11px;
}
.app-content .catalog-list-page > .compact-page-head h1 {
    margin: 0 0 3px;
    line-height: 1.12;
}
.app-content .catalog-list-page > .compact-page-head p {
    line-height: 1.4;
}
.app-content .catalog-list-page .catalog-primary-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
}
.app-content .catalog-list-page .catalog-primary-actions form {
    display: flex;
    align-items: center;
    margin: 0;
}
.app-content .catalog-list-page .catalog-primary-actions .button,
.app-content .catalog-list-page .catalog-primary-actions form .button {
    min-height: 46px;
    height: 46px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    white-space: nowrap;
    line-height: 1;
}
.app-content .catalog-list-page .professional-data-card > .data-grid-toolbar {
    min-height: 70px;
    padding: 14px 20px;
}
.app-content .catalog-list-page .data-grid-filters {
    grid-template-columns: minmax(360px, 1.75fr) minmax(210px, .55fr) minmax(210px, .55fr) auto;
    gap: 14px;
    align-items: end;
    max-height: 132px;
    padding: 16px 20px 18px;
}
.app-content .catalog-list-page .data-grid-filters label {
    gap: 7px;
    min-width: 0;
}
.app-content .catalog-list-page .data-grid-filters input,
.app-content .catalog-list-page .data-grid-filters select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    height: 48px;
    padding: 0 14px;
    border-radius: 11px;
    box-sizing: border-box;
}
.app-content .catalog-list-page .data-grid-filters .filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
}
.app-content .catalog-list-page .data-grid-filters .filter-actions .button {
    min-height: 48px;
    height: 48px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
}
.app-content .catalog-list-page .filter-label-line {
    min-height: 19px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.app-content .catalog-list-page .filter-status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-primary-soft, #eef4fb) 80%, #fff);
    color: var(--color-primary, #245f93);
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}
@media (max-width: 1500px) {
    .app-content .catalog-list-page > .compact-page-head {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 14px;
    }
    .app-content .catalog-list-page .catalog-primary-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}
@media (max-width: 1180px) {
    .app-content .catalog-list-page .data-grid-filters {
        grid-template-columns: minmax(320px, 1.5fr) repeat(2, minmax(180px, .7fr));
        max-height: 210px;
    }
    .app-content .catalog-list-page .data-grid-filters .filter-actions {
        grid-column: 1 / -1;
    }
}
@media (max-width: 820px) {
    .app-content .catalog-list-page .data-grid-filters {
        grid-template-columns: 1fr 1fr;
        max-height: 300px;
    }
    .app-content .catalog-list-page .data-grid-filters .filter-grow {
        grid-column: 1 / -1;
    }
    .app-content .catalog-list-page .data-grid-filters .filter-actions {
        grid-column: 1 / -1;
    }
}
@media (max-width: 620px) {
    .app-content .catalog-list-page > .compact-page-head {
        gap: 12px;
    }
    .app-content .catalog-list-page .catalog-primary-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
    .app-content .catalog-list-page .catalog-primary-actions form,
    .app-content .catalog-list-page .catalog-primary-actions .button,
    .app-content .catalog-list-page .catalog-primary-actions form .button {
        width: 100%;
    }
    .app-content .catalog-list-page .data-grid-filters {
        grid-template-columns: 1fr;
        max-height: 430px;
    }
    .app-content .catalog-list-page .data-grid-filters .filter-grow,
    .app-content .catalog-list-page .data-grid-filters .filter-actions {
        grid-column: auto;
    }
    .app-content .catalog-list-page .data-grid-filters .filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .app-content .catalog-list-page .data-grid-filters .filter-actions .button {
        width: 100%;
    }
}


/* === v320 · venta por importe + gestión profesional de series === */
.product-amount-mode { border:1px solid #dfe6f3; border-radius:12px; background:#f8fbff; padding:12px 14px; }
.product-amount-mode-check { display:flex!important; align-items:flex-start; gap:10px; margin:0; }
.product-amount-mode-check input { margin-top:4px; }
.product-amount-mode-check span { display:grid; gap:3px; }
.product-amount-mode-check strong { color:#25324a; }
.product-amount-mode-check small { color:#6f7a90; line-height:1.4; font-weight:400; }
.sale-line-total-input { width:92px; min-width:82px; border:0; background:transparent; text-align:right; font:inherit; font-weight:650; color:inherit; padding:6px 5px; border-radius:7px; }
.sale-line-total-input[readonly] { pointer-events:none; }
.sale-line-total-input.is-editable { border:1px solid var(--ui-primary,#316fe8); background:#fff; box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-primary,#316fe8) 10%,transparent); }
.terminal-pos-line-amount input { width:88px; min-height:34px; border:1px solid #cfd8e7; border-radius:8px; padding:5px 7px; text-align:right; font:inherit; font-weight:700; background:#fff; }
.branch-series-dialog-v65 { height:min(860px,calc(100vh - 20px)); }
.branch-series-panel-v65 { height:100%; max-height:none; }
.branch-series-body-v65 { flex:1 1 auto; overflow:hidden; }
.branch-series-list-v65 { display:flex; flex-direction:column; min-height:0; }
.branch-series-table-wrap-v65 { flex:1 1 auto; min-height:260px; max-height:none; overflow:auto; scrollbar-gutter:stable; }
.branch-series-default-badge-v320 { margin-bottom:4px; background:#e9f7ef!important; color:#176b42!important; border-color:#bfe7cf!important; }
.branch-series-delete-v320 { border:1px solid #f0c7ce; border-radius:7px; padding:6px 8px; background:#fff7f8; color:#b4233c; font:inherit; font-size:10.5px; cursor:pointer; }
.branch-series-delete-v320:hover { background:#ffecef; }
.branch-series-default-check-v320 { margin-top:-3px; }
@media (max-width:940px){ .branch-series-body-v65{overflow:auto;} .branch-series-dialog-v65{height:auto;} }

/* === v321 · series: acciones visibles y tabla navegable === */
.branch-series-table-inner-v65 th:last-child,.branch-series-table-inner-v65 td:last-child{position:sticky;right:0;z-index:2;background:#fff;box-shadow:-8px 0 12px -12px rgba(31,41,55,.45)}
.branch-series-table-inner-v65 th:last-child{z-index:3;background:#fbfcfe}
.branch-series-row-actions-v65{justify-content:flex-end;min-width:205px}
.branch-series-edit-v65.is-disabled,.branch-series-delete-v320.is-disabled{opacity:.45;cursor:not-allowed;filter:grayscale(.15)}
.branch-series-table-wrap-v65{max-height:min(52vh,520px);overflow:auto}
.branch-series-table-inner-v65{min-width:790px}
@media(max-width:940px){.branch-series-table-wrap-v65{max-height:460px}.branch-series-row-actions-v65{min-width:190px}}

/* v320.0.2 · POS por importe exacto + editor de series siempre accesible */
.terminal-pos-cart-line.has-amount { grid-template-columns:minmax(145px,1fr) 90px 102px 120px 42px; column-gap:8px; }
.terminal-pos-cart-line.has-amount .terminal-pos-qty input { width:100%; min-width:0; }
.terminal-pos-cart-line.has-amount .terminal-pos-line-money input { width:100%; min-width:0; box-sizing:border-box; }
.terminal-pos-cart-line.has-amount .terminal-pos-line-amount input { width:100%; min-width:0; }
.branch-series-editor-v65 { max-height:100%; min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.branch-series-form-actions-v65 { position:sticky; bottom:0; z-index:4; margin:4px -2px -2px; padding:12px 2px 2px; background:linear-gradient(to bottom,rgba(251,252,254,0),#fbfcfe 18px,#fbfcfe); }
@media (max-width:1180px) { .terminal-pos-cart-line.has-amount { grid-template-columns:minmax(130px,1fr) 82px 94px 112px 40px; } }
@media (max-width:940px) { .branch-series-editor-v65 { max-height:none; overflow:visible; } .branch-series-form-actions-v65 { position:static; } }
