:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #182822;
  background: #f6f6ef;
  font-synthesis: none;
  --forest: #112d24;
  --green: #16633f;
  --soft-green: #e2eee4;
  --paper: #fffefa;
  --ink: #182822;
  --muted: #56665e;
  --line: #dfe4db;
  --trf: #227450;
  --egf: #63a38a;
  --radius: 17px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p, dl { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #3b8c67; outline-offset: 3px; }
[id] { scroll-margin-top: 18px; }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  z-index: 5;
  inset: 12px auto auto 12px;
  padding: 12px 18px;
  border-radius: 8px;
  color: white;
  background: var(--forest);
}

.button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 650;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.button.primary { color: white; background: var(--forest); }
.button.primary:hover { background: var(--green); }
.button.quiet { color: #334a3d; border-color: var(--line); background: var(--paper); }
.button.quiet:hover, .text-button:hover { background: #eff4ed; border-color: #c4d6c8; }
.button:disabled { cursor: default; opacity: 0.5; }
.text-button { min-height: 34px; padding: 6px 11px; color: var(--green); border-color: #d6e4d8; background: #f9fcf7; }
.eyebrow { display: block; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.11em; text-transform: uppercase; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; color: #fffefa; font-size: 1.04rem; font-weight: 760; line-height: 1.04; text-decoration: none; }
.brand-mark {
  display: inline-grid;
  width: 39px;
  height: 39px;
  place-content: center;
  grid-auto-flow: column;
  align-items: center;
  padding-right: 2px;
  border-radius: 11px;
  background: #cde5be;
  color: #103323;
  font-size: 0.93rem;
  font-weight: 850;
  letter-spacing: -0.1em;
}
.brand-mark span { color: #356145; transform: translateY(3px); }
.profile-mark { display: inline-grid; flex: none; place-items: center; width: 37px; height: 37px; border-radius: 10px; color: #184631; background: #dcebdd; font-weight: 760; font-size: 0.88rem; }

.login-layout { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); }
.login-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 70px;
  min-height: 600px;
  padding: clamp(24px, 5vw, 74px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: white;
  background: radial-gradient(ellipse at 98% 100%, #2b5f40 3%, transparent 58%), linear-gradient(140deg, #0f2b22, #153c2c);
}
.login-intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 420px;
  aspect-ratio: 1;
  bottom: -242px;
  right: -150px;
  border: 1px solid #aecea753;
  border-radius: 50%;
  box-shadow: 0 0 0 33px #98c69117, 0 0 0 67px #98c69116, 0 0 0 102px #98c69112;
}
.login-intro .eyebrow { margin-bottom: 15px; color: #bde0be; }
.login-intro h1 { font-size: clamp(2.3rem, 4.5vw, 4.5rem); letter-spacing: -0.06em; line-height: 1.03; font-weight: 730; }
.login-intro p { max-width: 43ch; margin-top: 19px; color: #dfebe3; font-size: clamp(0.98rem, 1.4vw, 1.15rem); line-height: 1.65; }
.login-pilot-note { color: #c5decb; font-size: 0.84rem; }
.login-card { display: grid; place-items: center; padding: clamp(24px, 5vw, 72px); background: #f7f7ef; }
.login-form-wrap { width: min(100%, 390px); }
.login-form-wrap .profile-mark { width: 49px; height: 49px; border-radius: 13px; font-size: 1.16rem; margin-bottom: 20px; }
.login-form-wrap h2 { font-size: clamp(1.8rem, 3.1vw, 2.6rem); letter-spacing: -0.055em; line-height: 1.12; }
.login-form-wrap p { margin-top: 10px; color: var(--muted); line-height: 1.5; }
.login-form-wrap .form-error { padding: 11px 14px; border: 1px solid #ecc9c0; border-radius: 8px; color: #86372a; background: #fff0ea; }
.login-form-wrap form { display: grid; gap: 9px; margin-top: 28px; }
.login-form-wrap input { min-height: 46px; }
.login-form-wrap button { min-height: 46px; margin-top: 7px; }

.shell { display: grid; grid-template-columns: 219px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 27px 17px 21px;
  color: #dfeade;
  background: var(--forest);
}
.sidebar .wordmark { margin-left: 9px; }
.workspace-label { margin: 42px 10px 11px; color: #b5cbbb; font-size: 0.68rem; line-height: 1.2; font-weight: 700; text-transform: uppercase; letter-spacing: 0.085em; }
.sidebar nav { display: grid; gap: 4px; }
.nav-link { display: flex; gap: 11px; align-items: center; min-height: 41px; padding: 8px 10px; color: #e4eee4; font-size: 0.86rem; font-weight: 550; border: 1px solid transparent; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.nav-link span { flex: none; width: 19px; text-align: center; color: #b9d3bf; font-size: 1.1rem; }
.nav-link:hover, .nav-link[aria-current] { color: white; background: #27463a; border-color: #38594b; }
.sidebar :focus-visible, .login-intro :focus-visible { outline-color: #afd6a7; }
.sidebar-account { display: flex; gap: 10px; align-items: center; padding: 17px 5px 0; border-top: 1px solid #456657; min-width: 0; }
.sidebar-account strong, .sidebar-account div > span { display: block; }
.sidebar-account strong { font-size: 0.88rem; color: white; }
.sidebar-account div > span { margin-top: 3px; font-size: 0.74rem; color: #c0d4c4; }

.main-shell { min-width: 0; }
.topbar { min-height: 63px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px clamp(18px, 3vw, 45px); border-bottom: 1px solid var(--line); background: var(--paper); }
.breadcrumbs { font-size: 0.86rem; color: var(--muted); }
.breadcrumbs span { margin-inline: 8px; color: #749083; }
.breadcrumbs strong { color: var(--ink); font-weight: 700; }
#main { width: min(100%, 1600px); margin: 0 auto; padding: 28px clamp(18px, 3vw, 45px) 38px; }
.overview, .filterbar, .panel-heading, .partner-panel { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.overview { align-items: flex-end; margin-bottom: 23px; }
.overview h1 { font-size: clamp(2rem, 3.4vw, 3.2rem); letter-spacing: -0.058em; font-weight: 750; line-height: 1.05; }
.overview p { margin-top: 9px; color: var(--muted); font-size: 0.96rem; line-height: 1.5; }
.snapshot { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; padding-bottom: 1px; color: var(--muted); font-size: 0.77rem; white-space: nowrap; }
.sample-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 999px; background: #f8edce; color: #654a18; font-size: 0.73rem; line-height: 1.2; font-weight: 750; }
.sample-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #946718; }
.filterbar { align-items: center; margin-bottom: 16px; }
.segments { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #edf0e8; }
.segments button { padding: 6px 13px; min-height: 32px; border: 1px solid transparent; border-radius: 7px; color: #4c6255; background: transparent; font-size: 0.84rem; font-weight: 650; white-space: nowrap; }
.segments button:hover { color: var(--forest); background: #e0eadf; }
.segments button[aria-pressed="true"] { color: var(--forest); background: var(--paper); border-color: #dbe2d8; box-shadow: 0 1px 3px #19392812; }
.selects, .catalog-tools { display: flex; align-items: center; gap: 8px; }
input, select, textarea { width: 100%; min-width: 0; padding: 8px 11px; min-height: 38px; border: 1px solid #d5ded4; border-radius: 8px; color: var(--ink); background: var(--paper); font-size: 0.875rem; }
select { padding-right: 26px; }
textarea { display: block; resize: vertical; }
input::placeholder { color: #5b6c61; }
label { color: var(--ink); font-size: 0.86rem; font-weight: 680; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.metric, .panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 2px 5px #23342908; }
.metric { min-height: 122px; display: flex; flex-direction: column; align-items: flex-start; padding: 17px 17px 15px; }
.metric-label { color: #445b4e; font-size: 0.835rem; font-weight: 680; }
.metric strong { margin: 5px 0 4px; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 740; line-height: 1.1; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.metric-note { color: var(--muted); font-size: 0.75rem; }
.alert-metric { background: #fffcf3; border-color: #ede0c0; }
.alert-metric strong { color: #825512; }

.insights { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: stretch; gap: 15px; margin-bottom: 17px; }
.panel { padding: 18px; }
.panel-heading h2, .partner-panel h2 { font-size: 1.22rem; font-weight: 740; line-height: 1.24; letter-spacing: -0.032em; }
.panel-heading p, .partner-panel p { margin-top: 4px; color: var(--muted); font-size: 0.82rem; line-height: 1.46; }
.chart-unit { color: var(--muted); font-size: 0.75rem; font-weight: 620; }
.chart-region { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 7px; margin-top: 18px; }
#chart-scale { min-width: 24px; margin-top: -5px; color: var(--muted); font-size: 0.69rem; font-variant-numeric: tabular-nums; text-align: end; }
#chart { display: grid; min-width: 0; min-height: 156px; align-items: stretch; column-gap: 0; }
#chart > .empty-state { grid-column: 1 / -1; }
.chart-day { display: grid; grid-template-rows: 138px 18px; min-width: 0; }
.bars { display: flex; justify-content: center; align-items: flex-end; gap: clamp(1px, 0.32vw, 4px); min-width: 0; padding: 0 1px; border-bottom: 1px solid #93aa99; background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), #e8ece3 calc(25% - 1px) 25%); }
.bar { width: min(22px, 43%); display: block; flex-shrink: 1; border-radius: 4px 4px 0 0; }
.bar.trf, .dot.trf { background: var(--trf); }
.bar.egf, .dot.egf { background: var(--egf); }
.chart-label { padding-top: 4px; justify-self: center; white-space: nowrap; font-size: 0.67rem; color: var(--muted); }
.chart-day:first-child .chart-label { justify-self: start; }
.chart-day:last-child .chart-label { justify-self: end; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0 31px; color: #465c50; font-size: 0.73rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; }

.queue-count { display: grid; min-width: 28px; min-height: 27px; place-items: center; padding-inline: 6px; border-radius: 8px; color: #6f4a0c; background: #faedce; font-size: 0.78rem; font-weight: 750; }
#queue { margin-top: 8px; }
.queue-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; }
.queue-row + .queue-row { border-top: 1px solid #e7ebe3; }
.queue-main, .product-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.queue-details, .product-details { min-width: 0; }
.queue-name, .product-name { display: block; color: var(--ink); font-weight: 700; font-size: 0.84rem; line-height: 1.3; overflow-wrap: anywhere; }
.queue-meta, .product-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.product-mark { display: inline-grid; width: 32px; height: 32px; place-items: center; flex: none; border-radius: 9px; background: #e0eee3; color: #225d35; font-size: 0.83rem; font-weight: 770; }
.tone-gold { background: #f7edcb; color: #79561c; }
.tone-iris { background: #ede6f6; color: #644981; }
.tone-clay { background: #fae7de; color: #884a33; }
.empty-state { padding: 20px 10px; color: var(--muted); font-size: 0.87rem; text-align: center; }

.catalog-panel { margin-bottom: 17px; padding: 0; }
.catalog-heading { align-items: center; padding: 17px 18px; }
.catalog-tools input { width: min(19vw, 210px); }
.catalog-tools select { width: auto; }
.table-wrap { position: relative; overflow-x: auto; margin: 0 1px 3px; }
table { width: 100%; min-width: 630px; border-collapse: collapse; font-size: 0.85rem; text-align: left; }
th { padding: 11px 10px; border-block: 1px solid #e7ebe3; color: #465d4e; background: #f7f8f3; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid #ebeee8; color: #253d31; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8faf5; }
td:nth-child(4), td:nth-child(5) { font-variant-numeric: tabular-nums; }
.status-pill { display: inline-block; padding: 4px 7px; border-radius: 6px; font-size: 0.73rem; font-weight: 700; white-space: nowrap; }
.status-healthy { color: #205535; background: #e6f1e5; }
.status-low { color: #744d0c; background: #faefd2; }
.status-out { color: #903e2d; background: #fae9e0; }

.partner-panel { align-items: center; padding: 19px 20px; border: 1px solid #ccdfcd; border-radius: var(--radius); color: #153826; background: #e7f0e5; }
.partner-panel .eyebrow { margin-bottom: 6px; color: #416653; }
.partner-panel p { max-width: 64ch; }
.partner-button { color: #123d2a; border-color: #b6d1ba; background: #fafdf7; }
.partner-button:hover { background: #f0f8ef; border-color: #759b7d; }

dialog { width: min(540px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 25px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: 0 18px 60px #0a231d43; }
dialog::backdrop { background: #071c15a6; }
dialog h2 { margin-right: 39px; font-size: 1.57rem; letter-spacing: -0.04em; overflow-wrap: anywhere; }
dialog p { margin-top: 7px; color: var(--muted); line-height: 1.5; font-size: 0.88rem; }
dialog .sample-badge { margin-bottom: 10px; }
.dialog-close { position: absolute; top: 14px; right: 14px; }
.dialog-close .button { width: 34px; min-height: 34px; padding: 0; font-size: 1.2rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0; }
.field-row input, dialog textarea { margin-top: 6px; }
dialog textarea { white-space: pre-wrap; }
#copy-restock { margin-top: 13px; }
.dialog-feedback { min-height: 1.3em; }
.statement { margin: 14px 0; }
.statement > div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.statement dd { margin: 0; font-weight: 700; white-space: nowrap; }
.statement .statement-total { margin-top: 4px; padding: 11px 9px; border: 1px solid #cfe1cc; border-radius: 8px; color: #19422c; background: #e8f1e5; font-weight: 700; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 180px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  #main, .topbar { padding-inline: 22px; }
}

@media (max-width: 900px) {
  .insights { grid-template-columns: 1fr; }
  .queue-row { padding-block: 8px; }
  .catalog-tools input { width: 160px; }
}

@media (max-width: 700px) {
  .login-layout { grid-template-columns: 1fr; align-content: start; }
  .login-intro { min-height: auto; gap: 26px; padding: 23px 24px; }
  .login-intro h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .login-intro p { margin-top: 10px; }
  .login-intro .eyebrow { margin-bottom: 9px; }
  .login-card { padding: 32px 24px; }
  .shell { display: block; }
  .sidebar { position: static; height: auto; min-height: 0; padding: 14px 15px 9px; }
  .sidebar .wordmark { margin: 0 0 12px; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; }
  .nav-link { padding: 6px 7px; min-height: 37px; font-size: 0.78rem; gap: 4px; }
  .nav-link span { width: 15px; font-size: 0.92rem; }
  .workspace-label, .sidebar-account { display: none; }
  .topbar { min-height: 54px; padding: 8px 15px; }
  #main { padding: 22px 15px 26px; }
  .overview { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 15px; }
  .snapshot { flex-direction: row; align-items: center; }
  .filterbar { flex-wrap: wrap; gap: 8px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { min-height: 100px; padding: 11px 12px; }
  .insights { gap: 11px; }
  .queue-panel { grid-row: 1; }
  .panel { padding: 14px; }
  .catalog-panel { padding: 0; }
  .catalog-heading { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .catalog-tools { width: 100%; }
  .catalog-tools input { flex: 1; width: 0; }
  .catalog-tools select { max-width: 55%; }
  .partner-panel { align-items: flex-start; flex-direction: column; gap: 11px; padding: 15px; }
}

@media (max-width: 420px) {
  .sidebar nav { display: grid; grid-template-columns: repeat(4, auto); gap: 3px; overflow: visible; }
  .nav-link { justify-content: center; min-height: 39px; padding-inline: 3px; font-size: 0.73rem; }
  .nav-link span { display: none; }
}

@media (max-width: 360px) {
  .field-row { grid-template-columns: 1fr; }
  dialog { padding: 20px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
