/* ── Results table (zones 1 & 2) ── */
.results-table { font-size: 13px; }
.results-table th { font-size: 11px; position: sticky; top: 0; z-index: 1; }
.results-table .th-wh    { width: 60px;  text-align: center; }
.results-table .th-price { width: 100px; text-align: right; }
.results-table .th-cart  { width: 34px;  padding: 0; }
.results-table .product-row,
.results-table .analog-row { cursor: pointer; outline: none; }
.results-table .product-row.row-active td,
.results-table .analog-row.row-active  td { background: #edf2ff; }
.results-table .product-row:focus td,
.results-table .analog-row:focus  td      { outline: 2px solid var(--clr-primary); outline-offset: -2px; }
.td-article { font-family: monospace; white-space: nowrap; font-size: 12px; }
.td-brand   { white-space: nowrap; color: var(--clr-muted); }
.td-wh      { text-align: center; font-weight: 600; color: var(--clr-success); }
.td-wh.wh-zero { color: var(--clr-muted); font-weight: 400; }
.td-price   { text-align: right; font-weight: 600; white-space: nowrap; }
.td-price.no-price { color: var(--clr-muted); font-weight: 400; }
.td-cart    { padding: 2px 4px; width: 34px; }
.btn-row-cart {
  border: none; background: none; font-size: 14px; padding: 2px 4px;
  line-height: 1; cursor: pointer; opacity: .5; border-radius: 3px;
}
.btn-row-cart:hover { opacity: 1; background: #edf2ff; }
.analog-row.analog-ext td { color: var(--clr-muted); font-style: italic; }
.results-group-sep td {
  background: var(--clr-bg); color: var(--clr-muted);
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  padding: 4px 10px; border-top: 2px solid var(--clr-border);
}

/* Zone states */
.zone-empty,
.zone-placeholder { padding: 24px; text-align: center; color: var(--clr-muted); font-size: 13px; }
.zone-loading     { padding: 16px; text-align: center; color: var(--clr-muted); font-size: 13px; }

/* ── Cart popup ── */
.popup-header { font-size: 14px; margin-bottom: 8px; line-height: 1.4; }
.popup-prod-name { color: var(--clr-muted); }
.popup-price  { font-size: 13px; color: var(--clr-muted); margin-bottom: 12px; }
.popup-price .no-price { color: var(--clr-warning); }
.popup-fields { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.popup-label  { font-size: 12px; color: var(--clr-muted); white-space: nowrap; }
.popup-wh, .popup-note { height: 30px; font-size: 13px; }
.popup-qty    { height: 30px; font-size: 14px; font-weight: 600; width: 80px; text-align: right; }
.popup-btns   { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }
.popup-btns button { min-width: 100px; }

/* ── Zone 3 inline card ── */
.icard-header {
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--clr-border);
}
.icard-title { font-size: 13px; line-height: 1.4; }
.icard-group { font-size: 12px; }

.icard-body {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--clr-border);
}
.icard-photo {
  width: 80px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--clr-border); padding: 10px;
}
.photo-stub { font-size: 28px; color: var(--clr-border); }

.icard-wh-blocks { display: flex; flex: 1; }
.wh-block {
  flex: 1; padding: 8px 12px; font-size: 12px;
  border-right: 1px solid var(--clr-border);
}
.wh-title  { font-weight: 700; font-size: 12px; margin-bottom: 5px; color: var(--clr-primary); }
.wh-row    { display: flex; gap: 6px; margin-bottom: 3px; }
.wh-label  { color: var(--clr-muted); min-width: 62px; }
.wh-val    { font-weight: 500; }

