/* Octo web UI. Leben palette: forest #174B3B, leaf #568649, paper #F7F9F5, gold #C7A24B, terracotta #C9683D. */
:root {
  --forest: #174B3B;
  --forest-2: #24614C;
  --paper: #F7F9F5;
  --card: #FFFFFF;
  --ink: #16241E;
  --ink-2: #3A4740;
  --muted: #66726B;
  --line: #E1E8DE;
  --line-2: #BCC8BE;
  --soft: #EEF2EB;
  --tint: #E3EEDB;
  --pos: #467036;
  --neg: #B23B2E;
  --c-cogs: #7A9C8E;
  --c-fees: #C9683D;
  --c-ops: #C7A24B;
  --c-ads: #275670;
  --c-package: #6E5A8A;
  --c-cm: #568649;
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14px/1.45 var(--sans); }
a { color: var(--forest); }
a:hover { color: #0F3A2D; }
h1, h2, h3, p { margin: 0; }
button, input, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--c-ads); outline-offset: 2px; }

.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 200px; max-width: 232px; background: var(--forest); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 18px; text-decoration: none; color: #FBFCFA; font-size: 27px; font-weight: 800; letter-spacing: -0.04em; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { padding: 10px 12px; border-radius: 3px; color: #D6E5CB; text-decoration: none; font-size: 14px; font-weight: 500; }
.side nav a:hover { background: var(--forest-2); color: #FBFCFA; }
.side nav a.on { background: #FBFCFA; color: var(--forest); }
.side-foot { margin-top: auto; padding: 18px 12px 0; font-size: 12px; color: #D6E5CB; line-height: 1.6; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.side-foot a { color: #FBFCFA; }
main { flex: 999 1 640px; min-width: 0; padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 18px; outline: none; }
main.split { padding: 0; flex-direction: row; flex-wrap: wrap; gap: 0; }
@media (max-width: 760px) {
  .side { max-width: none; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; }
  .side .brand { padding: 0 8px 0 0; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin: 0 0 0 auto; padding: 0; flex-direction: row; gap: 10px; }
  main { padding: 16px; }
}

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.head > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.2; letter-spacing: -0.01em; }
h1 .mono { font-size: 15px; }
.sub { font-size: 13px; color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-cm); }
.crumbs { font-size: 13px; color: var(--ink); display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font: 500 13px var(--sans); padding: 7px 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); border-radius: 3px; cursor: pointer; min-height: 36px; }
.chip.on { background: var(--forest); border-color: var(--forest); color: #FBFCFA; }
.inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
select, input[type=date], input[type=month], input[type=text], input[type=password], input[type=number], input[type=search] { font: 500 13px var(--sans); padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--card); color: var(--ink); min-height: 36px; }
input:disabled, select:disabled { background: var(--paper); color: var(--ink-2); }

