:root {
  --ink: #172b2e;
  --ink-soft: #526568;
  --paper: #f3f5f3;
  --panel: #ffffff;
  --mist: #dbe6e9;
  --line: rgba(23, 43, 46, .14);
  --accent: #6f8f88;
  --danger: #9a4848;
  --shadow: 0 30px 80px rgba(12, 31, 34, .16);
  font-family: "Manrope", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { min-height: 100vh; margin: 0; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.admin-brand { display: inline-flex; align-items: flex-start; flex-direction: column; color: var(--ink); text-decoration: none; line-height: 1; }
.admin-brand strong { font-size: 25px; font-weight: 800; letter-spacing: -.055em; }
.admin-brand span { align-self: center; margin-top: 7px; color: #65857d; font-size: 8px; font-weight: 800; letter-spacing: .28em; }
.admin-brand--light { color: white; }
.admin-brand--light span { color: #9fbcb4; }
.admin-eyebrow { color: #6c8184; font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.admin-auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: linear-gradient(135deg, #dce7e9, #f5f6f3 60%); }
.auth-card { display: grid; gap: 44px; width: min(100%, 520px); padding: clamp(30px, 5vw, 58px); background: rgba(255, 255, 255, .78); box-shadow: var(--shadow); }
.auth-card h1 { max-width: 390px; margin: 12px 0 14px; font-family: "Cormorant", Georgia, serif; font-size: clamp(44px, 7vw, 66px); font-weight: 600; letter-spacing: -.055em; line-height: .88; }
.auth-card p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.auth-card form { display: grid; gap: 18px; }
.auth-card label, .category-form label { display: grid; gap: 8px; }
.auth-card label > span, .category-form label > span { font-size: 11px; font-weight: 800; text-transform: uppercase; }
.auth-card input, .category-form input { width: 100%; min-height: 52px; padding: 0 15px; border: 1px solid var(--line); outline: 0; background: white; }
.auth-card input:focus, .category-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(111, 143, 136, .14); }
.auth-card label small { color: #758486; font-size: 10px; }
.auth-back { color: var(--ink-soft); font-size: 12px; text-decoration: none; }

.admin-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 48px; padding: 0 18px; border: 1px solid var(--line); background: white; font-size: 12px; font-weight: 800; }
.admin-button i { font-style: normal; font-size: 18px; }
.admin-button:hover { border-color: rgba(23, 43, 46, .34); }
.admin-button:focus-visible, .text-button:focus-visible, .icon-button:focus-visible, .admin-sidebar button:focus-visible, .admin-sidebar a:focus-visible { outline: 3px solid #94b7ae; outline-offset: 2px; }
.admin-button:disabled { cursor: wait; opacity: .55; }
.admin-button--primary { border-color: var(--ink); color: white; background: var(--ink); }
.admin-button--primary:hover { background: #254044; }

.admin-app { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 30px 22px 24px; color: #d9e5e1; background: var(--ink); }
.admin-sidebar nav { display: grid; gap: 4px; margin-top: 62px; }
.admin-sidebar nav button { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; border: 0; color: #aebfba; background: transparent; text-align: left; }
.admin-sidebar nav button:hover, .admin-sidebar nav button.is-active { color: white; background: rgba(255, 255, 255, .08); }
.admin-sidebar nav b { min-width: 25px; padding: 4px 7px; border-radius: 20px; background: rgba(255, 255, 255, .08); font-size: 9px; text-align: center; }
.admin-sidebar__bottom { display: grid; gap: 4px; margin-top: auto; }
.admin-sidebar__bottom button, .admin-sidebar__bottom a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; border: 0; color: #9fb1ac; background: transparent; font-size: 11px; text-align: left; text-decoration: none; }
.admin-sidebar__bottom button:hover, .admin-sidebar__bottom a:hover { color: white; }

.admin-workspace { min-width: 0; }
.admin-header { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 104px; padding: 20px clamp(24px, 4vw, 58px); border-bottom: 1px solid var(--line); background: rgba(243, 245, 243, .92); backdrop-filter: blur(18px); }
.admin-header h1 { margin: 5px 0 0; font-family: "Cormorant", Georgia, serif; font-size: 34px; line-height: 1; }
.admin-menu-button { display: none; }
.admin-main { padding: 38px clamp(24px, 4vw, 58px) 80px; }
.admin-summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: rgba(255, 255, 255, .46); }
.admin-summary article { display: grid; grid-template-columns: 1fr auto; gap: 10px; min-height: 118px; padding: 22px 24px; }
.admin-summary article + article { border-left: 1px solid var(--line); }
.admin-summary span, .admin-summary small { color: var(--ink-soft); font-size: 10px; }
.admin-summary strong { grid-row: span 2; font-family: "Cormorant", Georgia, serif; font-size: 58px; font-weight: 500; line-height: .85; }
.admin-summary small { align-self: end; }
.admin-products { margin-top: 42px; }
.admin-products__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.admin-products__toolbar > span { color: var(--ink-soft); font-size: 11px; }
.admin-search input { width: min(360px, 60vw); min-height: 44px; padding: 0 14px; border: 1px solid var(--line); outline: none; background: rgba(255, 255, 255, .68); }
.admin-search input:focus { border-color: var(--accent); }
.admin-product-list { display: grid; gap: 8px; }
.admin-product-row { display: grid; grid-template-columns: 82px minmax(190px, 1fr) minmax(150px, .6fr) 120px 54px; align-items: center; gap: 18px; min-height: 96px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .6); transition: background-color 180ms ease, transform 180ms ease; }
.admin-product-row:hover { background: white; transform: translateY(-1px); }
.admin-product-row__image { display: grid; place-items: center; width: 82px; height: 74px; background: #dce7e9; }
.admin-product-row__image img { max-width: 88%; max-height: 84%; object-fit: contain; filter: drop-shadow(0 9px 8px rgba(23, 43, 46, .14)); }
.admin-product-row h2 { margin: 0 0 6px; font-family: "Cormorant", Georgia, serif; font-size: 26px; font-weight: 600; line-height: 1; }
.admin-product-row p { margin: 0; color: var(--ink-soft); font-size: 10px; }
.admin-product-row__category { color: var(--ink-soft); font-size: 11px; }
.status-pill { display: inline-flex; align-items: center; width: fit-content; min-height: 28px; padding: 0 10px; border: 1px solid var(--line); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.status-pill--published { color: #315f52; background: #dfece6; }
.status-pill--draft { color: #756734; background: #f2ecd5; }
.status-pill--hidden { color: #526568; background: #e7ebea; }
.status-pill--archived { color: #7e5555; background: #f0dfdf; }
.row-edit { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 18px; }
.row-edit:hover { color: white; background: var(--ink); }
.admin-empty { padding: 70px 24px; border: 1px solid var(--line); text-align: center; }
.admin-empty strong { font-family: "Cormorant", Georgia, serif; font-size: 34px; }
.admin-empty p { color: var(--ink-soft); }

.admin-dialog { width: min(1420px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); margin: auto; padding: 0; border: 0; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.admin-dialog::backdrop { background: rgba(9, 24, 27, .68); backdrop-filter: blur(6px); }
.product-editor__form { display: flex; flex-direction: column; min-height: min(920px, calc(100vh - 32px)); }
.editor-header { display: flex; align-items: center; justify-content: space-between; min-height: 92px; padding: 20px 30px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .7); }
.editor-header h2 { margin: 6px 0 0; font-family: "Cormorant", Georgia, serif; font-size: 36px; line-height: 1; }
.icon-button { position: relative; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.icon-button span { position: absolute; top: 22px; left: 13px; width: 20px; height: 1px; background: currentColor; transform: rotate(45deg); }
.icon-button span + span { transform: rotate(-45deg); }
.editor-body { display: grid; grid-template-columns: minmax(0, 1fr) 390px; flex: 1; min-height: 0; overflow: hidden; }
.editor-fields { overflow-y: auto; padding: 30px; }
.editor-section { margin-bottom: 26px; padding: 26px; border: 1px solid var(--line); background: rgba(255, 255, 255, .55); }
.editor-section__head, .editor-section summary { display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: start; margin-bottom: 25px; }
.editor-section__head > span, .editor-section summary > span { color: #718486; font-size: 9px; font-weight: 800; }
.editor-section h3 { margin: 0; font-family: "Cormorant", Georgia, serif; font-size: 28px; line-height: .9; }
.editor-section__head p, .editor-section summary p { margin: 7px 0 0; color: var(--ink-soft); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: grid; align-content: start; gap: 8px; }
.form-field--wide { grid-column: 1 / -1; }
.form-field > span { font-size: 10px; font-weight: 800; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 0; outline: 0; color: var(--ink); background: white; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(111, 143, 136, .12); }
.form-field small { min-height: 12px; color: var(--danger); font-size: 9px; }
.image-question { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 18px; }
.image-question > strong { width: 100%; font-size: 11px; }
.image-question label { position: relative; }
.image-question input { position: absolute; opacity: 0; }
.image-question span { display: flex; align-items: center; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); font-size: 10px; }
.image-question input:checked + span { border-color: var(--ink); background: #e4ecea; }
.image-drop { display: grid; place-items: center; min-height: 180px; padding: 24px; border: 1px dashed #91a5a5; background-color: #eef3f1; background-image: linear-gradient(45deg, rgba(23,43,46,.035) 25%, transparent 25%), linear-gradient(-45deg, rgba(23,43,46,.035) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(23,43,46,.035) 75%), linear-gradient(-45deg, transparent 75%, rgba(23,43,46,.035) 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; cursor: pointer; text-align: center; }
.image-drop input { position: absolute; opacity: 0; pointer-events: none; }
.image-drop__icon { font-size: 30px; font-weight: 300; }
.image-drop strong { margin-top: 8px; font-size: 12px; }
.image-drop small { margin-top: 5px; color: var(--ink-soft); font-size: 9px; }
.image-drop.has-image { background-image: none; }
.image-drop.has-image img { max-width: 90%; max-height: 230px; object-fit: contain; filter: drop-shadow(0 15px 16px rgba(23,43,46,.16)); }
.image-actions { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.image-help { margin: 12px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.text-button { min-height: 40px; padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; font-size: 10px; font-weight: 800; }
.text-button--danger { color: var(--danger); }
.attribute-list { display: grid; gap: 10px; margin-bottom: 12px; }
.attribute-row { display: grid; grid-template-columns: 1fr 1.4fr 40px; gap: 8px; }
.attribute-row input { min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); outline: 0; }
.attribute-row button { border: 1px solid var(--line); background: transparent; font-size: 18px; }
.editor-section--details summary { margin: 0; cursor: pointer; list-style: none; }
.editor-section--details summary::-webkit-details-marker { display: none; }
.editor-section--details[open] summary { margin-bottom: 25px; }
.editor-preview { overflow-y: auto; padding: 30px; border-left: 1px solid var(--line); background: #dde7e9; }
.preview-card { margin-top: 18px; border: 1px solid rgba(23,43,46,.16); background: rgba(255,255,255,.52); }
.preview-card__top { display: flex; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.preview-card__visual { display: grid; place-items: center; height: 300px; padding: 20px; }
.preview-card__visual img { max-width: 94%; max-height: 90%; object-fit: contain; filter: drop-shadow(0 18px 16px rgba(23,43,46,.18)); }
.preview-card__visual span { color: #708284; font-size: 10px; }
.preview-card > div:last-child { padding: 22px; border-top: 1px solid var(--line); }
.preview-card small { color: var(--ink-soft); font-size: 9px; }
.preview-card h3 { margin: 8px 0 12px; font-family: "Cormorant", Georgia, serif; font-size: 34px; line-height: .9; }
.preview-card p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.editor-preview > p { color: var(--ink-soft); font-size: 9px; line-height: 1.6; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 78px; padding: 14px 30px; border-top: 1px solid var(--line); background: white; }
.editor-footer > div { display: flex; align-items: center; gap: 12px; }
.form-message { min-height: 18px; color: var(--danger); font-size: 10px; }
.form-message.is-success { color: #3c6b5d; }

.category-dialog { width: min(680px, calc(100vw - 32px)); padding-bottom: 26px; }
.category-list { display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 24px 30px; }
.category-row { display: grid; grid-template-columns: minmax(150px, 1fr) 80px auto auto; align-items: center; gap: 10px; min-height: 54px; padding: 8px 10px 8px 16px; border: 1px solid var(--line); background: white; }
.category-row strong { font-size: 12px; }
.category-row input { width: 70px; min-height: 38px; padding: 0 8px; border: 1px solid var(--line); }
.category-row button { min-height: 38px; border: 0; border-bottom: 1px solid currentColor; color: var(--danger); background: transparent; font-size: 9px; }
.category-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; padding: 22px 30px 0; border-top: 1px solid var(--line); }
.category-dialog > .form-message { margin: 12px 30px 0; }
.admin-toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 18px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.admin-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .admin-app { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform 220ms ease; }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-menu-button { display: block; width: 44px; height: 44px; border: 1px solid var(--line); background: transparent; }
  .admin-menu-button span { display: block; width: 18px; height: 1px; margin: 5px auto; background: currentColor; }
  .admin-header > div { margin-right: auto; margin-left: 14px; }
  .editor-body { grid-template-columns: minmax(0, 1fr) 330px; }
}

@media (max-width: 720px) {
  .admin-header { min-height: 82px; padding: 14px 16px; }
  .admin-header h1 { font-size: 27px; }
  .admin-header .admin-button span { display: none; }
  .admin-header .admin-button { min-width: 46px; padding: 0; justify-content: center; }
  .admin-main { padding: 22px 16px 60px; }
  .admin-summary { grid-template-columns: 1fr; }
  .admin-summary article { min-height: 86px; }
  .admin-summary article + article { border-top: 1px solid var(--line); border-left: 0; }
  .admin-summary strong { font-size: 48px; }
  .admin-product-row { grid-template-columns: 68px minmax(0, 1fr) 44px; gap: 12px; min-height: 90px; padding: 9px; }
  .admin-product-row__image { width: 68px; height: 68px; }
  .admin-product-row__category { display: none; }
  .admin-product-row .status-pill { grid-column: 2; width: fit-content; }
  .admin-product-row .row-edit { grid-column: 3; grid-row: 1 / span 2; }
  .admin-dialog { width: 100vw; height: 100dvh; max-height: none; }
  .product-editor__form { min-height: 100dvh; }
  .editor-header { min-height: 76px; padding: 14px 16px; }
  .editor-header h2 { font-size: 30px; }
  .editor-body { display: block; overflow-y: auto; }
  .editor-fields { overflow: visible; padding: 16px; }
  .editor-section { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field--wide { grid-column: auto; }
  .editor-preview { overflow: visible; padding: 24px 16px; border-top: 1px solid var(--line); border-left: 0; }
  .preview-card__visual { height: 240px; }
  .editor-footer { position: sticky; bottom: 0; align-items: stretch; flex-direction: column; gap: 6px; padding: 12px 16px; }
  .editor-footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .editor-footer .text-button--danger { grid-column: 1 / -1; justify-self: start; }
  .category-dialog { width: 100vw; height: 100dvh; }
  .category-row { grid-template-columns: minmax(0, 1fr) 72px; }
  .category-row button { min-height: 34px; }
  .category-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