.icard-actions {
  padding: 10px 12px; min-width: 120px; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.icard-actions button.primary { padding: 7px 12px; }

.prices-strip {
  padding: 5px 12px; font-size: 12px; color: var(--clr-muted);
  background: #fafbff; border-bottom: 1px solid var(--clr-border);
}

/* ── Cart drawer ── */
.cart-title {
  font-size: 15px; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.cart-close-btn { border: none; background: none; font-size: 16px; color: var(--clr-muted); padding: 0; }
.cart-close-btn:hover { color: var(--clr-danger); background: none; }
.cart-empty { color: var(--clr-muted); padding: 24px; text-align: center; }
.cart-line {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 0; border-bottom: 1px solid var(--clr-border); font-size: 13px;
}
.cart-line-top     { display: flex; gap: 8px; align-items: flex-start; }
.cart-line-article { font-family: monospace; font-size: 11px; color: var(--clr-muted); }
.cart-line-name    { flex: 1; }
.cart-line-price   { white-space: nowrap; font-weight: 600; }
.cart-line-controls { display: flex; align-items: center; gap: 6px; }
.cart-line-controls input[type="text"] { width: 60px; height: 26px; padding: 2px 6px; text-align: right; }
.cart-line-del     { padding: 2px 8px; color: var(--clr-danger); border-color: var(--clr-danger); font-size: 12px; }
.cart-total        { font-weight: 700; margin-top: 10px; font-size: 14px; text-align: right; }
.cart-actions      { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cart-confirm      { font-size: 15px; padding: 10px; }
.cart-deficit      { color: var(--clr-danger); font-size: 12px; margin-top: 8px; }
.cart-meta         { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }

/* ── Photo thumbnail in search result rows ── */
.row-photo-thumb {
  width: 40px; height: 40px; object-fit: contain;
  vertical-align: middle; border-radius: 2px;
  cursor: pointer; margin-right: 3px; flex-shrink: 0;
}
.photo-icon {
  font-size: 11px; cursor: pointer; opacity: .6;
  user-select: none; vertical-align: middle;
}
.photo-icon:hover { opacity: 1; }

/* ── Cross-search indicator row ── */
.cross-indicator-row td { padding: 0 0 3px 10px; }
.cross-indicator-cell {
  font-size: 11px; color: var(--clr-primary);
  font-style: italic; padding: 0 10px 3px 22px;
  border-bottom: none;
}

/* ── Zone 3 photo slot ── */
.icard-photo-img {
  width: 60px; height: 60px; object-fit: contain;
  cursor: pointer; border-radius: 2px;
}
.icard-photo { position: relative; }
.photo-count {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 10px; padding: 1px 4px; border-radius: 3px;
}

/* ── Hover preview popup ── */
.photo-preview {
  position: fixed; z-index: 1200;
  background: #fff; border: 1px solid var(--clr-border);
  border-radius: 4px; box-shadow: 0 4px 20px rgba(0,0,0,.18);
  padding: 4px; pointer-events: none;
}
.photo-preview img { display: block; max-width: 260px; max-height: 260px; object-fit: contain; }
.photo-preview-count {
  font-size: 11px; text-align: center; color: var(--clr-muted); margin-top: 3px;
}

/* ── Photo modal ── */
.photo-modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
}
.photo-modal-box {
  position: relative; background: #fff;
  border-radius: 6px; padding: 12px;
  max-width: min(800px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  overflow: hidden;
}
.photo-modal-img {
  max-width: 100%; max-height: 60vh; object-fit: contain; border-radius: 2px;
}
.photo-modal-counter {
  font-size: 12px; color: var(--clr-muted); min-height: 16px;
}
.photo-modal-close {
  position: absolute; top: 8px; right: 8px;
  border: none; background: rgba(0,0,0,.08);
  font-size: 15px; padding: 2px 7px; border-radius: 3px; cursor: pointer;
}
.photo-modal-close:hover { background: rgba(0,0,0,.15); }
.photo-modal-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: none; background: rgba(0,0,0,.35); color: #fff;
  font-size: 22px; padding: 8px 12px; border-radius: 3px; cursor: pointer;
}
.photo-modal-nav:hover { background: rgba(0,0,0,.6); }
.photo-nav-prev { left: 8px; }
.photo-nav-next { right: 8px; }
.photo-modal-thumbs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.photo-thumb {
  width: 52px; height: 52px; object-fit: contain;
  border: 2px solid transparent; border-radius: 3px; cursor: pointer; opacity: .7;
}
.photo-thumb:hover { opacity: 1; }
.photo-thumb.active { border-color: var(--clr-primary); opacity: 1; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #323232; color: #fff;
  padding: 10px 18px; border-radius: var(--radius);
  font-size: 13px; z-index: 9000;
  animation: fadeIn .2s ease;
}
.toast.error   { background: var(--clr-danger); }
.toast.success { background: var(--clr-success); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ── Service section ── */
.service-subnav {
  display: flex; gap: 0; border-bottom: 1px solid var(--clr-border);
  background: var(--clr-surface); flex-shrink: 0;
}
.service-tab {
  padding: 10px 20px; font-size: 13px; font-weight: 500;
  border: none; background: none; cursor: pointer; color: var(--clr-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.service-tab:hover { color: var(--clr-text); }
.service-tab-active { color: var(--clr-primary); border-bottom-color: var(--clr-primary); font-weight: 600; }
.service-content { flex: 1; overflow-y: auto; padding: 16px 20px; }
.service-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.service-no-access { color: var(--clr-muted); padding: 32px; text-align: center; }

/* Users table */
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th, .users-table td {
  padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--clr-border);
}
.users-table th { font-weight: 600; background: var(--clr-bg); }
.user-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-active   { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #fee2e2; color: #b91c1c; }
.btn-link { background: none; border: none; color: var(--clr-primary); cursor: pointer; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }
.btn-secondary { background: var(--clr-bg); border: 1px solid var(--clr-border); }
.btn-danger { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 600;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--clr-surface); border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.2); padding: 28px 28px 24px;
  width: min(460px, 96vw); max-height: 90vh; overflow-y: auto;
}
.modal-form { display: flex; flex-direction: column; gap: 8px; }
.modal-form h3 { margin: 0 0 8px; font-size: 17px; }
.modal-form label { font-size: 12px; color: var(--clr-muted); font-weight: 600; }
.modal-form input, .modal-form select { height: 34px; width: 100%; }
.modal-actions { display: flex; gap: 8px; margin-top: 8px; }
.perm-check-label {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 8px 10px; background: var(--clr-bg); border-radius: var(--radius);
  cursor: pointer; border: 1px solid var(--clr-border);
}
.perm-check-label input { width: auto; height: auto; }

/* Roles matrix */
.roles-toolbar { margin-bottom: 12px; }
.roles-matrix-wrap { overflow: auto; }
.roles-matrix { border-collapse: collapse; font-size: 12px; min-width: 600px; }
.roles-matrix th, .roles-matrix td {
  border: 1px solid var(--clr-border); padding: 4px 8px; vertical-align: middle;
}
.roles-matrix th { background: var(--clr-bg); font-weight: 600; text-align: center; }
.perm-col { min-width: 200px; text-align: left !important; }
.role-col { min-width: 120px; }
.perm-group-label { background: var(--clr-bg); font-weight: 700; font-size: 11px;
  text-transform: uppercase; color: var(--clr-muted); padding: 6px 8px; }
.perm-cell { text-align: center; }
.perm-cell-locked { color: var(--clr-muted); background: #f9fafb; }
.perm-cell-on { color: var(--clr-primary); font-weight: 700; }
.scope-select { font-size: 11px; height: 22px; padding: 0 2px; width: 64px; }
.perm-name { font-size: 12px; }

/* ── Section stubs ── */
.stub-wrapper {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 48px 24px; max-width: 480px; text-align: center;
}
.stub-icon    { font-size: 48px; line-height: 1; }
.stub-title   { font-size: 24px; font-weight: 700; color: var(--clr-text); }
.stub-coming  { font-size: 14px; color: var(--clr-muted); }
.stub-items   {
  list-style: none; padding: 0; margin: 0; text-align: left;
  border: 1px solid var(--clr-border); border-radius: var(--radius);
  background: var(--clr-surface); min-width: 280px;
}
.stub-items li {
  padding: 9px 16px; font-size: 13px; color: var(--clr-muted);
  border-bottom: 1px solid var(--clr-border);
}
.stub-items li:last-child { border-bottom: none; }
.stub-items li::before    { content: '·  '; color: var(--clr-primary); }

/* ── Full-screen product card ── */
#goods-list-view { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.goods-card-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--clr-surface); }
.card-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; flex-shrink: 0;
  border-bottom: 1px solid var(--clr-border); background: var(--clr-surface);
}
.card-toolbar-title { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-toolbar-article { font-family: monospace; font-weight: 700; }
.card-main-form {
  flex-shrink: 0; padding: 14px 18px; border-bottom: 1px solid var(--clr-border);
  background: var(--clr-surface); overflow-y: auto; max-height: 280px;
}
.card-header-layout { display: flex; gap: 20px; align-items: flex-start; }
.card-fields { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; align-items: center; flex: 1; }
.card-fields label { font-size: 12px; color: var(--clr-muted); font-weight: 600; white-space: nowrap; }
.card-fields input, .card-fields select, .card-fields textarea { font-size: 13px; }
.card-fields textarea { resize: vertical; min-height: 52px; }
.card-article-static { font-family: monospace; font-size: 14px; font-weight: 700; }
.card-primary-photo {
  width: 120px; height: 120px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--clr-border); border-radius: var(--radius); overflow: hidden;
}
.card-photo-stub  { font-size: 36px; color: var(--clr-border); }
.card-photo-img   { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.card-photo-count {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 3px; pointer-events: none;
}
.card-primary-photo { position: relative; }
.card-tabs-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.card-tabs-nav  { display: flex; flex-shrink: 0; overflow-x: auto; border-bottom: 1px solid var(--clr-border); background: var(--clr-bg); }
.card-tab {
  padding: 8px 16px; font-size: 13px; border: none; border-radius: 0;
  background: none; color: var(--clr-muted); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.card-tab:hover { color: var(--clr-text); background: var(--clr-surface); }
.card-tab-active { color: var(--clr-primary); border-bottom-color: var(--clr-primary); font-weight: 600; }
.card-tabs-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.card-loading { padding: 16px; text-align: center; }
.card-sub-table { font-size: 13px; margin-bottom: 16px; }
.card-sub-table th { font-size: 11px; }
.td-mono    { font-family: monospace; font-size: 12px; }
.td-actions { width: 100px; text-align: right; white-space: nowrap; }
.th-actions { width: 100px; }
.btn-small  { padding: 3px 8px; font-size: 12px; margin-left: 4px; }
.td-qty     { text-align: right; font-weight: 600; width: 70px; }
.card-sup-warning {
  background: #fff7e6; border: 1px solid #ffe0a0; border-radius: var(--radius);
  padding: 8px 12px; font-size: 12px; color: #7a5800; margin-bottom: 12px;
}
.card-add-form { margin-top: 8px; }
.card-add-form-title { font-size: 13px; color: var(--clr-primary); cursor: pointer; padding: 6px 0; user-select: none; }
.card-add-form-title:hover { text-decoration: underline; }
.card-add-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px;
  background: var(--clr-bg); border-radius: var(--radius); border: 1px solid var(--clr-border); margin-top: 4px;
}
.card-add-row input { flex: 1; min-width: 120px; max-width: 220px; height: 30px; font-size: 13px; }
.card-price-section { margin-bottom: 24px; }
.card-price-wh-title { font-weight: 700; font-size: 14px; color: var(--clr-primary); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 2px solid var(--clr-primary); }
.card-price-stock-title { font-size: 12px; font-weight: 600; color: var(--clr-muted); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.price-val { text-align: right; font-weight: 600; }
.price-row-active td { background: #edf2ff; }
.card-img-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.card-img-thumb {
  width: 120px; height: 120px; position: relative;
  border: 2px solid var(--clr-border); border-radius: var(--radius); overflow: hidden; cursor: pointer;
}
.card-img-thumb.card-img-primary { border-color: var(--clr-primary); }
.card-img-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-img-thumb:hover { border-color: var(--clr-primary-h); }
.card-img-badge { position: absolute; top: 4px; left: 4px; background: var(--clr-primary); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 3px; }
.icard-article-link { font-family: monospace; font-weight: 700; font-size: 13px; color: var(--clr-primary); }
.icard-article-link:hover { text-decoration: underline; }
/* ===== Orders module ===== */
.orders-pane { flex-direction: column; }
.orders-list-view, .orders-card-view { flex: 1; overflow: auto; padding: 12px 16px; }

.orders-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; align-items: center; }
.orders-filters input, .orders-filters select { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
.orders-flt-q { min-width: 200px; }
.orders-cp-filter { position: relative; }
.orders-cp-drop { position: absolute; z-index: 20; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; min-width: 200px; box-shadow: 0 4px 14px rgba(0,0,0,.12); max-height: 240px; overflow: auto; }
.orders-cp-opt { padding: 6px 10px; cursor: pointer; }
.orders-cp-opt:hover { background: #eef2ff; }

.orders-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.orders-table th, .orders-table td { padding: 7px 10px; border-bottom: 1px solid #eef1f4; text-align: left; }
.orders-table th { color: #64748b; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.orders-table td.num, .orders-table th.num, .order-lines td.num, .order-lines th.num { text-align: right; }
.orders-row { cursor: pointer; }
.orders-row:hover { background: #f6f8fb; }
.orders-foot { display: flex; gap: 24px; padding: 10px 4px; font-weight: 600; border-top: 2px solid #e2e8f0; margin-top: 4px; }
.orders-pager { display: flex; gap: 8px; margin-top: 10px; }
.orders-pager button { padding: 5px 12px; border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; cursor: pointer; }
.orders-empty, .orders-loading { padding: 24px; text-align: center; }

.ord-status { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.ord-confirmed { background: #dcfce7; color: #166534; }
.ord-cancelled { background: #fee2e2; color: #991b1b; }
.ord-draft { background: #e2e8f0; color: #475569; }
.res-badge { font-size: 11px; font-weight: 600; }
.res-badge.overdue { color: #b91c1c; }
.res-badge.soon { color: #b45309; }

/* order card */
.order-head h2 { margin: 6px 0; display: flex; align-items: center; gap: 10px; }
.btn-back { background: none; border: none; color: #2563eb; cursor: pointer; padding: 4px 0; font: inherit; }
.order-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 6px 0 12px; }
.meta-item { display: flex; flex-direction: column; }
.meta-k { font-size: 11px; color: #64748b; text-transform: uppercase; }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.btn { padding: 6px 12px; border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; cursor: pointer; font: inherit; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.order-tabnav { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin-bottom: 10px; }
.order-tabnav button { padding: 7px 14px; border: none; background: none; cursor: pointer; font: inherit; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.order-tabnav button.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.order-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-lines th, .order-lines td { padding: 6px 9px; border-bottom: 1px solid #eef1f4; }
.qty-inp { width: 72px; padding: 3px 5px; border: 1px solid #cbd5e1; border-radius: 5px; text-align: right; }
.line-del { border: none; background: none; color: #dc2626; cursor: pointer; font-size: 15px; }
.order-total { text-align: right; padding: 10px 9px; font-size: 15px; }
.order-addline { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.order-addline input, .order-addline select { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 6px; }
.add-art { width: 160px; } .add-qty { width: 80px; }
.order-log { display: flex; flex-direction: column; gap: 2px; }
.log-row { display: grid; grid-template-columns: 150px 130px 130px 1fr; gap: 10px; padding: 5px 4px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.log-act { font-weight: 600; }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 10px; padding: 18px 20px; max-width: 560px; max-height: 80vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* header notify + retail */
.btn-notify { position: relative; background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px 6px; }
.notify-badge { position: absolute; top: -2px; right: -4px; background: #f59e0b; color: #fff; border-radius: 9px; font-size: 11px; padding: 0 5px; min-width: 16px; text-align: center; }
.notify-badge.overdue { background: #dc2626; }
.notify-drop { position: fixed; z-index: 120; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; width: 340px; max-height: 400px; overflow: auto; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.notify-title { font-weight: 600; padding: 10px 12px; border-bottom: 1px solid #eef1f4; }
.notify-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.notify-item:hover { background: #f6f8fb; }
.notify-item.overdue { border-left: 3px solid #dc2626; }
.notify-when { color: #64748b; font-size: 12px; }
.notify-empty { padding: 16px; text-align: center; }
.btn-retail { padding: 5px 10px; border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; cursor: pointer; margin-left: 4px; }

/* settings */
.settings-group { margin-bottom: 20px; }
.settings-group h3 { margin: 8px 0; }
.setting-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.setting-label { flex: 1; }
.setting-desc { font-size: 12px; }
.setting-input { width: 120px; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 6px; }
/* ===== Orders v1 additions ===== */
/* product autocomplete */
.ac-drop { position:absolute; z-index:60; background:#fff; border:1px solid #cbd5e1; border-radius:6px;
  min-width:340px; max-height:280px; overflow:auto; box-shadow:0 6px 20px rgba(0,0,0,.14); top:100%; left:0; }
.ac-opt { display:grid; grid-template-columns:110px 90px 1fr 70px; gap:8px; align-items:center; padding:5px 9px; cursor:pointer; font-size:13px; }
.ac-opt.active, .ac-opt:hover { background:#eef2ff; }
.ac-art { font-weight:600; } .ac-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ac-stock { text-align:right; color:#475569; } .ac-empty { padding:8px 10px; }

/* delivery block */
.delivery-block { border:1px solid #e2e8f0; border-radius:8px; padding:10px 12px; margin:10px 0; }
.delivery-title { font-weight:600; margin-bottom:6px; }
.delivery-row { display:flex; align-items:center; gap:8px; margin:4px 0; }
.delivery-label { width:96px; color:#64748b; font-size:13px; }
.delivery-row input, .delivery-row select { flex:1; padding:5px 8px; border:1px solid #cbd5e1; border-radius:6px; font:inherit; }
.cart-delivery .delivery-block { margin:8px 0; }

/* reserve header block */
.reserve-block { display:flex; flex-wrap:wrap; gap:6px 20px; background:#f1f5f9; border-radius:8px; padding:8px 12px; margin:8px 0; font-size:13px; }
.reserve-block.overdue { background:#fef2f2; }
.reserve-exp { color:#b91c1c; }

/* line color coding */
.oline-nostock { background:#fef2f2; }
.oline-partial { background:#fffbeb; }
.oline-belowcost .oline-price { color:#b45309; font-weight:600; }
.oline-partial-note { font-size:11px; color:#b45309; }
.oline-avail { font-size:12px; white-space:nowrap; }
.manual-badge { color:#7c3aed; cursor:help; }
.oline-price.manual { color:#7c3aed; }
.price-edit { border:none; background:none; cursor:pointer; color:#2563eb; margin-left:4px; }
.wh-sel { padding:2px 4px; border:1px solid #cbd5e1; border-radius:5px; }

/* header edit controls */
.cp-change-wrap { position:relative; }
.cp-change { margin-top:2px; padding:2px 6px; border:1px solid #cbd5e1; border-radius:5px; font-size:12px; width:150px; }
.pt-sel { padding:2px 6px; border:1px solid #cbd5e1; border-radius:5px; }

/* cart manual price / below cost */
.cart-line-price.manual { color:#7c3aed; }
.cart-line.below-cost { border-left:3px solid #f59e0b; }
.cart-line-price .price-edit { font-size:12px; }
/* ===== Sales module ===== */
.sales-pane { flex-direction: column; }
#sales-main { flex: 1; display: flex; flex-direction: column; }
.sales-content { flex: 1; overflow: auto; padding: 8px 12px; }
.sales-card-view, #sales-card-view { flex: 1; overflow: auto; padding: 12px 16px; }
.fs-badge { background: #e0e7ff; color: #3730a3; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.cart-direct { margin-top: 6px; padding: 8px; border: 1px solid #2563eb; color: #2563eb; background: #fff; border-radius: 6px; cursor: pointer; width: 100%; }
.cart-direct:hover { background: #eff6ff; }

.log-row { grid-template-columns: 160px 150px 1fr; }

.orders-toolbar { margin-bottom: 8px; }

.ord-partially_shipped { background: #fef3c7; color: #92400e; }
.ord-shipped { background: #dbeafe; color: #1e40af; }
