.stock-tabs{display:flex;gap:3px;flex-wrap:wrap;width:100%;border-bottom:1px solid #b8c8da;padding-top:3px}
.stock-tabs button{font:12px Arial,sans-serif;border:1px solid #bac9d8;border-bottom:0;background:#edf2f8;color:#344a60;padding:6px 12px;cursor:pointer}
.stock-tabs button.active{font-weight:700;background:white;box-shadow:inset 0 -3px #3878a9}
.stock-reference-filters{display:flex;gap:14px;align-items:center;flex-wrap:wrap;width:100%;font:12px Arial,sans-serif;padding:4px 0}
.stock-reference-filters select{font:inherit;height:26px;border:1px solid #b8c8da;background:white}
.stock-reference-filters span,.stock-reference-source{font:11px Arial,sans-serif;color:#546b80}
.stock-reference-source{padding:4px 0}
.stock-reference-pages{display:flex;justify-content:center;align-items:center;gap:12px;font:12px Arial,sans-serif;padding:5px}
.stock-reference-pages button,.stock-reference-table button{font:12px Arial,sans-serif;padding:3px 8px;cursor:pointer}
.stock-reference-table th:nth-child(3){width:32%}.stock-reference-table td{overflow-wrap:anywhere}
#moduleExtraToolbar:has(.stock-tabs){display:flex;flex-wrap:wrap;gap:4px}
#view-module:has(.stock-tabs) .module-table-wrap{width:100%;max-height:none;min-height:0;box-sizing:border-box}
@media print{#view-module:has(.stock-tabs) .module-table-wrap{height:auto!important;overflow:visible}}

/* One compact row baseline for all primary module tables. */
.clinic-view{--main-row-height:28px;--main-header-height:30px}
.clinic-view :is(.module-table,.catalog-table,.df-table,.care-table,.ab-table){height:auto;min-height:0}
.clinic-view :is(.module-table,.catalog-table,.df-table,.care-table,.ab-table)>tbody>tr{height:var(--main-row-height)!important;min-height:0}
.clinic-view :is(.module-table,.catalog-table,.df-table,.care-table,.ab-table)>tbody>tr>:is(td,th){height:var(--main-row-height)!important;padding:3px 6px!important;line-height:18px!important;vertical-align:middle;box-sizing:border-box}
.clinic-view :is(.module-table,.catalog-table,.df-table,.care-table,.ab-table)>thead>tr:not(.pm-name-row)>th{height:var(--main-header-height)!important;padding:4px 6px!important;line-height:18px!important;box-sizing:border-box}
.clinic-view :is(.module-table,.catalog-table,.df-table,.care-table)>tbody :is(.button,.catalog-edit-button,.catalog-delete-button,.ee-row-button){min-height:20px!important;height:20px!important;padding:1px 4px!important;line-height:18px!important}
.clinic-view :is(.module-table,.catalog-table,.df-table,.care-table)>tbody :is(input:not([type=checkbox]):not([type=radio]),select){min-height:20px!important;height:20px!important;padding-top:1px!important;padding-bottom:1px!important;box-sizing:border-box}
.clinic-view th[data-main-sort]{cursor:pointer;user-select:none}
.clinic-view th[data-main-sort]:focus-visible{outline:2px solid #337ab7;outline-offset:-2px}
.clinic-view th[data-main-sort][aria-sort=ascending]::after{content:' ▲';font-size:9px}
.clinic-view th[data-main-sort][aria-sort=descending]::after{content:' ▼';font-size:9px}

.clinic-view .stable-columns thead th{position:relative}
.clinic-view .stable-columns thead th{position:sticky}
.table-column-grip{position:absolute;top:0;right:-3px;width:8px;height:100%;cursor:col-resize;touch-action:none;z-index:6;background:transparent}
.table-column-grip:hover,.table-column-grip:focus-visible{background:#4b88b477;outline:none}
.column-resizing,.column-resizing *{cursor:col-resize!important;user-select:none!important}
#moduleContent .catalog-grid-cell{min-width:0;overflow:hidden}
#moduleContent .catalog-grid-cell :is(input,select,textarea){min-width:0!important;max-width:100%;box-sizing:border-box}

/* No animated layout or focus-driven resizing while editing the grid. */
.clinic-view table.stable-columns,.clinic-view table.stable-columns :is(td,th,col,input,select,textarea){transition:none!important;animation:none!important}
#moduleContent .catalog-grid-cell :is(input,textarea){cursor:text;user-select:text}
#moduleContent .catalog-grid-cell input{width:100%!important;min-width:0!important;box-sizing:border-box}
#moduleContent .catalog-grid-cell:focus-within{outline:2px solid #2877b3;outline-offset:-2px}

#moduleContent .pm-table.stable-columns tr>:first-child,#moduleContent .pm-table.stable-columns tr>:nth-child(2){position:sticky}#moduleContent .pm-table.stable-columns tr>:first-child{left:0}#moduleContent .pm-table.stable-columns tr>:nth-child(2){left:var(--pm-code-width)}

/* Editor de estoque compacto, com as seções lado a lado. */
#recordDialog[data-module="inventory"]{width:min(1280px,97vw);max-width:97vw;max-height:96dvh}
#recordDialog[data-module="inventory"] #recordForm{max-height:96dvh}
#recordDialog[data-module="inventory"] #recordForm>header{padding:8px 14px}
#recordDialog[data-module="inventory"] #recordForm>header h2{margin:2px 0;font-size:16px}
#recordDialog[data-module="inventory"] #recordFields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;align-items:start;gap:5px;padding:6px 10px;overflow:auto}
#recordDialog[data-module="inventory"] #recordFields>.record-section{min-width:0;margin:0;padding:6px;border-radius:3px}
#recordDialog[data-module="inventory"] #recordFields>.record-section:first-child{grid-column:1/-1}
#recordDialog[data-module="inventory"] .record-section h3{margin:0 0 4px;font-size:11px}
#recordDialog[data-module="inventory"] .record-section-fields{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 7px}
#recordDialog[data-module="inventory"] .record-field{gap:2px;min-width:0;font-size:11px}
#recordDialog[data-module="inventory"] .record-field :is(input,select){width:100%;min-width:0;min-height:28px;height:28px;padding:3px 6px;font-size:12px}
#recordDialog[data-module="inventory"] #recordForm>footer{padding:6px 12px}
@media(max-width:850px){#recordDialog[data-module="inventory"] #recordFields{grid-template-columns:1fr}#recordDialog[data-module="inventory"] #recordFields>.record-section:first-child{grid-column:auto}}
@media(max-width:540px){#recordDialog[data-module="inventory"] .record-section-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}

#moduleContent .module-table td[data-grid-field="expiration"].inventory-expired{background:#ffe2e2;color:#8b2626}
