:root {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #1c2b25;
  background: #f3f6f3;
  --ink: #1c2b25;
  --muted: #53665d;
  --border: #d7e0da;
  --green: #176348;
  --sidebar: #14241f;
  --radius: 13px;
  font-size: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #aabbb0; border-radius: 8px; background: white; color: var(--ink); padding: .62rem .95rem; font-weight: 650; }
button:hover { background: #eaf2ed; }
button:disabled { cursor: wait; opacity: .64; }
button.primary { background: var(--green); border-color: var(--green); color: white; }
button.primary:hover { background: #104e38; }
button.danger { color: #982e28; border-color: #dfaaa6; }
:focus-visible { outline: 3px solid #2f9a79; outline-offset: 3px; }
input, textarea { min-width: 0; border: 1px solid #aabbb0; border-radius: 8px; padding: .62rem .75rem; color: var(--ink); background: #fff; }
input[type='number'] { width: 6rem; }
input[type='file'] { width: 100%; max-width: 100%; }
textarea { resize: vertical; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 720; letter-spacing: -.046em; line-height: 1.1; margin-bottom: 1.65rem; }
h2 { font-size: 1.2rem; font-weight: 720; letter-spacing: -.018em; line-height: 1.3; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.initial { padding: 2rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: white; }
.brand-mark { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; flex: 0 0 auto; border-radius: 9px; background: #9fe9a2; color: #14241f; font-weight: 850; font-size: 1.35rem; }
.brand-text { font-weight: 725; line-height: 1.13; letter-spacing: -.025em; overflow-wrap: anywhere; }
.environment-badge { display: table; margin-top: .35rem; padding: .18rem .4rem; border-radius: 5px; background: #dff4e6; color: #1c462b; font-size: .75rem; font-weight: 650; }
.environment-badge.demo { background: #fff1ce; color: #604303; }
.layout { min-height: 100dvh; display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 2.6rem; padding: 1.55rem 1.05rem; background: var(--sidebar); align-self: stretch; }
.sidebar .brand { padding-inline: .45rem; }
.sidebar nav { display: grid; gap: .48rem; align-content: start; }
.sidebar nav button { display: flex; align-items: center; justify-content: space-between; gap: .45rem; text-align: left; background: #21352c; color: #eef6f0; border: 1px solid #40584b; border-radius: 10px; font-size: .925rem; transition: background-color .15s, border-color .15s; }
.sidebar nav button:hover { background: #355445; border-color: #708f7b; }
.sidebar nav button[aria-current='page'] { color: #2b2615; background: #ffe17a; border-color: #ffe17a; }
.sidebar nav button[aria-current='page']:hover { background: #ffecac; border-color: #ffecac; }
.claim-count { display: grid; place-items: center; min-width: 1.55rem; min-height: 1.5rem; padding-inline: .3rem; border-radius: 20px; color: #fff; background: #a91f30; font-size: .8rem; line-height: 1; font-variant-numeric: tabular-nums; }
.claim-count[hidden] { display: none; }
.field[hidden] { display: none; }
.field select { min-width: 0; width: 100%; padding: .65rem; border: 1px solid #aabbb0; border-radius: 8px; background: #fff; color: inherit; font: inherit; }
.side-account { margin-top: auto; display: flex; gap: .7rem; align-items: center; padding: 1rem .35rem 0; border-top: 1px solid #3a5146; color: #fff; overflow-wrap: anywhere; }
.side-account small { display: block; color: #c2d3ca; font-size: .85rem; }
.avatar { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 auto; border-radius: 50%; background: #395448; color: #eafff1; font-weight: 750; }
.workspace { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .55rem; min-height: 4.5rem; padding: .6rem clamp(1rem, 4vw, 3rem); background: #fff; border-bottom: 1px solid var(--border); }
.top-account { display: flex; gap: .65rem; align-items: center; line-height: 1.25; overflow-wrap: anywhere; min-width: 0; }
.top-account small { display: block; margin-top: .15rem; font-size: .85rem; color: var(--muted); }
.eyebrow { color: #466254; font-weight: 720; font-size: .875rem; }
.top-actions, .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.quiet { border-color: transparent; font-size: .9rem; padding: .45rem .65rem; }
.content { max-width: 83rem; margin-inline: auto; padding: clamp(1.3rem, 4vw, 3rem); }
.panel { border-radius: var(--radius); background: white; border: 1px solid var(--border); padding: clamp(1rem, 2.4vw, 1.6rem); margin-bottom: 1rem; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .8rem; }
.panel > p, .panel > .actions { margin-block: .75rem; }
.stack { display: grid; gap: .82rem; }
.field { display: grid; gap: .25rem; color: #33493e; font-weight: 620; font-size: .925rem; }
.field input, .field textarea { font-weight: 400; font-size: 1rem; }
.scan-form { display: grid; grid-template-columns: minmax(12rem, 32rem) auto; align-items: end; justify-content: start; gap: .65rem; margin-top: 1rem; }
.scan-form .feedback { grid-column: 1 / -1; }
.feedback:empty, #workspace-feedback:empty { display: none; }
.notice { padding: .65rem .85rem; border: 1px solid; border-radius: 8px; margin: 0 0 .85rem; }
.notice.error { color: #902e29; border-color: #ecc2bd; background: #fff0ee; }
.notice.success { color: #174b33; border-color: #badcc4; background: #e5f5e9; }
.notice.warning { color: #6d4a04; border-color: #efd086; background: #fff4d6; }
.empty { color: var(--muted); border: 1px dashed var(--border); border-radius: 8px; padding: 1rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: .68rem .85rem; vertical-align: middle; }
th { background: #eaf1ec; font-size: .9rem; color: #385346; white-space: nowrap; }
tbody tr + tr { border-top: 1px solid #e5eae6; }
td .actions button { font-size: .88rem; padding: .4rem .6rem; }
.cell-detail { display: block; color: var(--muted); font-size: .875rem; }
.text-button { border: 0; background: transparent; color: #146345; text-decoration: underline; padding: .1rem; }
.status { display: inline-block; padding: .19rem .55rem; border-radius: 20px; background: #edf2ef; color: #33483e; font-size: .875rem; font-weight: 700; white-space: nowrap; }
.status.waiting, .status.awaiting { color: #6d4a04; background: #fff1ce; }
.status.verify { color: #8a340b; background: #ffe0bf; }
.status.issue, .status.pending { color: #8b2e25; background: #fce8e4; }
.status.cancelled { color: #4a5256; background: #e9edef; }
.status.received, .status.closed, .status.sent { color: #155637; background: #e0f3e5; }
.metrics, .admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.metrics { margin-bottom: 1rem; }
.metrics > div { display: flex; flex-direction: column; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.metrics span { color: var(--muted); font-size: .9rem; }
.metrics strong { font-size: 1.85rem; }
.admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.order-card { margin-block: .65rem; border: 1px solid var(--border); border-radius: 10px; }
.order-card > summary { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.1rem; cursor: pointer; padding: .85rem 1rem; background: #f3f7f4; border-radius: 9px; list-style: none; }
.order-card > summary::-webkit-details-marker { display: none; }
.order-card > summary::before { content: '+'; font-weight: 800; color: var(--green); }
.order-card[open] > summary::before { content: '−'; }
.order-card > summary:hover { background: #e5f1e9; }
.order-counts { flex: 1 1 20rem; display: flex; flex-wrap: wrap; gap: .25rem .9rem; color: var(--muted); font-size: .875rem; }
.order-counts b { color: var(--ink); }
.order-detail { display: grid; gap: .75rem; padding: 1rem; min-width: 0; }
.order-detail > button { justify-self: start; }
.order-detail h3, .stack h3 { margin: 0; font-size: 1rem; }
.order-packs { margin: 0; padding: 0; list-style: none; }
.order-packs li { padding: .35rem 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.order-packs li small { color: var(--muted); display: inline-block; margin: .2rem; }
.form-grid, .finance-filters, .product-edit, .dialog-head { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.form-grid .field, .finance-filters .field, .product-edit .field { flex: 1 1 9rem; min-width: 0; }
.product-edit input[type='number'] { width: 100%; }
.product-edit { background: #f1f6f2; border-radius: 8px; padding: .65rem; margin-bottom: .5rem; }
.dialog-head { align-items: center; justify-content: space-between; }
dialog.wide-dialog { width: min(62rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); }
.checkbox { display: flex; align-items: baseline; gap: .45rem; color: var(--muted); font-size: .9rem; }
.photos { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .7rem; }
.photos:empty { display: none; }
.photos img { display: block; width: 6rem; height: 6rem; object-fit: cover; border: 1px solid var(--border); border-radius: 8px; }
.photo-controls summary { cursor: pointer; border: 1px solid #aabbb0; border-radius: 8px; padding: .62rem .95rem; font-weight: 650; }
.photo-controls[open] { flex-basis: 100%; }
.photo-controls[open] .actions { padding-block: .55rem; }
.finance-metrics { grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); }
.finance-filters { align-items: end; }
.finance-filters .feedback, .form-grid .feedback { flex-basis: 100%; }
.narrow { max-width: 32rem; }
pre { background: #f3f6f3; padding: .9rem; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }
dialog { width: min(29rem, calc(100vw - 2rem)); border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); padding: 1.3rem; }
dialog::backdrop { background: #14241f99; }
.auth-layout { display: grid; grid-template-columns: minmax(16rem, 40%) minmax(0, 1fr); min-height: 100dvh; }
.auth-aside { display: flex; flex-direction: column; gap: clamp(2rem, 13vh, 9rem); padding: clamp(1.4rem, 5vw, 4rem); background: var(--sidebar); color: white; }
.auth-aside .eyebrow { color: #b6e8c9; margin-bottom: .8rem; }
.auth-heading { max-width: 30rem; }
.auth-heading h1 { margin-bottom: 1rem; }
.auth-heading > p:last-child { color: #d0e3d7; }
.auth-main { display: grid; place-items: center; padding: clamp(1rem, 5vw, 4rem); }
.auth-card { width: min(100%, 29rem); }
.auth-card h2 { font-size: 1.7rem; margin-bottom: .55rem; }
.auth-card > .muted { margin-bottom: 1.25rem; }
@media (max-width: 850px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { gap: .7rem; padding: .85rem 1rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .side-account { display: none; }
}
@media (max-width: 610px) {
  .auth-layout, .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-layout { align-content: start; }
  .auth-aside { gap: 1.35rem; }
  .scan-form { grid-template-columns: minmax(0, 1fr); }
  .scan-form button { justify-self: start; }
  .metrics { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .metrics > div { flex-direction: row; justify-content: space-between; align-items: center; }
  .sidebar nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar nav button { padding: .5rem .55rem; }
  .order-counts { flex-basis: 100%; order: 1; }
  .order-card > summary { padding: .7rem; }
}
@media (prefers-reduced-motion: reduce) { .sidebar nav button { transition: none; } }
