/* Irfan Farms admin — builds on site.css tokens. */
.admin .brand { font-size: 22px; }
.admin .brand small { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted); }
.admin-tabs { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: #EFE6D2; }
.admin-tabs a { padding: 9px 18px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.admin-tabs a[aria-current] { background: var(--navy); color: #fff; }
.admin-user { font-size: 14px; color: var(--muted); }
.admin-main { padding-top: 32px; padding-bottom: 80px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head .h1 { margin: 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 28px; }
.kpi { padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi strong { font-family: var(--display); font-size: 28px; font-weight: 600; }
.kpi-warn { background: #FBE9CF; border-color: #F1D3A6; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input { max-width: 320px; height: 46px; border-radius: 999px; }
.seg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.seg a { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font-size: 12.5px; font-weight: 600; line-height: 1.5; background: var(--surface); }
.seg a[aria-current] { background: var(--navy); color: #fff; border-color: var(--ink); }
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.card .table-wrap { border: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.4; }
.tbl th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #F7FBF3; }
.tbl.plain td { padding: 8px 0; }
.tbl input { height: 42px; }
.tbl .w-sm { width: 80px; }
.r { text-align: right; }
.ok { color: var(--leaf); font-weight: 700; }
.badge { display: inline-flex; padding: 2px 8px; border-radius: 999px; font: 700 12px var(--sans); white-space: nowrap; }
.badge-amber { background: #FBE9CF; color: #6B3A0A; }
.badge-blue { background: #DCE6F2; color: #1D3A5C; }
.badge-green { background: var(--leaf-soft); color: var(--leaf-ink); }
.badge-red { background: var(--red-soft); color: var(--red-ink); }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 14px; grid-column: span 2; }
.check input { width: 18px; height: 18px; accent-color: var(--leaf); margin-top: 2px; }
.top-gap-sm { margin-top: 20px; }
.admin .timeline form { margin-top: 4px; }
@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .admin .nav-in { height: auto; flex-wrap: wrap; padding-block: 12px; }
}

/* Products + site photos */
.prod-row { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; scroll-margin-top: 120px; }
.prod-row.is-off { opacity: .7; }
.prod-photo { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.prod-photo img, .prod-photo > span { width: 220px; height: 220px; border-radius: 16px; object-fit: cover; background: var(--sand); display: flex; align-items: center; justify-content: center; padding: 12px; }
.prod-photo img { padding: 0; }
.upload-btn { width: 100%; cursor: pointer; }
.prod-photo input:focus-visible + .upload-btn, .upload-btn:focus-within { outline: 3px solid var(--marigold); }
.prod-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.prod-fields .span-2 { grid-column: span 2; }
.prod-fields .check { grid-column: span 2; align-self: center; }
.prod-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.photo-grid .h3 { margin: 0; }
.site-photo { height: 240px; border-radius: 16px; overflow: hidden; background: var(--sand); display: flex; align-items: center; justify-content: center; }
.site-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 960px) {
  .prod-row, .photo-grid { grid-template-columns: 1fr; }
  .prod-fields { grid-template-columns: 1fr 1fr; }
}

/* admin sign-in + account pages */
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { width: min(440px, calc(100vw - 32px)); padding: 40px 0; display: flex; flex-direction: column; gap: 18px; }
.login-logo { align-self: center; }
.login-logo .logo { height: 70px; width: auto; }
.login-box .h2 { text-align: center; font-size: 30px; }
.login-box .muted { text-align: center; margin: -6px 0 0; }
.inline-form { display: inline; }
.admin-user { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tmp-pw { padding: 3px 8px; border-radius: 6px; background: #fff; font: 700 16px ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; margin-left: 8px; }
.toolbar-search input { height: 44px; border-radius: 999px; min-width: 260px; }
.admin-tabs { flex-wrap: wrap; }
.plain-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.denied { max-width: 640px; margin: 40px auto; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.danger-zone { border-color: #F1C4B8; }
.btn-danger { background: #B3261E; color: #fff; }
.btn-danger:hover { background: #8C1D17; color: #fff; }
.prod-fs { display: contents; }

/* users & roles */
.roles-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.role-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.role-list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; }
.role-list a[aria-current] { border-color: var(--navy); box-shadow: inset 3px 0 0 var(--navy); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.perm-mod { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.perm-mod legend { font: 700 15px var(--display); color: var(--navy); padding: 0 6px; }
.perm-mod .check { grid-column: auto; font-weight: 500; }
.role-pick select { height: 36px; padding: 0 8px; border-radius: 8px; font-size: 14px; width: auto; }
.create-cust summary { cursor: pointer; margin: 0; }
.create-cust[open] summary { margin-bottom: 12px; }
@media (max-width: 960px) { .roles-grid { grid-template-columns: 1fr; } }

/* sales & reports */
.rep-filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.rep-custom { display: flex; align-items: center; gap: 8px; }
.rep-custom input[type=date] { height: 40px; padding: 0 10px; border-radius: 10px; width: auto; font-size: 14px; }
.kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi small { font-size: 12px; }
.dl { display: inline-block; font: 700 12px var(--display); padding: 2px 8px; border-radius: 999px; align-self: flex-start; }
.dl-up { background: var(--leaf-soft); color: var(--leaf-ink); }
.dl-down { background: var(--red-soft); color: var(--red-ink); }
.dl-flat, .dl-new { background: #EFE6D2; color: var(--muted); }
.owed { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.owed > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 14px; background: #fff; border: 1px dashed var(--line-2); }
.owed strong { font: 700 20px var(--display); color: var(--navy); }
.rep-card { margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
.rep-card .h3 { margin: 0; }
.rep-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 220px; }
.rep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.rep-grid > .rep-card { margin-bottom: 20px; }
.rep-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rep-tbl th { font-size: 12px; }
.rep-tbl td, .rep-tbl th { padding: 8px 10px; }
.tbl.plain.rep-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table-wrap.flat { border: 0; }
/* 100% split bars: validated categorical slots 1 (blue) and 2 (orange), 2px surface gap between segments */
.sb-bar { display: flex; gap: 2px; height: 16px; border-radius: 4px; overflow: hidden; background: #F3EEE2; }
.sb-seg { display: block; height: 100%; }
.sb-1 { background: #2a78d6; }
.sb-2 { background: #eb6834; }
.sb-3 { background: #1baf7a; }
.sb-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.sb-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.pipe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pipe li { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 10px; font-size: 14px; }
.pipe-bar { height: 12px; background: #F3EEE2; border-radius: 4px; overflow: hidden; }
.pipe-bar i { display: block; height: 100%; background: #2a78d6; border-radius: 0 4px 4px 0; }
.pipe-cancel .pipe-bar i { background: #a3a29c; }
.pipe-n { text-align: right; font-weight: 700; }
.thru { display: inline-block; width: 90px; height: 8px; background: #F3EEE2; border-radius: 4px; overflow: hidden; vertical-align: middle; }
.thru i { display: block; height: 100%; background: #2a78d6; }
details.rep-card summary { cursor: pointer; }
@media (max-width: 1180px) { .kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .owed { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .rep-grid, .rep-grid-3 { grid-template-columns: 1fr; } }
.rep-grid { align-items: start; }

/* home page pictures manager */
.interval-form { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.interval-form select { height: 40px; width: auto; border-radius: 10px; padding: 0 10px; font-size: 14px; }
.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.slide-card { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.slide-card.is-first { border-color: var(--leaf); box-shadow: 0 0 0 1px var(--leaf); }   /* ring, not a thicker border, so all cards stay the same width */
.slide-card.is-off .slide-thumb img { opacity: .45; filter: grayscale(.6); }
.slide-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--sand); display: flex; align-items: center; justify-content: center; }
.slide-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-n { position: absolute; top: 10px; left: 10px; width: 28px; height: 28px; border-radius: 99px; background: rgba(255,255,255,.94); display: flex; align-items: center; justify-content: center; font: 800 13px var(--display); color: var(--navy); }
.slide-tag { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 99px; background: var(--leaf); color: #fff; font: 700 12px var(--display); }
.slide-tag-off { background: #1F2A24; }
.slide-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 12px 4px; }
.sq-btn { width: 36px; height: 34px; border-radius: 8px; border: 1.5px solid var(--line-2); background: #fff; font-size: 15px; cursor: pointer; }
.sq-btn:disabled { opacity: .35; cursor: default; }
.sm-btn { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 8px; border: 1.5px solid var(--line-2); background: #fff; color: var(--ink); font: 600 13px var(--display); cursor: pointer; }
.sm-btn:hover, .sq-btn:hover:not(:disabled) { border-color: var(--navy); }
.sm-btn-navy { border-color: var(--navy); color: var(--navy); }
.sm-btn-red { border: 0; background: var(--red-soft); color: var(--red-ink); }
.sm-btn:focus-within { outline: 3px solid var(--marigold); outline-offset: 2px; }
.slide-text { padding: 4px 12px 12px; }
.slide-text summary { cursor: pointer; font: 600 14px var(--display); color: var(--navy); padding: 6px 0; }
.slide-text .fld input, .slide-text .fld textarea { height: 40px; font-size: 14px; }
.slide-text .fld textarea { height: auto; }
.dropzone { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 16px; border: 2px dashed var(--line-2); background: #fff; color: var(--muted); font-size: 15px; transition: border-color .15s ease, background-color .15s ease; }
.dropzone.is-over { border-color: var(--leaf); background: var(--leaf-soft); }
.dz-plus { font: 700 30px var(--display); color: var(--leaf); }
.dz-link { color: var(--navy); font-weight: 700; text-decoration: underline; cursor: pointer; }
.dz-link:focus-within { outline: 3px solid var(--marigold); outline-offset: 2px; }

/* Admin header: let the tab bar take a second line on narrower screens instead of overlapping the page. */
body.admin .nav-in { height: auto; min-height: 82px; padding-block: 10px; }

/* Orders list: compact rows — order no. on one line, small secondary text. */
.tbl td small { font-size: 12px; }
.tbl td:first-child a { white-space: nowrap; }
.toolbar input#q { height: 36px; font-size: 13.5px; }

/* Orders search: icon on the left, reset (↺ clears search + filter) inside the box on the right. */
.search-box { position: relative; flex: 0 1 340px; }
.search-box .search-ic { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.toolbar .search-box input#q { width: 100%; max-width: none; height: 36px; padding: 0 36px; font-size: 13.5px; }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; }
.search-clear svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s ease; }
.search-clear:hover svg { transform: rotate(-180deg); }
.search-clear:hover { background: #EFE6D2; color: var(--ink); }
.search-note { margin: -4px 0 10px; }

/* Header, top right: [View site ↗]  [avatar  Name / Role]  [log-out icon] on one tidy row. */
.admin-user { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; font-size: 13px; }
.au-site { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.au-site:hover { border-color: var(--navy); color: var(--navy); }
.au-me { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.au-avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font: 800 14px var(--display); flex: none; }
.au-name { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.au-name strong { font-size: 13px; color: var(--ink); }
.au-name small { font-size: 12px; color: var(--muted); }
.au-out { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); }
.au-out svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.au-out:hover { color: #B42318; border-color: #B42318; }
@media (max-width: 760px) { .au-name { display: none; } .au-me { padding-left: 8px; } }

/* Keep the brand on one line now the right side is wider. */
body.admin .brand span { white-space: nowrap; }
body.admin .admin-tabs a { padding: 7px 12px; font-size: 13.5px; white-space: nowrap; }
body.admin .brand small { display: block; }


/* Header runs edge to edge with a slim margin: logo far left, user controls far right, more room for the tabs. */
body.admin .nav .wrap.nav-in { max-width: none; padding-inline: 20px; }
@media (min-width: 961px) and (max-width: 1239px) {
  body.admin .au-site-t { display: none; }
  body.admin .au-site { width: 34px; padding: 0; justify-content: center; }
  body.admin .admin-tabs a { padding: 6px 9px; font-size: 13px; }
  body.admin .au-name { display: none; }
  body.admin .nav-in { gap: 12px; }
}
@media (min-width: 1080px) { body.admin .admin-tabs { flex-wrap: nowrap; } }

/* ---------- Sales & reports v2: tabs, compact tiles, SLA ---------- */
.rep-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.rep-title { margin: 0 0 2px; font-size: clamp(28px, 3vw, 38px); }
.rep-sub { margin: 0; }
.rep-range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rep-range .rep-custom input[type=date] { height: 30px; padding: 0 8px; border-radius: 8px; font-size: 12.5px; }
.rep-tabs { display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; overflow-x: auto; }
.rep-tabs a { padding: 9px 14px; font: 600 14px var(--sans); color: var(--muted); text-decoration: none; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.rep-tabs a:hover { color: var(--ink); }
.rep-tabs a[aria-current] { color: var(--navy); border-bottom-color: var(--navy); }
.rep-tabs .rep-dl { margin-left: auto; font-size: 12.5px; color: var(--navy); border: 0; }
.kpis-c { gap: 10px; margin-bottom: 14px; }
.kpis-c .kpi { position: relative; padding: 12px 14px; border-radius: 14px; gap: 2px; min-height: 92px; overflow: hidden; }
.kpis-c .kpi span { font-size: 12px; }
.kpis-c .kpi strong { font-size: 22px; line-height: 1.2; }
.kpis-c .kpi small { font-size: 12px; }
.kpis-c .dl { font-size: 12px; padding: 1px 7px; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.spark { position: absolute; right: 10px; bottom: 10px; width: 42%; height: 28px; overflow: visible; }
.spark polyline { fill: none; stroke: #2a78d6; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark polygon { fill: rgba(42, 120, 214, .10); stroke: none; }
.owed-c { gap: 10px; margin-bottom: 16px; }
.owed-c > div { padding: 10px 14px; border-radius: 12px; }
.owed-c span { font-size: 12px; color: var(--muted); }
.owed-c strong { font-size: 17px; }
.owed-c small { font-size: 12px; color: var(--muted); }
.rep-card { padding: 18px 20px; border-radius: 18px; gap: 10px; margin-bottom: 16px; }
.rep-grid { gap: 16px; }
.rep-grid > .rep-card { margin-bottom: 16px; }
.rep-card .h3 { font-size: 17px; }
.chart-box { height: 260px; }
.chart-box.sm { height: 200px; }
.rep-table-view summary { cursor: pointer; font-size: 12.5px; color: var(--navy); font-weight: 600; }
.pipe li { grid-template-columns: 120px 1fr 32px; font-size: 13px; }
.pipe { gap: 6px; }
.pipe-bar { height: 10px; }

/* overview: delivery-time snapshot */
.sla-snap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sla-snap > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #F7F2E6; }
.sla-snap strong { font: 800 24px var(--display); color: var(--ink); }
.sla-snap .is-bad { background: #FBE9CF; }
.sla-snap .is-bad strong { color: #8A2A1B; }

/* sales: weekday × time-of-day heatmap (one hue, light → dark) */
.heat { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.heat-row { display: grid; grid-template-columns: 36px repeat(6, minmax(0, 1fr)); gap: 3px; align-items: center; }
.heat-h { text-align: center; color: var(--muted); font-size: 12px; }
.heat-d { color: var(--muted); font-weight: 600; }
.heat-c { height: 26px; border-radius: 5px; background: #F3EEE2; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #1F2A24; }
.heat-c.l1 { background: #dbe8f8; } .heat-c.l2 { background: #a9c9ef; } .heat-c.l3 { background: #5f9be2; color: #fff; } .heat-c.l4 { background: #1d5ea8; color: #fff; }
.heat-key { display: flex; align-items: center; gap: 4px; margin: 4px 0 0; }
.heat-key .heat-c { width: 18px; height: 12px; border-radius: 3px; }

/* SLA tab */
.sla-alert { border-color: #EFC3B8; background: #FFF8F5; }
.sla-tbl td { vertical-align: middle; }
.sla-tbl .sla-bullet-h { width: 32%; }
.sla-total td { background: #FAF6EC; }
.bullet { position: relative; display: block; height: 14px; border-radius: 4px; background: #F3EEE2; }
.bullet i { position: absolute; left: 0; top: 3px; bottom: 3px; border-radius: 0 3px 3px 0; background: #2a78d6; }
.bullet i.over { background: #d03b3b; }
.bullet b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #1F2A24; border-radius: 1px; }
.ok-t { color: #006300; font-weight: 700; }
.late-t { color: #B42318; font-weight: 700; }
.sla-form { display: flex; flex-direction: column; gap: 6px; }
.sla-form label { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sla-form label > span:first-child { display: flex; flex-direction: column; font-size: 13px; }
.sla-form small { font-size: 12px; }
.sla-in { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.sla-in input { width: 78px; height: 32px; padding: 0 8px; border-radius: 8px; text-align: right; font-size: 13.5px; }
.sla-form .sla-total { border-bottom: 0; }
.sla-form .btn { align-self: flex-start; margin-top: 6px; }
.sla-list { list-style: none; margin: 0; padding: 0; }
.sla-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }

/* SLA in the orders list and on an order */
.sla-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; padding: 1px 7px; border-radius: 999px; background: var(--red-soft); color: var(--red-ink); font: 700 12px var(--sans); white-space: nowrap; }
.sla-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.sla-steps li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.sla-steps li .bullet { grid-column: 1 / -1; height: 10px; }
.sla-steps .st-ok { color: #006300; } .sla-steps .st-bad { color: #B42318; } .sla-steps .st-wait { color: var(--muted); }

@media (max-width: 1180px) { .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .sla-snap { grid-template-columns: 1fr; } .sla-tbl .sla-bullet-h, .sla-tbl td:nth-child(3) { display: none; } }

/* Number columns: headings line up with their right-aligned numbers. */
.tbl th.r { text-align: right; }

/* Sales tab tables: inline share bars, total rows, long lists scroll inside the card. */
.share { display: inline-block; width: 56px; height: 6px; margin-right: 8px; vertical-align: middle; border-radius: 3px; background: #F3EEE2; overflow: hidden; }
.share i { display: block; height: 100%; background: #2a78d6; border-radius: 0 3px 3px 0; }
.nowrap { white-space: nowrap; }
.rep-tbl tfoot td { font-weight: 700; border-top: 1.5px solid var(--line-2); border-bottom: 0; background: #FAF6EC; }
.rep-scroll { max-height: 420px; overflow-y: auto; }
.rep-scroll thead th { position: sticky; top: 0; background: var(--surface, #fff); z-index: 1; }
.rep-scroll tfoot td { position: sticky; bottom: 0; }

/* Setup sub-tabs (Site content · Top banner · Products · Batches) */
.sub-tabs { display: flex; align-items: center; gap: 4px; margin: 0 0 18px; padding-bottom: 0; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.sub-tabs-k { margin-right: 10px; font: 700 12px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sub-tabs a { padding: 9px 14px; font: 600 14px var(--sans); color: var(--muted); text-decoration: none; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.sub-tabs a:hover { color: var(--ink); }
.sub-tabs a[aria-current] { color: var(--navy); border-bottom-color: var(--navy); }

/* Sales: one table, regrouped by chips; sortable headings */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); font: 600 12.5px var(--sans); color: var(--ink); text-decoration: none; background: #fff; }
.chips a:hover { border-color: var(--navy); }
.chips a[aria-current] { background: var(--navy); border-color: var(--navy); color: #fff; }
[data-sortable] th button { all: unset; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
[data-sortable] th button:hover { color: var(--ink); }
[data-sortable] th button:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 3px; }
[data-sortable] th[aria-sort=descending] button::after { content: " ▼"; font-size: 12px; }
[data-sortable] th[aria-sort=ascending] button::after { content: " ▲"; font-size: 12px; }
.rep-half { max-width: calc(50% - 8px); }
@media (max-width: 960px) { .rep-half { max-width: none; } }

/* When people order tab: wider grid with totals */
.heat-wide .heat-row { grid-template-columns: 44px repeat(6, minmax(0, 1fr)) 56px; gap: 4px; }
.heat-wide .heat-c { height: 34px; font-size: 12.5px; }
.heat-t { text-align: center; font-weight: 700; font-size: 12px; color: var(--ink); }
.heat-wide .heat-h { font-size: 12px; }

/* ---------- Dashboard ---------- */
.db-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.db-title { margin: 0; font-size: clamp(26px, 2.8vw, 34px); }
.db-sub { margin: 2px 0 0; }
.db-kpis { display: grid; grid-template-columns: 1.3fr repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.db-kpis .kpi { padding: 12px 14px; border-radius: 14px; gap: 2px; }
.db-kpis .kpi span { font-size: 12px; }
.db-kpis .kpi strong { font-size: 22px; line-height: 1.2; }
.db-kpis .kpi small { font-size: 12px; }
.db-kpis .dl { font-size: 12px; padding: 1px 7px; margin-top: 2px; }
.db-hero { background: var(--navy); border-color: var(--navy); color: #fff; }
.db-hero span, .db-hero small.muted { color: rgba(255, 255, 255, .8); }
.db-hero strong { font-size: 26px; color: #fff; }
.db-attn { margin-bottom: 14px; }
.db-attn .h3 { font-size: 15px; margin: 0 0 8px; }
.db-attn ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.attn { display: flex; align-items: center; gap: 10px; height: 100%; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-sizing: border-box; }
a.attn:hover { border-color: var(--navy); }
.attn strong { font: 800 22px var(--display); min-width: 22px; }
.attn span { display: flex; flex-direction: column; font: 700 12.5px var(--sans); line-height: 1.25; }
.attn small { font-weight: 500; font-size: 12px; color: var(--muted); }
.attn-amber { background: #FDF3E1; border-color: #F1D3A6; } .attn-amber strong { color: #8A4B0B; }
.attn-blue { background: #EEF4FC; border-color: #C9DCF5; } .attn-blue strong { color: #1d5ea8; }
.attn-red { background: #FDECEA; border-color: #EFC3B8; } .attn-red strong { color: #B42318; }
.attn-zero strong { color: #a3a29c; } .attn-zero { opacity: .8; }
.db-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
.db-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.db-grid > .rep-card { margin-bottom: 14px; }
.db-recent td { padding: 6px 8px; font-size: 12.5px; }
.db-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.db-rank li { position: relative; display: flex; justify-content: space-between; gap: 8px; padding-bottom: 6px; font-size: 13px; }
.db-rank li i { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 2px; background: #2a78d6; }
.db-rank li::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px; background: #F3EEE2; z-index: -1; }
.db-rank li { z-index: 0; }
.db-facts { list-style: none; margin: 0; padding: 0; }
.db-facts li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.db-facts li:last-child { border-bottom: 0; }
.db-facts span { color: var(--muted); }
@media (max-width: 1280px) { .db-attn ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .db-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { .db-grid, .db-grid-3 { grid-template-columns: 1fr; } .db-attn ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.db-hero .dl { background: rgba(255, 255, 255, .18); color: #fff; }

/* Tab bars: swipe sideways on small screens, but never show scrollbars or arrows. */
.rep-tabs, .sub-tabs { overflow-y: hidden; scrollbar-width: none; }
.rep-tabs::-webkit-scrollbar, .sub-tabs::-webkit-scrollbar { display: none; }

/* Customers: counts in the filter pills; plain grey badge for guests */
.seg-n { margin-left: 4px; font-weight: 700; opacity: .65; }
.seg a[aria-current] .seg-n { opacity: .85; }
.badge:not([class*="badge-"]) { background: #EFE6D2; color: var(--muted); }

/* ---------- Products: compact list, each row opens its edit form ---------- */
.prod-help { margin: -6px 0 12px; }
.prod-help summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.prod-help p { margin: 6px 0 0; max-width: 900px; }
.prod-list { padding: 4px 0; border-radius: 16px; overflow: hidden; }
.prod-line { display: grid; grid-template-columns: 44px minmax(0, 2.6fr) 90px 100px 120px 70px 90px 60px; gap: 12px; align-items: center; padding: 8px 16px; font-size: 13.5px; }
.prod-line-h { padding-block: 8px; font: 700 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.prod-line > span { min-width: 0; }
.prod-line > span:nth-child(2) { display: flex; flex-direction: column; }
.prod-line small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-item { border-bottom: 1px solid var(--line); }
.prod-item:last-child { border-bottom: 0; }
.prod-item > summary { cursor: pointer; list-style: none; }
.prod-item > summary::-webkit-details-marker { display: none; }
.prod-item > summary:hover { background: #F7FBF3; }
.prod-item[open] > summary { background: #F3F7FC; }
.prod-item.is-off > summary { opacity: .6; }
.prod-thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--sand); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-plus { font: 800 20px var(--display); color: var(--leaf); background: var(--leaf-soft); }
.prod-edit { justify-self: end; font-weight: 700; font-size: 12.5px; color: var(--navy); }
.prod-edit::after { content: " ▾"; font-size: 12px; }
.prod-item[open] .prod-edit::after { content: " ▴"; }
.prod-line-add { grid-template-columns: 44px 1fr; }
/* the edit form inside an opened row */
.prod-item .prod-row { grid-template-columns: 150px 1fr; gap: 20px; padding: 14px 16px 18px; background: #FBFAF6; border-top: 1px solid var(--line); }
.prod-item .prod-photo img, .prod-item .prod-photo > span { width: 150px; height: 150px; border-radius: 12px; font-size: 12px; }
.prod-item .upload-btn { min-height: 36px; font-size: 13px; padding: 0 12px; }
.prod-item .prod-fields { gap: 10px 12px; }
.prod-item .prod-fields input { height: 38px; font-size: 14px; }
.prod-item .prod-fields label { font-size: 12.5px; }
.prod-item .prod-actions .btn { min-height: 38px; font-size: 14px; }
@media (max-width: 960px) {
  .prod-line { grid-template-columns: 44px minmax(0, 1fr) 90px 60px; }
  .prod-line > span:nth-child(3), .prod-line > span:nth-child(5), .prod-line > span:nth-child(6), .prod-line > span:nth-child(7) { display: none; }
  .prod-item .prod-row { grid-template-columns: 1fr; }
}

/* ---------- Products: pop-up editor ---------- */
.prod-item > .prod-line { width: 100%; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.prod-item > .prod-line:hover { background: #F7FBF3; }
.prod-item > .prod-line:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; }
.prod-item.just-saved > .prod-line { animation: justSaved 2.4s ease; }
@keyframes justSaved { 0%, 40% { background: #E6F2DD; } 100% { background: transparent; } }
.prod-edit::after { content: " ›"; font-size: 13px; }
.prod-dlg { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 20px; background: #FBFAF6; color: var(--ink); box-shadow: 0 30px 80px rgba(20, 30, 25, .35); overflow: auto; }
.prod-dlg::backdrop { background: rgba(20, 28, 24, .45); backdrop-filter: blur(3px); }
.prod-dlg[open] { animation: dlgIn .18s ease-out; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.dlg-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.dlg-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dlg-head .h3 { margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlg-head .prod-thumb { font: 800 20px var(--display); color: var(--leaf); }
.dlg-dirty { padding: 3px 9px; border-radius: 999px; background: #FBE9CF; color: #6B3A0A; font: 700 12px var(--sans); white-space: nowrap; }
.dlg-x { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
.dlg-x:hover { color: var(--ink); border-color: var(--ink); }
.prod-dlg .prod-row { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 18px; }
.prod-dlg .prod-photo img, .prod-dlg .prod-photo > span { width: 170px; height: 170px; border-radius: 12px; font-size: 12px; }
.prod-dlg .upload-btn { min-height: 36px; font-size: 13px; padding: 0 12px; }
.prod-dlg .prod-fields { gap: 10px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prod-dlg .prod-fields input { height: 38px; font-size: 14px; }
.prod-dlg .prod-fields label { font-size: 12.5px; }
.prod-dlg .prod-actions { position: sticky; bottom: 0; padding-top: 8px; }
.prod-dlg .prod-actions .btn { min-height: 38px; font-size: 14px; }
.fld-hint { display: block; margin-top: 3px; font-size: 12px; }
@media (max-width: 700px) { .prod-dlg .prod-row { grid-template-columns: 1fr; } .prod-dlg .prod-fields { grid-template-columns: 1fr; } .prod-dlg .prod-fields .span-2 { grid-column: auto; } }
.prod-dlg .prod-actions > span.muted { display: none; }   /* SKU is already in the pop-up header */

/* Live search: dim the results while new ones load */
[data-live-region="results"] { transition: opacity .15s ease; }
[data-live-region="results"].is-loading { opacity: .5; }
[data-live-region="reset"] { display: contents; }
/* Checkboxes: a plain 18px box, centred on its label (form input sizes must not stretch it) */
.check { align-items: center; }
.check input[type=checkbox], .prod-dlg .prod-fields .check input[type=checkbox] { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
.prod-dlg .prod-fields .check { align-self: center; margin-top: 4px; }
.prod-dlg .prod-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Users & roles: tabs, compact tables, role editor ---------- */
.tbl-compact td { padding: 8px 12px; vertical-align: middle; }
.tbl-compact tr.is-off td { opacity: .6; }
.au-avatar.sm { display: inline-flex; width: 26px; height: 26px; font-size: 12px; vertical-align: middle; margin-right: 4px; }
.role-pick select { height: 32px; font-size: 13px; }
.roles-grid { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.role-list { gap: 6px; }
.role-list a { padding: 9px 12px; border-radius: 12px; gap: 3px; font-size: 13.5px; }
.role-list .small { font-size: 12px; }
.perm-meter { display: block; height: 4px; border-radius: 2px; background: #F3EEE2; overflow: hidden; }
.perm-meter i { display: block; height: 100%; background: #2a78d6; }
.role-form .form-grid { gap: 10px 12px; }
.role-form input:not([type=checkbox]) { height: 38px; font-size: 14px; }
.perm-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.perm-mod { padding: 8px 12px 10px; border-radius: 12px; gap: 5px; }
.perm-mod legend { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.perm-mod .check { font-size: 13px; }
.perm-all { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 0 8px; font: 600 12px var(--sans); color: var(--navy); cursor: pointer; }
.perm-all:hover { border-color: var(--navy); }
.role-del { display: block; margin-top: 8px; }
.me-form { max-width: 460px; }
.me-form input { height: 40px; }
.sm-dlg { width: min(620px, calc(100vw - 32px)); }
.dlg-body { padding: 18px; }
.dlg-body input, .dlg-body select { height: 40px; font-size: 14px; }
@media (max-width: 860px) { .roles-grid { grid-template-columns: 1fr; } }

.pw-match { margin: -4px 0 0; min-height: 1em; color: #006300; }
.pw-match.bad { color: #B42318; }
.admin-head .btn-row { display: flex; gap: 8px; }

/* Header side margin: breathing room for the logo, scaling with the screen. */
body.admin .nav .wrap.nav-in { padding-inline: clamp(20px, 3vw, 48px); }

/* Batch page: stock box */
.stock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stock-kpis div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.stock-kpis span { font-size: 12px; color: var(--muted); }
.stock-kpis strong { font: 700 17px var(--display); color: var(--navy); }
.stock-kind { gap: 6px; }
.stock-kind label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; cursor: pointer; background: var(--surface); }
.stock-kind label:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.stock-kind input { accent-color: var(--leaf); }
.stock-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.stock-log li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.stock-log small { display: block; }
.sl-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.sl-amt.in { color: var(--leaf-ink); }
.sl-amt.out { color: var(--red-ink); }
/* Batches & stock: per-product stock summary */
.stock-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stock-sum .card { padding: 16px 18px; }
.stock-sum h3 { margin: 0 0 8px; font: 700 16px var(--display); color: var(--navy); }
.stock-sum dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; font-size: 13.5px; }
.stock-sum dt { color: var(--muted); }
.stock-sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.stock-sum .sell { color: var(--leaf-ink); }
.kpi-list { display: flex; flex-direction: column; gap: 2px; font-size: 16px !important; line-height: 1.25; }
.kpi-list small { font-size: 12px; font-weight: 500; }

/* Admin: buttons stay still — no hover lift, shadow or motion (the shop's buttons keep theirs) */
.btn, .btn:hover, .btn:active, .btn:focus-visible { transform: none; box-shadow: none; transition: background-color .12s ease, color .12s ease, border-color .12s ease; }
a.attn, .attn { transition: none; }
/* Orders list: one line per order */
.tbl-orders td { padding: 5px 10px; vertical-align: middle; white-space: nowrap; }
.tbl-orders th { padding: 7px 10px; }
.tbl-orders .to-cust small { margin-left: 4px; }
.tbl-orders .to-items { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.tbl-orders .badge { padding-top: 1px; padding-bottom: 1px; font-size: 12px; }
.tbl-orders .sla-chip { margin: 0 0 0 4px; }

/* Admin pages use the whole window (like the admin top bar): tables and dashboards need the width */
body.admin .wrap { max-width: 1350px; padding-inline: 24px; }
@media (max-width: 640px) { body.admin .wrap { padding-inline: 14px; } }
/* Orders: phone · city on its own small line under the customer's name */
.tbl-orders .to-cust small { display: block; margin: 1px 0 0; font-size: 12px; line-height: 1.2; }

/* Order detail: header strip, paired cards, compact sticky Update panel */
.od-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.od-title { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.od-back { font-size: 12.5px; }
.od-code { margin: 0; font: 800 24px var(--display); color: var(--navy); }
.od-meta { flex-basis: 100%; font-size: 13px; color: var(--ink-2); }
.od-actions { display: flex; gap: 8px; }
.od-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.od-main { display: flex; flex-direction: column; gap: 14px; }
.od-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.od-card { padding: 14px 16px; font-size: 13px; }
.od-h { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font: 700 14px var(--display); color: var(--navy); }
.od-who { display: flex; flex-direction: column; gap: 2px; margin: 0; line-height: 1.45; }
.od-map { font-size: 12.5px; font-weight: 600; }
.od-note { margin: 8px 0 0; padding: 7px 10px; font-size: 12.5px; }
.od-items td { padding: 4px 0; font-size: 13px; }
.od-total td { padding-top: 6px; border-top: 1px solid var(--line); font-weight: 700; }
.od-batch { margin: 8px 0 0; font-size: 12.5px; }
.od-hist { margin: 0; font-size: 12.5px; }
.od-hist li { padding: 4px 0; }
.od-evnote { color: var(--ink-2); }
.od-sla { font-size: 12.5px; }
.od-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 12px; }
.od-form { display: flex; flex-direction: column; gap: 8px; }
.od-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.od-form .fld { gap: 3px; }
.od-form .fld label { font-size: 12px; font-weight: 600; }
.od-form input, .od-form select { height: 34px; min-height: 0; padding: 0 10px; border-radius: 9px; font-size: 13px; }
.od-check { font-size: 12.5px; }
.od-fine { margin: 0; font-size: 12px; color: var(--muted); }
@media (max-width: 960px) { .od-grid { grid-template-columns: minmax(0, 1fr); } .od-side { position: static; } }
/* Order detail: Update panel on the left */
.od-grid { grid-template-columns: 340px minmax(0, 1fr); }
.od-side { order: -1; }
@media (max-width: 960px) { .od-grid { grid-template-columns: minmax(0, 1fr); } }
/* Order detail: customer banner across the top */
.od-cust { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 0; margin-bottom: 14px; padding: 12px 6px; font-size: 13px; }
.od-c { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 0 16px; }
.od-c + .od-c { border-left: 1px solid var(--line); }
.od-c-wide { flex: 1 1 280px; }
.od-ck { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.od-c strong { font-weight: 700; }
.od-c small { font-size: 12px; color: var(--muted); }
.od-c-note { flex: 0 1 260px; padding: 6px 12px; margin-right: 10px; border-left: 0 !important; border-radius: 10px; background: var(--warm-soft); color: var(--warm-ink); }
.od-c-note .od-ck { color: var(--warm-ink); }
/* Items, History and Time targets flow as one set of cards */
.od-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.od-main .od-pair { display: contents; }
@media (max-width: 640px) { .od-c + .od-c { border-left: 0; } .od-c { flex-basis: 100%; } }
/* Order banner: bigger name, mini map of the delivery pin */
.od-name { font: 800 17px/1.2 var(--display); color: var(--navy); }
.od-c-map { position: relative; flex: 0 0 180px; padding: 0 12px; }
.od-minimap { display: block; width: 100%; height: 88px; border: 0; border-radius: 10px; pointer-events: none; }   /* the whole tile is the link */
.od-c-map::after { content: "↗"; position: absolute; top: 4px; right: 18px; padding: 0 5px; border-radius: 6px; background: #fff; font-size: 12px; color: var(--navy); }
/* Order banner v2: centred cells; Note beside the address; History in the banner */
.od-cust { align-items: center; }
.od-c-wide { flex: 0 1 auto; max-width: 380px; }
.od-c-note { flex: 0 1 220px; margin: 0 4px; }
.od-c-hist { flex: 1 1 220px; }
.od-hist-mini { list-style: none; margin: 0; padding: 0; max-height: 70px; overflow-y: auto; font-size: 12px; line-height: 1.4; }
.od-hist-mini li + li { margin-top: 2px; }
.od-hist-mini small { display: block; color: var(--ink-2); font-size: 12px; }
.od-c-map { margin-left: auto; }
/* Order detail: wider Update card; "← All orders" on its own line above the order code */
.od-grid { grid-template-columns: 420px minmax(0, 1fr); }
.od-back { flex-basis: 100%; margin-bottom: -2px; }
/* Journey strip (time targets): whole journey on top, one coloured tile per stage */
.js-total { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; margin-bottom: 10px; }
.js-t-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.js-t-val { justify-self: end; font: 700 14px var(--display); }
.js-t-val small { font: 500 12px var(--sans); color: var(--muted); }
.js-total .js-bar { grid-column: 1 / -1; height: 6px; }
.js-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.js-step { display: flex; flex-direction: column; gap: 1px; padding: 7px 8px 8px; border-radius: 10px; border: 1px solid var(--line); border-top: 3px solid var(--tone, var(--line-2)); background: var(--tone-bg, #fff); }
.js-name { overflow: hidden; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; text-overflow: ellipsis; }
.js-val { font: 800 15px var(--display); color: var(--tone-ink, var(--ink)); }
.js-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.js-bar { display: block; height: 4px; margin-top: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.js-bar i { display: block; height: 100%; border-radius: 99px; background: var(--tone, var(--line-2)); }
.js-ok   { --tone: #2E7D32; --tone-bg: #F3F9EF; --tone-ink: #1F4D22; }
.js-bad  { --tone: #B42318; --tone-bg: #FDF1EE; --tone-ink: #7A2414; }
.js-run  { --tone: #E4912A; --tone-bg: #FFF8EC; --tone-ink: #6B3A0A; }
.js-todo { --tone: #C9C2B0; --tone-bg: #fff; --tone-ink: var(--muted); }
.js-total.js-todo .js-bar i, .js-total.js-run .js-bar i { background: var(--tone); }
@media (max-width: 960px) { .od-grid { grid-template-columns: minmax(0, 1fr); } }
.js-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.js-step { padding: 6px 6px 7px; }
.js-name { white-space: normal; line-height: 1.2; min-height: 2.4em; }
@media (max-width: 640px) { .js-steps { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); } }
.js-name { overflow: visible; text-overflow: clip; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; font-size: 12px; }
.js-name { overflow-wrap: normal; hyphens: manual; -webkit-hyphens: manual; font-size: 12px; letter-spacing: -.01em; }
@media (min-width: 1100px) { .od-main { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); } }
/* Time targets as rows: Stage · 56 m | 2 h · [bar] 47% */
.sla-rows { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sla-rows th, .sla-rows td { padding: 5px 0; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.sla-rows tr:last-child th, .sla-rows tr:last-child td { border-bottom: 0; }
.sla-rows th { padding-right: 10px; text-align: left; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.sr-time { padding-right: 12px !important; white-space: nowrap; }
.sr-time strong { color: var(--tone-ink, var(--ink)); }
.sr-time span { color: var(--muted); }
.sr-bar { width: 45%; }
.sr-track { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.sr-track i { display: block; height: 100%; border-radius: 99px; background: var(--tone, var(--line-2)); }
.sr-pct { width: 3.2em; padding-left: 8px !important; text-align: right; font-weight: 700; color: var(--tone-ink, var(--muted)); }
.sr-ok   { --tone: #2E7D32; --tone-ink: #1F4D22; }
.sr-bad  { --tone: #B42318; --tone-ink: #B42318; }
.sr-run  { --tone: #E4912A; --tone-ink: #8A4B0B; }
.sr-todo { --tone: #C9C2B0; }
.sr-total th, .sr-total td { padding-top: 8px; border-top: 1px solid var(--line); }
.sr-total th { color: var(--navy); font-weight: 800; }
/* Time targets: proper table (Stage | Taken | Target | Used | Status) */
.sla-tbl2 thead th { padding: 0 8px 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; }
.sla-tbl2 thead th.r, .sla-tbl2 td.r { text-align: right; }
.sla-tbl2 tbody th, .sla-tbl2 td { padding: 6px 8px 6px 0; }
.sla-tbl2 .sr-taken { font-weight: 700; color: var(--tone-ink, var(--ink)); white-space: nowrap; }
.sla-tbl2 .sr-target { color: var(--muted); white-space: nowrap; padding-right: 14px; }
.sla-tbl2 .sr-used { width: 34%; }
.sla-tbl2 .sr-used .sr-track { display: inline-block; width: calc(100% - 44px); vertical-align: middle; }
.sla-tbl2 .sr-used b { display: inline-block; width: 40px; text-align: right; font-size: 12px; color: var(--tone-ink, var(--muted)); }
.sr-chip { display: inline-block; padding: 1px 8px; border-radius: 99px; background: color-mix(in srgb, var(--tone, #C9C2B0) 14%, #fff); color: var(--tone-ink, var(--muted)); font-size: 12px; font-weight: 700; white-space: nowrap; }
.sla-tbl2 td:last-child { padding-right: 0; }
.od-ship { display: flex; flex-direction: column; gap: 8px; }
.od-ship[hidden] { display: none; }
.od-h-sub { margin-top: 14px; }
.od-hist { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.od-hist li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.od-hist li:last-child { border-bottom: 0; }
.od-h-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.od-h-row .od-batch { margin: 0; font: 500 12px var(--sans); color: var(--ink); }
.od-col { display: flex; flex-direction: column; gap: 14px; }

/* Admin notices ("Order updated." etc.): a small pill that fits its text, not a full-width band */
body.admin .flash { display: flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; margin: 12px 0 0; padding: 6px 12px; border-radius: 99px; font-size: 13px; }
body.admin .flash:not(.flash-err)::before { content: "✓"; font-weight: 800; }
body.admin .flash-err::before { content: "!"; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 99px; background: var(--red-ink); color: #fff; font-size: 12px; font-weight: 800; }
body.admin > .wrap:has(> .flash) + .admin-main { padding-top: 14px; }
/* Time targets: finished stages fade back so the live one stands out */
.sla-rows tr.sr-done > * { opacity: .45; }
.sla-rows tr.sr-done:hover > * { opacity: 1; }
/* Orders list: whole-journey time taken | allowed, with a slim bar */
.tbl-orders .to-time { min-width: 120px; }
.to-time strong { color: var(--to-ink, var(--ink)); }
.to-bar { display: block; width: 100%; height: 3px; margin-top: 3px; border-radius: 99px; background: var(--line); overflow: hidden; }
.to-bar i { display: block; height: 100%; background: var(--to, var(--line-2)); }
.to-ok  { --to: #2E7D32; --to-ink: #1F4D22; }
.to-run { --to: #E4912A; --to-ink: #8A4B0B; }
.to-bad { --to: #B42318; --to-ink: #B42318; }
/* Orders: time breakdown popup */
.to-time[data-sla] { cursor: pointer; }
.to-time[data-sla]:hover strong, .to-time[data-sla]:focus-visible strong { text-decoration: underline; text-underline-offset: 3px; }
.sla-pop { position: absolute; z-index: 60; width: 460px; max-width: calc(100vw - 16px); padding: 12px 14px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 16px 40px rgba(29, 63, 127, .22); font-size: 12.5px; }
.sla-pop[hidden] { display: none; }
.sp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sp-head strong { font: 700 14px var(--display); color: var(--navy); }
.sp-x { width: 26px; height: 26px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.sp-x:hover { background: var(--bg); color: var(--ink); }
.sla-pop table { width: 100%; border-collapse: collapse; }
.sla-pop thead th { padding: 0 8px 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); text-align: left; }
.sla-pop .r { text-align: right; }
.sla-pop tbody th, .sla-pop td { padding: 5px 8px 5px 0; border-bottom: 1px dashed var(--line); font-weight: 500; text-align: left; white-space: nowrap; }
.sla-pop tbody th { font-weight: 600; color: var(--ink-2); }
.sla-pop .sp-t { font-weight: 700; color: var(--to-ink, var(--ink)); }
.sla-pop .sp-u { width: 30%; }
.sla-pop .sp-u .to-bar { display: inline-block; width: calc(100% - 38px); margin: 0; vertical-align: middle; height: 5px; }
.sla-pop .sp-u b { display: inline-block; width: 34px; text-align: right; font-size: 12px; color: var(--to-ink, var(--muted)); }
.sp-chip { display: inline-block; padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, var(--to, #C9C2B0) 14%, #fff); color: var(--to-ink, var(--muted)); font-size: 12px; font-weight: 700; }
.sla-pop td:last-child { padding-right: 0; }
.sla-pop tr.sp-done > * { opacity: .45; }
.sla-pop tr.sp-total > * { border-bottom: 0; border-top: 1px solid var(--line); padding-top: 7px; }
.sla-pop tr.sp-total th { color: var(--navy); font-weight: 800; }
.sp-open { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 700; }
/* Orders list: 1px smaller type; order number as a pill coloured by the day it was placed */
.tbl-orders { font-size: 12.5px; }
.tbl-orders th { font-size: 12px; }
.tbl-orders .to-cust small, .tbl-orders .badge { font-size: 12px; }
.to-no { display: inline-block; padding: 2px 9px; border-radius: 99px; font: 700 12px var(--display); letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.to-no:hover { text-decoration: underline; }
.d-today { background: #E3F2DC; color: #1F4D22; }
.d-yday  { background: #DCE6F4; color: #1D3A6B; }
.d-2     { background: #FBEBD2; color: #7A4608; }
.d-old0  { background: #EFE7F6; color: #4E2E6B; }
.d-old1  { background: #E6F1F1; color: #1E5252; }
.d-old2  { background: #EEEDE6; color: #555247; }
/* Orders: whole row opens the order; courier tracking number beside "With courier" */
.tbl-orders tr.to-row { cursor: pointer; }
.tbl-orders tr.to-row:hover td { background: #FBF8F0; }
.to-cn { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 6px; background: #EEF3FA; color: #1D3A6B; font: 500 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
.to-cn b { font-weight: 800; }
/* Filter buttons: order count badge on the top-right corner */
.seg a.seg-n { position: relative; }
.seg-badge { position: absolute; top: -7px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--marigold); color: var(--ink); font: 800 12px/17px var(--display); text-align: center; box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
.seg a[aria-current] .seg-badge { background: var(--leaf); color: #fff; }
.seg { padding-top: 6px; }
/* Orders: courier + tracking number as one prominent two-part tag beside "With courier" */
.to-trk { display: inline-flex; align-items: stretch; margin-left: 6px; border: 1.5px solid var(--navy); border-radius: 8px; overflow: hidden; vertical-align: middle; white-space: nowrap; }
.to-trk-co { display: flex; align-items: center; padding: 2px 8px; background: var(--navy); color: #fff; font: 800 12px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.to-trk-no { display: flex; align-items: center; padding: 2px 8px; background: #fff; color: var(--navy); font: 800 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; }
.od-trk { margin-left: 0; }
.od-trk .to-trk-co { font-size: 12px; padding: 3px 10px; }
.od-trk .to-trk-no { font-size: 15px; padding: 3px 10px; }
/* Order detail header: status as a bold, solid pill */
.od-title > .badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 99px; font: 800 13.5px var(--display); letter-spacing: .01em; box-shadow: 0 4px 12px rgba(0, 0, 0, .10); }
.od-title > .badge::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.od-title > .badge-amber { background: var(--marigold); color: var(--ink); }
.od-title > .badge-blue  { background: var(--navy); color: #fff; }
.od-title > .badge-green { background: var(--leaf); color: #fff; }
.od-title > .badge-red   { background: var(--red-ink); color: #fff; }
/* Status pill: same corners and height as the courier tag, and a colour of its own (not the courier's navy) */
.od-title > .badge { border-radius: 8px; padding: 4px 11px; box-shadow: none; border: 1.5px solid transparent; }
.od-title > .badge-blue { background: #0F766E; border-color: #0F766E; color: #fff; }   /* on the way: teal */
.od-title > .badge-amber { border-color: var(--marigold); }
.od-title > .badge-green { border-color: var(--leaf); }
.od-title > .badge-red { border-color: var(--red-ink); }
/* Setup pages: the sub-tabs already name the page, so the big page heading is hidden (kept for screen readers) */
.in-setup h1.h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.in-setup .admin-head:not(:has(> :not(h1))) { display: none; }   /* a heading row with nothing else in it disappears */
.in-setup .sub-tabs { margin-bottom: 16px; }

/* Setup pages: compact cards, smaller type */
.in-setup .card { padding: 16px 18px; border-radius: 16px; }
.in-setup .card.stack, .in-setup .stack { gap: 10px; }
.in-setup .h3 { margin: 0; font-size: 16px; }
.in-setup .h2, .in-setup h2 { font-size: 17px; }
.in-setup p, .in-setup .muted.small, .in-setup .small { font-size: 12.5px; }
.in-setup .fld { gap: 4px; }
.in-setup .fld label { font-size: 12px; }
.in-setup input:not([type=checkbox]):not([type=radio]):not([type=file]), .in-setup select { height: 36px; min-height: 0; padding: 0 11px; border-radius: 10px; font-size: 13px; }
.in-setup textarea { padding: 8px 11px; border-radius: 10px; font-size: 13px; }
.in-setup .btn { min-height: 34px; padding: 0 14px; font-size: 12.5px; gap: 6px; }
.in-setup .btn.btn-lg { min-height: 38px; font-size: 13.5px; }
.in-setup .tbl { font-size: 12.5px; }
.in-setup .tbl td { padding: 6px 10px; }
/* Site content: smaller picture cards, all their buttons on one row */
.in-setup .slide-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.in-setup .slide-card { border-radius: 12px; }
.in-setup .slide-n { top: 7px; left: 7px; width: 22px; height: 22px; font-size: 12px; }
.in-setup .slide-tag { top: 7px; right: 7px; padding: 2px 8px; font-size: 12px; }
.in-setup .slide-actions { flex-wrap: nowrap; gap: 4px; padding: 8px 8px 2px; }
.in-setup .sq-btn { width: 28px; height: 28px; border-radius: 7px; font-size: 13px; flex-shrink: 0; }
.in-setup .sm-btn { height: 28px; padding: 0 8px; border-radius: 7px; font-size: 12px; }
.in-setup .slide-text { padding: 2px 8px 8px; }
.in-setup .slide-text summary { padding: 4px 0; font-size: 12px; }
.in-setup .dropzone { gap: 10px; padding: 10px 14px; border-radius: 12px; font-size: 12.5px; }
.in-setup .dz-plus { font-size: 20px; }
.in-setup .photo-grid { gap: 12px; }
.in-setup .site-photo { height: 170px; border-radius: 12px; }
/* Setup: heading hidden → the page's action button (e.g. "+ Add a pack size") sits on the right */
.in-setup .admin-head { justify-content: flex-end; margin-bottom: 10px; }
.in-setup .top-gap { margin-top: 14px; }
.in-setup .site-photo { height: 150px; }
/* Batches & stock: each product's stock as one horizontal strip (name, then five figures side by side) */
.in-setup .stock-sum { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; }
.in-setup .stock-sum .card { display: flex; align-items: center; gap: 24px; padding: 10px 16px; }
.in-setup .stock-sum h3 { flex: 0 0 140px; margin: 0; font: 700 15px var(--display); color: var(--navy); }
.in-setup .stock-sum dl { flex: 1; display: grid; grid-template-rows: auto auto; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0 16px; margin: 0; }
.in-setup .stock-sum dt { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.in-setup .stock-sum dd { margin: 0; font: 700 15px var(--display); color: var(--ink); }
.in-setup .stock-sum .sell { color: var(--leaf-ink); }
.in-setup > p.muted:first-of-type { font-size: 12px; }
@media (max-width: 760px) { .in-setup .stock-sum .card { flex-direction: column; align-items: stretch; gap: 8px; } .in-setup .stock-sum dl { grid-template-rows: none; grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); } }
.in-setup .stock-sum dl { grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); max-width: 760px; }
.in-setup .stock-sum dt, .in-setup .stock-sum dd { text-align: left; padding: 0; border: 0; }
/* Pack sizes & prices: tighter rows, smaller type; "How pack sizes work" shares the row with the Add button */
.in-setup .prod-line { gap: 10px; padding: 5px 14px; font-size: 12.5px; }
.in-setup .prod-line-h { padding-block: 6px; font-size: 12px; }
.in-setup .prod-line strong, .in-setup .prod-line > span:nth-child(2) > :first-child { font-size: 13px; }
.in-setup .prod-line small { font-size: 12px; }
.in-setup .prod-thumb { width: 30px; height: 30px; border-radius: 7px; }
.in-setup .prod-line { grid-template-columns: 34px minmax(0, 2.6fr) 80px 90px 110px 64px 80px 56px; }
.in-setup .prod-line-add { grid-template-columns: 34px 1fr; }
.in-setup .prod-plus { font-size: 16px; }
.in-setup .prod-edit { font-size: 12px; }
.in-setup .prod-list { border-radius: 14px; }
.in-setup .prod-help { margin: -40px 0 14px; font-size: 12.5px; max-width: calc(100% - 200px); }   /* sits on the Add button's row */
.in-setup .prod-item .prod-row { grid-template-columns: 120px 1fr; gap: 16px; padding: 10px 14px 12px; }
.in-setup .prod-item .prod-photo img, .in-setup .prod-item .prod-photo > span { width: 120px; height: 120px; }
.in-setup .prod-item .prod-fields input, .in-setup .prod-item .prod-fields select { height: 34px; font-size: 13px; }
.in-setup .prod-item .prod-fields label { font-size: 12px; }
/* Pack size editor: lot details (enquiry products) */
.lot-fields { margin: 4px 0 0; padding: 10px 12px 12px; border: 1px dashed var(--line-2); border-radius: 12px; background: #fff; }
.lot-fields[hidden] { display: none; }
.lot-fields legend { padding: 0 6px; font: 700 13px var(--display); color: var(--navy); }
.lot-grid { display: grid; grid-template-columns: 180px 1fr; gap: 8px 14px; align-items: center; }
.lot-grid .lot-facts { grid-column: 1 / -1; }
/* Enquiries list */
.tbl-enq td { vertical-align: middle; }
.tbl-enq .nowrap { white-space: nowrap; }
.enq-msg-cell { max-width: 260px; }
.enq-act { white-space: nowrap; }
.enq-act .inline-form { display: inline; }
.enq-act .sm-btn { height: 28px; padding: 0 9px; font-size: 12px; margin: 2px 0; }
/* Pack size editor: lot gallery */
.lot-gallery { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.lot-gallery .lg-k { flex-basis: 100%; font-size: 12px; font-weight: 600; }
.lg-item { position: relative; display: flex; flex-direction: column; width: 92px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; font-size: 12px; }
.lg-item img { width: 100%; height: 64px; object-fit: cover; }
.lg-item input { position: absolute; top: 5px; right: 5px; width: 16px; height: 16px; accent-color: var(--red-ink); }
.lg-item span { padding: 3px 6px; color: var(--muted); }
.lg-item:has(input:checked) { border-color: var(--red-ink); }
.lg-item:has(input:checked) img { opacity: .35; }
.lg-item:has(input:checked) span { color: var(--red-ink); font-weight: 700; }
.lg-add { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 92px; min-height: 84px; border: 1.5px dashed var(--line-2); border-radius: 10px; color: var(--leaf); font: 700 12px var(--display); text-align: center; cursor: pointer; }
.lg-add:hover { border-color: var(--leaf); background: var(--leaf-soft); }
.lg-add small { color: var(--ink-2); font: 500 12px var(--sans); }
.fld.lot-gallery { flex-direction: row; }
/* Pack sizes & prices: product tabs on the left of the heading row, Add button on the right */
.in-setup .admin-head.has-tabs { justify-content: space-between; }
.in-setup .admin-head.has-tabs + .prod-help { margin: -2px 0 10px; max-width: none; }
/* Pack sizes list: price stays on one line; its unit ("per acre") sits underneath */
.in-setup .prod-line { grid-template-columns: 34px minmax(0, 2.6fr) 80px 130px 110px 64px 80px 56px; }
.prod-line strong { white-space: nowrap; }
.prod-line .pl-per { display: block; font-size: 12px; line-height: 1.2; }
/* Pack sizes list: more breathing room between columns */
.in-setup .prod-line { column-gap: 22px; padding-inline: 18px; grid-template-columns: 34px minmax(0, 2.4fr) 90px 140px 120px 70px 90px 60px; }
.in-setup .prod-line > span:nth-child(3), .in-setup .prod-line > span:nth-child(4) { padding-right: 6px; }
.in-setup .prod-line > span:nth-child(5) { padding-left: 10px; }   /* badge column steps away from the price */
/* Pages under sub-tabs (Orders group, Setup): the tab names the page, so the big h1 is hidden (kept for screen readers) */
.sub-tabbed h1.h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.sub-tabbed .admin-head:not(:has(> :not(h1))) { display: none; }
.sub-tabbed .sub-tabs { margin-bottom: 16px; }

/* Pack sizes & prices: "Shown / Hidden" in a row is a small switch that flips that one listing. */
.vis-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 4px; border-radius: 999px; background: #ECEBE6; color: var(--muted);
  font: 700 12px var(--sans); cursor: pointer; user-select: none; transition: background .2s, color .2s; }
.vis-toggle i { position: relative; width: 26px; height: 15px; border-radius: 999px; background: #C9C6BC; transition: background .2s; }
.vis-toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: transform .2s; }
.vis-toggle.is-on { background: #E3F1DC; color: #1F5A2A; }
.vis-toggle.is-on i { background: #2E7D32; }
.vis-toggle.is-on i::after { transform: translateX(11px); }
.vis-toggle:hover { filter: brightness(.96); }
.vis-toggle.is-busy { opacity: .5; pointer-events: none; }
.prod-item.is-off > .prod-line > span:not(:nth-child(7)) { opacity: .55; }   /* hidden listings fade, the switch stays clear */
/* Second switch (shop packs only): In stock ⇄ Sold out by hand. Stacked under Shown / Hidden. */
.prod-line > span:nth-child(7) { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.stock-toggle:not(.is-on) { background: #FBE3DC; color: #8A2B14; }
.stock-toggle:not(.is-on) i { background: #C4553A; }
.vis-toggle { gap: 5px; padding: 3px 8px 3px 3px; font-size: 12px; white-space: nowrap; }
.vis-toggle i { width: 22px; height: 13px; }
.vis-toggle i::after { width: 9px; height: 9px; }
.vis-toggle.is-on i::after { transform: translateX(9px); }

/* Status chip in a row + its small menu (Pack sizes & prices). */
.st-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font: 700 12px var(--sans); white-space: nowrap; cursor: pointer; background: #ECEBE6; color: var(--muted); }
.st-chip:hover { filter: brightness(.95); }
.st-chip.is-busy { opacity: .5; pointer-events: none; }
.st-in_stock, .st-available { background: #E3F1DC; color: #1F5A2A; }
.st-sold_out, .st-sold { background: #FBE3DC; color: #8A2B14; }
.st-coming_soon { background: #EEF6C8; color: #4B5A10; }
.st-under_offer { background: #FFF1D9; color: #6B3A0A; }
.st-menu { position: absolute; z-index: 90; display: grid; gap: 2px; min-width: 140px; padding: 5px; border-radius: 12px; background: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, .16), 0 0 0 1px var(--line); }
.st-menu button { padding: 7px 10px; border: 0; border-radius: 8px; font: 600 12.5px var(--sans); text-align: left; cursor: pointer; }
.st-menu button:not(:hover) { background: none; color: var(--ink); }
.st-menu button.is-cur::after { content: " ✓"; }
/* Show/hide switch and status chip side by side in the "On shop" column. */
.prod-line > span:nth-child(7) { flex-direction: row; align-items: center; gap: 6px; }
.prod-line { grid-template-columns: 44px minmax(0, 2.6fr) 90px 100px 120px 70px 210px 60px; }
.in-setup .prod-line { grid-template-columns: 34px minmax(0, 2.4fr) 90px 140px 120px 70px 210px 60px; }

/* Customers → temporary password strip: who · password + Copy · Send on WhatsApp, on one line */
.pw-card { display: flex; align-items: center; gap: 14px; margin: 12px 0 18px; padding: 10px 12px 10px 14px; border-radius: 16px; background: #EAF3DC; border: 1px solid rgba(47, 82, 18, .15); }
.pw-ic { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: #D4F36C; color: #2F5212; }
.pw-ic .ic { width: 16px; height: 16px; }
.pw-who { display: grid; gap: 1px; min-width: 0; margin-right: auto; line-height: 1.3; }
.pw-who strong { font-size: 14px; }
.pw-who strong .muted { font-weight: 500; margin-left: 4px; }
.pw-who small { font-size: 12px; color: #4A524C; }
.pw-code { display: grid; gap: 1px; line-height: 1.2; }
.pw-code small { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #4A524C; }
.pw-card .tmp-pw { display: block; padding: 4px 10px; white-space: nowrap; border: 1px solid rgba(11, 20, 16, .12); font-size: 15px; }
.pw-card .btn-sm { margin-left: 0; gap: 6px; white-space: nowrap; }
.pw-card .btn-sm .ic { width: 15px; height: 15px; }
@media (max-width: 760px) { .pw-card { flex-wrap: wrap; } .pw-who { flex-basis: calc(100% - 44px); } }

/* Customers toolbar: filters · search (reset always there) · compact "New customer" at the right */
.toolbar .search-box { flex: 1 1 200px; max-width: 340px; margin-left: auto; }
.toolbar .cust-new { margin-left: 0; min-height: 34px; height: 34px; padding: 0 14px 0 10px; gap: 6px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.toolbar .cust-new .ic { width: 15px; height: 15px; }
.toolbar .cust-new[aria-expanded="true"] { opacity: .6; }
.create-cust:not([open]) { display: none; }
.create-cust > summary { display: none; }
.create-cust .h3 { margin: 0 0 10px; }
.create-cust .btn-row { display: flex; gap: 8px; }

/* Reports hub (admin/_reports_hub.php) — the agricore hub pattern: a row per group, compact one-line cards */
.rh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.rh-head .rep-sub { margin: 0; }
.rh-search { flex: 0 1 280px; min-width: 200px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13.5px; }
.rh-search:focus { outline: 2px solid var(--leaf); outline-offset: 1px; }
.rg { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line-2); }
.rg:first-of-type { border-top: 0; padding-top: 4px; }
.rg[hidden], .rg-item[hidden] { display: none !important; }
.rg-label { display: flex; align-items: center; gap: 8px; padding-top: 6px; min-width: 0; }
.rg-label .adm-ic { width: 17px; height: 17px; stroke: var(--leaf); }
.rg-label h2 { margin: 0; font-size: 14.5px; font-weight: 700; }
.rg-label .cnt { padding: 1px 7px; border-radius: 99px; background: #ECEBE4; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.rg-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 6px; }
.rg-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .12s, background .12s; }
.rg-item:hover { border-color: var(--ink); background: #FBFAF6; }
.rg-item:focus-visible { outline: 2px solid var(--leaf); outline-offset: 1px; }
.rg-item .adm-ic { flex: none; width: 16px; height: 16px; stroke: var(--muted); }
.rg-item:hover .adm-ic { stroke: var(--leaf); }
.rg-item .tx { min-width: 0; }
.rg-item .nm { display: block; font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-item .bl { display: block; font-size: 12px; line-height: 1.35; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-none { padding: 18px 2px; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .rg { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
/* a report page: back to the hub above its title */
.rep-back { display: inline-block; margin-bottom: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.rep-back:hover { color: var(--ink); }

/* Sales → Every sale: search + filtered count on the left, CSV button on the right; a tight table with a coloured
   header and rounded corners. Every order in the range is on the page, the newest 25 show (no inner scroll). */
.rep-sales { padding: 14px 16px; gap: 10px; }
.rs-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rs-search { flex: 0 1 300px; }
#rsq { width: 100%; height: 34px; padding: 0 34px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; }
.rs-search input:focus { outline: 2px solid var(--leaf); outline-offset: 1px; }
.rs-search .search-clear { border: 0; background: none; cursor: pointer; }
.rs-search .search-clear[hidden] { display: none; }
.rs-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rs-count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.rs-csv { align-self: center; margin-left: auto; gap: 6px; min-height: 32px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; white-space: nowrap; }
.rs-csv .adm-ic { width: 15px; height: 15px; }
.rs-wrap { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.rep-lines { width: 100%; border-collapse: separate; border-spacing: 0; }
.rep-lines thead th, .adm-theme .tbl.plain.rep-lines thead th { background: #1F3B2C; color: #fff; padding: 6px 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; border: 0; }
.rep-lines thead th button { color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.adm-theme .tbl.plain.rep-lines thead th[aria-sort] { background: #2C5240; }
.tbl.plain.rep-lines td { padding: 3px 8px; font-size: 12.5px; line-height: 1.25; white-space: nowrap; border-bottom: 1px solid var(--line); }
.rep-lines tbody tr:hover td { background: #F1F6EA; }
.rep-lines tr[hidden] { display: none; }
.tbl.plain.rep-lines td .badge { padding: 0 6px; min-height: 0; height: auto; font-size: 12px; line-height: 1.4; vertical-align: 1px; }
.rep-lines tfoot td { padding: 6px 8px; font-size: 12.5px; white-space: nowrap; border-bottom: 0; }
.rep-lines tfoot a { font-weight: 600; }
.rep-lines tfoot a[hidden] { display: none; }
.rs-none { margin: 0; font-size: 13px; }
/* Sales: search · count · date range on one row inside the card (everything narrowed to fit) */
.rs-head { flex-wrap: nowrap; gap: 10px; }
.rs-search { flex: 1 1 210px; min-width: 196px; max-width: 280px; }
.rs-head .rep-range { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: nowrap; }
.rs-head .seg { flex-wrap: nowrap; gap: 3px; padding-top: 0; }
.adm-theme .rs-head .seg a { padding: 4px 8px; font-size: 12px; white-space: nowrap; }
.rs-head .rep-custom { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.rs-head .rep-custom .sm-btn { height: 30px; padding: 0 10px; font-size: 12px; }
@media (max-width: 1060px) { .rs-head { flex-wrap: wrap; } .rs-head .rep-range { margin-left: 0; } }
/* Sales table: one clean font and size everywhere — headings, cells, tags, totals */
.rep-sales .rep-lines, .rep-sales .rep-lines :is(th, td, button, a, .badge, b) { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0; text-transform: none; }
.adm-theme .tbl.plain.rep-lines thead th { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.rep-sales .rep-lines td, .rep-sales .rep-lines td a { font-weight: 400; }
.tbl.plain.rep-lines td .badge { font-size: 12.5px; font-weight: 500; line-height: 1.25; }
.rep-sales .rep-lines tfoot td { font-weight: 600; }
.rep-sales .rs-count, .rep-sales .rs-count b { font-size: 12.5px; }
.rep-lines td.rs-unpaid { color: #8A5A00; }   /* unpaid amounts in their own column, amber, so the Paid total stays clean */
.rep-lines td.rs-total { font-weight: 600; border-left: 1px solid var(--line); }   /* item + delivery: the row's total, set apart */
/* Sales KPI cards: one compact row above the table (same figures as the table, for the whole period) */
.rs-kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rs-kpi { display: grid; gap: 1px; align-content: start; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); min-width: 0; }
.rs-kpi > span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-kpi strong { font-size: 17px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-kpi small, .rs-kpi .dl { font-size: 12px; color: var(--muted); }
.rs-kpi .dl { justify-self: start; margin-top: 1px; padding: 0 6px; border-radius: 6px; line-height: 1.5; }
.rs-kpi .dl-up { color: #2F6B1E; } .rs-kpi .dl-down { color: #B3261E; }
.rs-kpi-due strong { color: #8A5A00; }
@media (max-width: 1100px) { .rs-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .rs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rs-kpi-note { grid-column: 1 / -1; margin: -2px 2px 0; font-size: 12px; color: var(--muted); text-align: right; }
/* Report date range: "2 Sep 2026" as text over the real date input (kept for the calendar and the form) */
.rd { position: relative; display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12px; white-space: nowrap; cursor: pointer; }
.rd:hover { border-color: var(--ink); }
.rd:focus-within { outline: 2px solid var(--leaf); outline-offset: 1px; }
.adm-theme .rd input[type=date], .rd input[type=date] { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
/* Date range: a thin divider between the preset buttons and the from → to dates */
.rep-range .rep-custom { padding-left: 10px; border-left: 1px solid var(--line-2); }
/* One height for the whole range row: search, presets, dates, Apply */
.adm-theme .rep-range .seg a { display: inline-flex; align-items: center; height: 30px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
.rep-range .rd, .rep-range .rep-custom .sm-btn { height: 30px; box-sizing: border-box; }
#rsq { height: 30px; }
.rep-range .rep-custom .sm-btn { margin-left: 8px; }   /* breathing room between the "to" date and Apply */
/* Sales: the "7/7 orders · Rs …" count sits under the search box, giving the range row more room */
.rs-find { display: grid; gap: 3px; flex: 1 1 210px; min-width: 196px; max-width: 280px; }
.rs-find .rs-search { flex: none; min-width: 0; max-width: none; }
.rs-find .rs-count { padding-left: 12px; font-size: 12px; }
.rep-sales .rs-find .rs-count, .rep-sales .rs-find .rs-count b { font-size: 12px; }
.rs-head { align-items: flex-start; }
.rs-head .rep-range { margin-top: 0; }
.rep-range .rd { min-width: 112px; justify-content: center; padding: 0 14px; }   /* roomier date pills */
.link-btn.link-danger { color: #B3261E; }   /* Customers → Reset password: a destructive action, so it reads as one */
/* Warning dialog (Customers → Reset password): replaces the browser's confirm box */
.warn-dlg { width: min(540px, calc(100vw - 32px)); padding: 24px 26px 20px; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -20px rgba(11, 20, 16, .45); }
.warn-dlg::backdrop { background: rgba(11, 20, 16, .45); }
.warn-ic { width: 38px; height: 38px; margin-bottom: 12px; border-radius: 12px; display: grid; place-items: center; background: #FDECEA; color: #B3261E; font: 800 20px/1 var(--sans); }
.warn-dlg h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.warn-dlg > p.muted { margin: 2px 0 0; }
.warn-dlg ul { margin: 14px 0 0; padding: 0 0 0 18px; display: grid; gap: 6px; font-size: 13px; line-height: 1.45; }
.warn-note { margin: 14px 0 0; padding: 8px 12px; border-radius: 10px; background: #FFF4E0; color: #6B3F00; font-size: 12.5px; font-weight: 600; }
.warn-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.warn-btns .btn-sm { margin-left: 0; min-height: 34px; padding: 0 16px; border-radius: 999px; font-size: 13px; }
.warn-go { background: #B3261E; border-color: #B3261E; color: #fff; }
.warn-go:hover { background: #8C1D12; border-color: #8C1D12; }
/* Hold to confirm: a darker fill sweeps across the red button while it is held (1.5 s); letting go snaps it back */
.warn-go { position: relative; overflow: hidden; min-width: 190px; user-select: none; -webkit-user-select: none; touch-action: none; }
.warn-go::before { content: ""; position: absolute; inset: 0; width: 0; background: #6E140C; transition: width .2s ease-out; }
.warn-go.holding::before, .warn-go.done::before { width: 100%; transition: width 1.5s linear; }
.warn-go .warn-go-t { position: relative; }
.warn-go:disabled { opacity: 1; cursor: default; }
@media (prefers-reduced-motion: reduce) { .warn-go.holding::before { transition: width 1.5s steps(3); } }
/* Row action buttons (Customers: Reset password · Create account): compact pills with an icon */
.row-act { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 500 12.5px var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.row-act .adm-ic { width: 14px; height: 14px; }
.row-act:hover { border-color: var(--ink); background: #F4F3EE; }
.row-act-danger { color: #B3261E; background: #FDECEA; border-color: #E8B4AE; font-weight: 600; }
.row-act-danger:hover { color: #fff; background: #B3261E; border-color: #B3261E; }
.row-act:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
/* Reset password, step 2 (last check): a stronger icon, a tick-box to arm the final button */
.warn-ic-2 { background: #B3261E; color: #fff; font-size: 16px; letter-spacing: -.05em; }
.warn-2-txt { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; }
.warn-ack { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 10px; border: 1px solid #E8B4AE; background: #FDF3F2; font-size: 13px; line-height: 1.45; cursor: pointer; }
.warn-ack input { flex: none; width: 16px; height: 16px; margin-top: 2px; accent-color: #B3261E; }
.warn-go-final:disabled { background: #E9C3BF; border-color: #E9C3BF; color: #fff; cursor: not-allowed; }
.warn-go-final::before { display: none; }

/* Users & roles → Roles: the roles run across the top as horizontal tabs, the selected role's permissions open below */
.roles-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.role-list { flex-direction: row; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.role-list li { flex: 0 0 auto; min-width: 190px; }
.role-list a { height: 100%; }

/* Hub: one tab per group across the top (icon, name, count); the chosen group's cards show below */
.rh-tabs { display: flex; gap: 2px; margin: 0 0 14px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.rh-tabs::-webkit-scrollbar { display: none; }
.rh-tab { display: inline-flex; align-items: center; gap: 7px; flex: none; margin-bottom: -1px; padding: 9px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); font: 600 14px var(--sans); cursor: pointer; white-space: nowrap; }
.rh-tab .adm-ic { width: 17px; height: 17px; stroke: currentColor; }
.rh-tab .cnt { padding: 1px 7px; border-radius: 99px; background: #ECEBE4; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.rh-tab:hover { color: var(--ink); }
.rh-tab[aria-selected="true"] { background: var(--surface); border-color: var(--line-2); color: var(--leaf); }
.rh-tab:focus-visible { outline: 2px solid var(--leaf); outline-offset: -2px; }
.rh-tabs.is-searching { opacity: .45; }
.rh-tab[aria-selected="true"] { color: var(--navy); box-shadow: 0 -1px 0 rgba(0,0,0,.02); }
/* inside a tab: the group's name, count and fold arrow on the left, its cards to the right */
.rg { grid-template-columns: 230px minmax(0, 1fr); gap: 14px; padding: 14px 0 6px; border-top: 0; }
.rg-label { width: 100%; padding: 6px 4px; border: 0; background: transparent; cursor: pointer; text-align: left; font: inherit; color: var(--navy); }
.rg-label .adm-ic { width: 19px; height: 19px; stroke: var(--navy); }
.rg-label h2 { font-size: 17px; color: var(--navy); }
.rg-label .rg-caret { width: 14px; height: 14px; margin-left: auto; stroke: var(--muted); transition: transform .15s; }
.rg-label[aria-expanded="false"] .rg-caret { transform: rotate(-90deg); }
.rg-items[hidden] { display: none; }
.rg-item { border-radius: 12px; padding: 9px 12px; }
.rg-item .nm { font-size: 14px; }
@media (max-width: 760px) { .rg { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
/* Hub: smaller type */
.rh-tab { font-size: 13px; padding: 8px 12px; }
.rh-tab .adm-ic { width: 15px; height: 15px; }
.rh-tab .cnt, .rg-label .cnt { font-size: 11px; }
.rg { grid-template-columns: 200px minmax(0, 1fr); }
.rg-label h2 { font-size: 14.5px; }
.rg-label .adm-ic { width: 16px; height: 16px; }
.rg-item { padding: 7px 10px; }
.rg-item .nm { font-size: 12.5px; }
.rg-item .bl { font-size: 11px; }
.rg-item .adm-ic { width: 15px; height: 15px; }

/* Product types: a card for each product, then one tidy form below */
.pt-lead { margin: -4px 0 16px; max-width: 70ch; font-size: 13.5px; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pt-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.pt-card:hover { border-color: var(--ink); }
.pt-card[aria-current] { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(30, 90, 54, .12); }
.pt-card.is-off { opacity: .65; }
.pt-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pt-name { font: 700 16px var(--display); letter-spacing: -.02em; }
.pt-code { padding: 2px 7px; border-radius: 6px; background: #ECEBE4; font-size: 12px; }
.pt-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 9px 0; border-block: 1px solid var(--line-2); font-size: 11.5px; color: var(--muted); }
.pt-stats b { display: block; font: 700 15px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.pt-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.pt-steps i, .pt-preview i { padding: 2px 8px; border-radius: 99px; background: var(--leaf-soft, #E9F3EC); color: var(--leaf-ink, #1E5A36); font: 500 11.5px var(--sans); font-style: normal; white-space: pre; }
.pt-new { align-items: center; justify-content: center; text-align: center; min-height: 150px; border-style: dashed; background: transparent; }
.pt-plus { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--leaf-soft, #E9F3EC); color: var(--leaf); font-size: 22px; line-height: 1; }
.pt-form { max-width: 980px; padding: 18px 20px; }
.pt-form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pt-form-head h2 { margin: 0; }
.pt-x { font-size: 24px; line-height: 1; color: var(--muted); text-decoration: none; }
.pt-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.pt-sec { font: 700 11.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pt-sec .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.pt-col textarea { width: 100%; }
.pt-preview { display: flex; flex-wrap: wrap; gap: 5px; }
@media (max-width: 860px) { .pt-cols { grid-template-columns: minmax(0, 1fr); gap: 18px; } }
.pt-dlg { width: min(940px, calc(100vw - 32px)); }
.pt-dlg .pt-form { max-width: none; padding: 20px 22px 22px; background: transparent; border: 0; box-shadow: none; }
/* Product types: a search bar over a plain table */
.pt-bar { display: flex; align-items: center; justify-content: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pt-search { position: relative; display: flex; align-items: center; flex: 0 1 360px; min-width: 220px; }
.pt-search > .adm-ic { position: absolute; left: 12px; width: 16px; height: 16px; stroke: var(--muted); pointer-events: none; }
.pt-search input { width: 100%; height: 38px; padding: 0 40px 0 36px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13.5px; }
.pt-search input:focus { outline: 2px solid var(--leaf); outline-offset: 1px; }
.pt-search input::-webkit-search-cancel-button { display: none; }
.pt-reset { position: absolute; right: 5px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.pt-reset[hidden] { display: none; }
.pt-reset:hover { background: #ECEBE4; color: var(--ink); }
.pt-reset .adm-ic { width: 16px; height: 16px; stroke: currentColor; }
.pt-tbl tbody tr[hidden] { display: none; }
.pt-tbl tr.is-sel { background: var(--leaf-soft, #E9F3EC); }
.pt-edit { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); }
.pt-edit:hover { background: #ECEBE4; color: var(--leaf); }
.pt-edit .adm-ic { width: 17px; height: 17px; stroke: currentColor; }
.pt-none { padding: 14px 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pt-bar .btn-primary { box-shadow: 0 6px 14px -4px rgba(30, 90, 54, .45), 0 2px 4px rgba(20, 30, 25, .18); transition: box-shadow .15s, transform .15s; }
.pt-bar .btn-primary:hover { box-shadow: 0 10px 20px -6px rgba(30, 90, 54, .55), 0 3px 6px rgba(20, 30, 25, .2); transform: translateY(-1px); }
.pt-bar .btn-primary:active { box-shadow: 0 2px 6px -2px rgba(30, 90, 54, .4); transform: none; }
.pt-bar .btn-primary { order: 2; margin-left: auto; }
.pt-bar { width: 100%; box-sizing: border-box; justify-content: space-between; }
.pt-bar .btn-primary { margin-left: auto; flex: none; }
/* Pop-up footer: "Show on the shop" with the Save/Cancel buttons beside it, at the right, same height as + Add a product */
.pt-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.pt-foot .check { margin-right: 6px; }
.pt-foot .btn { flex: none; }
/* Pop-up: batch steps run full width under the two columns, the textarea beside its live preview */
.pt-stepsbox { margin-top: 18px; }
.pt-steps-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .pt-steps-cols { grid-template-columns: minmax(0, 1fr); } }
/* Pop-up fields on one grid so both columns line up row for row, and every box is the same height */
.pt-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 28px; align-items: start; }
.pt-wide { grid-column: 1 / -1; }
.pt-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pt-dlg .fld { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.pt-dlg .fld > label { margin: 0; font-size: 13px; line-height: 1.2; }
.pt-dlg .fld input:not([type="checkbox"]):not([type="hidden"]), .pt-dlg .fld select { box-sizing: border-box; width: 100%; height: 42px; margin: 0; padding: 0 12px; font-size: 14px; line-height: 1.2; }
.pt-dlg .fld small { margin: 0; line-height: 1.35; }
@media (max-width: 860px) { .pt-fields, .pt-pair { grid-template-columns: minmax(0, 1fr); } }

/* Site content → Hero background: live preview + sliders */
.hbg-admin { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.hbg-demo { position: relative; aspect-ratio: 16 / 8; overflow: hidden; border: 1px solid var(--line-2); border-radius: 12px; background: radial-gradient(110% 90% at 72% 52%, #FDFCF8 0%, #F3F2ED 52%, #EAE9E1 100%); }
.hbg-demo-pic { position: absolute; left: var(--hb-left, 50%); top: calc(50% + var(--hb-lift, 0%)); width: var(--hb-width, 100%); max-width: none; height: auto; transform: translate(-50%, -50%); opacity: var(--hb-op, .3); mix-blend-mode: multiply; }
.hbg-demo-none { position: absolute; inset: 0; display: grid; place-items: center; }
.hbg-demo-copy { position: absolute; left: 7%; top: 22%; width: 34%; display: grid; gap: 7px; }
.hbg-demo-copy b { height: 14px; width: 80%; border-radius: 4px; background: #0B1410; opacity: .8; }
.hbg-demo-copy i { height: 8px; width: 100%; border-radius: 3px; background: #0B1410; opacity: .18; }
.hbg-demo-copy em { height: 16px; width: 44%; margin-top: 4px; border-radius: 99px; background: #D4F36C; }
.hbg-sliders { display: grid; gap: 10px; }
.hbg-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 52px; align-items: center; gap: 10px; font-size: 13px; }
.hbg-row span { font-weight: 600; color: var(--ink-2, #3b3b36); }
.hbg-row output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.hbg-row input[type=range] { width: 100%; accent-color: var(--leaf, #1E5A36); }
.hbg-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.hbg-thumb { position: relative; width: 96px; height: 64px; margin: 0; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: #fff; }
.hbg-thumb img { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.hbg-thumb .hbg-n { position: absolute; left: 4px; top: 3px; font: 700 10px var(--sans); color: var(--muted); }
.hbg-thumb button { position: absolute; right: 3px; top: 3px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(20, 28, 24, .7); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.hbg-up { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .hbg-admin { grid-template-columns: minmax(0, 1fr); } }
.hbg-demo-pic { -webkit-mask-image: radial-gradient(ellipse 72% 72% at 50% 50%, #000 52%, transparent 100%); mask-image: radial-gradient(ellipse 72% 72% at 50% 50%, #000 52%, transparent 100%); }
.hbg-demo-pic { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22%, #000 78%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 22%, #000 78%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%); -webkit-mask-composite: source-in; mask-composite: intersect; }

/* Site content → Hero pictures */
.ho-demo-pic { position: absolute; left: 50%; top: 50%; width: min(70%, calc(46% * var(--ho-s, 1) * 2)); max-width: none; height: auto; aspect-ratio: 1; transform: translate(calc(-50% + var(--ho-x, 0%)), calc(-50% + var(--ho-y, 0%))); filter: drop-shadow(0 10px 10px rgba(11, 20, 16, .16)); }
.ho-demo .ho-demo-pic { left: 70%; width: calc(40% * var(--ho-s, 1)); }
.ho-list { display: grid; gap: 10px; }
.ho-item { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface, #fff); }
.ho-item.is-off { opacity: .62; }
.ho-thumb { position: relative; width: 110px; height: 110px; border-radius: 10px; background: #F3F1EA; display: grid; place-items: center; overflow: hidden; }
.ho-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ho-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
.ho-fields .fld { display: flex; flex-direction: column; gap: 3px; margin: 0; min-width: 0; }
.ho-fields .fld > label { margin: 0; font: 600 12px/1.2 var(--sans); }
.ho-fields input, .ho-fields select { box-sizing: border-box; width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.ho-fields .btn-row { grid-column: 1 / -1; }
.ho-actions { display: grid; gap: 6px; justify-items: end; }
@media (max-width: 900px) { .ho-item { grid-template-columns: 80px minmax(0, 1fr); } .ho-thumb { width: 80px; height: 80px; } .ho-actions { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; } .ho-fields { grid-template-columns: minmax(0, 1fr); } }

/* Site content → Featured banner */
.ft-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; align-items: start; }
.ft-form .fld { display: flex; flex-direction: column; gap: 3px; margin: 0; min-width: 0; }
.ft-form .fld > label { margin: 0; font: 600 12px/1.2 var(--sans); }
.ft-form input:not([type=checkbox]):not([type=file]) { box-sizing: border-box; width: 100%; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.ft-w2 { grid-column: span 2; } .ft-w3 { grid-column: 1 / -1; } .ft-on { grid-column: 1 / -1; }
.ft-img { display: flex; align-items: center; gap: 10px; }
.ft-img img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
@media (max-width: 760px) { .ft-form { grid-template-columns: minmax(0, 1fr); } .ft-w2 { grid-column: auto; } }
.ho-fields .ho-cap { grid-column: 1 / -1; }
.ft-form textarea { box-sizing: border-box; width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 13px; }

/* ---------- Admin → Traffic (admin/traffic.php) ---------- */
.trf__range { display: flex; gap: 6px; flex-wrap: wrap; }
.trf__range a { padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.trf__range a.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.trf__auto { margin: 0 0 12px; }
.trf__chart { margin-bottom: 16px; }
.trf__svg { width: 100%; height: auto; display: block; max-height: 190px; }
.trf__grid { stroke: var(--line); stroke-width: 1; }
.trf__tick { font-size: 11px; fill: var(--muted); }
.trf__views { fill: #9DB6DE; background: #9DB6DE; }
.trf__vis { fill: var(--navy); background: var(--navy); }
.trf__key { display: flex; gap: 18px; margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.trf__key i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.trf__list, .trf__plain { list-style: none; margin: 0; padding: 0; }
.trf__list li { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(28px, 1fr) auto; gap: 8px; align-items: center; padding: 2px 0; font-size: 13px; line-height: 1.3; }
.trf__lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trf__bar { background: var(--line); border-radius: 99px; height: 6px; overflow: hidden; }
.trf__bar i { display: block; height: 100%; background: var(--navy-3); border-radius: 99px; }
.trf__val { font-variant-numeric: tabular-nums; }
.trf__val small { color: var(--muted); font-size: 11px; }
.trf__plain li { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.trf__h3 { margin: 12px 0 4px; font-size: 13px; }
.trf__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.trf__table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); text-align: start; padding: 2px 6px 4px; border-bottom: 1px solid var(--line-2); }
.trf__table td { padding: 3px 6px; border-bottom: 1px solid var(--line); line-height: 1.25; }
.trf__table tr:last-child td { border-bottom: 0; }
.trf__table th:nth-child(n+2), .trf__table td:nth-child(n+2) { text-align: end; white-space: nowrap; width: 60px; font-variant-numeric: tabular-nums; }
.trf__pg { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trf__pg a { text-decoration: none; }
.trf__pg a:hover { text-decoration: underline; }
.trf__tip { font-size: 12px; margin-top: 10px; line-height: 1.4; }
.trf__dbline { margin: 2px 0 8px; }
.trf__steps { margin: 4px 0 0; padding-inline-start: 18px; line-height: 1.6; }
@media (max-width: 900px) { .rep-grid-3 { grid-template-columns: 1fr; } }
