/* Admin portal additions on top of SmartAdmin + the navy token theme copied from GTyres. */
#js-page-content { font-variant-numeric: tabular-nums; }
.page-header .search { flex: 1; max-width: 520px; }
.page-header .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--c-section-bg, #F1F5F9); display: inline-flex; align-items: center; justify-content: center; color: var(--c-primary, #0D1B4C); }
.nav-menu .dl-ref { font-size: .7rem; padding: 2px 7px; border-radius: 999px; color: #111; font-weight: 700; }
.nav-menu .dl-ref:empty { display: none; }
.nav-menu form { margin: 0; }

.section-heading { display: flex; align-items: center; gap: 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .8px; color: var(--c-text-tertiary, #64748B); font-weight: 700; margin: 22px 0 10px; }
.section-heading .accent-bar { width: 4px; height: 16px; background: var(--c-primary, #0D1B4C); border-radius: 2px; }
.section-heading:first-child { margin-top: 0; }

.kpi-card { background: var(--c-card-bg, #fff); border: 1px solid var(--c-border, #E2E8F0); border-radius: var(--c-radius, 8px); padding: 16px 18px; height: 100%; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c-primary, #0D1B4C); }
.kpi-card.warn::before { background: var(--c-warning, #F59E0B); }
.kpi-card.danger::before { background: var(--c-error, #DC2626); }
.kpi-card.ok::before { background: var(--c-success, #16A34A); }
.kpi-card.info::before { background: var(--c-info, #0EA5E9); }
.kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; color: var(--c-text-tertiary, #64748B); font-weight: 600; }
.kpi-value { font-size: 1.9rem; font-weight: 800; color: var(--c-text-primary, #0F172A); line-height: 1.1; margin: 6px 0 2px; }
.kpi-sub { font-size: .82rem; color: var(--c-text-secondary, #334155); }
.kpi-card a.stretched-link { text-decoration: none; }

.panel-card { background: var(--c-card-bg, #fff); border: 1px solid var(--c-border, #E2E8F0); border-radius: var(--c-radius, 8px); padding: 16px 18px; margin-bottom: 18px; }
.panel-card h2, .panel-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.panel-card h2 .badge, .panel-card h3 .badge { font-weight: 600; }
.table-tight th, .table-tight td { padding: .45rem .6rem; font-size: .9rem; vertical-align: middle; }
.table-tight thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--c-text-tertiary, #64748B); border-top: 0; }

.channel-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.channel-chip { flex: 1; min-width: 110px; background: var(--c-section-bg, #F1F5F9); border-radius: 8px; padding: 10px 12px; }
.channel-chip b { font-size: 1.3rem; display: block; }
.channel-chip small { color: var(--c-text-tertiary, #64748B); }

/* Fitment badges, same colours as the shop so the story reads the same on both sides */
.badge-fit { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; line-height: 1; }
.badge-green { background: #DCFCE7; color: #15803D; }
.badge-amber { background: #FEF3C7; color: #B45309; }
.badge-red { background: #FEE2E2; color: #B91C1C; }
.badge-grey { background: #E2E8F0; color: #475569; }
.src-tag { font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: .4px; }
.src-TecDoc { background: #DBEAFE; color: #1D4ED8; }
.src-Supplier { background: #FEF3C7; color: #B45309; }
.src-Manual { background: #E2E8F0; color: #334155; }
.status-tag { font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.status-Active { background: #DCFCE7; color: #15803D; }
.status-Conflict { background: #FEF3C7; color: #B45309; }
.status-Blocked { background: #FEE2E2; color: #B91C1C; }
.status-Rejected { background: #E2E8F0; color: #64748B; }
.route-tag { font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: #E2E8F0; color: #334155; }
.route-Warehouse { background: #DCFCE7; color: #15803D; }
.route-Dropship { background: #DBEAFE; color: #1D4ED8; }
.route-Backorder { background: #FEF3C7; color: #B45309; }
.order-status { font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #E2E8F0; color: #334155; }
.order-status.Placed, .order-status.Processing { background: #DBEAFE; color: #1D4ED8; }
.order-status.AwaitingSupplier { background: #FEF3C7; color: #B45309; }
.order-status.Dispatched { background: #DCFCE7; color: #15803D; }
.order-status.Delivered { background: #D1FAE5; color: #065F46; }
.order-status.Cancelled { background: #FEE2E2; color: #B91C1C; }

/* Issues queue */
.issue { border: 1px solid var(--c-border, #E2E8F0); border-left: 4px solid var(--c-warning, #F59E0B); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; background: var(--c-card-bg, #fff); transition: opacity .3s, transform .3s; }
.issue.returns { border-left-color: var(--c-error, #DC2626); }
.issue.resolved { opacity: 0; transform: translateX(20px); }
.issue h4 { font-size: .98rem; font-weight: 700; margin: 0 0 4px; }
.issue .detail { font-size: .86rem; color: var(--c-text-secondary, #334155); white-space: pre-line; }
.issue .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.issue .actions input { max-width: 300px; }
.issue-type { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; padding: 2px 8px; border-radius: 4px; }
.issue-type.Conflict { background: #FEF3C7; color: #B45309; }
.issue-type.ReturnsFlag { background: #FEE2E2; color: #B91C1C; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--c-border, #E2E8F0); margin-left: 8px; }
.timeline li { position: relative; padding: 0 0 14px 18px; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--c-primary, #0D1B4C); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--c-border, #E2E8F0); }
.timeline li.Dispatched::before, .timeline li.Delivered::before { background: var(--c-success, #16A34A); }
.timeline li.eBay::before { background: #E53238; }
.timeline li small { display: block; color: var(--c-text-tertiary, #64748B); font-size: .76rem; }
.timeline li.new { animation: pop .4s ease; }
@keyframes pop { from { transform: translateX(-6px); opacity: 0 } to { transform: none; opacity: 1 } }

/* Outbox */
.outbox-msg { border: 1px solid var(--c-border, #E2E8F0); border-radius: 8px; margin-bottom: 10px; background: var(--c-card-bg, #fff); }
.outbox-msg header { padding: 10px 14px; border-bottom: 1px solid var(--c-border, #E2E8F0); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; cursor: pointer; }
.outbox-msg pre { margin: 0; padding: 12px 14px; font-size: .82rem; white-space: pre-wrap; background: var(--c-section-bg, #F8FAFC); border-radius: 0 0 8px 8px; max-height: 420px; overflow: auto; }
.outbox-msg.new { animation: pop .4s ease; border-color: var(--c-success, #16A34A); }
.msg-type { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.msg-SupplierDispatchEmail { background: #DBEAFE; color: #1D4ED8; }
.msg-OrderConfirmation { background: #E2E8F0; color: #334155; }
.msg-CustomerDispatchNotification { background: #DCFCE7; color: #15803D; }
.msg-EbayTrackingPush { background: #FDE68A; color: #92400E; }
.msg-EbayDelist { background: #FEE2E2; color: #B91C1C; }

/* eBay preview */
.ebay-frame { background: #fff; color: #191919; border: 1px solid #e5e5e5; border-radius: 6px; font-family: "Market Sans", Arial, sans-serif; overflow: hidden; }
.ebay-top { background: #fff; padding: 10px 18px; border-bottom: 1px solid #e5e5e5; display: flex; align-items: center; gap: 14px; }
.ebay-logo { font-weight: 900; font-size: 1.6rem; letter-spacing: -1px; }
.ebay-logo span:nth-child(1) { color: #E53238; } .ebay-logo span:nth-child(2) { color: #0064D2; } .ebay-logo span:nth-child(3) { color: #F5AF02; } .ebay-logo span:nth-child(4) { color: #86B817; }
.ebay-search { flex: 1; border: 2px solid #191919; border-radius: 999px; padding: 6px 14px; color: #767676; font-size: .9rem; }
.ebay-body { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; padding: 20px; }
.ebay-img { background: #f7f7f7; border-radius: 6px; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.ebay-img img { max-width: 80%; }
.ebay-title { font-size: 1.35rem; font-weight: 700; margin: 0 0 4px; line-height: 1.3; }
.ebay-sub { color: #707070; font-size: .9rem; margin-bottom: 12px; }
.ebay-price { font-size: 1.7rem; font-weight: 700; }
.ebay-cta { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; max-width: 300px; }
.ebay-cta .btn { border-radius: 999px; font-weight: 700; }
.ebay-cta .buy { background: #3665F3; color: #fff; }
.ebay-cta .basket { background: #fff; color: #3665F3; border: 1px solid #3665F3; }
.ebay-cta .watch { background: #fff; color: #191919; border: 1px solid #c7c7c7; }
.ebay-meta { font-size: .88rem; color: #333; }
.ebay-meta div { margin-bottom: 4px; }
.ebay-section { padding: 16px 20px; border-top: 1px solid #e5e5e5; }
.ebay-section h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 10px; }
.ebay-compat th { background: #f7f7f7; font-weight: 700; font-size: .82rem; }
.ebay-compat td { font-size: .86rem; }
.ebay-specifics { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 20px; font-size: .88rem; }
.ebay-specifics div span:first-child { color: #707070; display: inline-block; min-width: 150px; }
.delist-banner { background: #FEE2E2; color: #B91C1C; padding: 12px 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.listed-banner { background: #DCFCE7; color: #15803D; padding: 10px 20px; font-weight: 700; }

/* Import */
.step-bar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.step { flex: 1; min-width: 140px; padding: 10px 14px; border-radius: 8px; background: var(--c-section-bg, #F1F5F9); color: var(--c-text-tertiary, #64748B); font-weight: 600; font-size: .88rem; }
.step.active { background: var(--c-primary, #0D1B4C); color: #fff; }
.step.done { background: #DCFCE7; color: #15803D; }
.mapping-table td { vertical-align: middle; }
.sample-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--c-text-tertiary, #64748B); }
.outcome-tag { font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.outcome-Created { background: #DCFCE7; color: #15803D; }
.outcome-Updated { background: #DBEAFE; color: #1D4ED8; }
.outcome-Duplicate { background: #E2E8F0; color: #334155; }
.outcome-Rejected { background: #FEE2E2; color: #B91C1C; }
.outcome-Warning { background: #FEF3C7; color: #B45309; }
.report-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.report-kpi { background: var(--c-card-bg, #fff); border: 1px solid var(--c-border, #E2E8F0); border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; }
.report-kpi b { font-size: 1.6rem; display: block; }
.report-kpi.active { outline: 2px solid var(--c-primary, #0D1B4C); }
.msgs { font-size: .82rem; color: var(--c-text-secondary, #334155); }
.msgs span { display: inline-block; background: var(--c-section-bg, #F1F5F9); border-radius: 4px; padding: 1px 6px; margin: 1px 2px 1px 0; }
.drop-zone { border: 2px dashed var(--c-border, #CBD5E1); border-radius: 10px; padding: 26px; text-align: center; color: var(--c-text-tertiary, #64748B); }

.admin-toast { position: fixed; right: 20px; bottom: 20px; background: #0F172A; color: #fff; padding: 12px 18px; border-radius: 10px; opacity: 0; transform: translateY(10px); transition: all .2s; z-index: 2000; max-width: 420px; font-weight: 500; }
.admin-toast.show { opacity: 1; transform: none; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--c-primary, #0D1B4C), var(--c-secondary, #1E40AF)); }
.login-box { background: #fff; border-radius: 14px; padding: 32px; width: 380px; max-width: calc(100vw - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.email-preview { background: #fff; border: 1px solid var(--c-border, #E2E8F0); border-radius: 8px; padding: 12px 14px; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; white-space: pre-wrap; max-height: 300px; overflow: auto; }
.extract-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.extract-grid div { background: var(--c-section-bg, #F1F5F9); border-radius: 6px; padding: 8px 10px; font-size: .85rem; }
.extract-grid div b { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--c-text-tertiary, #64748B); }
.sku-link { font-weight: 700; color: var(--c-primary, #0D1B4C); }
.search-results-list a { display: block; padding: 8px 10px; border-radius: 6px; color: inherit; }
.search-results-list a:hover, .search-results-list a.active { background: var(--c-section-bg, #F1F5F9); text-decoration: none; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* Product management: spreadsheet style grid */
.excel-grid thead tr.titles th { background: var(--c-section-bg, #F1F5F9); position: sticky; top: 0; z-index: 2; }
.excel-grid thead tr.filters th { background: #FFFDF5; border-bottom: 2px solid var(--c-primary, #0D1B4C); padding: 4px 6px; position: sticky; top: 33px; z-index: 2; }
.excel-grid thead tr.filters .form-control-sm { height: 28px; font-size: .78rem; padding: 2px 6px; min-width: 60px; }
.excel-grid thead tr.filters select.form-control-sm { padding-right: 18px; }
.excel-grid .range { display: flex; gap: 3px; }
.excel-grid .range input { width: 64px; min-width: 0; text-align: right; }
.excel-grid tbody td { border-right: 1px solid #EEF2F7; }
.excel-grid tbody td:last-child { border-right: 0; }
.excel-grid .cell-edit { cursor: cell; }
.excel-grid .cell-edit:hover { outline: 2px solid var(--c-accent, #3882F6); outline-offset: -2px; }
.excel-grid .cell-input { height: 26px; font-size: .85rem; padding: 2px 6px; text-align: right; width: 90px; }
.excel-grid .cell-edit.saved { background: #DCFCE7; transition: background .9s; }
.excel-grid .js-clear-filters { width: 100%; }
.excel-grid td.mono, .excel-grid td .sku-link { white-space: nowrap; }
.excel-grid tbody td { padding-top: .35rem; padding-bottom: .35rem; }
#globalSearch { width: 320px; }
.subheader-title + .fs-sm { max-width: 640px; }
.btn-add-product { white-space: nowrap; }
/* Product management */
.product-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.product-filters .form-control { width: auto; min-width: 150px; flex: 1; max-width: 260px; }
.product-filters .form-control[name=q] { max-width: 340px; }
.product-filters .chk { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .85rem; white-space: nowrap; }
.product-grid .thumb { width: 44px; height: 34px; object-fit: cover; border-radius: 4px; background: #F8FAFC; border: 1px solid var(--c-border, #E2E8F0); }
.product-grid .js-row { cursor: pointer; }
.product-grid th a { color: inherit; text-decoration: none; white-space: nowrap; }
.product-hero-img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--c-border, #E2E8F0); background: #fff; }
.product-tabs .nav-link { font-weight: 600; }
.product-tabs .nav-link.disabled { opacity: .5; }
.product-tab-content { padding-top: 18px; }
.live-price { background: var(--c-section-bg, #F1F5F9); border-radius: 8px; padding: 10px 12px; transition: box-shadow .3s; }
.live-price.flash { box-shadow: 0 0 0 3px rgba(13,27,76,.25); }
.lp-row { display: flex; justify-content: space-between; font-size: .95rem; padding: 2px 0; }
.lp-row b { font-size: 1.05rem; }
.lp-rule { font-size: .75rem; color: var(--c-text-tertiary, #64748B); margin-top: 6px; border-top: 1px dashed var(--c-border, #CBD5E1); padding-top: 6px; }
.dup-warning { display: flex; gap: 12px; align-items: flex-start; background: #FEF3C7; border: 1px solid #FDE68A; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: .9rem; }
.dup-warning img { width: 56px; height: 44px; object-fit: cover; border-radius: 6px; background: #fff; }
.image-drop.over { border-color: var(--c-primary, #0D1B4C); background: #EFF6FF; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.image-tile { border: 1px solid var(--c-border, #E2E8F0); border-radius: 8px; overflow: hidden; background: #fff; cursor: grab; }
.image-tile.main { border-color: var(--c-success, #16A34A); box-shadow: 0 0 0 2px rgba(22,163,74,.2); }
.image-tile img { width: 100%; height: 130px; object-fit: contain; background: #F8FAFC; }
.image-meta { padding: 6px 8px 0; }
.image-actions { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; gap: 6px; }
.reg-plate-admin { display: flex; align-items: stretch; background: #FFD500; border: 2px solid #111; border-radius: 6px; overflow: hidden; height: 38px; width: 170px; }
.reg-plate-admin span { background: #1C3F94; color: #fff; font-weight: 700; font-size: .6rem; display: flex; align-items: flex-end; justify-content: center; padding: 3px 5px; }
.reg-plate-admin input { background: transparent; border: 0; outline: 0; font-family: "Arial Black", Impact, sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; text-align: center; width: 100%; font-size: 1.05rem; }
.fit-vehicle-card { background: var(--c-section-bg, #F1F5F9); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.quick-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quick-picks .chip { background: var(--c-section-bg, #F1F5F9); border: 1px solid var(--c-border, #E2E8F0); border-radius: 999px; padding: 3px 10px; font-size: .78rem; cursor: pointer; }
.quick-picks .chip:hover { border-color: var(--c-primary, #0D1B4C); color: var(--c-primary, #0D1B4C); }
.issue-type.ManualConflict { background: #FDE68A; color: #92400E; }
@media (max-width: 992px) { .preview-card { position: static; } }
@media (max-width: 900px) { .ebay-body { grid-template-columns: 1fr; } }
