.stock-notice:empty { display:none; }
.closing-summary { margin:0; display:grid; gap:16px; }
.closing-summary > div { display:flex; justify-content:space-between; gap:20px; }
.closing-summary dt { color:var(--text-secondary); }
.closing-summary dd { margin:0; font-weight:600; }
.closing-search { padding:0 24px 20px; }
.closing-history-status { padding:0 24px 20px; }
#closing-result:empty { display:none; }
#closing-result { line-height:1.6; overflow-wrap:anywhere; }
.movement-filters { display:grid; grid-template-columns:minmax(200px,1.6fr) repeat(3,minmax(140px,1fr)) auto; gap:12px; align-items:end; }
.movement-filters .dash-button { min-height:44px; }
.movement-pagination { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:16px; padding:20px 24px; }
.movement-detail { display:grid; grid-template-columns:1fr 1fr; gap:20px; padding:24px; margin:0; }
.movement-detail dt { color:var(--text-secondary); font-size:.85rem; margin-bottom:6px; }
.movement-detail dd { margin:0; overflow-wrap:anywhere; white-space:pre-wrap; }
.movement-type { display:inline-block; padding:5px 10px; border-radius:8px; background:var(--bg-input); }
.movement-type.entrada { color:var(--success-soft-text); background:var(--success-soft-bg); }
.movement-type.merma { color:var(--danger-soft-text); background:var(--danger-soft-bg); }
#movement-error { color:var(--danger-soft-text); }
#movement-error:empty,#movement-warning:empty { display:none; }
@media(max-width:1100px) { .movement-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:540px) { .movement-filters,.movement-detail { grid-template-columns:1fr; } }
.exit-products { padding:0 24px 24px; max-height:620px; overflow:auto; }
.exit-totals { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.exit-totals span { display:block; color:var(--text-secondary); font-size:.85rem; }
.exit-totals strong { display:block; font-size:1.5rem; margin-top:6px; overflow-wrap:anywhere; }
.exit-quantity { width:100px; min-height:44px; padding:10px; box-sizing:border-box; border-radius:8px; border:1px solid var(--border-color); background:var(--bg-input); color:var(--text-primary); font:inherit; }
.exit-quantity:invalid { border-color:var(--danger); }
#exit-validation { color:var(--danger-soft-text); }
#exit-validation:empty,#exit-result:empty { display:none; }
#exit-reason-wrap[hidden] { display:none; }
#exit-result { line-height:1.6; }
@media(max-width:540px) { .exit-products { padding:0 18px 18px; } .exit-totals { grid-template-columns:1fr; } }
/* Entradas: catálogo y partidas comparten el espacio disponible. */
body[data-view="entradas"] #module-content { padding:24px; gap:16px; height:100dvh; min-height:640px; box-sizing:border-box; }
body[data-view="entradas"] .dash-head { flex-shrink:0; }
body[data-view="entradas"] .dash-head h1 { font-size:1.8rem; margin-bottom:4px; }
body[data-view="entradas"] .dash-head p { font-size:.875rem; }
.entry-status { margin:0; color:var(--text-secondary); font-size:.75rem; line-height:1.5; }
.entry-status:empty { display:none; }
.entry-layout { display:grid; grid-template-columns:minmax(240px,.8fr) minmax(0,1.8fr); gap:16px; flex:1; min-height:0; }
.entry-layout > .dash-panel { display:flex; flex-direction:column; min-height:0; }
.entry-layout .dash-section-head { padding:16px; gap:10px; flex-shrink:0; align-items:center; }
.entry-layout .dash-section-head h2 { font-size:1rem; margin:0; }
.entry-layout .dash-section-head p { margin-top:5px; font-size:.8rem; }
.entry-picker { display:grid; gap:10px; padding:0 16px 12px; flex-shrink:0; }
.entry-picker > :is(input,select) { min-width:0; width:100%; min-height:44px; box-sizing:border-box; padding:10px 12px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); color:var(--text-primary); font:inherit; font-size:.875rem; }
.entry-picker .ss-display { font-size:.875rem; }
.entry-products { padding:0 16px 12px; overflow:auto; min-height:0; flex:1; }
.entry-products .dash-empty { padding:18px 0; font-size:.875rem; }
.entry-product { display:flex; width:100%; justify-content:space-between; align-items:center; gap:12px; padding:14px 0; border:0; border-bottom:1px solid var(--border-color); background:transparent; color:var(--text-primary); text-align:left; font:inherit; font-size:.875rem; cursor:pointer; }
.entry-product:hover { color:var(--primary); }
.entry-product > span:first-child { min-width:0; }
.entry-product > span:last-child { flex-shrink:0; text-align:right; }
.entry-product strong { overflow-wrap:anywhere; }
.entry-product small { display:block; color:var(--text-secondary); font-size:.75rem; margin-top:5px; line-height:1.4; }
.entry-cart .entry-table-wrap { min-height:110px; max-height:none; flex:1; overflow:auto; }
.entry-cart .dash-table :is(th,td) { padding:12px 10px; font-size:.8rem; }
.entry-cart .dash-table th { white-space:normal; }
.entry-cart .dash-table td:first-child { min-width:135px; max-width:260px; white-space:normal; overflow-wrap:anywhere; }
.entry-cart .dash-table small { font-size:.75rem; }
.entry-cart .product-actions { justify-content:center; align-items:center; gap:6px; flex-wrap:nowrap; }
.entry-cart .dash-table :is(th,td):last-child { text-align:center; vertical-align:middle; }
.entry-cart .product-actions .dash-button { padding:7px 8px; font-size:.75rem; min-height:34px; }
.entry-empty { display:flex; flex-direction:column; gap:8px; padding:24px 12px; text-align:center; white-space:normal; line-height:1.5; }
.entry-empty span { color:var(--text-secondary); }
.entry-extra { flex-shrink:1; min-height:48px; overflow:auto; border-top:1px solid var(--border-color); }
.entry-extra summary { padding:13px 16px; cursor:pointer; font-size:.875rem; font-weight:600; }
.entry-extra summary span { color:var(--text-secondary); font-size:.75rem; font-weight:400; margin-left:6px; }
.entry-details { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.2fr); gap:12px; padding:0 16px 16px; }
.entry-details .stock-field { margin:0; font-size:.75rem; }
.entry-details :is(input,textarea) { margin-top:auto; }
.entry-details textarea { width:100%; box-sizing:border-box; resize:vertical; height:44px; min-height:44px; padding:10px 12px; border-radius:8px; border:1px solid var(--border-color); background:var(--bg-input); color:var(--text-primary); font:inherit; }
.entry-checkout { flex-shrink:0; border-top:1px solid var(--border-color); padding:16px; display:grid; gap:12px; }
.entry-summary { display:grid; grid-template-columns:auto auto minmax(0,1fr); gap:20px; align-items:end; }
.entry-summary > div:last-child { text-align:right; }
.entry-summary span { display:block; color:var(--text-secondary); font-size:.75rem; }
.entry-summary strong { display:block; font-size:1.3rem; margin-top:4px; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.entry-summary > div:last-child strong { color:var(--primary); font-size:1.6rem; }
.entry-help { font-size:.8rem; color:var(--text-secondary); line-height:1.5; margin:0; }
#entry-form { margin:0; }
#entry-product-info { margin:0; line-height:1.5; }
.entry-line-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; }
.entry-line-fields .stock-field { margin:0; }
.entry-line-fields input { margin-top:auto; }
#entry-form-error { color:var(--danger-soft-text); margin:0; }
#entry-form-error:empty,#entry-result:empty { display:none; }
#entry-result { line-height:1.5; font-size:.85rem; margin:0; max-height:100px; overflow:auto; }
@media(max-width:1100px) {
    body[data-view="entradas"] #module-content { height:auto; min-height:0; padding:20px; flex-shrink:0; }
    .entry-layout { grid-template-columns:minmax(0,1fr); flex:none; }
    .entry-layout > .dash-panel { min-height:auto; }
    .entry-extra { flex-shrink:0; }
    .entry-picker { grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); }
    .entry-products { max-height:200px; flex:auto; }
    .entry-cart .entry-table-wrap { max-height:340px; flex:auto; }
}
@media(max-height:700px) and (min-width:1101px) {
    body[data-view="entradas"] #module-content { height:auto; min-height:0; flex-shrink:0; }
    .entry-layout { flex:none; }
    .entry-layout > .dash-panel { min-height:auto; }
    .entry-extra { flex-shrink:0; }
    .entry-products,.entry-cart .entry-table-wrap { max-height:300px; flex:auto; }
}
@media(max-width:540px) {
    body[data-view="entradas"] #module-content { padding:16px; }
    .entry-picker,.entry-details,.entry-line-fields { grid-template-columns:minmax(0,1fr); }
    .entry-extra summary span { display:block; margin:5px 0 0; }
    .entry-summary { gap:12px; }
}
/* Catálogos: la tabla ocupa el espacio restante, sin el límite fijo de 440px. */
body:is([data-view="catalogo"], [data-view="categorias"]) .app-main { min-height:0; }
body:is([data-view="catalogo"], [data-view="categorias"]) #module-content { flex:1; min-height:560px; box-sizing:border-box; }
body:is([data-view="catalogo"], [data-view="categorias"]) #module-content > :not(.dash-panel) { flex-shrink:0; }
body:is([data-view="catalogo"], [data-view="categorias"]) #module-content > .dash-panel { display:flex; flex-direction:column; flex:1; min-height:0; }
body:is([data-view="catalogo"], [data-view="categorias"]) .dash-section-head { flex-shrink:0; }
body:is([data-view="catalogo"], [data-view="categorias"]) .dash-table-wrap { flex:1; min-height:0; max-height:none; overflow:auto; border-top:1px solid var(--border-color); }
/* Los bordes colapsados no acompañan bien a las celdas sticky durante el scroll. */
body:is([data-view="catalogo"], [data-view="categorias"]) .dash-table { margin-top:0; border-collapse:separate; border-spacing:0; }
body:is([data-view="catalogo"], [data-view="categorias"]) .dash-table th { border:0; box-shadow:inset 0 -1px 0 var(--border-color); }
body:is([data-view="catalogo"], [data-view="categorias"]) .dash-table td { border-top:0; }
@media(max-width:768px) {
    body:is([data-view="catalogo"], [data-view="categorias"]) #module-content { flex:none; min-height:calc(100dvh - 64px); }
    body:is([data-view="catalogo"], [data-view="categorias"]) .dash-table-wrap { flex:auto; min-height:280px; max-height:65dvh; }
}
.product-toolbar { display:grid; grid-template-columns:minmax(220px,1fr) minmax(200px,240px) 200px auto; gap:12px; align-items:center; }
/* El estado vacío ocupa el panel, no una fila estrecha bajo encabezados sin datos. */
.dash-table-wrap:has(.catalog-empty) { display:grid; place-items:center; }
.dash-table:has(.catalog-empty) { display:block; }
.dash-table:has(.catalog-empty) thead { display:none; }
.dash-table:has(.catalog-empty) :is(tbody,tr,td) { display:block; width:100%; min-width:0; box-sizing:border-box; border:0; }
.dash-table:has(.catalog-empty) tr:hover { background:transparent; }
.catalog-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; padding:32px 16px; max-width:480px; margin:auto; text-align:center; white-space:normal; }
.catalog-empty-icon { display:grid; place-items:center; width:64px; height:64px; border-radius:18px; background:var(--bg-panel-soft); color:var(--primary); font-size:1.65rem; }
.catalog-empty h3 { margin:0; font-size:1.15rem; line-height:1.4; color:var(--text-primary); }
.catalog-empty p { margin:0; color:var(--text-secondary); font-size:.9rem; line-height:1.65; }
.product-toolbar > * { width:100%; height:44px; margin:0; box-sizing:border-box; }
.product-toolbar > :is(input,select) { padding:10px 14px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); color:var(--text-primary); font:inherit; font-size:.875rem; }
.product-toolbar .ss-wrapper { min-width:0; }
.product-toolbar .ss-display { height:44px; font-size:.875rem; }
/* Productos: columnas con espacio real para nombres y acciones en una laptop. */
body[data-view="catalogo"] #module-content { padding:24px; gap:18px; min-height:480px; }
body[data-view="catalogo"] .product-header { display:flex; flex-direction:column; align-items:stretch; gap:14px; container-type:inline-size; }
body[data-view="catalogo"] .product-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; flex:0 0 auto; }
body[data-view="catalogo"] .product-heading h1 { margin:0; font-size:clamp(1.25rem,1.8vw,1.6rem); letter-spacing:-.03em; line-height:1.3; }
body[data-view="catalogo"] #product-count { display:block; flex-shrink:0; margin:0; text-align:right; color:var(--text-secondary); font-size:.75rem; line-height:1.4; }
body[data-view="catalogo"] .product-toolbar { width:100%; min-width:0; grid-template-columns:minmax(180px,1fr) 190px 165px max-content; gap:8px; }
body[data-view="catalogo"] .product-toolbar > * { height:36px; min-height:36px; }
body[data-view="catalogo"] .product-toolbar > :is(input,select,button) { padding:7px 11px; border-radius:8px; font-size:.8125rem; }
body[data-view="catalogo"] .product-toolbar .ss-display { height:36px; min-height:36px; padding:7px 34px 7px 11px; border-radius:8px; font-size:.8125rem; text-transform:none; letter-spacing:normal; }
body[data-view="catalogo"] .product-toolbar .ss-search-input { padding:7px 34px 7px 11px; font-size:.8125rem; }
@container (max-width:720px) {
    body[data-view="catalogo"] .product-toolbar { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
}
body[data-view="catalogo"] .dash-table-wrap { border-top:0; }
body[data-view="catalogo"] .dash-table { table-layout:fixed; }
body[data-view="catalogo"] .dash-table :is(th,td) { padding:12px 10px; white-space:normal; overflow-wrap:anywhere; font-size:.8125rem; }
body[data-view="catalogo"] .dash-table th { padding-top:10px; padding-bottom:10px; font-size:.75rem; letter-spacing:.025em; }
body[data-view="catalogo"] .product-sort { position:relative; display:inline-flex; align-items:center; justify-content:center; max-width:calc(100% - 30px); padding:2px 0; border:0; background:transparent; color:inherit; font:inherit; letter-spacing:inherit; text-transform:inherit; cursor:pointer; }
body[data-view="catalogo"] .product-sort .sort-chevrons { position:absolute; left:calc(100% + 5px); top:50%; transform:translateY(-50%); display:inline-flex; flex-direction:column; align-items:center; gap:3px; width:10px; }
body[data-view="catalogo"] .sort-chevrons i { display:block; width:5px; height:5px; border-top:1.5px solid currentColor; border-left:1.5px solid currentColor; opacity:.4; }
body[data-view="catalogo"] .sort-up { transform:rotate(45deg); }
body[data-view="catalogo"] .sort-down { transform:rotate(225deg); }
body[data-view="catalogo"] th[aria-sort="ascending"] .sort-up,
body[data-view="catalogo"] th[aria-sort="descending"] .sort-down { opacity:1; }
body[data-view="catalogo"] th[aria-sort="ascending"] .sort-down,
body[data-view="catalogo"] th[aria-sort="descending"] .sort-up { display:none; }
body[data-view="catalogo"] .product-sort:is(:hover,:focus,:active) { text-decoration:none; box-shadow:none; background:transparent; }
body[data-view="catalogo"] .product-sort:focus:not(:focus-visible) { outline:none; }
body[data-view="catalogo"] .product-sort:focus-visible { outline:2px solid var(--text-primary); outline-offset:4px; border-radius:3px; }
body[data-view="catalogo"] .product-name-line { display:flex; align-items:center; justify-content:center; gap:6px; }
body[data-view="catalogo"] .product-state { display:inline-block; flex-shrink:0; padding:0 5px; border:1px solid var(--border-color); border-radius:20px; color:var(--text-secondary); font-size:.6rem; line-height:1.4; white-space:nowrap; }
body[data-view="catalogo"] .product-state.is-inactive { border-style:dashed; font-weight:600; }
body[data-view="catalogo"] .dash-table th:first-child { width:21%; }
body[data-view="catalogo"] .dash-table th:last-child { width:120px; }
body[data-view="catalogo"] .dash-table td:first-child { min-width:0; text-align:center; padding-left:18px; padding-right:18px; }
body[data-view="catalogo"] .dash-table :is(th,td):last-child { padding-right:18px; }
body[data-view="catalogo"] .dash-table small { font-size:.75rem; line-height:1.5; }
body[data-view="catalogo"] .dash-table .product-identity { min-width:0; gap:10px; justify-content:center; }
body[data-view="catalogo"] .dash-table .product-identity > div { min-width:0; }
body[data-view="catalogo"] .dash-table .product-identity img { width:36px; height:36px; }
body[data-view="catalogo"] .product-actions { justify-content:center; flex-wrap:nowrap; gap:6px; }
@media(max-width:768px) {
    body[data-view="catalogo"] #module-content { padding:20px 16px; }
    body[data-view="catalogo"] .product-toolbar { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
    body[data-view="catalogo"] .dash-table:not(:has(.catalog-empty)) { min-width:680px; }
}
@media(max-width:540px) {
    body[data-view="catalogo"] .product-toolbar { grid-template-columns:1fr; }
}
.product-identity { display:flex; align-items:center; gap:12px; min-width:210px; }
.product-identity img,.product-photo-empty { width:48px; height:48px; flex-shrink:0; object-fit:contain; border-radius:8px; background:var(--bg-input); }
.product-photo-empty { display:grid; place-items:center; color:var(--text-secondary); font-size:1.5rem; }
.product-identity strong { white-space:normal; overflow-wrap:anywhere; }
.product-actions { display:flex; gap:8px; }
.catalog-row-actions { display:flex; flex-wrap:nowrap; align-items:center; justify-content:center; gap:6px; }
body[data-view="categorias"] .dash-table :is(th,td):last-child { width:132px; padding-left:16px; padding-right:16px; }
/* Acciones compactas compartidas: title y aria-label conservan su significado. */
body[data-view] .dash-table .dash-button.row-action {
    display:inline-flex; align-items:center; justify-content:center; flex:0 0 34px;
    width:34px; height:34px; min-width:34px; min-height:34px; padding:0;
    border:1px solid transparent; border-radius:9px; background:transparent;
    color:var(--text-secondary); font-size:15px; line-height:1; cursor:pointer;
    transition:background .15s ease, color .15s ease, border-color .15s ease;
}
body[data-view] .dash-table .row-action i { pointer-events:none; }
body[data-view] .dash-table .dash-button.row-action--edit { color:var(--primary); }
body[data-view] .dash-table .dash-button.row-action--danger { color:var(--danger-soft-text); }
body[data-view] .dash-table .dash-button.row-action--toggle { color:var(--text-secondary); font-size:19px; }
body[data-view] .dash-table .row-action:not(:disabled):hover { background:var(--bg-input); border-color:var(--border-color); color:var(--text-primary); }
body[data-view] .dash-table .row-action--danger:not(:disabled):hover { background:var(--danger-soft-bg); color:var(--danger-soft-text); border-color:currentColor; }
body[data-view] .dash-table .row-action:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
body[data-view] .dash-table .row-action:disabled { opacity:.4; cursor:not-allowed; }
body[data-view="catalogo"] .product-sort { white-space:nowrap; }
@media(pointer:coarse) {
    body[data-view] .dash-table .dash-button.row-action { width:44px; height:44px; min-width:44px; min-height:44px; flex-basis:44px; }
    body[data-view="catalogo"] .dash-table th:last-child { width:150px; }
    body[data-view="categorias"] .dash-table :is(th,td):last-child { width:150px; }
}
#product-dialog { width:min(1040px,calc(100vw - 32px)); max-width:none; }
#product-form { margin:0; }
.product-form-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; }
#product-form .product-editor-body { grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:24px 32px; }
.product-editor-column { display:flex; flex-direction:column; gap:16px; min-width:0; }
.product-editor-column + .product-editor-column { border-left:1px solid var(--border-color); padding-left:32px; }
.product-editor-column h3 { margin:0; font-size:.95rem; color:var(--text-secondary); }
.product-photo-controls { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.product-photo-controls:not(:has(> :not([hidden]))) { display:none; }
#product-form #product-error { grid-column:1 / -1; margin:0; }
#product-form #product-stock { margin:0; line-height:1.5; }
#product-margin { padding:12px 14px; border-radius:10px; background:var(--bg-input); font-size:.875rem; }
#product-form .ss-display { text-transform:none; letter-spacing:normal; font-weight:400; }
#product-form .ss-search-input { padding:11px 44px 11px 14px; min-height:0; border:0; border-radius:0; outline:none; box-shadow:none; font:inherit; }
#product-form .stock-field { margin:0; }
#product-form .product-form-grid > .stock-field > input { margin-top:auto; }
#product-form .product-check { display:flex; align-items:center; gap:10px; margin:0; text-transform:none; letter-spacing:normal; }
#product-form .product-check input { appearance:auto; width:18px; height:18px; margin:0; accent-color:var(--primary); }
#product-form [hidden] { display:none; }
#product-preview { width:80px; height:80px; object-fit:contain; border-radius:10px; background:var(--bg-input); }
#product-stock,#product-form small { color:var(--text-secondary); font-size:.85rem; }
#product-error:empty { display:none; }
#product-load-error { color:var(--danger-soft-text); }
@media(max-width:1000px) { .product-toolbar { grid-template-columns:1fr 1fr; } }
@media(max-width:760px) {
    #product-form .product-editor-body { grid-template-columns:minmax(0,1fr); }
    .product-editor-column + .product-editor-column { border-left:0; border-top:1px solid var(--border-color); padding-left:0; padding-top:20px; }
}
@media(max-width:540px) { .product-toolbar,.product-form-grid { grid-template-columns:1fr; } }
.stock-notice { padding:14px 18px; border:1px solid var(--success-soft-border); background:var(--success-soft-bg); border-radius:10px; }
.stock-notice.error, #product-error { color:var(--danger-soft-text); }
.stock-toolbar { display:flex; flex-wrap:wrap; gap:16px; align-items:end; }
.stock-field { display:flex; flex-direction:column; gap:8px; min-width:0; font-size:.875rem; }
.stock-toolbar .stock-field { flex:1; min-width:200px; }
.stock-field input,.stock-field select { width:100%; box-sizing:border-box; padding:12px; border-radius:8px; border:1px solid var(--border-color); background:var(--bg-input); color:var(--text-primary); font:inherit; min-height:44px; }
.stock-field input:focus { outline:2px solid var(--primary); outline-offset:2px; }
.stock-form { display:flex; flex-direction:column; gap:18px; padding:24px; max-width:650px; }
.stock-dialog { background:var(--bg-card); color:var(--text-primary); border:1px solid var(--border-color); border-radius:16px; width:min(560px,92vw); max-height:90vh; margin:auto; padding:0; }
.stock-dialog::backdrop { background:var(--surface-overlay); backdrop-filter:blur(5px); }
.stock-sale { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(320px,1fr); gap:24px; align-items:start; }
.stock-products { display:grid; grid-template-columns:repeat(auto-fill,minmax(155px,1fr)); gap:14px; }
.stock-product { display:flex; flex-direction:column; gap:12px; align-items:start; padding:20px; border:1px solid var(--border-color); border-radius:14px; background:var(--bg-card); color:var(--text-primary); text-align:left; cursor:pointer; font:inherit; }
.stock-product:hover { border-color:var(--primary); }
.stock-product img { width:100%; height:100px; object-fit:contain; }
.stock-product-icon { color:var(--primary); font-size:2rem; }
.stock-product small { color:var(--text-secondary); }
.stock-qty { display:flex; align-items:center; gap:10px; }
button:disabled { opacity:.5; cursor:not-allowed; }
progress { height:8px; width:100%; accent-color:var(--primary); }
.dash-stat strong { font-size:clamp(1.4rem,2.6vw,2.5rem); overflow-wrap:anywhere; }
@media(max-width:1000px){.stock-sale{grid-template-columns:1fr;}}
@media(max-width:600px){.stock-form{padding:18px;}.stock-products{grid-template-columns:repeat(2,minmax(0,1fr));}.stock-product{padding:14px;}}

/* Categorías: controles alineados y modal con campos y acciones separados. */
body[data-view="categorias"] #module-content { padding:24px; gap:18px; min-height:480px; }
body[data-view="categorias"] .category-header { display:flex; flex-direction:column; gap:14px; }
body[data-view="categorias"] .category-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
body[data-view="categorias"] .category-heading h1 { margin:0; font-size:clamp(1.25rem,1.8vw,1.6rem); letter-spacing:-.03em; line-height:1.3; }
body[data-view="categorias"] #category-count { flex-shrink:0; margin:0; text-align:right; color:var(--text-secondary); font-size:.75rem; line-height:1.4; }
body[data-view="categorias"] .dash-table-wrap { border-top:0; }
body[data-view="categorias"] .category-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 165px max-content;
    align-items: center;
    gap: 8px;
}
body[data-view="categorias"] .category-toolbar > * {
    height: 36px;
    min-height: 36px;
    margin: 0;
    box-sizing: border-box;
    width: 100%;
}
body[data-view="categorias"] .category-toolbar > :is(input,select) {
    padding: 7px 11px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    font: inherit;
    font-size: .8125rem;
}
body[data-view="categorias"] .category-toolbar .ss-wrapper { min-width:0; }
body[data-view="categorias"] .category-toolbar .ss-display { height:36px; min-height:36px; padding:7px 34px 7px 11px; border-radius:8px; font-size:.8125rem; text-transform:none; letter-spacing:normal; }
body[data-view="categorias"] .category-toolbar .ss-search-input { padding:7px 34px 7px 11px; font-size:.8125rem; }
body[data-view="categorias"] .category-toolbar > button { padding:7px 11px; border-radius:8px; font-size:.8125rem; }
@media(max-width:768px) {
    body[data-view="categorias"] #module-content { padding:20px 16px; }
}
#category-notice:empty { display: none; }
#category-dialog { width: min(520px, calc(100vw - 32px)); }
#category-form { margin: 0; padding: 0; }
.category-modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 24px; gap: 16px; border-bottom: 1px solid var(--border-color);
}
.category-modal-head h2 { margin: 0; font-size: 1.25rem; }
.category-modal-close {
    display: grid; place-items: center; width: 36px; height: 36px;
    padding: 0; border: 0; border-radius: 8px;
    background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 1.75rem;
}
.category-modal-close:hover { background: var(--bg-input); }
.category-modal-body { display: grid; gap: 20px; padding: 24px; }
#category-form .stock-field { margin: 0; gap: 8px; }
#category-form :is(input:not([type="checkbox"]),textarea) {
    margin: 0; width: 100%; box-sizing: border-box; padding: 12px 14px;
    border: 1px solid var(--border-color); border-radius: 8px;
    background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: .9375rem;
}
#category-form textarea { resize: vertical; min-height: 88px; }
#category-form .category-active {
    display: flex; align-items: center; justify-content: flex-start;
    gap: 10px; margin: 0; text-transform: none; letter-spacing: 0; cursor: pointer;
}
#category-form .category-active input {
    appearance: auto; display: inline-block; flex: 0 0 18px;
    width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0;
    accent-color: var(--primary); box-shadow: none;
}
#category-error { margin: 0; color: var(--danger-soft-text); font-size: .875rem; }
#category-error:empty { display: none; }
.category-modal-footer {
    display: flex; justify-content: flex-end; align-items: center; gap: 12px;
    padding: 18px 24px; border-top: 1px solid var(--border-color);
}
.category-modal-footer .dash-button { min-height: 44px; margin: 0; }
@media (max-width: 850px) {
    body[data-view="categorias"] .category-toolbar { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}
@media (max-width: 480px) {
    body[data-view="categorias"] .category-toolbar { gap: 10px; }
    body[data-view="categorias"] #category-search { grid-column: 1 / -1; }
    body[data-view="categorias"] #new-category { grid-column: 1 / -1; }
    .category-modal-body, .category-modal-head, .category-modal-footer { padding: 18px; }
}

/* Full-page purchase history and corrections. */
.entry-history-content { border:0; padding:0; margin:0; min-width:0; display:grid; gap:16px; }
.entry-history-tools,.entry-history-row-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.entry-history-tools > p { flex:1; min-width:220px; font-size:.85rem; }
.entry-history-tools input { width:min(360px,100%); }
.entry-history-detail .entry-history-tools { padding:16px; }
.entry-history-fields { display:grid; grid-template-columns:1fr 1fr 2fr; gap:14px; padding:16px; }
.entry-history-table { max-height:calc(100dvh - 250px); }
.entry-history-table td small { display:block; margin-top:5px; }
.entry-history-table td input { width:115px; }
.entry-history-tools input,.entry-history-tools select,.entry-history-table input { padding:10px; border:1px solid var(--border-color); border-radius:8px; background:var(--bg-input); color:var(--text-primary); font:inherit; }
@media(max-width:750px){.entry-history-fields{grid-template-columns:1fr;}.entry-history-table{max-height:60dvh;}}

body.history-page #module-content { height:auto; min-height:0; }
.history-page .dash-head, .history-editor-head, .history-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.history-page #history-search, .history-picker input { width:min(300px,100%); padding:10px 12px; border-radius:8px; border:1px solid var(--border-color); background:var(--bg-input); color:var(--text-primary); }
.history-page .entry-status:empty { display:none; }
.history-icons { display:inline-flex; flex-wrap:nowrap; gap:6px; }
.history-icons button, .entry-history-table [data-remove-line] { width:34px; height:34px; padding:0; justify-content:center; }
.history-icons [data-delete-entry]:hover { color:var(--danger,#ed7777); }
.history-editor-head, .history-foot { padding:14px 18px; }
.history-editor-head h2 { margin:0; font-size:1rem; }
.history-editor-head span,.history-foot span { color:var(--text-secondary); font-size:.85rem; }
.history-foot { border-top:1px solid var(--border-color); }
.history-foot > :first-child { margin-right:auto; }
.history-picker { margin:12px 16px; width:min(350px,calc(100% - 32px)); }
.history-picker summary { cursor:pointer; color:var(--text-primary); padding:8px 0; }
.history-options { max-height:145px; overflow:auto; display:grid; }
.history-options button { text-align:left; padding:8px; background:transparent; color:var(--text-primary); border:0; cursor:pointer; }
.history-options button:hover { background:var(--bg-input); }
.history-options small { color:var(--text-secondary); }
.history-page .entry-history-fields { border-top:1px solid var(--border-color); }
@media(max-width:700px){.history-page .dash-head .entry-history-row-actions{width:100%;flex-wrap:nowrap}.history-page #history-search{flex:1;min-width:0}.history-page .entry-history-row-actions button{white-space:nowrap}.history-page .entry-history-table{overflow:auto}}
