.col-sort { color: inherit; font: inherit; text-decoration: none; white-space: nowrap; }
.col-sort:hover { text-decoration: underline; }
.product-prices { display: grid; grid-template-columns: repeat(2, minmax(118px, 1fr)); gap: 8px 16px; margin: 0; min-width: 265px; text-align: right; direction: rtl; }
.product-prices div { display: grid; gap: 2px; min-width: 0; }
.product-prices dt { color: var(--ui-muted); font-size: 11px; }
.product-prices dd { margin: 0; color: var(--ui-ink); font-weight: 750; white-space: nowrap; }
.catalog-price { display: grid; gap: 3px; width: fit-content; max-width: 100%; margin: 16px 0; padding: 12px 18px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--surface-alt); }
.catalog-price span { color: var(--ui-muted); font-size: 12px; }
.catalog-price strong { color: var(--ui-ink); font-size: clamp(17px, 2vw, 24px); overflow-wrap: anywhere; }
.old-price { color: var(--ui-muted); font-size: .85em; margin-inline-end: .4em; }
.ref-prices { display: block; color: var(--ui-muted); font-size: 11px; margin-top: 2px; }
:root[data-theme=dark] .catalog-price, :root[data-theme=dark] .product-prices { color: var(--ui-ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) a:not(.btn), :root:not([data-theme=light]) .btn.ghost { color: #d0e6f6; }
  :root:not([data-theme=light]) .field-help, :root:not([data-theme=light]) .row-sub { color: var(--ui-muted); }
}
@media (max-width: 760px) {
  .product-prices { width: 100%; min-width: 0; }
  .data-table td:has(.product-prices) { grid-column: 1 / -1; display: block; }
  .catalog-price { width: 100%; }
}
@media (max-width: 420px) { .product-prices { grid-template-columns: 1fr; } }
.notification-link { color: var(--ui-ink); border: 1px solid var(--ui-line); border-radius: 8px; padding: 7px 10px; text-decoration: none; font-weight: 700; white-space: nowrap; }
.notification-list { display: grid; gap: 10px; }
.notification-item { display: flex; justify-content: space-between; gap: 18px; padding: 14px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-surface); }
.notification-item.unread { border-inline-start: 3px solid var(--ui-accent); }
.notification-item p { margin: 6px 0; }
.notification-item small { color: var(--ui-muted); }
.notification-item > div:last-child { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 600px) { .notification-item { flex-direction: column; } }