.note { padding: 10px 14px; background: #F7EBC7; border-radius: 4px; font-size: 13px; color: #5C4510; }
.note strong { font-weight: 600; }
.error { padding: 12px 14px; background: #F8E3DF; border-radius: 4px; color: #7A251C; font-size: 13px; }
.loading { color: var(--muted); font-size: 13px; padding: 24px 0; }
.empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.mono { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.muted { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-t { font-size: 15px; font-weight: 600; }
.more { font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; }
.hint { font-size: 12px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.scroll { overflow-x: auto; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { gap: 6px; padding: 16px 18px; text-decoration: none; color: var(--ink); }
a.kpi:hover { border-color: var(--line-2); color: var(--ink); }
.kpi .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi svg { width: 100%; height: 28px; }
.kpi .foot { font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.kpi .foot b { font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile .label { font-size: 12px; color: var(--muted); }
.tile .value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .foot { font-size: 12px; color: var(--ink-2); }

.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini td, .mini th { padding: 8px 0 8px 12px; border-bottom: 1px solid var(--soft); }
.mini td:first-child, .mini th:first-child { padding-left: 0; }
.mini th { font-size: 12px; font-weight: 500; color: var(--muted); text-align: right; }
.mini th:first-child { text-align: left; }
.mini tr:last-child td { border-bottom: none; }
.mini a { text-decoration: none; font-weight: 500; }
.mini a:hover { text-decoration: underline; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 2px; white-space: nowrap; display: inline-block; }
.tag.ok { background: var(--tint); color: #2F5A22; }
.tag.warn { background: #F7EBC7; color: #5C4510; }
.tag.bad { background: #F8D9D4; color: #8A2A1F; }
.tag.off { background: var(--soft); color: var(--muted); }
a.tag { text-decoration: none; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 1px; display: inline-block; flex: none; }
.sw.line { height: 2px; width: 16px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 500 10px var(--sans); fill: var(--muted); }

.stack { display: flex; height: 18px; border-radius: 2px; overflow: hidden; background: var(--soft); }
.stack.tall { height: 44px; }
.stack i { display: block; height: 100%; }
.bar-cell { width: 42%; }
.bar { height: 14px; background: var(--c-cogs); border-radius: 1px; min-width: 2px; }

.watch { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.watch li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.watch li:last-child { border-bottom: none; }
.watch b { font-weight: 600; display: block; }
.watch span.d { color: var(--ink-2); }

.avg-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; font-size: 13px; color: var(--ink-2); }
.avg-legend b { display: block; font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; padding-left: 22px; }
.avg-legend span { display: flex; align-items: center; gap: 10px; }
.avg-legend .sw { width: 12px; height: 12px; }
.final { height: 12px; display: flex; border-radius: 1px; overflow: hidden; }
.final i:first-child { background: var(--forest); }
.final i:last-child { background: repeating-linear-gradient(135deg, var(--c-cm) 0 6px, #CFE0C4 6px 12px); }
.pairs { display: flex; flex-direction: column; }
.pairs > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--soft); font-size: 14px; }
.pairs > div:last-child { border-bottom: none; font-weight: 600; }
.pairs small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.pairs b { font-weight: 600; font-variant-numeric: tabular-nums; }

.unit-bars { display: grid; grid-template-columns: minmax(120px, 210px) 1fr 70px; gap: 12px 14px; align-items: center; font-size: 14px; }
.unit-bar { position: relative; height: 26px; }
.unit-bar .stack { height: 26px; background: transparent; border-radius: 0; overflow: visible; }
.unit-bar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; flex: 3 1 420px; }
.inputs span { font-size: 12px; color: var(--muted); display: block; }
.inputs b { font-size: 16px; font-weight: 600; display: block; }

.btn { font: 600 13px var(--sans); padding: 8px 14px; border-radius: 3px; border: 1px solid var(--line-2); background: var(--card); color: var(--forest); cursor: pointer; min-height: 36px; text-decoration: none; display: inline-flex; align-items: center; }
.btn:hover { background: #F3F6F1; }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #FBFCFA; }

/* Reports */
.panel { flex: 1 1 220px; max-width: 240px; background: var(--card); border-right: 1px solid var(--line); padding: 24px 20px; display: flex; flex-direction: column; gap: 22px; }
.panel h2 { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.panel section { display: flex; flex-direction: column; }
.report { flex: 999 1 560px; min-width: 0; padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 760px) { .panel { max-width: none; border-right: none; border-bottom: 1px solid var(--line); } .report { padding: 16px; } }
.saved { display: flex; align-items: center; border-radius: 3px; }
.saved:hover { background: #F3F6F1; }
.saved.on { background: var(--tint); }
.saved a { flex: 1; padding: 8px 10px; font-size: 13px; color: var(--ink); text-decoration: none; }
.saved.on a { font-weight: 600; }
.saved small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 28px; cursor: pointer; }
.check input { accent-color: var(--forest); width: 16px; height: 16px; }
.builder { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.builder > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.builder > div + div { border-top: 1px solid var(--soft); padding-top: 12px; }
.builder .lab { font-weight: 600; margin-right: 4px; }
.lvl { display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--sans); padding: 0 4px 0 10px; border-radius: 3px; background: var(--forest); color: #FBFCFA; min-height: 36px; }
.lvl .n { font-size: 11px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; background: #FBFCFA; color: var(--forest); display: inline-flex; align-items: center; justify-content: center; }
.x { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; width: 28px; height: 28px; border-radius: 2px; }
.x:hover { background: rgba(255, 255, 255, 0.18); }
.add { font: 600 13px var(--sans); padding: 0 12px; border-radius: 3px; border: 1px dashed var(--c-cogs); background: var(--card); color: var(--forest); cursor: pointer; min-height: 36px; }
.add:hover { background: var(--tint); }
.focus { display: inline-flex; align-items: center; gap: 6px; font: 500 13px var(--sans); padding: 0 2px 0 10px; border-radius: 3px; background: #F7EBC7; color: #5C4510; min-height: 32px; }
.focus .x:hover, .saved .x:hover { background: rgba(92, 69, 16, 0.12); }
.push { margin-left: auto; }
.tbl-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; padding: 10px 9px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 14px; }
.tbl th.left { text-align: left; }
.tbl td { padding: 8px 9px; border-bottom: 1px solid var(--line); }
.tbl td:last-child, .tbl th:last-child { padding-right: 14px; }
.tbl tr.l0 td { font-weight: 600; background: #FBFCFA; }
.tbl tr.l2 td { color: var(--ink-2); font-size: 12.5px; }
.tbl tr.total td { font-weight: 700; border-top: 1px solid var(--ink); border-bottom: none; }
.tbl .cell { display: flex; align-items: center; gap: 8px; }
.tbl a.sku { text-decoration: none; font-weight: 500; }
.tbl a.sku:hover { text-decoration: underline; }
.tog { border: none; background: transparent; padding: 0; width: 24px; height: 24px; cursor: pointer; color: var(--forest); font-size: 12px; border-radius: 2px; flex: none; }
.tog:hover { background: var(--tint); }
.tog.none { visibility: hidden; }
.name { border: none; background: transparent; padding: 2px 0; font: inherit; color: inherit; cursor: pointer; text-align: left; border-bottom: 1px dotted var(--c-cogs); }
.name:hover { color: var(--forest); border-bottom-style: solid; }
.detail { font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.detail:hover { text-decoration: underline; }

/* Costs & rules */
.edit td { padding-top: 5px; padding-bottom: 5px; }
.edit input, .edit select { min-height: 32px; padding: 4px 8px; width: 100%; }
.edit input[type=number] { text-align: right; min-width: 110px; }
.edit .state { font-size: 12px; width: 60px; }
.rules { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }

/* Settings */
.settings { table-layout: fixed; width: 100%; min-width: 760px; }
.settings td { vertical-align: middle; }
.settings td:first-child { width: 170px; font-weight: 500; }
.settings .sub-line { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings .actions { white-space: nowrap; width: 190px; }
.settings .actions .btn + .btn { margin-left: 8px; }
[hidden] { display: none !important; }
