:root { color-scheme: light; font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; background: #f5f6f8; color: #1d2430; }
a { color: #1259a7; text-decoration: none; }
a:hover { text-decoration: underline; }
header { background: #151a22; color: #fff; padding: 14px 22px; }
header .bar { max-width: 1420px; margin: 0 auto; display:flex; gap:18px; align-items:center; flex-wrap:wrap; }
header strong { margin-right:auto; }
header a { color:#fff; }
main { max-width: 1420px; margin: 22px auto; padding: 0 18px 50px; }
.card { background:#fff; border:1px solid #dfe3e8; border-radius:10px; padding:18px; margin-bottom:18px; box-shadow:0 1px 2px rgba(0,0,0,.03); }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; }
.metric { font-size:30px; font-weight:700; margin-top:4px; }
.muted { color:#687386; }
.small { font-size: 13px; }
.badge { display:inline-block; border-radius:999px; padding:4px 9px; font-size:12px; font-weight:700; background:#e8edf3; }
.badge.ok { background:#dff5e5; color:#166534; }
.badge.warn { background:#fff1c7; color:#8a5200; }
.badge.err { background:#fde2e2; color:#991b1b; }
.badge.info { background:#e2efff; color:#164e87; }
.flash { padding:12px 15px; border-radius:8px; margin-bottom:12px; border:1px solid transparent; }
.flash.success { background:#e8f7ec; border-color:#b6e2c0; }
.flash.error { background:#fff0f0; border-color:#f3b9b9; }
.flash.warning { background:#fff7df; border-color:#edd69a; }
label { display:block; font-weight:650; margin:12px 0 5px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=url], select, textarea { width:100%; padding:9px 10px; border:1px solid #bcc5d0; border-radius:7px; background:#fff; font:inherit; }
textarea { min-height:120px; }
button, .button { display:inline-block; padding:9px 14px; border-radius:7px; border:1px solid #174f8f; background:#1769bf; color:#fff; font:inherit; font-weight:650; cursor:pointer; text-decoration:none; }
button.secondary, .button.secondary { background:#fff; color:#174f8f; }
button.danger { background:#a51d2d; border-color:#7f1622; }
button:disabled { opacity:.5; cursor:not-allowed; }
.actions { display:flex; gap:9px; align-items:center; flex-wrap:wrap; margin-top:14px; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th,td { padding:9px 8px; border-bottom:1px solid #e6e9ed; text-align:left; vertical-align:top; }
th { background:#f8f9fb; position:sticky; top:0; z-index:1; }
tr.ready td { background:#f0fbf3; }
tr.blocked td, tr.mapping td, tr.factor td, tr.product_missing td { background:#fff8e7; }
tr.booked td { background:#eef3f8; color:#5f6b7a; }
tr.zero td { color:#778291; }
.table-wrap { overflow:auto; max-height:70vh; border:1px solid #e1e5ea; border-radius:8px; }
code { background:#eef1f4; padding:2px 5px; border-radius:4px; }
pre { background:#111827; color:#e5e7eb; padding:14px; overflow:auto; border-radius:8px; }
.two-col { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; }
@media (max-width:900px){ .two-col{grid-template-columns:1fr;} th{position:static;} }
.inline { display:inline; }
.danger-zone { border-color:#efb0b0; }
fieldset { border:1px solid #dfe3e8; border-radius:8px; padding:12px; }
legend { font-weight:700; }

.create-link { display:inline-block; margin-top:7px; font-weight:700; }
.readout { padding:10px 11px; border:1px solid #d5dce4; border-radius:7px; background:#f8fafc; min-height:41px; }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.section-head h2 { margin-right:auto; }
.bulk-defaults { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; align-items:end; }
button.compact { margin-top:7px; padding:7px 10px; font-size:13px; }
.bulk-table-wrap { max-height:72vh; }
.bulk-table { min-width:1850px; }
.bulk-table input[type=text], .bulk-table input[type=number], .bulk-table select { min-width:125px; }
.bulk-table td:nth-child(3) input { min-width:220px; }
.bulk-table td:nth-child(6) select { min-width:85px; }
.bulk-table .readout { min-width:95px; }

.price-table-wrap { max-height:78vh; }
.price-table { min-width:2100px; }
.price-table td:nth-child(1) { min-width:210px; }
.price-table td:nth-child(2) { min-width:320px; }
.price-table td:nth-child(3), .price-table td:nth-child(4), .price-table td:nth-child(5), .price-table td:nth-child(6) { min-width:170px; }
.price-table td:nth-child(7) { min-width:260px; }
.price-big { font-size:18px; font-weight:750; }
tr.price-diff td { box-shadow: inset 0 1px 0 #f1c56f, inset 0 -1px 0 #f1c56f; }
.diff-strong { color:#9a4d00; font-weight:750; }
.checkline { display:flex; gap:7px; align-items:center; margin:5px 0; font-size:13px; }
.checkline input { width:auto; }
.discount-list { display:flex; gap:8px; flex-wrap:wrap; }
.discount-chip { padding:7px 10px; border:1px solid #d8dee7; border-radius:999px; background:#f8fafc; font-size:13px; }
details summary { cursor:pointer; color:#1259a7; margin-top:6px; }


.traffic-legend { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:10px 0 14px; }
.traffic-preview { margin-top:6px; font-weight:700; }
.traffic-preview.traffic-green { color:#166534; }
.traffic-preview.traffic-yellow { color:#8a5200; }
.traffic-preview.traffic-red { color:#991b1b; }
.reconciliation-table-wrap { max-height:75vh; }
.reconciliation-table { min-width:1200px; }
.reconciliation-table td:nth-child(1) { min-width:220px; }
.reconciliation-table td:nth-child(2), .reconciliation-table td:nth-child(3) { min-width:300px; }
.reconciliation-table td:nth-child(4) { min-width:190px; }
.reconciliation-table td:nth-child(5) { min-width:230px; }
tr.recon-invoice_excess td, tr.recon-invoice_only td { background:#fff0f0; }
tr.recon-delivery_excess td, tr.recon-delivery_only td { background:#fff8e7; }
tr.recon-ok td { background:#f0fbf3; }
tr.recon-review td { background:#eef4fb; }

/* Mobile reports */
.mobile-session-table { max-height: 58vh; }
.report-summary .card { margin-bottom: 0; }
.report-metric { font-size: 18px; margin-top: 12px; }
.report-meta { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:18px; }
.report-table-wrap { max-height:72vh; }
.report-table { min-width:780px; }
.report-events-wrap { max-height:65vh; }
.report-events-wrap table { min-width:920px; }
tr.report-ok td { background:#f0fbf3; }
tr.report-missing td, tr.report-unexpected td { background:#fff0f0; }
tr.report-excess td { background:#fff8e7; }
tr.report-undo td { background:#f3f4f6; color:#667085; }
@media print {
  header, .actions, .button, button { display:none !important; }
  body { background:#fff; }
  main { max-width:none; margin:0; padding:0; }
  .card { box-shadow:none; break-inside:avoid; }
  .table-wrap { max-height:none; overflow:visible; }
  th { position:static; }
}

/* B2B administration */
.b2b-list { max-height:65vh; }
.b2b-items { max-height:75vh; }
.b2b-items table { min-width:1250px; }
.b2b-items textarea { min-width:220px; min-height:70px; }
.b2b-items input[type=text] { min-width:145px; }
.market-product-results { max-height: 52vh; }
.market-price-table-wrap { max-height: 72vh; }
.market-price-table { min-width: 1180px; }
.market-price-table td:nth-child(2) { min-width: 320px; }
.market-price-table td:nth-child(5) { min-width: 180px; }
.market-result-uncertain { opacity: .68; background: #fafbfc; }
.market-kpis .card { margin-bottom: 0; }

/* Mapping: live Shopware product search */
.mapping-shopware-search { margin: 14px 0 18px; background:#fbfcfe; }
.mapping-search-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:end; }
.mapping-search-button { padding-bottom:0; }
.mapping-product-results { max-height:45vh; }
.mapping-product-results table { min-width:760px; }
@media (max-width:900px){ .mapping-search-row{grid-template-columns:1fr;} }

/* Shopware product enrichment */
.enrichment-table { min-width: 1050px; }
.enrichment-table td:nth-child(1) { width: 95px; text-align:center; }
.enrichment-table td:nth-child(2) { min-width: 185px; }
.enrichment-table td:nth-child(3) { min-width: 260px; max-width: 420px; }
.enrichment-table td:nth-child(4) { min-width: 380px; }
.enrichment-table textarea { min-height: 110px; }
.enrichment-image-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:14px; margin:12px 0 20px; }
.enrichment-image-card { border:1px solid #d8dee8; border-radius:10px; padding:10px; background:#fff; }
.enrichment-image-preview { height:155px; display:flex; align-items:center; justify-content:center; background:#f7f9fc; border-radius:7px; overflow:hidden; margin-bottom:8px; }
.enrichment-image-preview img { max-width:100%; max-height:155px; object-fit:contain; }
