:root {
  --ink: #151515;
  --ink-soft: #292824;
  --gold: #c9a44d;
  --gold-light: #f5edda;
  --canvas: #f7f6f2;
  --paper: #fff;
  --line: #e2ded5;
  --line-dark: #d2c9b9;
  --muted: #6e6b64;
  --success: #177a4d;
  --danger: #a43d2e;
  --shadow: 0 12px 28px rgba(30, 27, 20, .08);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-optical-sizing: auto; }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 8px max(24px, calc((100vw - 1440px) / 2)); color: #fff; background: var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 15px; }
.brand-logo { display: block; width: 190px; height: auto; padding: 5px 8px; border-radius: 3px; background: #fff; }
.brand small { color: #e8e2d6; font-size: 10px; font-weight: 800; letter-spacing: .11em; }
.freshness { display: flex; align-items: center; gap: 7px; color: #ddd8ce; font-size: 12px; }
.freshness strong { color: #fff; font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #56c889; box-shadow: 0 0 0 3px rgba(86, 200, 137, .16); }

.page-shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 44px 0 34px; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 8px; color: #8c6c22; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
h1 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.2; letter-spacing: -.035em; }
.intro p:not(.eyebrow) { max-width: 620px; margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.ftp-availability { max-width: 760px !important; margin-top: 14px !important; padding: 9px 12px; border-left: 3px solid var(--gold); background: var(--gold-light); color: #554a32 !important; font-size: 13px !important; line-height: 1.45; }
.ftp-availability strong { color: var(--ink); font-weight: 600; }
.intro-stat { flex: 0 0 auto; min-width: 152px; padding: 14px 17px; border-left: 3px solid var(--gold); background: var(--gold-light); }
.intro-stat strong, .intro-stat span { display: block; }
.intro-stat strong { font-size: 26px; line-height: 1; }
.intro-stat span { margin-top: 4px; color: #635332; font-size: 12px; }

.offer-controls { margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.offer-search { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.search-field { flex: 1 1 420px; }
.search-field input { width: 100%; min-height: 42px; padding: 0 13px; border: 1px solid var(--line-dark); border-radius: 7px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus, button:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 164, 77, .18); }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-weight: 720; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: var(--gold); color: var(--ink); background: var(--gold); }
.button-primary:hover { background: #d8b45d; }
.button-quiet { border-color: var(--line); background: #fff; color: #58554e; }
.advanced-filters { flex: 1 0 100%; margin-top: 2px; }
.advanced-filters summary { width: fit-content; color: #5d5136; cursor: pointer; font-size: 12px; font-weight: 750; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.filter-grid label { min-width: 0; display: grid; gap: 4px; color: #59564f; font-size: 11px; font-weight: 720; }
.filter-grid input, .filter-grid select { width: 100%; min-height: 35px; padding: 0 8px; border: 1px solid var(--line-dark); border-radius: 5px; background: #fff; color: var(--ink); font-size: 13px; outline: none; }
.control-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.page-size-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.page-size-label select { min-height: 32px; padding: 0 8px; border: 1px solid var(--line-dark); border-radius: 5px; background: #fff; }
.button-export { color: #fff; background: var(--ink-soft); }
.button-export span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--gold); color: var(--ink); font-size: 11px; }
.load-message { min-height: 20px; margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.load-message.is-error { color: var(--danger); font-weight: 650; }

.offer-list { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.table-scroll { overflow-x: auto; }
.offer-table { width: 100%; min-width: 1120px; border-collapse: collapse; table-layout: fixed; }
.offer-table col.image-col { width: 60px; }
.offer-table col.manufacturer-col { width: 135px; }
.offer-table col.quantity-col { width: 75px; }
.offer-table col.price-col { width: 100px; }
.offer-table col.notes-col { width: 160px; }
.offer-table col.information-col { width: 160px; }
.offer-table th { position: sticky; top: 0; z-index: 1; padding: 12px 10px; border-bottom: 1px solid var(--line-dark); color: #5f5a50; background: #faf9f6; text-align: left; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.offer-table th button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; cursor: pointer; font: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit; }
.offer-table th button:hover { color: #8b6c28; }
.offer-table th button[aria-sort="ascending"]::after, .offer-table th button[aria-sort="descending"]::after { color: var(--gold); font-size: 15px; line-height: 10px; }
.offer-table th button[aria-sort="ascending"]::after { content: "↑"; }
.offer-table th button[aria-sort="descending"]::after { content: "↓"; }
.offer-table th:first-child, .offer-table td:first-child { padding-left: 15px; }
.offer-table th:last-child, .offer-table td:last-child { padding-right: 15px; }
.offer-table td { padding: 9px 10px; border-bottom: 1px solid #eeeae2; vertical-align: middle; }
.offer-table tr:last-child td { border-bottom: 0; }
.offer-table tbody tr { transition: background .15s ease; }
.offer-table tbody tr:hover { background: #fdfcf9; }
.offer-table tbody tr.is-opportunity { background: linear-gradient(90deg, #fffdf7, #fff); }
.product-image-cell { width: auto; }
.product-image-cell img, .product-image-placeholder { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #e5dfd2; border-radius: 6px; object-fit: contain; background: #fff; }
.product-image-placeholder { color: #9d8c66; background: #f7f3e9; font-size: 9px; font-weight: 850; letter-spacing: .05em; }
.manufacturer { display: block; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.name-cell { min-width: 0; }
.name-cell > strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.product-codes { display: flex; flex-wrap: wrap; gap: 4px 9px; align-items: center; margin-top: 5px; color: #807a70; font-size: 10px; }
.product-codes b { color: #625d55; font-weight: 500; }
.number-col, .number-cell { width: auto; text-align: right !important; }
.number-cell { white-space: nowrap; }
.number-cell strong { display: inline; font-size: 15px; font-weight: 500; }
.number-cell span { margin-left: 4px; }
.number-cell span { color: #827e74; font-size: 10px; }
.price-col, .price-cell { width: auto; text-align: right !important; white-space: nowrap; }
.price-cell strong { font-size: 14px; font-weight: 600; }
.notes-cell { color: #4e4b44; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.fixed-text-cell { color: #68635b; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.opportunity-label { display: inline-block; margin: 0 6px 2px 0; padding: 2px 5px; border-radius: 3px; color: #694b0c; background: #f4dd9b; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.empty-state { padding: 42px !important; text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state span { margin-top: 5px; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 17px; padding: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pagination button { border: 0; background: transparent; color: #79591a; cursor: pointer; font-weight: 750; }
.pagination button:disabled { color: #aaa59b; cursor: not-allowed; }

@media (max-width: 900px) { .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 820px) {
  .site-header { min-height: 58px; padding: 11px 16px; }
  .brand-logo { width: 142px; padding: 4px 6px; }
  .brand small, .freshness > span { display: none; }
  .freshness { gap: 5px; font-size: 11px; }
  .page-shell { width: min(100% - 28px, 1440px); padding: 28px 0; }
  .intro { display: block; margin-bottom: 20px; }
  .intro p:not(.eyebrow) { font-size: 15px; }
  h1 { font-size: 24px; }
  .intro-stat { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; margin-top: 17px; padding: 9px 12px; }
  .intro-stat span { margin: 0; }
  .offer-controls { padding: 12px; }
  .search-field { flex-basis: 100%; }
  .button-primary, .button-quiet { flex: 1; }
  .filter-grid { grid-template-columns: 1fr; }
  .control-actions { align-items: stretch; flex-direction: column; }
  .page-size-label, .button-export { width: 100%; }
  .page-size-label { justify-content: space-between; }
  .page-size-label select { min-width: 80px; }
  .offer-list { border: 0; background: transparent; box-shadow: none; }
  .table-scroll { overflow: visible; }
  .offer-table, .offer-table tbody, .offer-table tr, .offer-table td { display: block; min-width: 0; width: 100%; }
  .offer-table thead { display: none; }
  .offer-table tbody { display: grid; gap: 10px; }
  .offer-table tbody tr { position: relative; display: grid; grid-template-columns: 53px 1fr; column-gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 5px 14px rgba(30, 27, 20, .045); }
  .offer-table tbody tr.is-opportunity { border-left: 3px solid var(--gold); }
  .offer-table td { min-width: 0; padding: 0; border: 0; }
  .product-image-cell { grid-column: 1; grid-row: 1 / span 3; width: auto; }
  .product-image-cell img, .product-image-placeholder { width: 48px; height: 48px; }
  .offer-table td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .name-cell { grid-column: 2; grid-row: 2; min-width: 0; padding-top: 2px; }
  .manufacturer { max-width: none; }
  .number-cell, .price-cell { display: inline-flex; grid-column: 2; align-items: baseline; gap: 5px; width: auto; margin-top: 7px; text-align: left !important; }
  .number-cell { grid-row: 3; }
  .price-cell { grid-row: 4; }
  .number-cell strong, .price-cell strong { font-size: 13px; }
  .number-cell span { margin-left: 0; }
  .number-cell::before, .price-cell::before { color: #817c71; font-size: 10px; font-weight: 750; text-transform: uppercase; }
  .number-cell::before { content: "Quantity"; }
  .price-cell::before { content: "Price"; }
  .notes-cell, .fixed-text-cell { grid-column: 1 / -1; max-width: none; margin-top: 8px; padding-top: 8px; border-top: 1px solid #eeeae2; }
  .notes-cell::before, .fixed-text-cell::before { display: block; margin-bottom: 2px; color: #817c71; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .notes-cell::before { content: "Notes"; }
  .fixed-text-cell::before { content: "Information"; }
  .empty-state { padding: 30px !important; border: 1px solid var(--line) !important; text-align: center; }
  .site-footer { display: grid; gap: 7px; padding: 18px 16px; }
}
