:root {
  color-scheme: light;
  --forest: #123f2b;
  --forest-deep: #0b2e20;
  --leaf: #d5e6a8;
  --paper: #f7f7f1;
  --white: #fffefa;
  --ink: #20342a;
  --muted: #737d73;
  --line: #e2e6dd;
  --rust: #b95e42;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
[hidden] { display: none !important; }
.admin-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px max(5vw, 22px); background: var(--forest); color: white; }
.admin-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 19px; font-weight: 700; }
.admin-brand .brand-logo { width: 38px; height: 38px; display: block; border-radius: 50%; background: white; object-fit: cover; }
.admin-brand .brand-name { display: inline-flex; align-items: baseline; gap: 5px; }
.admin-brand small { display: block; margin-top: 2px; color: #c6d1c5; font-family: var(--sans); font-size: 8px; font-weight: 600; letter-spacing: .15em; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.store-link { color: #e6ecdf; font-size: 11px; }
.store-link span { padding-left: 4px; color: var(--leaf); }
.signed-in-as { max-width: 220px; overflow: hidden; color: #d0dbd0; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.admin-main { width: min(1240px, calc(100% - 48px)); min-height: calc(100vh - 132px); margin: 0 auto; padding: 54px 0 70px; }
.eyebrow { margin: 0; color: #bdc9b8; font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.eyebrow-dark { color: #78866f; }
.auth-layout { min-height: 450px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 430px); align-items: center; gap: clamp(40px, 9vw, 130px); padding: 55px clamp(25px, 8vw, 110px); background: #edf0e6; border-top: 4px solid var(--rust); }
.auth-intro h1, .workspace-heading h1 { margin: 18px 0 13px; color: var(--forest); font-family: var(--serif); font-size: clamp(36px, 5vw, 56px); font-weight: 500; line-height: 1.08; }
.auth-intro h1 em, .workspace-heading h1 em { color: var(--rust); font-weight: 500; }
.auth-intro > p:last-child { max-width: 340px; margin: 0; color: #647166; font-size: 13px; line-height: 1.8; }
.login-form { display: grid; gap: 16px; padding: 28px; background: var(--white); border: 1px solid var(--line); }
.login-form h2 { margin: 8px 0 2px; color: var(--forest); font-family: var(--serif); font-size: 25px; font-weight: 500; }
.login-form label, .form-grid label { display: grid; gap: 7px; color: #546257; font-size: 10px; font-weight: 600; }
.login-form input, .form-grid input, .form-grid select { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid #dce2d8; border-radius: 0; outline-color: #749064; background: #fff; color: var(--ink); font-size: 12px; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 15px; padding: 0 15px; border: 1px solid transparent; cursor: pointer; font-size: 11px; font-weight: 700; transition: background .16s, color .16s, border-color .16s; }
.button:disabled, .row-button:disabled { opacity: .58; cursor: wait; }
.button-primary { background: var(--forest); color: white; }
.button-primary:hover:not(:disabled) { background: #245c3e; }
.button-primary span { color: var(--leaf); font-size: 16px; }
.button-quiet { min-height: 32px; border-color: rgba(255,255,255,.38); background: transparent; color: white; font-size: 10px; }
.button-quiet:hover:not(:disabled) { border-color: var(--leaf); color: var(--leaf); }
.message { min-height: 16px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.message.is-error { color: #a63c34; }
.message.is-success { color: #28714a; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.workspace-heading h1 { margin: 9px 0 0; font-size: 37px; }
.workspace-heading > .button { flex: 0 0 auto; }
.workspace-heading > .button span { font-size: 17px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,254,250,.58); }
.metric { min-height: 102px; display: grid; grid-template-columns: 1fr auto; align-content: center; column-gap: 14px; padding: 18px 23px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric > span { grid-column: 1 / -1; color: #859084; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.metric strong { align-self: center; margin-top: 5px; color: var(--forest); font-family: var(--serif); font-size: 29px; font-weight: 500; line-height: 1; }
.metric small { align-self: end; color: var(--muted); font-size: 9px; }
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 17px; }
.catalog-search { width: min(390px, 100%); min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border-bottom: 1px solid #b7c0b3; background: #fffefa; }
.catalog-search:focus-within { border-color: var(--forest); }
.search-mark { color: #72816f; font-size: 21px; line-height: 1; }
.catalog-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.filter-switch { display: inline-flex; border: 1px solid #d9e0d6; }
.filter-button { min-width: 61px; min-height: 33px; padding: 0 10px; border: 0; border-right: 1px solid #d9e0d6; background: transparent; color: #657166; cursor: pointer; font-size: 10px; }
.filter-button:last-child { border-right: 0; }
.filter-button.active { background: var(--forest); color: white; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .82fr); align-items: start; gap: 22px; }
.catalog-section { min-width: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid #cfd7cc; }
.section-title h2, .editor-heading h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 20px; font-weight: 500; }
.section-title > span { color: var(--muted); font-size: 9px; }
.catalog-section > .message { margin-top: 8px; }
.product-list { min-height: 160px; }
.product-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.product-cover { width: 48px; height: 64px; object-fit: cover; background: #e5e8df; }
.product-details { min-width: 0; }
.product-details h3 { margin: 0; overflow-wrap: anywhere; color: #293b30; font-family: var(--serif); font-size: 13px; font-weight: 600; line-height: 1.35; }
.product-details > p { margin: 4px 0 7px; overflow-wrap: anywhere; color: var(--muted); font-size: 9px; }
.product-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.status-tag, .pick-tag { padding: 3px 6px; font-size: 8px; font-weight: 600; }
.status-tag.is-active { background: #e7f0dd; color: #356344; }
.status-tag.is-hidden { background: #eceee9; color: #69736a; }
.pick-tag { background: #f5e8c3; color: #735a1e; }
.product-price { align-self: start; padding-top: 3px; color: var(--forest); font-size: 10px; white-space: nowrap; }
.product-actions { grid-column: 2 / -1; display: flex; gap: 7px; }
.row-button { min-height: 27px; padding: 0 9px; border: 1px solid #ccd7ca; background: #fffefa; color: var(--forest); cursor: pointer; font-size: 9px; font-weight: 600; }
.row-button:hover:not(:disabled) { border-color: var(--forest); }
.row-button-secondary { color: #6b7169; }
.row-button-danger { border-color: #dfc4bd; color: #a54235; }
.row-button-danger:hover:not(:disabled) { border-color: #a54235; background: #fff0eb; }
.list-empty { padding: 26px 0; color: var(--muted); font-family: var(--serif); font-size: 14px; }
.editor-panel { position: sticky; top: 16px; padding: 20px; border-top: 3px solid var(--rust); background: var(--white); box-shadow: 0 8px 24px rgba(31,48,40,.045); }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.editor-heading h2 { margin-top: 6px; font-size: 19px; }
.text-button { padding: 5px 0; border: 0; border-bottom: 1px solid #b9c3b4; background: transparent; color: #647466; cursor: pointer; font-size: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.form-grid label { font-size: 9px; }
.form-grid input, .form-grid select { height: 36px; padding: 0 8px; font-size: 10px; }
.cover-upload-label { display: grid; gap: 8px; }
.cover-upload-label > label { font-size: 9px; }
.cover-upload-control { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 48px; padding: 6px; border: 1px dashed #cbd5c7; background: #f9faf7; }
.form-grid .cover-file-input { position: absolute; width: 1px; min-width: 1px; height: 1px; min-height: 1px; padding: 0; overflow: hidden; opacity: 0; }
.form-grid .cover-file-button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; background: var(--forest); color: #fff; cursor: pointer; font-size: 10px; font-weight: 600; transition: background .18s ease; }
.cover-file-button:hover { background: #245c3e; }
.form-grid .cover-file-button span { color: var(--leaf); font-size: 16px; line-height: 1; }
.form-grid .cover-file-input:focus-visible + .cover-file-button { outline: 2px solid #c77754; outline-offset: 3px; }
.cover-file-name { min-width: 0; overflow: hidden; color: #59665b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.cover-upload-hint { color: #69776a; font-size: 9px; }
.check-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 17px 0; }
.check-label { display: inline-flex; align-items: center; gap: 7px; color: #59665b; font-size: 9px; cursor: pointer; }
.check-label input { width: 15px; height: 15px; margin: 0; accent-color: var(--forest); }
.save-button { width: 100%; }
.editor-panel .message { margin-top: 9px; }
.admin-footer { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px max(5vw, 22px); background: var(--forest-deep); color: #d2dbcd; font-size: 9px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid #c77754; outline-offset: 3px; }
.workspace-actions { display: flex; align-items: center; gap: 12px; }
.view-switch { display: inline-flex; border: 1px solid #d9e0d6; }
.view-button { min-height: 40px; padding: 0 14px; border: 0; border-right: 1px solid #d9e0d6; background: var(--white); color: #657166; cursor: pointer; font-size: 10px; }
.view-button:last-child { border-right: 0; }
.view-button.active { background: var(--forest); color: white; }
.button-quiet-dark { min-height: 38px; border: 1px solid #ccd7ca; background: var(--white); color: var(--forest); }
.reports-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 8px 0 24px; }
.date-fields { display: flex; align-items: end; gap: 10px; }
.date-fields label { display: grid; gap: 7px; color: #546257; font-size: 10px; font-weight: 600; }
.date-fields input { height: 38px; padding: 0 9px; border: 1px solid #dce2d8; background: var(--white); color: var(--ink); }
.report-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,254,250,.58); }
.report-metrics .metric strong { max-width: 220px; overflow: hidden; font-size: 24px; text-overflow: ellipsis; white-space: nowrap; }
.report-metrics .metric:last-child strong { font-family: var(--sans); font-size: 14px; }
.report-filter-row { align-items: end; }
.report-filter-row .date-fields { display: flex; align-items: end; }
.report-filter-row .date-fields label { display: grid; gap: 7px; color: #546257; font-size: 10px; font-weight: 600; }
.report-filter-row .date-fields input { height: 33px; padding: 0 9px; border: 1px solid #dce2d8; background: var(--white); color: var(--ink); }
.report-quick-filters .filter-button { min-width: 78px; }
.report-list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0 10px; border-bottom: 1px solid #cfd7cc; }
.report-list-heading h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 20px; font-weight: 500; }
.report-list-heading span { color: var(--muted); font-size: 9px; }
.order-list { min-height: 100px; }
.order-item { border-bottom: 1px solid var(--line); }
.order-row { width: 100%; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 4px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.order-row:hover, .order-row.is-open { background: rgba(213,230,168,.15); }
.order-reference { display: grid; gap: 5px; }
.order-reference strong { color: var(--rust); font-family: var(--serif); font-size: 14px; }
.order-reference small { color: var(--muted); font-size: 9px; }
.order-row-total { display: flex; align-items: center; gap: 14px; color: var(--forest); }
.order-row-total strong { font-size: 12px; }
.order-row-total span { color: #9ba894; font-size: 24px; line-height: 1; transition: transform .16s; }
.order-row.is-open .order-row-total span { transform: rotate(90deg); }
.order-details { padding: 4px 18px 14px 18px; background: rgba(213,230,168,.10); }
.order-book-row { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; border-bottom: 1px solid rgba(226,230,221,.75); color: #56655d; font-size: 10px; }
.order-book-row:last-child { border-bottom: 0; }
.order-book-row strong { color: var(--forest); }
.order-empty { text-align: center; }
.report-total-row { display: flex; justify-content: space-between; gap: 20px; padding: 16px 4px; background: #edf0e6; border-top: 2px solid var(--forest); color: var(--forest); font-size: 12px; }

@media (min-width: 900px) {
  .product-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .product-actions { grid-column: 2 / -1; }
}
@media (max-width: 760px) {
  .admin-main { width: min(100% - 32px, 620px); padding-top: 32px; }
  .auth-layout { grid-template-columns: 1fr; gap: 26px; padding: 32px 22px; }
  .auth-intro h1 { font-size: 41px; }
  .workspace-heading { align-items: start; }
  .workspace-heading h1 { font-size: 30px; }
  .metrics { margin-bottom: 25px; }
  .metric { min-height: 88px; padding: 14px 12px; }
  .metric small { font-size: 8px; }
  .admin-layout { grid-template-columns: 1fr; }
  .editor-panel { position: static; grid-row: 1; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .catalog-search { width: 100%; }
  .filter-switch { align-self: start; }
  .workspace-heading { flex-direction: column; }
  .workspace-actions { width: 100%; justify-content: space-between; }
  .reports-toolbar { align-items: stretch; flex-direction: column; }
  .date-fields { flex-wrap: wrap; }
  .date-fields label { flex: 1 1 120px; }
  .date-fields input { width: 100%; }
  .report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-table { min-width: 680px; }
}
@media (max-width: 480px) {
  .admin-header { min-height: 62px; padding-inline: 16px; }
  .admin-brand { font-size: 16px; }
  .admin-brand .brand-logo { width: 34px; height: 34px; }
  .header-actions { gap: 10px; }
  .store-link { font-size: 9px; }
  .signed-in-as { display: none; }
  .button-quiet { padding-inline: 8px; }
  .admin-main { width: calc(100% - 28px); padding-top: 25px; }
  .workspace-heading { align-items: start; flex-direction: column; }
  .workspace-heading > .button { min-height: 37px; }
  .metric { grid-template-columns: 1fr; gap: 3px; }
  .metric > span { font-size: 7px; }
  .metric strong { margin-top: 2px; font-size: 24px; }
  .metric small { display: none; }
  .product-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 9px; }
  .product-cover { width: 42px; height: 58px; }
  .product-price { font-size: 9px; }
  .product-actions { gap: 5px; }
  .row-button { padding-inline: 7px; }
  .editor-panel { padding: 16px; }
  .admin-footer { padding-inline: 16px; }
}