/* Shared UI foundation */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-pill: 999px;
  --text-xs: 10px; --text-sm: 12px; --text-base: 14px; --text-lg: 18px; --text-xl: 24px;
  --neutral: #607186; --neutral-bg: #eef2f5;
}
:root[data-theme=dark] { --neutral: #b4c3cf; --neutral-bg: #2a3a4a; }

.form-grid input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]),
.form-grid select, .form-grid textarea,
.form-stack input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]),
.form-stack select, .form-stack textarea,
.card input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]),
.card select, .card textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--ui-line); border-radius: var(--radius-sm);
  background: var(--ui-surface); color: var(--ui-ink); transition: border-color .16s, box-shadow .16s;
}
.form-grid textarea, .form-stack textarea, .card textarea { resize: vertical; min-height: 96px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus,
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus,
.card input:focus, .card select:focus, .card textarea:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 3px rgba(201,38,96,.12); }
.form-grid select, .form-stack select, .card select { appearance: none; padding-inline-end: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--ui-muted) 50%), linear-gradient(135deg, var(--ui-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=checkbox], input[type=radio] { accent-color: var(--ui-accent); width: 16px; height: 16px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ui-ink); font-weight: 500; cursor: pointer; }
.check input { width: auto; min-height: auto; }
input[type=file] { width: 100%; padding: 8px; border: 1px dashed var(--ui-line); border-radius: var(--radius-sm); background: var(--surface-alt); color: var(--ui-muted); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--ui-line); margin: 0 0 16px; }
.tab { flex: 0 0 auto; padding: 9px 14px; border-bottom: 2px solid transparent; color: var(--ui-muted); text-decoration: none; font-size: var(--text-sm); font-weight: 700; white-space: nowrap; }
.tab:hover, .tab[aria-current=page] { color: var(--ui-accent); border-bottom-color: var(--ui-accent); }
.status-chip.bad { background: var(--bad-bg); color: var(--bad); }
.status-chip.neutral { background: var(--neutral-bg); color: var(--neutral); }
.card-narrow-sm { max-width: 760px; }
.card-narrow-md { max-width: 900px; }
.card-narrow-lg { max-width: 980px; }
.card-narrow-xl { max-width: 960px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.field-inline-sm { width: 180px; }
.field-inline-md { width: 200px; }
.input-level { width: 72px; }
.inline-gap { margin: 0 6px; }
.receipt-item-flex { flex-wrap: wrap; gap: 10px; }
.inline-form { display: inline; }
.inline-form-flex { display: inline-flex; gap: 6px; align-items: center; }
.section-divider { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 18px; }
.section-heading-sm { font-size: 14px; margin: 22px 0 8px; }
.section-heading-md { font-size: 14px; margin: 24px 0 8px; }
.section-heading-top { font-size: 14px; margin-top: 24px; }
.disclosure-summary { cursor: pointer; }
.disclosure-form { display: contents; }
.category-node { padding-inline-start: calc(var(--tree-depth, 0) * 20px); }
.check.tree-node { padding-inline-start: calc(var(--tree-depth, 0) * 20px); }
.category-summary { cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.category-actions { display: inline-flex; }
.import-table-spaced { margin-top: 16px; }
.tree-depth-0 { --tree-depth: 0; } .tree-depth-1 { --tree-depth: 1; } .tree-depth-2 { --tree-depth: 2; } .tree-depth-3 { --tree-depth: 3; } .tree-depth-4 { --tree-depth: 4; } .tree-depth-5 { --tree-depth: 5; } .tree-depth-6 { --tree-depth: 6; } .tree-depth-7 { --tree-depth: 7; } .tree-depth-8 { --tree-depth: 8; } .tree-depth-9 { --tree-depth: 9; } .tree-depth-10 { --tree-depth: 10; }
.diff-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.diff-item { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border: 1px solid var(--ui-line); border-radius: var(--radius-sm); background: var(--surface-alt); }
.diff-old, .diff-new { padding: 6px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.diff-old { background: var(--bad-bg); color: var(--bad); } .diff-new { background: var(--good-bg); color: var(--good); }
@media (max-width: 600px) { .diff-item { grid-template-columns: 1fr; } }

/* Product gallery thumbnails */
.detail-thumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px; }
.detail-thumb { display: block; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--ui-line); background: var(--surface-alt); flex: 0 0 auto; }
.detail-thumb img { width: 100%; height: 100%; object-fit: contain; }
.detail-thumb:hover { border-color: var(--ui-accent); }

/* Ticket conversation thread */
.ticket-thread { display: grid; gap: 12px; margin: 18px 0; }
.message-bubble { border: 1px solid var(--ui-line); border-radius: 10px; padding: 12px 14px; background: var(--surface-alt); }
.message-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.message-author { font-size: 12px; color: var(--ui-ink); }
.message-time { font-size: 10px; color: var(--ui-muted); }
.message-body { margin: 0; font-size: 12px; line-height: 1.9; color: var(--ui-ink); overflow-wrap: anywhere; }

/* Order items table + payment instructions */
.order-items-table { margin-top: 4px; }
.payment-instructions { border: 1px solid var(--ui-line); border-radius: 10px; background: var(--surface-alt); padding: 14px 16px; margin: 14px 0; }
.payment-instructions h2 { margin: 0 0 8px; font-size: 14px; }
.payment-instructions p { margin: 4px 0; font-size: 12px; }

/* Notification row actions */
.notification-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notification-actions form { display: inline; }

/* Excel upload progress */
.upload-progress { display: grid; gap: 6px; margin: 10px 0; }
.upload-progress-bar { height: 8px; border-radius: var(--radius-pill); background: var(--ui-line); overflow: hidden; }
.upload-progress-bar::before { content: ''; display: block; height: 100%; width: var(--upload-progress, 0%); border-radius: var(--radius-pill); background: var(--ui-accent); transition: width .2s ease; }
.upload-progress-text { font-size: 12px; color: var(--ui-muted); }
