/* Inventory: tinta #17304a, azul #215bc1, fondo #f2f5f8, blanco #fff, texto #526477. */
:root { color-scheme: light; font-family: "Segoe UI", sans-serif; color: #17304a; background: #f2f5f8; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #215bc1; }
.login-page { min-height: 100svh; display: grid; place-items: center; padding: 32px 20px; border-top: 5px solid #215bc1; }
.login-panel { width: 100%; max-width: 440px; padding: 40px; background: #fff; border: 1px solid #dce3ec; border-radius: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 40px; color: #17304a; font-size: 23px; font-weight: 700; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: #215bc1; color: #fff; font-size: 29px; }
h1 { font-size: 29px; line-height: 1.2; letter-spacing: -.7px; margin: 0 0 12px; }
.intro { margin: 0 0 30px; color: #526477; line-height: 1.5; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label { font-size: 14px; font-weight: 600; }
.field input { width: 100%; min-height: 48px; border: 1px solid #a8b6c6; border-radius: 6px; padding: 12px; font: inherit; background: #fff; color: #17304a; }
input::placeholder { color: #64748b; }
.remember { display: flex; align-items: center; gap: 9px; font-size: 14px; margin: 4px 0 26px; line-height: 1.5; }
.remember input { width: 18px; height: 18px; margin: 0; accent-color: #215bc1; }
.primary-button { width: 100%; min-height: 48px; border: 0; border-radius: 6px; background: #215bc1; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.primary-button:hover { background: #184a9f; }
:focus-visible { outline: 3px solid #215bc1; outline-offset: 3px; }
.validation { color: #a4262c; font-size: 14px; line-height: 1.5; }
.validation ul { padding-left: 20px; }
.input-validation-error { border-color: #a4262c !important; }
@media (max-width: 480px) { .login-panel { padding: 28px 24px; } }

.app-header { background: #fff; border-bottom: 1px solid #dce3ec; }
.app-topbar { max-width: 1248px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.app-brand { color: #17304a; font-size: 23px; font-weight: 700; text-decoration: none; }
.app-account { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 14px; }
.text-button { border: 0; background: none; padding: 8px 0; color: #215bc1; cursor: pointer; font: inherit; }
.workspace { max-width: 1248px; margin: 0 auto; padding: 44px 24px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 22px; }
.page-heading .intro { margin-bottom: 0; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.page-heading .primary-button, .form-actions .primary-button { width: auto; padding: 12px 20px; }
.catalog, .editor-panel { background: #fff; border: 1px solid #dce3ec; border-radius: 10px; overflow: hidden; }
.search-form { padding: 24px; display: grid; gap: 8px; }
.search-form label { font-weight: 600; font-size: 14px; }
.search-controls { display: flex; align-items: center; gap: 12px; }
.search-controls input { min-width: 0; width: 360px; max-width: 100%; padding: 12px; min-height: 46px; border: 1px solid #a8b6c6; border-radius: 6px; font: inherit; }
.secondary-button { border: 1px solid #a8b6c6; background: #fff; border-radius: 6px; padding: 12px 18px; color: #17304a; font: inherit; cursor: pointer; }
.secondary-button:hover { background: #f2f5f8; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; }
th { padding: 14px 20px; background: #f7f9fc; font-size: 13px; font-weight: 600; color: #526477; border-block: 1px solid #e4eaf1; }
td { padding: 19px 20px; border-bottom: 1px solid #e4eaf1; overflow-wrap: anywhere; max-width: 280px; }
.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.product-name { font-weight: 600; min-width: 180px; }
.product-code { white-space: nowrap; }
.row-actions { display: flex; gap: 18px; }
.row-actions a { padding-block: 8px; }
.danger-link { color: #a4262c; }
.out-of-stock { background: #fff0ef; color: #a4262c; padding: 4px 10px; border-radius: 5px; }
.pagination { padding: 20px 24px; display: flex; justify-content: space-between; gap: 16px; color: #526477; font-size: 14px; }
.pagination > div { display: flex; gap: 18px; }
.empty-state { padding: 64px 24px; text-align: center; border-block: 1px solid #e4eaf1; }
h2 { font-size: 21px; margin: 0 0 12px; }
.empty-state p { color: #526477; margin: 0; line-height: 1.6; }
.notice { padding: 16px 20px; background: #e7f3ee; border: 1px solid #9fcbb8; border-radius: 6px; color: #205b42; }
.form-workspace { max-width: 800px; }
.back-link { display: inline-block; margin-bottom: 28px; }
.editor-panel { padding: 32px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.full-width { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 16px; border-top: 1px solid #e4eaf1; margin-top: 8px; }
.danger-button { background: #a4262c; }
.danger-button:hover { background: #801b20; }
.product-details { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding-block: 16px; }
.product-details dt { color: #526477; }
.product-details dd { margin: 0; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.row-actions { flex-wrap: wrap; gap: 4px 16px; min-width: 170px; }
.field-help { margin: 0 0 20px; color: #526477; font-size: 14px; line-height: 1.6; }
.stock-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; padding: 18px 22px; border: 1px solid #dce3ec; border-radius: 8px; background: #fff; }
.stock-summary strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.stock-summary a { margin-left: auto; }
.movement-type { margin: 0 0 24px; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.movement-type legend { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.movement-type label { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border: 1px solid #a8b6c6; border-radius: 6px; cursor: pointer; }
.movement-type label:has(input:checked) { background: #edf3ff; border-color: #215bc1; }
.movement-type input { width: 18px; height: 18px; accent-color: #215bc1; }
.field textarea { border: 1px solid #a8b6c6; border-radius: 6px; padding: 12px; width: 100%; font: inherit; color: #17304a; resize: vertical; }
.field select { border: 1px solid #a8b6c6; border-radius: 6px; padding: 12px; width: 100%; min-height: 48px; font: inherit; color: #17304a; background: #fff; }
.movement-table { min-width: 1100px; }
.movement-table td { max-width: 240px; }
.cell-secondary { display: block; color: #526477; margin-top: 6px; }
.date-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.movement-label { padding: 5px 9px; border-radius: 5px; white-space: nowrap; }
.movement-entry { background: #e7f3ee; color: #205b42; }
.movement-exit { background: #fff0ef; color: #a4262c; }
.lot-fields { border: 1px solid #dce3ec; border-radius: 8px; padding: 20px; margin: 0 0 24px; }
.lot-fields legend { font-weight: 600; font-size: 14px; padding: 0 8px; }
.lot-fields[hidden] { display: none; }
.warning-notice { color: #754b0a; background: #fff6e1; border-left: 4px solid #c18b23; padding: 16px 20px; line-height: 1.6; }
.lot-alerts { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 20px 0; margin-bottom: 20px; border-block: 1px solid #dce3ec; }
.lot-alerts a { display: inline-flex; align-items: center; gap: 12px; padding: 8px 0; }
.lot-alerts strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.lot-expiring { color: #754b0a; background: #fff1cc; }
.search-controls select { font: inherit; min-height: 46px; padding: 12px; border: 1px solid #a8b6c6; border-radius: 6px; max-width: 100%; background: #fff; color: #17304a; }
.lot-date-note { margin-top: 20px; }
.lot-history { margin-bottom: 12px; min-width: 170px; }
.sale-workspace { max-width: 1100px; }
.sale-entry-table { min-width: 520px; }
.sale-entry-table td { max-width: none; padding: 12px; }
.sale-entry-table input, .sale-entry-table select { width: 100%; min-height: 46px; font: inherit; color: #17304a; border: 1px solid #a8b6c6; border-radius: 6px; padding: 10px; background: #fff; }
.sale-entry-table td:first-child { width: 55%; }
.sale-entry-table td:last-child { width: 18%; }
.add-sale-line { margin: 12px 0; }
.sale-payment { margin-top: 24px; }
.sale-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 28px; margin-top: 24px; padding: 22px 0; border-top: 2px solid #17304a; font-size: 19px; }
.sale-total strong { font-size: 30px; font-variant-numeric: tabular-nums; }
.sale-lot-row td { padding-top: 8px; background: #f7f9fc; color: #526477; font-size: 13px; }
.receipt-lot { display: block; margin-top: 6px; }
.receipt .product-details { grid-template-columns: 180px 1fr; }
#cash-field[hidden] { display: none; }
.operation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.table-container { overflow-x: auto; margin-block: 20px; }
.table-container table { min-width: 650px; }
.table-container td form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.table-container td select { min-height: 42px; padding: 8px; font: inherit; color: #17304a; border: 1px solid #a8b6c6; border-radius: 6px; background: #fff; }
.table-container td label { display: inline-flex; align-items: center; gap: 6px; }
.section-heading { margin: 36px 0 20px; }
.cash-opening { max-width: 560px; }
.cash-action { width: auto; padding: 12px 20px; }
.cash-workspace { max-width: 1200px; }
.lot-retire-link { display: block; margin-top: 12px; }
.purchase-entry-table { min-width: 1080px; }
.purchase-entry-table td:first-child { width: 22%; }
.purchase-entry-table td:last-child { width: 15%; }
@media (max-width: 800px) { .operation-grid { grid-template-columns: 1fr; } }
@media print {
    @page { margin: 12mm; }
    :root, body { background: #fff; color: #000; }
    .app-header, .no-print { display: none; }
    .workspace { padding: 0; max-width: none; }
    .receipt { padding: 0; border: 0; border-radius: 0; }
    .table-scroll { overflow: visible; }
    table { font-size: 11px; }
    td, th { padding: 10px; }
    tr { break-inside: avoid; }
    .sale-total { break-inside: avoid; }
}
@media (max-width: 720px) {
    .app-topbar { flex-wrap: wrap; gap: 8px 20px; padding: 16px; }
    .app-account { flex-basis: 100%; justify-content: space-between; margin: 0; }
    .app-account span { overflow-wrap: anywhere; min-width: 0; }
    .app-account form { flex-shrink: 0; }
    .workspace { padding: 28px 16px; }
    .page-heading { flex-direction: column; }
    .search-form, .editor-panel { padding: 20px; }
    .search-controls { flex-wrap: wrap; }
    .search-controls input { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .pagination { flex-direction: column; padding: 20px; }
    .pagination > div { flex-wrap: wrap; }
}
