.stock-workspace { min-width: 0; }
.stock-workspace > :not(.team-topbar) { margin-left: 28px; margin-right: 28px; }
.stock-toolbar, .stock-actions, .stock-tabs, .stock-search, .stock-filter-controls, .stock-pagination, .stock-pagination > div, .stock-row-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stock-toolbar { justify-content: space-between; margin-bottom: 18px; }
.stock-main-toolbar { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(148px, auto); gap: 16px; align-items: center; min-height: 44px; }
.stock-filter-controls { min-width: 0; justify-content: flex-end; }
.stock-main-toolbar .stock-search { margin-left: auto; }
.stock-action-slot { min-width: 148px; justify-content: flex-end; }
.stock-action-placeholder { display: block; min-width: 148px; min-height: 44px; }
.stock-tabs-placeholder { min-height: 44px; }
.stock-search { flex: 1; max-width: 540px; }
.stock-search > .input, .stock-search > .field { flex: 1; min-width: 150px; }
.stock-tabs .active { background: var(--surface-soft, #e5f6f3); }
.stock-summary { display: flex; align-items: center; gap: 28px; margin: -4px 0 18px; padding: 12px 16px; color: var(--muted, #718299); background: #fff; border: 1px solid var(--border, #dce6ed); border-radius: 12px; }
.stock-summary b { color: var(--text, #202d42); font-size: 18px; }
.stock-summary .stock-low b { color: #9a610b; }
.stock-supplier-field > div { display: flex; gap: 8px; align-items: center; }
.stock-supplier-field .select { min-width: 0; flex: 1; }
.stock-table-wrap { position: relative; overflow-x: auto; background: #fff; border: 1px solid var(--border, #dce6ed); border-radius: 16px; }
.stock-table-wrap.is-loading { min-height: 166px; }
.stock-loading { min-height: 164px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted, #718299); }
.stock-loading-spinner { width: 18px; height: 18px; border: 2px solid #c8dadf; border-top-color: #0c9e91; border-radius: 50%; animation: stock-spin .7s linear infinite; }
.stock-refresh-indicator { position: absolute; top: 10px; right: 12px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; color: var(--muted, #718299); background: color-mix(in srgb, #fff 92%, transparent); border-radius: 999px; font-size: 12px; pointer-events: none; }
.stock-refresh-indicator .stock-loading-spinner { width: 13px; height: 13px; border-width: 2px; }
.stock-summary-loading { min-height: 46px; }
@keyframes stock-spin { to { transform: rotate(360deg); } }
.stock-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stock-table th, .stock-table td { padding: 16px; border-bottom: 1px solid var(--border, #e4edf2); text-align: left; }
.stock-table th { color: var(--muted, #718299); font-size: 12px; font-weight: 600; white-space: nowrap; }
.stock-table tbody tr:last-child td { border-bottom: 0; }
.stock-table td { vertical-align: middle; }
.stock-table small { display: block; color: var(--muted, #718299); margin-top: 6px; }
.stock-name { border: 0; background: none; padding: 0; color: var(--text, #202d42); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.stock-name:hover { color: #0c9e91; }
.stock-name:focus-visible { outline: 2px solid #0c9e91; outline-offset: 4px; }
.stock-low { color: #9a610b; font-weight: 600; }
.stock-archive { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.stock-pagination { justify-content: space-between; margin: 16px 0; color: var(--muted, #718299); }
.stock-row-actions { gap: 4px; }
.stock-client-results { display: grid; gap: 6px; margin-top: 16px; }
.stock-client-results .btn { text-align: left; justify-content: flex-start; }
.stock-sale-picker { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0 20px; }
.stock-sale-product { display: grid; grid-template-columns: minmax(150px, 1fr) 90px; gap: 10px; }
.sale-item-row:has(.stock-sale-product) { grid-template-columns: minmax(240px, 1.4fr) minmax(140px, 1fr) 90px 90px 36px; }
.stock-modal .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stock-modal h3 { margin: 0 0 16px; }
.sale-modal, .stock-modal { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.sale-modal > .modal-header, .sale-modal > .modal-footer,
.stock-modal > .modal-header, .stock-modal > .modal-footer { flex: 0 0 auto; }
.sale-modal > .modal-body, .stock-modal > .modal-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
@media (max-width: 760px) {
  .stock-workspace > :not(.team-topbar) { margin-left: 12px; margin-right: 12px; }
  .stock-workspace .team-topbar { margin-bottom: 12px; }
  .stock-main-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .stock-main-toolbar .stock-tabs { grid-column: 1 / -1; }
  .stock-main-toolbar .stock-filter-controls { grid-column: 1 / -1; order: 3; }
  .stock-main-toolbar .stock-action-slot { grid-column: 2; grid-row: 1; min-width: 0; }
  .stock-main-toolbar .stock-search { flex-basis: 100%; max-width: none; flex-wrap: nowrap; margin-left: 0; }
  .stock-main-toolbar .stock-archive { margin-left: auto; }
  .stock-toolbar { gap: 10px; margin-bottom: 12px; }
  .stock-tabs, .stock-actions { gap: 6px; }
  .stock-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .stock-tabs .btn { flex: 0 0 auto; }
  .stock-summary { justify-content: space-between; gap: 12px; margin-bottom: 12px; }
  .stock-supplier-field > div { align-items: stretch; }
  .stock-table { font-size: 14px; display: block; }
  .stock-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stock-table tbody { display: block; }
  .stock-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; gap: 12px; border-bottom: 1px solid #e4edf2; }
  .stock-table tr:last-child { border-bottom: 0; }
  .stock-table td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .stock-table td::before { content: attr(data-label); display: block; font-size: 12px; color: #718299; margin-bottom: 4px; }
  .stock-table td:first-child { grid-column: 1 / -1; }
  .stock-table td:first-child::before { display: none; }
  .stock-table td:has(.stock-row-actions) { grid-column: 1 / -1; }
  .stock-row-actions .btn { min-height: 44px; }
  .stock-modal .form-grid { grid-template-columns: 1fr; }
  .stock-sale-picker { grid-template-columns: minmax(0, 1fr) auto; }
  .sale-item-row:has(.stock-sale-product) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-sale-product { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) 90px; }
  .mobile-bottom-nav:has([data-view="inventory"]) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
