/* Inventory workspace: navigation, page hierarchy and task-oriented forms. */
:root { --md-ui-bg:#ffffff; }
html,body { background:var(--md-ui-bg); }
main { padding:0 0 48px; }
.workspace-nav-wrap { background:#fff; border-bottom:1px solid #e1e7f0; }
.workspace-nav { display:flex; gap:8px; max-width:1280px; margin:auto; padding:10px 20px; overflow-x:auto; }
.workspace-nav a { display:flex; align-items:center; gap:8px; padding:9px 14px; border-radius:8px; white-space:nowrap; color:#667389; font-size:13px; font-weight:500; }
.workspace-nav a:hover { text-decoration:none; background:#f3f5f9; color:#1c2d52; }
.workspace-nav a[aria-current="page"] { color:#1c2d52; background:#eaf0f8; font-weight:600; }
.workspace-page { max-width:1280px; padding:32px 24px; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:26px; }
.page-heading h1 { text-align:left; font-size:28px; margin:4px 0 8px; }
.page-heading p { margin:0; color:#69758a; max-width:680px; }
.eyebrow { color:#768399; font-size:10px; font-weight:700; letter-spacing:1.4px; }
.form-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:24px; align-items:start; }
.form-section { padding:24px; margin-bottom:20px; }
.form-section h2 { font-size:17px; margin:0 0 5px; }
.section-heading { display:flex; align-items:flex-start; gap:12px; margin-bottom:22px; border-bottom:1px solid #edf0f5; padding-bottom:18px; }
.section-heading p { color:#768196; margin:0; font-size:12px; }
.section-number { display:grid; place-items:center; flex:0 0 32px; height:32px; background:#edf2f9; color:#344b71; border-radius:8px; font-size:12px; font-weight:600; }
.field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 22px; }
.field-grid .form-group { margin:0; }
.form-group label { margin-bottom:7px; }
.form-control::placeholder { color:#9aa5b5; font-size:13px; }
.image-preview { display:grid; place-items:center; height:175px; background:#f6f8fb; border:1px dashed #ced8e7; border-radius:10px; margin:20px 0; }
.image-preview img { max-width:90%; max-height:145px; object-fit:contain; }
input[type="file"].form-control { height:auto; padding:9px; font-size:12px; }
.help-panel { display:flex; gap:12px; padding:20px; border-radius:10px; color:#516580; background:#e8eef7; font-size:12px; }
.help-panel > i { padding-top:4px; }
.help-panel strong { color:#243b60; display:block; margin-bottom:7px; }
.help-panel p { margin:0; }
.form-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; background:#fff; border:1px solid #e1e7f0; border-radius:10px; padding:18px 24px; }
.form-actions > span { font-size:12px; color:#768196; }
.form-actions > div { display:flex; gap:10px; }
.inventory-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:22px; }
.inventory-summary > div { padding:18px 22px; background:#fff; border:1px solid #e1e7f0; border-radius:10px; }
.inventory-summary span { display:block; color:#748097; font-size:12px; }
.inventory-summary strong { display:block; color:#203759; font-size:26px; margin-top:3px; }
.inventory-summary .summary-caption { font-size:17px; padding-top:7px; }
.search-panel { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; background:#fff; border:1px solid #e1e7f0; padding:18px 22px; border-radius:10px; }
.search-panel > div { width:min(100%,540px); }
.search-panel p { margin:0 0 10px; color:#748097; font-size:12px; }
.inventory-toolbar { margin-top:16px !important; }
.inventory-card { transition:box-shadow .15s ease; }
.inventory-card:hover { box-shadow:0 10px 26px rgba(28,45,82,.09); }
.inventory-card .card-title { line-height:1.45; }
.inventory-card .card-text small { font-size:14px; }
.inventory-card .card-img-top { background:#fbfcfe; }
.inventory-card .custom-btn { border-radius:8px; }
.product-details { border-top:1px solid #edf0f5; padding-bottom:10px; }
.scanner-page { max-width:800px; }
.scanner-page .card { padding:24px !important; }
.scanner-page video { display:block; max-height:320px; object-fit:cover; background:#17233b; }
.scanner-page .alert { margin-bottom:0; font-size:13px; }
.alert-info { background:#edf3fc; color:#35547d; border-color:#dce7f6; }
.alert-secondary { background:#f3f5f8; color:#667389; border-color:#e6eaf0; }
.dashboard-page > .row > .col-12 .d-flex { flex-direction:column; align-items:flex-start !important; gap:4px; }
.dashboard-page .card-body { padding:24px; }
.dashboard-page .card-title i { color:#547098; }
.dashboard-page .btn { margin-top:18px !important; }
#filtersCard { border-radius:10px !important; box-shadow:none !important; }
#filtersCard .row > div { margin-bottom:12px; }
.form-select { display:block; width:100%; }
.edit-product-body form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 20px; }
.edit-product-body form > button { grid-column:1/-1; justify-self:end; }
.modal-dialog { margin:24px auto; }
.modal-content { max-height:calc(100vh - 48px); max-height:calc(100dvh - 48px); }
.modal-body { overflow:auto; }
.modal-content > form { display:flex; flex-direction:column; min-height:0; overflow:auto; }
.modal-content > form > .modal-body { flex:1 1 auto; }
.modal-header,.modal-footer { flex-shrink:0; }
.auth-page { margin-top:24px; }
.auth-page .card { border-top:3px solid #1c2d52 !important; }
.auth-page .card-header { padding-top:24px; }
.auth-page .card-img-top { max-width:110px; }
.ms-auto { margin-left:auto; } .ms-1 { margin-left:4px; } .ms-2 { margin-left:8px; } .me-1 { margin-right:4px; } .text-end { text-align:right; }
[hidden] { display:none !important; }
@media(max-width:991.98px) { .form-layout { grid-template-columns:minmax(0,1fr) 260px; gap:18px; } .form-section { padding:20px; } }
@media(max-width:767.98px) {
 .workspace-page { padding:24px 16px; }
 .page-heading { align-items:flex-start; flex-direction:column; gap:14px; }
 .page-heading h1 { font-size:24px; }
 .form-layout { grid-template-columns:1fr; }
 .form-aside { display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
 .form-actions { align-items:flex-start; flex-direction:column; }
 .inventory-summary { gap:8px; }
 .inventory-summary > div { padding:14px; }
 .inventory-summary .summary-caption { font-size:14px; }
 .search-panel { align-items:stretch; flex-direction:column; gap:6px; }
 .search-panel p { margin:0; }
 .modal-dialog { margin:10px; max-width:calc(100% - 20px); }
 .modal-content { max-height:calc(100dvh - 20px); }
}
@media(max-width:575.98px) {
 .workspace-nav { padding:8px 12px; gap:4px; }
 .workspace-nav a { padding:10px 12px; }
 .field-grid,.form-aside,.edit-product-body form { grid-template-columns:1fr; }
 .form-section { padding:18px; }
 .form-actions { padding:16px; }
 .form-actions > div { width:100%; } .form-actions .btn { flex:1; }
 .inventory-summary { grid-template-columns:1fr 1fr; } .inventory-summary > div:last-child { grid-column:1/-1; }
 .modal-body { padding:16px; }
 .page-heading > .btn { width:100%; }
}
@media(max-width:991.98px) {
 .navbar > .container { column-gap:10px; }
 .navbar .navbar-brand { flex:1 1 0; max-width:none; margin-right:0; min-width:0; }
 .navbar .brand-copy { min-width:0; overflow-wrap:anywhere; }
 .navbar-toggler { flex:0 0 48px; width:48px; padding:6px 8px; }
 .navbar-collapse { flex-basis:100%; }
}
/* Main navigation grouped in a single dropdown. */
.inventory-menu { min-width:250px; padding:8px; }
.inventory-menu .dropdown-item { display:flex; align-items:center; gap:12px; min-height:42px; padding:10px 12px; }
.inventory-menu .dropdown-item i { flex:0 0 18px; width:18px; text-align:center; color:#637a9a; font-size:14px; }
.inventory-menu .dropdown-header { font-size:10px; letter-spacing:.7px; text-transform:uppercase; color:#8792a3; padding:8px 12px 4px; }
.inventory-menu .dropdown-item[aria-current="page"] { background:#eaf0f8; color:#1c2d52; font-weight:600; }
.inventory-menu .dropdown-item[aria-current="page"] i { color:#1c2d52; }
@media(max-width:991.98px) { .inventory-menu { min-width:0; width:100%; } }
/* Compact inventory heading: inline totals and one search/action row. */
.inventory-page .page-heading { margin-bottom:16px; }
.inventory-page .compact-summary { display:flex; flex-wrap:wrap; gap:8px 24px; margin:0 0 14px; }
.inventory-page .compact-summary > div { display:flex; align-items:center; gap:10px; padding:6px 0; background:transparent; border:0; border-radius:0; }
.inventory-page .compact-summary span { font-size:12px; }
.inventory-page .compact-summary strong { margin:0; padding:2px 10px; background:#e6ecf5; border-radius:6px; font-size:15px; line-height:1.4; }
.inventory-controls { display:flex; align-items:center; gap:20px; padding:14px 18px; margin-bottom:22px; background:#fff; border:1px solid #e1e7f0; border-radius:10px; }
.inventory-controls .search-panel { flex:1; min-width:0; padding:0; border:0; border-radius:0; gap:12px; align-items:center; }
.inventory-controls .search-panel > div { flex:1; width:auto; }
.inventory-controls .search-panel label { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.inventory-controls .search-panel p { margin:0; white-space:nowrap; }
.inventory-controls .inventory-toolbar { flex-shrink:0; margin:0 !important; gap:10px; }
.inventory-controls .btn { white-space:nowrap; }
@media(max-width:991.98px) { .inventory-controls { flex-wrap:wrap; gap:12px; } .inventory-controls .search-panel { flex-basis:100%; flex-direction:row; } }
@media(max-width:575.98px) {
 .inventory-controls { padding:12px; }
 .inventory-controls .search-panel { flex-wrap:wrap; gap:6px; }
 .inventory-controls .search-panel > div { flex-basis:100%; }
 .inventory-controls .inventory-toolbar { width:100%; }
 .inventory-controls .inventory-toolbar > .btn { flex:1; width:auto; padding:10px 12px; }
}
/* Compact product cards: essential information and explicit actions. */
.product-compact { padding:18px; display:flex; flex-direction:column; }
.product-topline { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:14px; }
.product-thumbnail { width:88px; height:88px; border-radius:8px; background:#f1f4f8; color:#8291a8; display:grid; place-items:center; font-size:23px; }
.product-thumbnail img { width:100%; height:100%; object-fit:contain; border-radius:8px; }
.product-more { padding:8px !important; min-width:40px; min-height:40px; background:transparent; color:#69758a; border:0; }
.product-more:hover { background:#edf1f7; }
.product-compact .product-name { font-size:15px; line-height:1.45; margin:0 0 5px; overflow-wrap:anywhere; }
.product-code { color:#7c889a; font-size:11px; margin:0 0 18px; overflow-wrap:anywhere; }
.product-stock { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-top:auto; }
.product-stock > div > span { display:block; color:#7c889a; font-size:11px; }
.product-stock strong { display:block; font-size:15px; color:#17233b; line-height:1.4; }
.product-stock small { font-size:13px; font-weight:400; }
.stock-warning { background:#fff3d8; color:#89600d; padding:3px 8px; border-radius:5px; font-size:10px; font-weight:600; }
.product-links { display:flex; gap:8px; margin:14px 0; }
.product-links button { display:flex; align-items:center; justify-content:center; gap:7px; flex:1; padding:8px 10px; background:#f1f4f8; border:1px solid #e4eaf2; border-radius:7px; color:#344b6c; font:inherit; font-size:12px; font-weight:600; cursor:pointer; min-height:40px; }
.product-links button:hover { color:#1c2d52; background:#e5ecf5; border-color:#c7d4e5; text-decoration:none; }
.product-actions { display:flex; gap:8px; padding-top:14px; border-top:1px solid #edf0f5; }
.product-actions .btn { flex:1; padding:10px 6px; border-radius:7px; font-size:12px; }
.product-facts { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.product-facts dt { color:#7c889a; font-size:12px; font-weight:400; }
.product-facts dd { color:#17233b; font-size:14px; margin:3px 0 0; overflow-wrap:anywhere; }
.product-description { color:#69758a; white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:575.98px) { .product-actions .btn { min-height:42px; } }

/* Uniform height for product card actions. */
.product-links button, .product-actions .btn { min-height:36px; height:36px; display:flex; align-items:center; justify-content:center; padding:8px 10px; line-height:1.2; }

.history-remision-link { display:inline-flex; align-items:center; gap:6px; font-weight:600; color:#1c2d52; text-decoration:underline; text-underline-offset:3px; }
/* Soft movement labels with readable text. */
.history-page tr[data-tipo] td:nth-child(4) .badge { padding:5px 9px; font-size:11px; line-height:1.2; font-weight:600; border-radius:6px; background:#edf0f5 !important; color:#475569 !important; }
.history-page tr[data-tipo="entrada"] td:nth-child(4) .badge { background:#e6f5eb !important; color:#22613d !important; }
.history-page tr[data-tipo="salida"] td:nth-child(4) .badge,
.history-page tr[data-tipo="eliminar"] td:nth-child(4) .badge { background:#fce8eb !important; color:#983744 !important; }
.history-page tr[data-tipo="remision"] td:nth-child(4) .badge { background:#fff3d6 !important; color:#805a12 !important; }
.history-page tr[data-tipo="excel"] td:nth-child(4) .badge { background:#e1f3f6 !important; color:#24616c !important; }
.history-page tr[data-tipo="ajuste"] td:nth-child(4) .badge,
.history-page tr[data-tipo="editar"] td:nth-child(4) .badge { background:#e9effc !important; color:#385b96 !important; }
.reception-page { max-width:1120px; }
.reception-reader,.reception-review { padding:24px; margin-bottom:20px; }
.reader-input-row { display:flex; gap:12px; }
.reader-input-row .form-control { flex:1; min-width:0; font-family:monospace; }
.reception-heading,.reception-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.reception-heading { margin-bottom:18px; }
.reception-heading h2 { font-size:18px; margin:0 0 6px; }
.reception-review td { overflow-wrap:anywhere; }
@media(max-width:575.98px) { .reception-reader,.reception-review { padding:16px; } .reader-input-row,.reception-heading { flex-direction:column; align-items:stretch; } .reception-footer { flex-wrap:wrap; } .reception-footer .btn { flex:1; } }
/* Reception confirmation matches the main Macrodent actions. */
#saveReceipt { background:#1c2d52; border-color:#1c2d52; color:#fff; }
#saveReceipt:hover:not(:disabled), #saveReceipt:active:not(:disabled) { background:#293f68; border-color:#293f68; }
#saveReceipt:disabled { background:#e8ecf2; border-color:#dce2eb; color:#788497; opacity:1; cursor:not-allowed; }
#compareCount,#updateCount { background:#1c2d52; border-color:#1c2d52; color:#fff; }
#compareCount:hover:not(:disabled),#updateCount:hover:not(:disabled) { background:#293f68; border-color:#293f68; }
#compareCount:disabled,#updateCount:disabled { background:#e8ecf2; border-color:#dce2eb; color:#788497; opacity:1; }
/* Compact history rows, with enough room for operator names. */
.history-page .table th { padding:11px 12px; }
.history-page .table td { padding:12px 12px; line-height:1.5; vertical-align:middle; }
.history-page .table th:nth-child(5),.history-page .table td:nth-child(5) { min-width:195px; }
.history-page .table th:nth-child(7),.history-page .table td:nth-child(7) { min-width:110px !important; white-space:nowrap; }
.history-page .table .show-details { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; padding:0; line-height:1; }
.history-page tr[data-tipo] td:nth-child(4) .badge { padding:4px 7px; }
/* Matching, vertically centered Excel import dialogs. */
.excel-import-modal .modal-dialog { width:calc(100% - 32px); max-width:560px; margin:16px auto; min-height:calc(100vh - 32px); min-height:calc(100dvh - 32px); display:flex; align-items:center; }
.excel-import-modal .modal-dialog::before { display:none; }
.excel-import-modal .modal-content { width:100%; max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); }
.excel-import-modal .modal-header { padding:20px 24px; align-items:center; }
.excel-import-modal .modal-title { font-size:16px; line-height:1.4; }
.excel-import-modal .modal-body { padding:24px; }
.excel-import-modal .modal-footer { padding:16px 24px; gap:10px; }
.excel-import-modal .modal-footer .btn { margin:0; min-width:130px; height:40px; padding:8px 16px; font-size:12px; }
.excel-import-modal .excel-file-input { display:block; width:100%; height:48px; padding:0 12px 0 0; border:1px solid #d9e1ed; border-radius:8px; background:#fff; color:#69758a; font:12px/46px Inter,'Segoe UI',sans-serif; cursor:pointer; }
.excel-file-input::file-selector-button { height:46px; padding:0 16px; margin:0 12px 0 0; border:0; border-right:1px solid #d9e1ed; background:#f1f4f8; color:#1c2d52; font:600 12px Inter,'Segoe UI',sans-serif; cursor:pointer; }
.excel-file-input::file-selector-button:hover { background:#e7edf5; }
.excel-file-input:focus-visible { outline:2px solid #8095ba; outline-offset:3px; }
.excel-file-help { margin:10px 0 0; color:#8490a2; font-size:12px; }
@media(max-width:575.98px) {
 .excel-import-modal .modal-header,.excel-import-modal .modal-body { padding:18px; }
 .excel-import-modal .modal-footer { padding:14px 18px; }
 .excel-import-modal .modal-footer .btn { min-width:0; flex:1; }
}
.excel-import-note { color:#617089; font-size:12px; line-height:1.6; margin:0 0 12px; }
.excel-format-help { background:#f6f8fb; border:1px solid #e7edf5; border-radius:8px; padding:10px 12px; margin-bottom:18px; }
.excel-format-help summary { color:#344b6c; font-size:12px; font-weight:600; cursor:pointer; }
.excel-format-help p { color:#69758a; font-size:12px; margin:12px 0 8px; }
.excel-column-list { display:flex; flex-wrap:wrap; gap:6px; }
.excel-column-list code { background:#fff; border:1px solid #e1e7f0; padding:3px 6px; border-radius:4px; color:#344b6c; font-size:11px; }
.excel-template-download { margin:0 0 16px; }
.excel-template-download .btn { display:inline-flex; align-items:center; font-size:12px; }
.excel-template-download p { margin:8px 0 0; font-size:11px; color:#7a879b; line-height:1.5; }
.signature-status { display:flex; flex-direction:column; align-items:center; gap:5px; max-width:240px; margin:auto; }
.signature-status span { display:inline-flex; align-items:center; gap:5px; color:#47715e; font-size:11px; }
.signature-status strong { color:#34455e; font-size:12px; font-weight:500; line-height:1.45; }
.stock-status { padding:3px 8px; border-radius:5px; font-size:10px; font-weight:600; }
.stock-low { background:#fff3d8; color:#89600d; }
.stock-critical { background:#fce8eb; color:#983744; }
.stock-stable { background:#e6f5eb; color:#22613d; }

/* Center every Bootstrap modal; tall dialogs remain scrollable. */
.modal .modal-dialog{display:flex;align-items:center;min-height:calc(100% - 2rem);margin:1rem auto;pointer-events:none}
.modal .modal-dialog::before{display:none}
.modal .modal-content{width:100%;pointer-events:auto;max-height:calc(100vh - 2rem);max-height:calc(100dvh - 2rem);display:flex;flex-direction:column}
.modal .modal-header,.modal .modal-footer{flex-shrink:0}
.modal .modal-body{min-height:0;overflow-y:auto;overscroll-behavior:contain}
.modal .modal-content>form{display:flex;flex-direction:column;min-height:0;overflow-y:auto}
@media(max-width:575.98px){.modal .modal-dialog{margin:.5rem;min-height:calc(100% - 1rem)}.modal .modal-content{max-height:calc(100vh - 1rem);max-height:calc(100dvh - 1rem)}}

/* Grouped inventory navigation, matching controlfresadoras. */
.inventory-menu{border:1px solid #e2e9f4;border-radius:12px;box-shadow:0 8px 24px rgba(29,49,91,.08);max-height:calc(100vh - 100px);overflow-y:auto}
.inventory-menu .dropdown-item{border-radius:7px}
.inventory-menu .dropdown-item i{margin:0!important}
.inventory-menu .dropdown-item span{min-width:0}
.inventory-menu .dropdown-header{font-weight:600}
.inventory-menu .dropdown-divider{margin:6px 4px;border-color:#e2e9f4}
.inventory-menu .dropdown-item:hover i,.inventory-menu .dropdown-item:focus i{color:#1d315b}
