:root {
    --navy-950: #0b1535;
    --navy-900: #111d43;
    --navy-800: #172554;
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --slate-900: #172033;
    --slate-700: #42506a;
    --slate-500: #718096;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --surface: #ffffff;
    --canvas: #f5f7fb;
    --danger: #dc2626;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 12px 30px rgba(15, 23, 42, .08);
    --radius: 14px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--slate-900);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { color: #1d4ed8; }
button, input, select, textarea { font: inherit; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    overflow-y: auto;
    padding: 26px 18px;
    color: #dbe5ff;
    background: linear-gradient(180deg, var(--navy-950), var(--navy-900));
}

.brand { display: flex; align-items: center; gap: 11px; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    color: white;
    background: linear-gradient(145deg, #60a5fa, #2563eb);
    box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
    font-size: 19px;
    font-weight: 800;
}
.brand strong { display: block; font-size: 19px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: -3px; color: #91a4cf; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }

.tenant-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 24px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
}
.tenant-avatar { display: grid; width: 35px; height: 35px; flex: 0 0 auto; color: #bfdbfe; border: 1px solid rgba(147, 197, 253, .22); border-radius: 9px; background: rgba(37, 99, 235, .2); font-size: 14px; font-weight: 800; place-items: center; }
.tenant-copy { display: flex; min-width: 0; flex-direction: column; }
.tenant-card strong { overflow: hidden; color: #fff; text-overflow: ellipsis; white-space: nowrap; }
.tenant-label { color: #91a4cf; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.status-dot { margin-top: 5px; color: #a7f3d0; font-size: 11px; }
.status-dot i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #34d399; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-section { margin: 18px 11px 5px; color: #6f83b2; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #c3cfea; font-size: 14px; font-weight: 500; transition: .18s ease; }
.sidebar-nav a:hover { color: #fff; background: rgba(96, 165, 250, .13); transform: translateX(2px); }
.nav-icon { display: grid; width: 22px; color: #7ea2e8; place-items: center; font-size: 17px; }
.sidebar-footer { margin: 28px 10px 0; padding-top: 18px; border-top: 1px solid rgba(148, 163, 184, .12); }
.sidebar-footer span, .sidebar-footer strong { display: block; }
.sidebar-footer span { color: #6f83b2; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-footer strong { margin-top: 3px; color: #9aabd0; font-size: 11px; font-weight: 500; }

.app-main { min-width: 0; width: calc(100% - 260px); margin-left: 260px; }
.topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    padding: 13px 34px;
    border-bottom: 1px solid var(--slate-200);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
}
.topbar > div:first-child { display: flex; flex-direction: row; }
.topbar-kicker { color: var(--slate-500); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.topbar strong { font-size: 15px; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; width: 36px; height: 36px; color: white; border-radius: 50%; background: linear-gradient(145deg, #2563eb, #7c3aed); font-weight: 700; place-items: center; }
.user-copy { display: flex; flex-direction: column; min-width: 100px; margin-right: 4px; }
.user-copy strong { font-size: 13px; }
.user-copy small { color: var(--slate-500); font-size: 11px; }
.inline-form { display: inline; }

.content-wrapper { width: min(1180px, 100%); margin: 0 auto; padding: 38px 34px 60px; }
.content-wrapper > h2, .content-wrapper > h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.035em; }
.content-wrapper > h2 + a { display: inline-flex; margin: 8px 0 18px; padding: 9px 14px; color: #fff; border-radius: 9px; background: var(--blue-600); font-size: 13px; font-weight: 700; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 26px; }
.page-heading h1 { margin: 3px 0 3px; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.045em; line-height: 1.15; }
.page-heading p, .section-title p { margin: 0; color: var(--slate-500); }
.eyebrow { color: var(--blue-600); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 700; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--blue-600); box-shadow: 0 7px 15px rgba(37, 99, 235, .18); }
.button-primary:hover { color: #fff; background: #1d4ed8; }
.button-secondary { color: var(--slate-700); border-color: var(--slate-200); background: #fff; }
.button-secondary:hover { color: var(--slate-900); border-color: var(--slate-300); }
.button-ghost { min-height: 34px; padding: 6px 10px; color: var(--slate-500); border-color: var(--slate-200); background: transparent; }
.button-danger { color: #fff; background: var(--danger); }
.button-block { width: 100%; }

.welcome-panel { position: relative; display: flex; min-height: 190px; overflow: hidden; align-items: center; justify-content: space-between; margin-bottom: 34px; padding: 33px 38px; color: #fff; border-radius: 19px; background: linear-gradient(115deg, #172554 5%, #1e3a8a 62%, #2563eb); box-shadow: 0 18px 40px rgba(30, 58, 138, .18); }
.welcome-panel::after { position: absolute; right: 80px; width: 250px; height: 250px; border: 45px solid rgba(255,255,255,.05); border-radius: 50%; content: ""; }
.welcome-panel > div { position: relative; z-index: 1; max-width: 610px; }
.welcome-label { color: #93c5fd; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.welcome-panel h2 { margin: 8px 0 7px; font-size: 26px; letter-spacing: -.035em; }
.welcome-panel p { margin: 0; color: #cbd9f5; }
.welcome-visual { position: relative; z-index: 1; display: grid; width: 92px; height: 92px; color: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.25); border-radius: 24px; background: rgba(255,255,255,.1); font-size: 45px; font-weight: 800; place-items: center; transform: rotate(5deg); }

.section-title { display: flex; justify-content: space-between; margin-bottom: 15px; }
.section-title h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.section-title p { font-size: 13px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.quick-card { display: grid; min-height: 112px; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 19px; color: var(--slate-900); border: 1px solid var(--slate-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); transition: .2s ease; }
.quick-card:hover { color: var(--slate-900); border-color: #bfdbfe; box-shadow: var(--shadow-md); transform: translateY(-3px); }
.quick-card > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.quick-card strong { font-size: 14px; }
.quick-card small { margin-top: 2px; color: var(--slate-500); font-size: 11px; }
.quick-card i { color: var(--slate-300); font-size: 19px; font-style: normal; }
.quick-icon { display: grid; width: 42px; height: 42px; border-radius: 12px; font-size: 20px; place-items: center; }
.accent-blue { color: #2563eb; background: #eff6ff; }
.accent-violet { color: #7c3aed; background: #f5f3ff; }
.accent-amber { color: #d97706; background: #fffbeb; }
.accent-green { color: #059669; background: #ecfdf5; }

.setup-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 22px 24px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: #fff; }
.setup-card > div { display: flex; align-items: center; gap: 16px; }
.setup-card p { margin: 2px 0 0; color: var(--slate-500); font-size: 13px; }
.setup-number { display: grid; width: 43px; height: 43px; color: var(--blue-600); border-radius: 50%; background: #eff6ff; font-size: 12px; font-weight: 800; place-items: center; }

table { width: 100%; overflow: hidden; margin-top: 2px; border: 1px solid var(--slate-200) !important; border-collapse: separate; border-spacing: 0; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
th, td { padding: 14px 16px !important; border: 0; border-bottom: 1px solid var(--slate-200); text-align: left; vertical-align: middle; }
th { color: var(--slate-500); background: #f8fafc; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
td { color: var(--slate-700); font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcff; }
td:last-child { white-space: nowrap; }
td:last-child a { display: inline-flex; padding: 5px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
td:last-child a:last-child { color: var(--danger); }
td:last-child a:hover { background: var(--slate-100); }
.status-badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.status-badge::before { width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; content: ""; }
.status-badge.is-active { color: #047857; background: #ecfdf5; }
.status-badge.is-active::before { background: #10b981; }
.status-badge.is-inactive { color: #64748b; background: #f1f5f9; }
.status-badge.is-inactive::before { background: #94a3b8; }
.status-badge.is-low { color: #92400e; background: #fffbeb; }
.status-badge.is-low::before { background: #f59e0b; }
.status-badge.is-minimum { color: #9a3412; background: #fff7ed; }
.status-badge.is-minimum::before { background: #f97316; }
.status-badge.is-empty { color: #991b1b; background: #fef2f2; }
.status-badge.is-empty::before { background: #ef4444; }
.filter-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.filter-form label { margin: 0; }
.filter-form select { width: auto; min-width: 180px; }
.stock-detail { display: block; color: var(--slate-500); white-space: normal; }
.item-type-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.item-type-badge.is-product { color: #1d4ed8; background: #eff6ff; }
.item-type-badge.is-service { color: #6d28d9; background: #f5f3ff; }

.content-wrapper > form:not(.inline-form):not(.confirm-actions):not(.list-toolbar) { max-width: 760px; margin-top: 18px; padding: 26px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.content-wrapper form p { margin: 0 0 17px; }
label { display: block; margin-bottom: 6px; color: var(--slate-700); font-size: 12px; font-weight: 700; }
input:not([type="checkbox"]):not([type="hidden"]), select, textarea { width: 100%; min-height: 43px; padding: 9px 12px; color: var(--slate-900); border: 1px solid var(--slate-300); border-radius: 8px; outline: none; background: #fff; transition: .15s ease; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--blue-600); vertical-align: middle; }
.content-wrapper form button[type="submit"]:not(.button) { display: inline-flex; min-height: 40px; align-items: center; padding: 9px 17px; color: #fff; border: 0; border-radius: 9px; background: var(--blue-600); cursor: pointer; font-weight: 700; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--slate-200); }
.form-actions .button { min-width: 108px; }
.content-wrapper > form + a { display: inline-block; margin-top: 14px; color: var(--slate-500); font-size: 13px; font-weight: 700; }
.errorlist { margin: 5px 0; padding: 0; color: var(--danger); list-style: none; font-size: 12px; }
.lookup-panel { display: grid; margin-bottom: 22px; padding: 16px; gap: 12px; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; }
.lookup-panel[hidden] { display: none; }
.lookup-panel strong, .lookup-panel small { display: block; }
.lookup-panel h3 { margin: 0; font-size: 19px; }
.lookup-copy { margin: 0 !important; color: var(--slate-600); font-size: 13px; }
.lookup-panel small { margin-top: 3px; color: var(--slate-500); }
.lookup-panel .button { justify-self: start; }
.lookup-status { min-height: 18px; color: var(--slate-600); font-size: 12px; font-weight: 650; }
.lookup-status[data-state="success"] { color: #047857; }
.lookup-status[data-state="warning"] { color: #92400e; }
.lookup-status[data-state="error"] { color: var(--danger); }
.helptext { display: block; margin-top: 6px; color: var(--slate-500); font-size: 11px; }

.confirm-card { max-width: 560px; margin: 70px auto; padding: 38px; text-align: center; border: 1px solid var(--slate-200); border-radius: 18px; background: #fff; box-shadow: var(--shadow-md); }
.danger-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 18px; color: var(--danger); border-radius: 50%; background: #fef2f2; font-size: 24px; font-weight: 800; place-items: center; }
.confirm-card h1 { margin: 7px 0; font-size: 27px; }
.confirm-card p { margin: 0 auto; color: var(--slate-500); }
.confirm-actions { display: flex; justify-content: center; gap: 10px; margin-top: 25px; }
.notice-card { max-width: 680px; margin: 55px auto; padding: 42px; text-align: center; border: 1px solid var(--slate-200); border-radius: 18px; background: #fff; box-shadow: var(--shadow-md); }
.notice-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 18px; color: var(--blue-600); border-radius: 50%; background: #eff6ff; font-size: 23px; font-family: Georgia, serif; font-weight: 700; place-items: center; }
.notice-card h1 { margin: 7px 0 10px; font-size: 28px; letter-spacing: -.035em; }
.notice-card p { max-width: 570px; margin: 0 auto; color: var(--slate-500); }
.notice-actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }

.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(390px, 46%) 1fr; background: #fff; }
.auth-showcase { display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 44px 55px; color: #fff; background: radial-gradient(circle at 80% 20%, rgba(59,130,246,.38), transparent 30%), linear-gradient(145deg, #0b1535, #172554 60%, #1e3a8a); }
.brand-light { align-self: flex-start; }
.showcase-copy { max-width: 520px; }
.showcase-copy h1 { margin: 13px 0 18px; font-size: clamp(43px, 5vw, 70px); letter-spacing: -.06em; line-height: .98; }
.showcase-copy p { max-width: 480px; margin: 0; color: #bfcef0; font-size: 17px; line-height: 1.7; }
.eyebrow-light { color: #93c5fd; }
.showcase-footer { margin: 0; color: #8296c2; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.auth-content { display: grid; min-height: 100vh; padding: 40px; place-items: center; }
.auth-card { width: min(410px, 100%); }
.auth-card h2 { margin: 7px 0 3px; font-size: 32px; letter-spacing: -.045em; }
.muted { margin: 0 0 28px; color: var(--slate-500); }
.field-group { margin-bottom: 18px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.field-label-row label { margin-bottom: 6px; }
.field-label-row a { margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.login-form .button { margin-top: 8px; }
.login-help { margin-top: 22px; color: var(--slate-500); text-align: center; font-size: 12px; }
.auth-back-link { display: block; margin-top: 22px; color: var(--slate-500); text-align: center; font-size: 12px; font-weight: 700; }
.auth-state { text-align: center; }
.state-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 18px; color: #047857; border-radius: 50%; background: #ecfdf5; font-size: 24px; font-weight: 800; place-items: center; }
.password-form ul { margin: -8px 0 18px; padding-left: 18px; color: var(--slate-500); font-size: 11px; }
.password-form .helptext { display: block; margin-top: 6px; color: var(--slate-500); font-size: 11px; }
.form-alert, .message { margin-bottom: 18px; padding: 11px 13px; color: #991b1b; border: 1px solid #fecaca; border-radius: 8px; background: #fef2f2; font-size: 13px; }
.message-success, .message-info { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }
.message-warning { color: #92400e; border-color: #fde68a; background: #fffbeb; }

/* Punto de venta */
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 20px; }
/* La columna se ajusta a su espacio: un contenido ancho (como el XML) se
   desplaza dentro de su recuadro en vez de invadir la columna vecina. */
.pos-main, .pos-side { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.panel { padding: 20px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.panel h2 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.02em; }
.panel-subtitle { margin: 18px 0 8px; font-size: 14px; }
.panel table { box-shadow: none; }
.panel th, .panel td { padding: 10px 12px !important; }
.pos-search { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.pos-search-query { flex: 1 1 260px; }
.pos-search-qty { flex: 0 0 110px; }
.pos-inline { display: flex; gap: 8px; }
.qty-form, .discount-form { display: flex; align-items: center; gap: 6px; }
.qty-form input { width: 92px !important; min-height: 36px !important; }
.discount-form input { width: 130px !important; min-height: 34px !important; text-align: right; }
.totals { display: grid; grid-template-columns: 1fr auto; margin: 0 0 12px; gap: 7px 12px; }
.totals dt { color: var(--slate-500); font-size: 13px; }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .totals-total { padding-top: 8px; border-top: 1px solid var(--slate-200); color: var(--slate-900); font-size: 21px; font-weight: 800; }
.totals-tax { padding-top: 10px; border-top: 1px dashed var(--slate-200); font-size: 12px; }
.payment-list { margin: 0 0 14px; padding: 0; list-style: none; }
.payment-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; padding: 8px 0; gap: 8px; border-bottom: 1px solid var(--slate-100); }
.payment-list small { display: block; color: var(--slate-500); }
.payment-form p { margin: 0 0 10px !important; }
.button-large { min-height: 52px; font-size: 16px; }
.button[disabled] { cursor: not-allowed; opacity: .5; transform: none; }
.text-danger { color: var(--danger); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 20px; gap: 12px; }
.summary-card { padding: 14px 16px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; }
.summary-card span { display: block; color: var(--slate-500); font-size: 12px; font-weight: 700; }
.summary-card strong { font-size: 21px; font-variant-numeric: tabular-nums; }
.pagination { display: flex; align-items: center; justify-content: center; margin-top: 18px; gap: 16px; font-size: 13px; }
.cancel-form { margin-top: 18px; text-align: left; }
.filter-form input { width: auto; }

@media (max-width: 1000px) {
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .pos-layout { grid-template-columns: 1fr; }
    .auth-showcase { padding: 38px; }
}

@media (max-width: 760px) {
    .topbar { min-height: 66px; padding: 10px 14px; }
    .topbar-title, .user-copy { display: none; }
    .content-wrapper { padding: 27px 18px 45px; }
    .page-heading, .setup-card { align-items: flex-start; flex-direction: column; }
    .welcome-panel { padding: 27px; }
    .welcome-visual { display: none; }
    .quick-grid { grid-template-columns: 1fr; }
    table:not(.data-table) { display: block; overflow-x: auto; white-space: nowrap; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-showcase { min-height: auto; padding: 24px; }
    .showcase-copy, .showcase-footer { display: none; }
    .auth-content { min-height: calc(100vh - 87px); padding: 30px 24px; }
}

@media (max-width: 430px) {
    .topbar-kicker { display: none; }
    .welcome-panel h2 { font-size: 22px; }
    .confirm-card { margin: 25px auto; padding: 27px 20px; }
    .confirm-actions { flex-direction: column-reverse; }
    .form-actions { align-items: stretch; flex-direction: column; }
    .form-actions .button { width: 100%; }
}

/* Selector de sucursal del punto de venta */
.branch-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.branch-tile { display: grid; min-height: 120px; align-content: center; gap: 4px; padding: 20px; color: var(--slate-900); border: 2px solid var(--slate-200); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.branch-tile:hover { color: var(--slate-900); border-color: var(--blue-500); }
.branch-tile strong { font-size: 20px; }
.branch-tile small { color: var(--slate-500); }
.branch-tile-code { justify-self: start; padding: 2px 10px; color: var(--blue-600); border-radius: 999px; background: #eff6ff; font-size: 12px; font-weight: 800; }

/* Pantallas táctiles: objetivos de toque más grandes en toda la aplicación. */
@media (pointer: coarse) {
    .button { min-height: 48px; padding: 12px 18px; font-size: 15px; }
    input:not([type="checkbox"]):not([type="hidden"]), select, textarea { min-height: 50px; font-size: 16px; }
    input[type="checkbox"] { width: 24px; height: 24px; }
    .sidebar-nav a { min-height: 48px; }
    td a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 6px; }
}

/* Alertas de stock mínimo */
.nav-badge { display: inline-grid; min-width: 22px; height: 22px; margin-left: auto; padding: 0 6px; color: #fff; border-radius: 999px; background: #dc2626; font-size: 12px; font-weight: 800; place-items: center; }
.alert-banner { margin-bottom: 18px; padding: 12px 14px; color: #92400e; border: 1px solid #fde68a; border-radius: 10px; background: #fffbeb; }
.alert-banner a { margin-left: 8px; font-weight: 700; }
.checkbox-filter { display: inline-flex; align-items: center; gap: 8px; min-height: 43px; margin: 0; }
.alert-card { margin-bottom: 26px; padding: 20px 22px; border: 1px solid #fde68a; border-radius: 16px; background: #fffbeb; }
.alert-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.alert-card h2 { margin: 2px 0 0; font-size: 20px; }
.alert-card ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.alert-card li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #fff; }
.alert-card li small { display: block; color: var(--slate-500); }

/* Integraciones */
.info-panel { display: grid; gap: 4px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; font-size: 14px; }
.info-panel code, .key-card code { word-break: break-all; }
.key-box { display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; padding: 12px; border: 2px dashed var(--blue-500); border-radius: 12px; background: #f8fafc; text-align: left; }
.key-box code { flex: 1; font-size: 14px; }
.section-heading { margin: 34px 0 12px; font-size: 20px; }

/* Documentos electrónicos */
.detail-list { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); margin: 0; gap: 10px 18px; }
.detail-list dt { color: var(--slate-500); font-size: 13px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.detail-list code { font-size: 13px; }
.xml-preview { max-width: 100%; max-height: 420px; margin: 0; padding: 14px; overflow: auto; color: #e2e8f0; border-radius: 10px; background: #0f172a; font-size: 12px; line-height: 1.5; white-space: pre; }
.timeline { display: grid; gap: 12px; margin: 0; padding-left: 18px; }
.timeline li span, .timeline li small { display: block; }
.timeline li small { color: var(--slate-500); }
.stacked-form p { margin: 0 0 12px; }
.einvoice-row { display: grid; gap: 4px; margin: 0 0 12px; }

/* Métricas de usabilidad */
.summary-card small { display: block; color: var(--slate-500); font-size: 12px; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin-bottom: 20px; }
.metric-table { box-shadow: none; }
.metric-bar { display: inline-block; width: 120px; height: 10px; margin-right: 8px; overflow: hidden; vertical-align: middle; border-radius: 4px; background: var(--slate-100); }
.metric-bar span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--blue-600); }
.metrics-users { margin-bottom: 14px; }

/* ------------------------------------------------------------------
   Navegación: secciones plegables, pantalla completa y panel deslizable
   ------------------------------------------------------------------ */
.sidebar { z-index: 40; display: flex; flex-direction: column; transition: transform .25s ease, visibility .25s; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sidebar-close { display: none; width: 44px; height: 44px; color: #dbe5ff; border: 1px solid rgba(148,163,184,.3); border-radius: 12px; background: transparent; font-size: 24px; place-items: center; cursor: pointer; }
.sidebar-nav { flex: 1; }
.sidebar-nav a.nav-link, .nav-group-toggle { min-height: 46px; }
.nav-group-toggle { display: flex; width: 100%; align-items: center; gap: 11px; padding: 10px 12px; color: #e2e9fb; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.nav-group-toggle:hover, .nav-group.is-open > .nav-group-toggle { background: rgba(96, 165, 250, .13); }
.nav-chevron { margin-left: auto; color: #7ea2e8; font-size: 20px; line-height: 1; transition: transform .2s ease; }
.nav-group-toggle .nav-badge { margin-left: auto; }
.nav-group-toggle .nav-badge + .nav-chevron { margin-left: 8px; }
.nav-group.is-open .nav-chevron { transform: rotate(90deg); }
.nav-group-links { display: none; margin: 2px 0 8px 22px; padding-left: 12px; border-left: 1px solid rgba(148, 163, 184, .22); }
.nav-group.is-open .nav-group-links { display: grid; gap: 2px; }
.sidebar-nav a.is-current { color: #fff; background: rgba(37, 99, 235, .45); font-weight: 700; }
.sidebar-nav a.is-current:hover { transform: none; }

.topbar-start { display: flex; align-items: center; gap: 14px; }
.topbar-title { display: flex; flex-direction: column; }
.topbar-button { display: inline-flex; min-height: 46px; align-items: center; gap: 8px; padding: 0 14px; color: var(--slate-700); border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.topbar-button span:first-child { font-size: 20px; line-height: 1; }
.topbar-button:hover { border-color: var(--slate-300); }

.app-main { transition: margin-left .25s ease, width .25s ease; }
html.nav-hidden .sidebar { transform: translateX(-100%); }
html.nav-hidden .app-main { width: 100%; margin-left: 0; }
html.nav-hidden .content-wrapper { width: min(1400px, 100%); }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(15, 23, 42, .45); }
.sidebar-backdrop[hidden] { display: none; }

@media (max-width: 900px) {
    .sidebar { width: min(320px, 86vw); visibility: hidden; transform: translateX(-100%); box-shadow: none; }
    body.nav-open .sidebar, html.nav-hidden body.nav-open .sidebar { visibility: visible; transform: none; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
    .sidebar-close { display: grid; }
    .app-main, html.nav-hidden .app-main { width: 100%; margin-left: 0; }
}

.app-toast { position: fixed; right: 18px; bottom: 18px; left: 18px; z-index: 60; max-width: 560px; margin: 0 auto; padding: 14px 18px; color: #fff; border-radius: 14px; background: var(--slate-900); box-shadow: var(--shadow-md); font-weight: 650; }
.app-toast.is-error { background: #b91c1c; }
.app-toast.is-success { background: #047857; }
.app-toast[hidden] { display: none; }

/* ------------------------------------------------------------------
   Listas táctiles: buscador, acciones y tarjetas en pantallas angostas
   ------------------------------------------------------------------ */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; }
.search-field { display: flex; flex: 1 1 320px; align-items: center; gap: 8px; padding: 4px 6px 4px 14px; border: 2px solid var(--slate-200); border-radius: 14px; background: #fff; }
.search-field:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(59, 130, 246, .12); }
.search-field > span[aria-hidden] { color: var(--slate-500); font-size: 20px; }
.search-field input { min-height: 46px !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; font-size: 16px; }
.list-count { color: var(--slate-500); font-size: 13px; font-weight: 700; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions a, .row-actions button { display: inline-flex; min-height: 40px; align-items: center; padding: 0 12px; color: var(--blue-600); border: 1px solid var(--slate-200); border-radius: 10px; background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.row-actions .is-danger { color: var(--danger); }
/* Las tablas táctiles no heredan el «último enlace en rojo» de las tablas antiguas. */
.data-table td:last-child { white-space: normal; }
.data-table td:last-child .row-actions a:not(.is-danger) { color: var(--blue-600); }
.data-table td:last-child .row-actions a { padding: 0 12px; border-radius: 10px; font-size: 13px; }
.cell-primary strong { display: block; }
.cell-primary small { display: block; color: var(--slate-500); font-size: 12px; }
.data-table td.cell-number { font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
    table.data-table, .data-table thead, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    table.data-table { overflow: visible; border: 0 !important; background: transparent; box-shadow: none; white-space: normal; }
    .data-table thead { display: none; }
    .data-table tr { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--slate-200); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
    .data-table tr[hidden] { display: none; }
    .data-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 !important; border: 0; text-align: right; }
    .data-table td::before { content: attr(data-label); color: var(--slate-500); font-size: 12px; font-weight: 700; text-align: left; }
    .data-table td.cell-primary { display: block; font-size: 17px; text-align: left; }
    .data-table td.cell-primary::before, .data-table td.cell-actions::before, .data-table tr.empty-row td::before { display: none; }
    .data-table td.cell-actions { justify-content: flex-start; padding-top: 10px !important; }
    .data-table tr.empty-row td { justify-content: center; text-align: center; }
}

/* ------------------------------------------------------------------
   Formularios táctiles
   ------------------------------------------------------------------ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.field { display: grid; align-content: start; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field[hidden] { display: none; }
.field label { margin: 0; font-size: 13px; }
.app-form input:not([type="checkbox"]):not([type="radio"]), .app-form select { min-height: 48px; font-size: 16px; }
.app-form textarea { font-size: 16px; }
.ruc-details[hidden] { display: none; }
.lookup-panel .field { max-width: 420px; }
.points-table input { width: 100%; max-width: 140px; }
.field .errorlist { margin: 0; }
.field-check { display: flex; align-items: center; gap: 14px; min-height: 58px; margin: 0; padding: 10px 14px; border: 2px solid var(--slate-200); border-radius: 14px; background: #fff; cursor: pointer; }
.field-check:has(input:checked) { border-color: var(--blue-500); background: #eff6ff; }
.field-check input[type="checkbox"] { width: 24px; height: 24px; flex: 0 0 auto; }
.field-check strong { display: block; color: var(--slate-900); font-size: 15px; }
.field-check .helptext { margin-top: 2px; }
.app-form .form-actions { position: sticky; bottom: 0; z-index: 5; margin: 24px -26px -26px; padding: 16px 26px; border-radius: 0 0 var(--radius) var(--radius); background: rgba(255, 255, 255, .96); }
.app-form .form-actions .button { min-height: 50px; padding: 0 22px; font-size: 15px; }
.voice-field { display: flex; width: 100%; align-items: center; gap: 8px; }
.voice-field > input, .voice-field > textarea { flex: 1; min-width: 0; }
.voice-button { display: grid; width: 46px; height: 46px; flex: 0 0 auto; color: #fff; border: 0; border-radius: 12px; background: var(--blue-600); cursor: pointer; place-items: center; }
.voice-button svg { width: 22px; height: 22px; fill: currentColor; }
.voice-button.is-listening { background: #dc2626; animation: voice-pulse 1.1s ease-in-out infinite; }
@keyframes voice-pulse { 50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); } 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); } }
.search-field .voice-button { width: 42px; height: 42px; }

@media (max-width: 760px) {
    .form-grid { grid-template-columns: 1fr; }
    .content-wrapper > form:not(.inline-form):not(.confirm-actions):not(.list-toolbar) { padding: 18px; }
    .app-form .form-actions { margin: 20px -18px -18px; padding: 14px 18px; }
}

/* ------------------------------------------------------------------
   Roles: grupos plegables y acciones en una línea
   ------------------------------------------------------------------ */
.role-form { max-width: 960px !important; }
.role-note { margin: 10px 0 0; }
.perm-sections { display: grid; gap: 12px; margin-top: 20px; }
.perm-section { border: 2px solid var(--slate-200); border-radius: 16px; background: #fff; }
.perm-section.has-selection { border-color: #bfdbfe; }
.perm-section summary { display: flex; min-height: 64px; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; list-style: none; }
.perm-section summary::-webkit-details-marker { display: none; }
.perm-section-title { flex: 1; }
.perm-section-title strong { display: block; font-size: 16px; }
.perm-section-title small { color: var(--slate-500); }
.perm-count { padding: 4px 10px; color: var(--slate-700); border-radius: 999px; background: var(--slate-100); font-size: 13px; font-weight: 800; white-space: nowrap; }
.perm-section.has-selection .perm-count { color: #1d4ed8; background: #dbeafe; }
.perm-chevron { color: var(--slate-500); font-size: 22px; transition: transform .2s ease; }
.perm-section[open] .perm-chevron { transform: rotate(90deg); }
.perm-section-body { display: grid; gap: 4px; padding: 0 16px 16px; }
.perm-tools { display: flex; gap: 8px; margin-bottom: 6px; }
.perm-tool { min-height: 40px; padding: 0 14px; color: var(--blue-600); border: 1px solid var(--slate-200); border-radius: 10px; background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.perm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--slate-100); }
.perm-row-label { flex: 0 0 210px; font-weight: 700; }
.perm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-chip { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; margin: 0; padding: 0 14px; color: var(--slate-700); border: 2px solid var(--slate-200); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 700; cursor: pointer; user-select: none; }
.perm-chip input { width: 18px; height: 18px; }
.perm-chip:has(input:checked) { color: #1d4ed8; border-color: var(--blue-600); background: #eff6ff; }
.role-delete { margin-left: auto; color: var(--danger) !important; }

/* Casillas múltiples (por ejemplo, Roles de un usuario) como chips */
.field div[id^="id_"]:has(input[type="checkbox"]) { display: flex; flex-wrap: wrap; gap: 8px; }
.field div[id^="id_"]:has(input[type="checkbox"]) label { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; margin: 0; padding: 0 14px; border: 2px solid var(--slate-200); border-radius: 999px; background: #fff; font-size: 14px; cursor: pointer; }
.field div[id^="id_"]:has(input[type="checkbox"]) label:has(input:checked) { color: #1d4ed8; border-color: var(--blue-600); background: #eff6ff; }

@media (max-width: 760px) {
    .perm-row-label { flex-basis: 100%; }
}

@media (max-width: 760px) {
    .filter-form > div, .filter-form select, .filter-form input { width: 100%; min-width: 0; }
    .filter-form > .button { width: 100%; min-height: 48px; }
    .data-table td { overflow-wrap: anywhere; }
}

/* Proveedores */
.summary-card.is-alert { border-color: #fcd34d; background: #fffbeb; }
.supplier-contact { margin-bottom: 8px; }
.supplier-hint a, .stock-detail a { font-weight: 700; }
.data-table td .status-badge + .status-badge { margin-left: 4px; }

/* Opciones grandes (radios) y elección entre dos caminos */
.field ul, .field div[id^="id_"]:has(> div > label > input[type="radio"]) { display: grid; margin: 0; padding: 0; gap: 8px; list-style: none; }
.field label:has(> input[type="radio"]) { display: flex; min-height: 52px; align-items: center; gap: 12px; padding: 10px 14px; border: 2px solid var(--slate-200); border-radius: 14px; background: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.field label:has(> input[type="radio"]:checked) { border-color: var(--blue-500); background: #eff6ff; }
.field input[type="radio"] { width: 22px; height: 22px; flex: 0 0 auto; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 20px; }
.choice-card h2 { margin: 0 0 6px; font-size: 18px; }
.choice-card .form-actions { position: static; margin: 18px 0 0; padding: 0; background: none; }
.self-printer-ranges .data-table input { max-width: 130px; }

/* Movimientos de stock: una fila por producto */
.line-rows { display: grid; gap: 10px; }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 48px; gap: 12px; align-items: end; padding: 12px; border: 2px solid var(--slate-200); border-radius: 14px; background: #fff; }
.line-row[hidden] { display: none; }
.line-row .line-errors { grid-column: 1 / -1; margin: 0; }
.line-row.is-added { animation: line-added 1.2s ease-out; }
@keyframes line-added { from { border-color: var(--blue-600); background: #eef4ff; } }
.line-product { display: grid; gap: 2px; min-width: 0; align-self: center; }
.line-product strong { font-size: 17px; overflow-wrap: anywhere; }
.line-product small, .line-unit { color: var(--slate-500); font-weight: 500; }
.line-label { color: var(--slate-500); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.line-search { display: grid; gap: 8px; margin-bottom: 14px; padding: 14px; border: 2px dashed var(--slate-300); border-radius: 14px; background: var(--slate-100); }
.line-search > label { font-weight: 700; }
.line-search-box { display: flex; gap: 8px; align-items: stretch; }
.line-search-box input { flex: 1; min-width: 0; min-height: 52px; font-size: 18px; }
.line-search-box .voice-button { flex: 0 0 52px; min-height: 52px; }
.line-search-status { margin: 0; color: var(--slate-500); font-size: 14px; }
.line-search-status[data-state="ok"] { color: #15803d; }
.line-search-status[data-state="error"] { color: var(--danger); }
.line-results { display: grid; grid-auto-rows: max-content; gap: 6px; max-height: 340px; overflow-y: auto; }
.line-result { display: grid; gap: 2px; height: auto; line-height: 1.35; padding: 12px 14px; text-align: left; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; min-height: 52px; }
.line-result small { color: var(--slate-500); }
.line-result:hover, .line-result:focus { border-color: var(--blue-600); outline: 2px solid var(--blue-600); outline-offset: 0; }
.line-empty { margin: 0; padding: 16px; color: var(--slate-500); text-align: center; border: 1px solid var(--slate-200); border-radius: 14px; }
.line-remove { width: 48px; height: 48px; color: var(--danger); border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; font-size: 24px; cursor: pointer; }
.line-remove[hidden] { visibility: hidden; display: block; }
.document-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.confirm-form { max-width: none !important; margin: 18px 0 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; text-align: left; }
@media (max-width: 760px) {
    .line-row { grid-template-columns: minmax(0, 1fr) 48px; }
    .line-row .line-product { grid-column: 1 / -1; }
}

/* Caja: arqueo y resumen */
.draft-alert { max-width: 820px; margin-bottom: 18px; padding: 16px 18px; border: 2px solid #fca5a5; border-radius: 16px; background: #fef2f2; }
.draft-alert h2 { margin: 0 0 4px; color: #991b1b; font-size: 18px; }
.draft-alert p { margin: 0 0 12px; color: #7f1d1d; }
.draft-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.draft-list li { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: #fff; }
.draft-list li > span:first-child { display: grid; gap: 2px; }
.draft-list small { color: var(--slate-500); }
.draft-actions { display: flex; gap: 8px; }
.draft-actions form { margin: 0; }
.draft-actions .button { min-height: 44px; }
.denomination-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.denomination { display: grid; gap: 6px; padding: 12px; border: 2px solid var(--slate-200); border-radius: 14px; background: #fff; cursor: text; }
.denomination span { font-size: 13px; font-weight: 700; color: var(--slate-700); }
.denomination input { min-height: 48px; font-size: 20px; text-align: center; }
.denomination small { min-height: 16px; color: var(--slate-500); text-align: right; }
.cash-total { align-content: center; padding: 12px 16px; border-radius: 14px; background: #eff6ff; }
.cash-total strong { font-size: 28px; color: var(--slate-900); }
.cash-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 18px 0; }
.cash-over { color: #047857; font-weight: 700; }
.cash-short { color: var(--danger); font-weight: 700; }
.review-form { margin-top: 18px; }
.review-form h2 { margin: 0 0 12px; }
.pos-cash-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; color: #dbe5ff; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; font-size: 13px; font-weight: 700; }
.pos-cash-chip.is-overdue { color: #fecaca; border-color: #f87171; }
.pos-brand-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; background: #fff; }
.tenant-logo { object-fit: contain; background: #fff; padding: 3px; }

/* Tablet: tablas de muchas columnas con celdas más compactas antes de pasar a tarjetas. */
@media (min-width: 761px) and (max-width: 1100px) {
    .data-table th, .data-table td { padding: 10px 8px !important; }
    .data-table td { font-size: 12.5px; }
}

/* Reportes */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 8px; }
.report-card { display: grid; gap: 6px; min-height: 96px; padding: 16px 18px; color: var(--slate-700); border: 2px solid var(--slate-200); border-radius: 16px; background: #fff; text-decoration: none; }
.report-card:hover { border-color: var(--blue-500); background: #f8fbff; }
.report-card strong { color: var(--slate-900); font-size: 16px; }
.report-card span { font-size: 13px; }
.report-filters input, .report-filters select { min-height: 46px; }
.report-table tfoot td { font-weight: 800; background: #f8fafc; border-top: 2px solid var(--slate-300); }
@media (max-width: 760px) {
    .report-table tfoot { display: block; }
    .report-table tfoot tr { display: flex; flex-wrap: wrap; gap: 8px; }
    .report-table tfoot td:empty { display: none; }
}

/* Alta rápida de productos */
.quick-defaults { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--slate-200); border-radius: 16px; background: #fff; }
.quick-defaults > strong { align-self: center; color: var(--slate-700); }
.quick-defaults label { display: grid; gap: 4px; margin: 0; font-size: 12px; font-weight: 700; color: var(--slate-500); }
.quick-defaults select { min-height: 44px; min-width: 160px; }
.quick-count { margin-left: auto; align-self: center; color: var(--slate-600); font-weight: 700; }
.quick-head, .quick-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) 150px 160px; gap: 10px; align-items: center; }
/* Línea 1: código, descripción, precio y botones; línea 2: categoría, unidad e IVA (suelen quedar por defecto). */
.quick-extra { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; order: 5; }
.quick-extra .quick-cell { flex: 0 1 200px; }
.quick-extra select { min-height: 38px; font-size: 14px; }
.quick-price { order: 3; }
.quick-actions { order: 4; }
.quick-status { order: 6; }
.quick-head { padding: 0 14px 6px; color: var(--slate-500); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.quick-rows { display: grid; gap: 10px; }
.quick-row { padding: 12px 14px; border: 2px solid var(--slate-200); border-radius: 16px; background: #fff; }
.quick-row:focus-within { border-color: var(--blue-500); }
.quick-row.is-saved { border-color: #bbf7d0; background: #f0fdf4; }
.quick-row input, .quick-row select { width: 100%; min-height: 46px; font-size: 16px; }
.quick-row input:disabled, .quick-row select:disabled { color: var(--slate-700); background: transparent; border-color: transparent; }
.quick-cell { display: block; margin: 0; }
.quick-label { display: none; }
.quick-name-input { display: flex; gap: 6px; }
.quick-voice { width: 46px; height: 46px; flex: 0 0 auto; }
.quick-actions { display: flex; gap: 6px; align-items: center; order: 4; }
.quick-actions .button { flex: 1; min-height: 46px; }
.quick-remove { width: 46px; height: 46px; color: var(--danger); border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; font-size: 22px; cursor: pointer; }
.quick-saved { font-weight: 800; }
.quick-status { grid-column: 1 / -1; margin: 0; min-height: 0; font-size: 13px; }
.quick-status:empty { display: none; }
.quick-status[data-state="ok"] { color: #047857; }
.quick-status[data-state="warning"], .quick-status[data-state="info"] { color: #92400e; }
.quick-status[data-state="error"] { color: var(--danger); font-weight: 700; }
.quick-status[data-state="busy"] { color: var(--slate-500); }
@media (max-width: 900px) {
    .quick-head { display: none; }
    .quick-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-name, .quick-actions { grid-column: 1 / -1; }
    .quick-extra .quick-cell { flex: 1 1 140px; }
    .quick-extra select { min-height: 46px; font-size: 16px; }
    .quick-label { display: block; margin-bottom: 4px; color: var(--slate-500); font-size: 12px; font-weight: 700; }
}
.quick-row.is-saved .quick-voice { display: none; }
.cell-note { display: block; margin-top: 2px; color: var(--slate-500); font-size: 12px; }
.link-button { padding: 0; border: 0; background: none; color: var(--blue-600); font: inherit; font-weight: 700; cursor: pointer; }
.link-button.is-danger { color: var(--danger); }

/* Listas grandes: filtro, contador y paginación */
.list-toolbar .list-filter-select { flex: 0 1 auto; width: auto; max-width: 100%; }
.list-filter-select { min-height: 54px; padding: 0 12px; border: 2px solid var(--slate-200); border-radius: 14px; background: #fff; font-size: 15px; }
.list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 14px; }
.list-footer .pagination { margin-top: 0; }
