:root {
  color-scheme: light;
  --cream: #f8f5ef;
  --paper: #fcfaf6;
  --sand: #e9e0d1;
  --ink: #34261f;
  --muted: #82776e;
  --olive: #697055;
  --line: rgba(68, 50, 39, .16);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--cream); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.admin-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 78px; border-bottom: 1px solid var(--line); }
.admin-brand { display: flex; align-items: center; gap: 10px; font: 500 17px/1 var(--serif); }
.admin-brand b { display: block; margin-top: 4px; font: 500 10px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.admin-mark { color: var(--olive); font-size: 27px; }
.back-link { color: var(--muted); font-size: 11px; }
.back-link:hover { color: var(--ink); }
.access-view { display: grid; min-height: calc(100vh - 79px); place-items: center; padding: 48px 0; }
.access-card { width: min(100%, 460px); padding: 37px; border: 1px solid var(--line); background: var(--paper); }
.admin-eyebrow { margin: 0 0 12px; color: var(--olive); font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.access-card h1, .dashboard-heading h1 { margin: 0; font: 500 36px/1.15 var(--serif); letter-spacing: -.04em; }
.access-copy { margin: 15px 0 26px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.access-card label, .editor-card > label { display: grid; gap: 8px; margin-top: 15px; color: #65594f; font-size: 10px; }
.access-card input, .editor-card input[type="text"], .editor-card textarea, .new-category-form input, .category-editor input[type="text"] { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #d8cdbf; border-radius: 0; outline: 0; background: #fffefa; color: var(--ink); font: 12px var(--sans); }
.access-card input:focus, .editor-card input:focus, .editor-card textarea:focus, .new-category-form input:focus, .category-editor input:focus { border-color: var(--olive); box-shadow: 0 0 0 2px rgba(105,112,85,.12); }
.admin-button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 0 15px; border: 1px solid transparent; font-size: 10px; transition: background .2s, transform .2s; }
.admin-button:hover { transform: translateY(-1px); }
.admin-button:disabled { cursor: wait; opacity: .65; transform: none; }
.admin-button-dark { background: var(--ink); color: white; }
.admin-button-dark:hover { background: var(--olive); }
.access-card > .admin-button { width: 100%; margin-top: 22px; }
.admin-button-quiet { border-color: var(--line); background: transparent; color: var(--ink); }
.admin-button-quiet:hover { background: #eee8dd; }
.form-message { min-height: 18px; margin: 13px 0 0; color: #9b4c37; font-size: 10px; line-height: 1.6; }
.form-message.success { color: var(--olive-dark, #4c513e); }
.dashboard { padding: 47px 0 55px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; padding-bottom: 27px; border-bottom: 1px solid var(--line); }
.dashboard-heading h1 { font-size: clamp(32px, 4vw, 44px); }
.dashboard-heading > div > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.dashboard-message { min-height: 17px; margin: 13px 0 0; color: var(--olive); font-size: 10px; }
.dashboard-message.error { color: #9b4c37; }
.admin-section { padding-top: 43px; }
.admin-section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.admin-section-heading .admin-eyebrow { margin-bottom: 5px; }
.admin-section-heading h2 { margin: 0; font: 500 28px/1.2 var(--serif); }
.section-count { color: var(--muted); font-size: 10px; }
.product-admin-layout { display: grid; grid-template-columns: minmax(270px, .8fr) minmax(0, 1.2fr); align-items: start; gap: 20px; }
.editor-card { padding: 23px; border: 1px solid var(--line); background: var(--paper); }
.site-settings-form { max-width: 800px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.settings-field { display: grid; gap: 8px; margin-top: 15px; color: #65594f; font-size: 10px; }
.settings-field-wide { grid-column: 1 / -1; }
.settings-field input, .settings-field textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #d8cdbf; border-radius: 0; outline: 0; background: #fffefa; color: var(--ink); font: 12px var(--sans); }
.settings-field textarea { resize: vertical; }
.settings-field input:focus, .settings-field textarea:focus { border-color: var(--olive); box-shadow: 0 0 0 2px rgba(105,112,85,.12); }
.editor-card h3 { margin: 0 0 15px; font: 500 20px var(--serif); }
.editor-card textarea { min-height: 85px; resize: vertical; }
.editor-card input[type="file"] { width: 100%; color: var(--muted); font: 10px var(--sans); }
.optional-label { color: #95897c; font-size: 9px; }
.check-label { display: flex !important; align-items: center; gap: 8px !important; }
.check-label input, .category-editor input[type="checkbox"] { accent-color: var(--olive); }
.current-image { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.current-image img { width: 54px; height: 46px; object-fit: cover; background: var(--sand); }
.editor-actions { display: flex; gap: 8px; margin-top: 19px; }
.product-admin-list { display: grid; gap: 10px; }
.product-admin-card { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); background: rgba(252,250,246,.66); }
.product-admin-card img { display: block; width: 78px; height: 68px; object-fit: cover; background: var(--sand); }
.product-admin-card h3 { margin: 0 0 4px; font: 500 17px var(--serif); }
.product-admin-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.product-status { display: inline-block; margin-top: 6px; color: var(--olive); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.product-status.inactive { color: #a06b52; }
.product-actions { display: flex; flex-direction: column; gap: 6px; }
.product-actions button { padding: 6px 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 9px; }
.product-actions button:hover { background: #eee8dd; }
.section-explainer { max-width: 700px; margin: -7px 0 17px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.new-category-form { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 13px; padding: 14px; border: 1px solid var(--line); background: var(--paper); }
.new-category-form label { color: #65594f; font-size: 10px; }
.category-admin-list { display: grid; gap: 8px; }
.category-editor { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto 32px 32px auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(252,250,246,.66); }
.category-editor > span { color: #988b7e; font-family: var(--serif); font-size: 13px; }
.category-editor .check-label { margin: 0; white-space: nowrap; color: var(--muted); font-size: 9px; }
.category-editor .check-label input { margin: 0; }
.category-editor button { width: 32px; height: 32px; border: 1px solid var(--line); background: transparent; color: var(--ink); }
.category-editor button:hover { background: #eee8dd; }
.category-editor .save-category { width: auto; padding: 0 10px; background: var(--ink); color: white; font-size: 9px; }
.local-note { display: flex; gap: 10px; margin: 38px 0 0; padding: 14px; background: #eee8dd; color: #766b60; font-size: 9px; line-height: 1.7; }
.local-note span { color: var(--olive); }

@media (max-width: 760px) {
  .admin-shell { width: calc(100% - 32px); }
  .admin-topbar { min-height: 67px; }
  .admin-brand { font-size: 15px; }
  .dashboard { padding-top: 32px; }
  .dashboard-heading { align-items: start; flex-direction: column; }
  .product-admin-layout { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-field-wide { grid-column: auto; }
  .new-category-form { grid-template-columns: 1fr auto; }
  .new-category-form label { grid-column: 1 / -1; }
  .category-editor { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .category-editor > span { grid-column: 1; grid-row: 1; }
  .category-editor input[type="text"] { grid-column: 2 / -1; grid-row: 1; }
  .category-editor .check-label { grid-column: 2; grid-row: 2; }
  .category-editor .category-up { grid-column: 3; grid-row: 2; }
  .category-editor .category-down { grid-column: 4; grid-row: 2; }
  .category-editor .save-category { grid-column: 2 / -1; grid-row: 3; justify-self: end; height: 34px; }
}

@media (max-width: 450px) {
  .access-card { padding: 24px 19px; }
  .access-card h1 { font-size: 30px; }
  .product-admin-card { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
  .product-admin-card img { width: 58px; height: 58px; }
  .product-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .new-category-form { grid-template-columns: 1fr; }
  .new-category-form label { grid-column: auto; }
}
