/* Garrab UI kit for the portal and admin. Tokens and rules from the brand guideline v1.0:
   Forest pill primary button, one Peach accent per screen, no gradients, no shadows,
   1px Sand borders on cards, two-tone headlines (Ink then Grey), Cairo everywhere. */
:root {
  --forest:#143822; --cream:#F4F2EB; --paper:#FCFBF8; --ink:#0F1A13;
  --peach:#F3D6A8; --mint:#BFE8E0; --lavender:#D2C6F7; --sage:#9DB5A3;
  --sand:#DDD6C9; --mist:#E9E9E3; --grey:#8A8B84;
  --orange:#C9791A; --teal:#1F8A7C; --purple:#6B4BD6;
  --radius-card:20px; --radius-pill:999px;
  --font: Cairo, system-ui, sans-serif;
  --muted:#5c5d57;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; }
/* Links: Forest, underlined (Teal is 4.1:1, "large text and icons" only in the brand guide). */
a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a, button, .btn, summary, input[type="checkbox"], input[type="file"], select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { text-wrap: balance; }
p, li, td { text-wrap: pretty; overflow-wrap: anywhere; }
.stat, td, .tabular { font-variant-numeric: tabular-nums; }
img { max-width: 100%; }
.shell { max-width: 960px; margin: 0 auto; padding: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0 16px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.logo .tile { position: relative; width: 32px; height: 32px; border-radius: 9px; background: var(--forest); color: var(--paper); display: grid; place-items: center; font-weight: 700; }
.logo .tile::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--peach); }
nav.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
nav.tabs a { text-decoration: none; color: var(--ink); padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--sand); background: var(--paper); min-height: 40px; display: inline-flex; align-items: center; }
nav.tabs a[aria-current="page"] { background: var(--forest); color: var(--paper); border-color: var(--forest); }
h1 { font-weight: 400; font-size: 32px; line-height: 1.2; margin: 8px 0 16px; }
h1 .soft, h2 .soft { color: var(--grey); }
h2 { font-weight: 700; font-size: 19px; margin: 0 0 8px; }
.card { background: var(--paper); border: 1px solid var(--sand); border-radius: var(--radius-card); padding: 24px; margin-bottom: 16px; }
.dark { background: var(--forest); color: var(--paper); border-color: var(--forest); }
.dark .soft { color: var(--sage); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 24px; border-radius: var(--radius-pill); font: 700 15px/1 var(--font);
  text-decoration: none; cursor: pointer; border: 1px solid transparent; background: var(--forest); color: var(--paper); }
