:root {
  --ink: #17251c;
  --muted: #68736b;
  --paper: #f7f5ef;
  --surface: #fff;
  --line: #dcded7;
  --green: #244d32;
  --green-2: #326743;
  --lime: #dff15b;
  --cream: #f1eadb;
  --red: #a13b32;
  --amber: #a36b14;
  --shadow: 0 8px 28px rgba(24, 37, 28, .08);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input, textarea, select { font: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.admin-header {
  min-height: 76px;
  padding: 0 clamp(18px, 4vw, 54px);
  display: flex;
  align-items: center;
  gap: 34px;
  position: sticky;
  top: 0;
  z-index: 20;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 3px 14px rgba(0,0,0,.16);
}
.admin-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: max-content; }
.admin-brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font: 900 22px/1 Georgia, serif;
  transform: rotate(-5deg);
}
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font-size: 16px; letter-spacing: .01em; }
.admin-brand small { margin-top: 2px; color: #b9c4bc; font-size: 12px; }
.admin-nav { display: flex; align-self: stretch; align-items: center; gap: 6px; }
.admin-nav a { padding: 12px 14px; border-radius: 9px; color: #dfe6e1; font-size: 14px; font-weight: 700; text-decoration: none; }
.admin-nav a:hover, .admin-nav a.is-active { color: #fff; background: rgba(255,255,255,.1); }
.admin-account { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; }
.admin-account span { color: #c6d0c9; }
.admin-account a { color: #fff; font-weight: 700; }

.admin-main { width: min(1500px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 80px; }
.page-heading { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1, .editor-topbar h1 { margin: 4px 0 5px; font: 800 clamp(32px, 4vw, 48px)/1.05 Georgia, serif; letter-spacing: -.02em; }
.page-heading p, .editor-topbar p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--green) !important; font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }

.button {
  min-height: 42px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #bfc5bf;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.button:hover { border-color: var(--green); background: #fbfcf8; transform: translateY(-1px); }
.button-primary { border-color: var(--green); color: #fff; background: var(--green); box-shadow: 0 4px 12px rgba(36,77,50,.18); }
.button-primary:hover { color: #fff; background: var(--green-2); }
.button-large { min-height: 48px; padding-inline: 21px; }
.button-full { width: 100%; }

.notice { max-width: 900px; margin: 0 0 22px; padding: 14px 17px; border: 1px solid; border-radius: 9px; font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,.04); }
.notice-success { border-color: #8fb79a; color: #1c5a2c; background: #ecf8ef; }
.notice-error { border-color: #d8a49f; color: #822d27; background: #fff0ee; }
.notice-info { border-color: #9db4c5; color: #254d69; background: #eef7fc; }

.status-overview { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.status-overview a { min-height: 91px; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 3px 12px rgba(24,37,28,.035); text-decoration: none; }
.status-overview a:hover, .status-overview a.is-active { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.status-overview a.is-active { background: #f5f9f2; }
.status-overview strong, .status-overview span { display: block; }
.status-overview strong { margin-bottom: 4px; font: 800 25px/1 Georgia, serif; }
.status-overview span { color: var(--muted); font-size: 13px; font-weight: 700; }

.catalog-tools { margin-bottom: 20px; padding: 13px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.admin-search { width: min(650px, 100%); }
.admin-search label { display: block; margin: 0 0 6px 2px; font-size: 12px; font-weight: 800; }
.admin-search > div { display: flex; }
.admin-search input { width: 100%; min-height: 42px; padding: 10px 13px; border: 1px solid #bfc5bf; border-radius: 8px 0 0 8px; }
.admin-search .button { border-radius: 0 8px 8px 0; }
.view-switch { padding: 3px; display: flex; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.view-switch button { padding: 8px 10px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 800; cursor: pointer; }
.view-switch button[aria-pressed="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.09); }

.product-collection { display: grid; grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 18px; }
.admin-product-card { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.product-cover { height: 224px; display: block; overflow: hidden; background: #ecebe5; }
.product-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.admin-product-card:hover .product-cover img { transform: scale(1.025); }
.image-placeholder { height: 100%; display: grid; place-items: center; color: #868e88; font-weight: 800; }
.admin-product-info { padding: 17px 17px 12px; flex: 1; }
.card-meta { min-height: 25px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #7b857e; font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.status-pill { padding: 5px 7px; border-radius: 999px; font: 800 10px/1.15 Inter, sans-serif; letter-spacing: .02em; text-transform: none; }
.status-published { color: #246438; background: #e2f5e7; }
.status-draft { color: #8a5d13; background: #fff1cf; }
.status-archived { color: #68706b; background: #eaedeb; }
.admin-product-card h2 { margin: 0; font: 800 19px/1.28 Georgia, serif; }
.admin-product-card h2 a { text-decoration: none; }
.product-subline { min-height: 34px; margin: 8px 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.card-price { margin: 12px 0 6px; font-weight: 900; }
.card-updated { margin: 0; color: #8a928c; font-size: 11px; }
.card-actions { padding: 12px 16px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #ebece8; background: #fcfcfa; }
.card-actions > .button { flex: 1; }
.more-menu { position: relative; }
.more-menu summary { width: 43px; height: 42px; display: grid; place-items: center; border: 1px solid #bfc5bf; border-radius: 8px; list-style: none; cursor: pointer; font-weight: 900; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu > div { width: 210px; padding: 6px; position: absolute; right: 0; bottom: calc(100% + 7px); z-index: 5; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 12px 32px rgba(20,30,23,.18); }
.more-menu a, .more-menu button { width: 100%; padding: 10px; display: block; border: 0; border-radius: 6px; color: var(--ink); background: transparent; text-align: left; text-decoration: none; cursor: pointer; }
.more-menu a:hover, .more-menu button:hover { background: var(--paper); }

.product-collection[data-view-mode="list"] { display: block; }
.product-collection[data-view-mode="list"] .admin-product-card { min-height: 130px; margin-bottom: 10px; display: grid; grid-template-columns: 150px minmax(0, 1fr) 160px; align-items: stretch; }
.product-collection[data-view-mode="list"] .product-cover { height: 130px; }
.product-collection[data-view-mode="list"] .admin-product-info { padding: 15px 20px; display: grid; grid-template-columns: minmax(240px, 1.6fr) minmax(150px, 1fr) 150px; column-gap: 20px; align-content: center; }
.product-collection[data-view-mode="list"] .card-meta { grid-column: 1 / -1; justify-content: flex-start; }
.product-collection[data-view-mode="list"] .product-subline { min-height: auto; margin: 3px 0; align-self: center; }
.product-collection[data-view-mode="list"] .card-price { margin: 0; align-self: center; }
.product-collection[data-view-mode="list"] .card-updated { grid-column: 1 / -1; margin-top: 5px; }
.product-collection[data-view-mode="list"] .card-actions { border-top: 0; border-left: 1px solid #ebece8; }

.empty-state { padding: 70px 30px; border: 1px dashed #bdc4bd; border-radius: 14px; background: #fff; text-align: center; }
.empty-state h2 { margin: 10px 0 5px; font: 800 28px/1 Georgia, serif; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }
.empty-icon { font-size: 52px; color: #9aa49c; }

.editor-topbar { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; }
.editor-topbar h1 { font-size: 38px; }
.editor-actions { display: flex; gap: 9px; }
.back-link { display: inline-block; margin-bottom: 6px; color: var(--green); font-size: 13px; font-weight: 800; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(310px, .8fr); gap: 22px; align-items: start; }
.editor-main-column { display: grid; gap: 18px; }
.editor-side-column { min-width: 0; }
.editor-card { padding: clamp(20px, 3vw, 29px); border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.editor-card h2 { margin: 0; font: 800 23px/1.15 Georgia, serif; }
.card-heading { margin-bottom: 22px; display: flex; align-items: flex-start; gap: 13px; }
.card-heading p, .section-copy p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.step-number { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--ink); background: var(--lime); font-weight: 900; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.editor-card label, .login-form label { display: block; }
.editor-card label > span:first-child, .login-form label > span:first-child, .optional-field > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; }
.editor-card label em { margin-left: 5px; color: var(--red); font-size: 10px; font-style: normal; text-transform: uppercase; }
.editor-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .editor-card textarea, .editor-card select, .login-form input {
  width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid #bcc3bc; border-radius: 8px; color: var(--ink); background: #fff; outline: 0;
}
.editor-card textarea { resize: vertical; line-height: 1.5; }
.editor-card input:focus, .editor-card textarea:focus, .editor-card select:focus, .login-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36,77,50,.12); }
.editor-card label small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.field-full { margin: 0 0 19px; }
.form-grid + .field-full, .field-full + .form-grid { margin-top: 19px; }
.sticky-card { position: sticky; top: 98px; }
.sticky-card > h2 { margin-bottom: 20px; }
.sticky-card > label { margin-bottom: 18px; }
.price-input { display: flex; position: relative; }
.price-input input { padding-right: 42px !important; font-size: 19px !important; font-weight: 800; }
.price-input > span { position: absolute; right: 14px; top: 12px; color: var(--muted); font-weight: 800; }
.choice-card { padding: 13px; display: flex !important; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fafaf7; cursor: pointer; }
.choice-card input { margin: 3px 0 0; accent-color: var(--green); }
.choice-card span { margin: 0 !important; }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { margin-top: 3px !important; }
.visibility-choice { margin: 22px 0; padding: 0; border: 0; }
.visibility-choice legend { margin-bottom: 8px; font-size: 13px; font-weight: 900; }
.visibility-choice label { margin: 0 0 8px; padding: 13px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.visibility-choice label:has(input:checked) { border-color: var(--green); background: #eff6ee; box-shadow: inset 0 0 0 1px var(--green); }
.visibility-choice input { margin-top: 3px; accent-color: var(--green); }
.visibility-choice strong, .visibility-choice small { display: block; }
.visibility-choice small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.save-explainer { margin: 18px 0; padding: 12px; display: flex; gap: 9px; border-radius: 8px; color: #275b35; background: #e9f5e9; }
.save-explainer > span { font-weight: 900; }
.save-explainer p { margin: 0; font-size: 12px; line-height: 1.4; }
.source-card { margin-top: 18px; }
.source-card p { color: var(--muted); font-size: 13px; }
.source-card a { color: var(--green); font-weight: 800; }

.upload-zone { min-height: 174px; padding: 25px; display: grid !important; place-items: center; align-content: center; border: 2px dashed #aeb8af; border-radius: 12px; background: #fafbf7; text-align: center; cursor: pointer; }
.upload-zone:hover, .upload-zone.is-dragging { border-color: var(--green); background: #f1f6ed; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone .upload-icon { width: 42px; height: 42px; margin: 0 0 8px !important; display: grid !important; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 26px !important; }
.upload-zone strong { font-size: 15px; }
.upload-zone small { margin-top: 4px !important; }
[data-file-summary] { margin-top: 9px !important; color: var(--green); font-size: 12px !important; font-weight: 800 !important; }
.current-images { margin-bottom: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 11px; }
.current-image { padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.current-image img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; }
.current-image > span { margin: 7px 0 4px !important; }
.image-options { display: grid; gap: 4px; margin-top: 7px; }
.image-options label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.image-options label:last-child { color: var(--red); }
.image-options input { margin: 0; accent-color: var(--green); }

.login-page, .setup-page { min-height: 100vh; padding: 28px 18px; display: grid; place-items: center; background: radial-gradient(circle at 50% 0, #385444 0, #17251c 52%, #101a14 100%); }
.login-card { width: min(460px, 100%); padding: clamp(25px, 6vw, 44px); border-radius: 16px; background: var(--paper); box-shadow: 0 24px 65px rgba(0,0,0,.3); }
.login-brand { margin-bottom: 38px; display: flex; align-items: center; gap: 11px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font: 800 17px/1 Georgia, serif; }
.login-brand small { margin-top: 4px; color: var(--muted); }
.login-card h1 { margin: 0 0 8px; font: 800 34px/1.1 Georgia, serif; }
.login-card > p { margin: 0 0 25px; color: var(--muted); line-height: 1.5; }
.login-form label { margin-bottom: 16px; }
.login-form .button { width: 100%; margin-top: 5px; }
.login-card > .back-link { margin: 24px 0 0; display: block; text-align: center; }

.setup-page { display: block; }
.setup-shell { width: min(900px, 100%); margin: 30px auto 70px; }
.setup-heading { margin-bottom: 18px; display: flex; align-items: center; gap: 13px; color: #fff; }
.setup-heading p { margin: 0 0 3px; color: #bbc8bf; font-size: 13px; }
.setup-heading h1 { margin: 0; font: 800 34px/1 Georgia, serif; }
.setup-intro { max-width: 660px; margin: 0 0 24px; color: #dce5de; line-height: 1.5; }
.setup-form { padding: 0; overflow: hidden; }
.setup-form section { padding: 28px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 15px; border-bottom: 1px solid var(--line); }
.setup-form .section-copy, .setup-form .form-grid, .setup-form .choice-card, .setup-form .optional-field { grid-column: 2; }
.setup-form .section-copy { grid-row: 1; }
.setup-form .form-grid { margin-top: 7px; }
.setup-form > .button { margin: 24px 28px 28px auto; display: flex; }
.optional-field { margin-top: 15px; }

.import-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); gap: 22px; align-items: start; }
.import-help { padding: 22px; border-radius: 12px; color: #fff; background: var(--green); }
.import-help h2 { margin: 0 0 12px; font: 800 23px/1.1 Georgia, serif; }
.import-help ol { margin: 0; padding-left: 20px; color: #e2ebe4; line-height: 1.55; }
.import-help li + li { margin-top: 9px; }
.url-entry { display: flex; gap: 9px; }
.url-entry input { flex: 1; }
.import-progress { margin-top: 12px; color: var(--muted); font-size: 12px; }
.import-list { margin-top: 20px; display: grid; gap: 10px; }
.import-item { padding: 13px; display: grid; grid-template-columns: 24px 86px minmax(0,1fr) auto; gap: 13px; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.import-item > input { accent-color: var(--green); }
.import-item img, .import-thumb-placeholder { width: 86px; height: 76px; border-radius: 6px; object-fit: cover; background: #eceeea; }
.import-item h3 { margin: 0 0 5px; font: 800 15px/1.25 Georgia, serif; }
.import-item p { margin: 0; color: var(--muted); font-size: 12px; }
.import-item .status-pill { justify-self: end; }
.import-submit { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }

@media (max-width: 980px) {
  .admin-header { min-height: auto; padding-block: 12px; flex-wrap: wrap; gap: 8px 20px; }
  .admin-nav { order: 3; width: 100%; overflow-x: auto; }
  .admin-account span { display: none; }
  .editor-layout, .import-layout { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
  .product-collection[data-view-mode="list"] .admin-product-card { grid-template-columns: 120px minmax(0, 1fr); }
  .product-collection[data-view-mode="list"] .product-cover { height: 150px; }
  .product-collection[data-view-mode="list"] .admin-product-info { display: block; }
  .product-collection[data-view-mode="list"] .card-actions { grid-column: 1 / -1; border: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .admin-main { width: min(100% - 24px, 1500px); padding-top: 24px; }
  .admin-brand small, .view-switch span { display: none; }
  .page-heading, .editor-topbar { align-items: stretch; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .status-overview { grid-template-columns: 1fr 1fr; }
  .catalog-tools { align-items: stretch; }
  .form-grid { grid-template-columns: 1fr; }
  .editor-actions { position: sticky; bottom: 0; z-index: 8; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(247,245,239,.95); box-shadow: 0 -4px 18px rgba(0,0,0,.08); }
  .editor-actions .button { flex: 1; }
  .product-collection[data-view-mode="list"] .admin-product-card { grid-template-columns: 94px minmax(0, 1fr); }
  .product-collection[data-view-mode="list"] .product-cover { height: 122px; }
  .product-collection[data-view-mode="list"] .card-meta { display: block; }
  .product-collection[data-view-mode="list"] .card-meta > span:last-child, .product-collection[data-view-mode="list"] .card-updated { display: none; }
  .product-collection[data-view-mode="list"] .product-subline { display: none; }
  .product-collection[data-view-mode="list"] .admin-product-card h2 { font-size: 15px; }
  .setup-form section { grid-template-columns: 1fr; }
  .setup-form .section-copy, .setup-form .form-grid, .setup-form .choice-card, .setup-form .optional-field { grid-column: 1; }
  .import-item { grid-template-columns: 22px 62px minmax(0,1fr); }
  .import-item img, .import-thumb-placeholder { width: 62px; height: 62px; }
  .import-item .status-pill { grid-column: 3; justify-self: start; }
}