.btn.accent { background: var(--peach); color: var(--forest); }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--sand); }
.btn.small { min-height: 36px; padding: 0 16px; font-size: 13px; }
.btn { transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.btn:hover:not(:disabled) { background: #0e2a19; }
.btn.accent:hover:not(:disabled) { background: #ecc98f; }
.btn.ghost:hover:not(:disabled) { background: var(--cream); border-color: var(--grey); }
.btn:active:not(:disabled) { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active:not(:disabled) { transform: none; } }
.btn:disabled { opacity: .5; cursor: default; }
/* A choice that is made reads as done, not as disabled. */
.btn.chosen, .btn.chosen:hover:not(:disabled) { background: var(--mint); color: var(--forest); border-color: var(--mint); }
.btn.chosen-off, .btn.chosen-off:hover:not(:disabled) { background: var(--mist); color: var(--muted); border-color: var(--mist); }
.btn.chosen:disabled, .btn.chosen-off:disabled { opacity: 1; }
figure.shot { margin: 0; }
figure.shot figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; text-align: center; }
/* Phones: the menu is one row you can swipe, instead of wrapping. */
@media (max-width: 600px) {
  nav.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; overscroll-behavior-x: contain; }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs a { flex: none; }
}
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
label { display: block; font-weight: 700; font-size: 13px; margin: 12px 0 4px; }
input, select, textarea { width: 100%; font: 15px var(--font); padding: 10px 14px; border-radius: 14px; border: 1px solid var(--grey); background: #fff; color: var(--ink); min-height: 44px; } /* Grey: a field's edge must reach 3:1 */
textarea { min-height: 96px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.chip { display: inline-block; border-radius: var(--radius-pill); padding: 2px 12px; font: 700 11px/1.8 var(--font); letter-spacing: .1em; text-transform: uppercase; background: var(--mist); color: var(--ink); }
.chip.peach { background: var(--peach); color: var(--forest); }
.chip.mint { background: var(--mint); }
.chip.lavender { background: var(--lavender); }
.chip.bad { background: #fbe9e2; color: #8a2f12; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 12px; align-items: center; }
.dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; border: 1px solid var(--sand); background: var(--paper); }
.dot.done { background: var(--mint); border-color: var(--mint); color: var(--teal); }
.dot.active { background: var(--peach); border-color: var(--peach); color: var(--forest); }
.preview { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--sand); background: var(--mist); }
.preview img { display: block; width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.preview .chip { position: absolute; top: 8px; left: 8px; background: var(--peach); color: var(--forest); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
pre.code { background: var(--ink); color: var(--paper); border-radius: 16px; padding: 16px; overflow-x: auto; font-size: 13px; white-space: pre-wrap; word-break: break-all; }
.note { background: var(--mint); border-radius: 16px; padding: 12px 16px; }
.warn { background: #fbe9e2; color: #8a2f12; border-radius: 16px; padding: 12px 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--mist); font-size: 14px; vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat { font-size: 28px; font-weight: 700; }
@media (max-width: 600px) { h1 { font-size: 26px; } .card { padding: 16px; } }
@media (prefers-reduced-motion: no-preference) { .fade { animation: fade 200ms ease; } @keyframes fade { from { opacity: 0 } to { opacity: 1 } } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* A button that reads as an inline text link (secondary actions inside a sentence). */
button.linkish {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  font: inherit;
  color: var(--forest);
  text-decoration: underline;
  cursor: pointer;
}

/* Tap-to-enlarge thumbnails (Approve) and the full-size viewer. */
button.preview.zoom { display: block; width: 100%; padding: 0; cursor: zoom-in; font: inherit; color: inherit; }
button.preview.zoom:hover { border-color: var(--grey); }
button.preview.zoom:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.preview .chip.mini { top: 4px; left: 4px; padding: 0 6px; font-size: 9px; line-height: 1.7; letter-spacing: .04em; text-transform: none; }
dialog.viewer { border: 1px solid var(--sand); border-radius: var(--radius-card); background: var(--paper); color: var(--ink); padding: 16px;
  width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
dialog.viewer::backdrop { background: rgba(15, 26, 19, .7); }
dialog.viewer[open] { animation: viewer-in 200ms ease; }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.viewer[open] { animation: none; } }
.viewer-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.viewer-top p { margin: 0; }
.viewer-shot { position: relative; margin: 0 0 12px; border-radius: 16px; overflow: hidden; background: var(--mist); }
.viewer-shot img { display: block; width: 100%; max-height: calc(100dvh - 200px); object-fit: contain; }
.viewer-shot .chip { position: absolute; top: 12px; left: 12px; background: var(--peach); color: var(--forest); }

/* ---------- Results (portal) ---------- */
.results h1 { margin-bottom: 4px; }
.results-head { margin-bottom: 16px; gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 720px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { border-radius: var(--radius-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.kpi.mist { background: var(--mist); } .kpi.lavender { background: var(--lavender); } .kpi.mint { background: var(--mint); } .kpi.peach { background: var(--peach); }
.kpi-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--forest); }
.kpi-value { font-size: 32px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 12px; color: var(--muted); }
.card.rates { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; }
.card.rates > div { padding: 16px 20px; display: flex; flex-direction: column; }
.card.rates > div + div { border-inline-start: 1px solid var(--sand); }
.rate-value { font-size: 26px; font-weight: 700; color: var(--forest); font-variant-numeric: tabular-nums; }

.daychart { margin: 8px 0 12px; }
.daychart-plot { display: flex; align-items: flex-end; gap: 2px; height: 180px; border-bottom: 1px solid var(--sand); }
.daychart-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; outline: none; cursor: default; }
.daychart-col:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.daychart-bar { width: 100%; background: var(--forest); border-radius: 4px 4px 0 0; transition: opacity 150ms ease; }
.daychart-bar.zero { background: var(--sand); }
.daychart-plot:hover .daychart-bar { opacity: .55; }
.daychart-plot:hover .daychart-col:hover .daychart-bar { opacity: 1; }
.daychart-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  background: var(--paper); border: 1px solid var(--sand); border-radius: 12px; padding: 6px 10px; font-size: 12px; line-height: 1.4; pointer-events: none; }
.daychart-col:first-child .daychart-tip { left: 0; transform: none; }
.daychart-col:last-child .daychart-tip { left: auto; right: 0; transform: none; }
.daychart-axis { display: flex; gap: 2px; margin-top: 6px; }
.daychart-axis span { flex: 1; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }
@media (prefers-reduced-motion: reduce) { .daychart-bar { transition: none; } }

table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 8px; }
table.data th, table.data td { text-align: end; padding: 10px 8px; border-top: 1px solid var(--sand); font-weight: 400; }
table.data th:first-child, table.data td:first-child { text-align: start; }
table.data thead th { border-top: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.products-table .prod { display: flex; align-items: center; gap: 10px; }
.products-table img, .products-table .noimg { width: 36px; height: 45px; object-fit: cover; border-radius: 8px; border: 1px solid var(--sand); background: var(--mist); flex: none; }
.rank { width: 22px; height: 22px; border-radius: 11px; background: var(--mist); color: var(--forest); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rank.top { background: var(--peach); }
@media (max-width: 560px) { .products-table th:nth-child(2), .products-table td:nth-child(2), .products-table th:nth-child(3), .products-table td:nth-child(3) { display: none; } }

/* Print / Save as PDF: just the report, on white. */
@media print {
  html, body { background: #fff !important; }
  header.top, nav, footer, .no-print { display: none !important; }
  .card { break-inside: avoid; border-color: #ccc; }
  .kpi, .rank.top, .daychart-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
