:root {
  --ink: #1b1d1f;
  --muted: #747875;
  --line: #deded8;
  --paper: #f6f4ef;
  --white: #fffefa;
  --accent: #b97750;
  --accent-dark: #8d5237;
  --sage: #cad1c6;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; overflow: hidden; }
.topbar { height: 78px; padding: 0 5.5vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(246,244,239,.92); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; letter-spacing: .08em; }
.brand-mark { width: 32px; height: 32px; border: 1px solid var(--ink); display: grid; place-items: center; font-family: var(--serif); font-size: 20px; font-style: italic; }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { font-size: 15px; letter-spacing: .18em; }
.brand small { font-family: var(--mono); color: var(--muted); font-size: 7px; letter-spacing: .08em; margin-top: 4px; }
.topbar-actions { display: flex; gap: 8px; }
.view-switch, .ghost-button { border: 0; background: none; color: var(--muted); padding: 10px 14px; transition: .2s; }
.view-switch.active, .view-switch:hover { color: var(--ink); background: var(--white); }
.view-switch .icon { margin-right: 6px; font-size: 13px; }
.view { display: none; }
.active-view { display: block; }
.catalog-intro { padding: 74px 9vw 68px; min-height: 315px; display: flex; align-items: flex-end; justify-content: space-between; background: linear-gradient(112deg, #e9ece6 0%, #f6f4ef 55%, #eee0d5 100%); border-bottom: 1px solid var(--line); }
.eyebrow, .section-kicker, .note-label { font-family: var(--mono); font-size: 10px; letter-spacing: .13em; color: var(--accent-dark); }
.eyebrow { margin: 0 0 20px; }
h1, h2, h3, p { margin-top: 0; }
.catalog-intro h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 5vw, 64px); line-height: .99; letter-spacing: -.03em; margin-bottom: 22px; }
h1 em { color: var(--accent); font-style: italic; }
.intro-copy { color: var(--muted); line-height: 1.8; }
.intro-aside { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); line-height: 1.7; margin-bottom: 4px; }
.intro-aside b { color: var(--ink); font-family: var(--mono); font-size: 20px; font-weight: 400; }
.pulse-dot { width: 8px; height: 8px; margin-top: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px rgba(185,119,80,.14); }
.catalog-layout { max-width: 1440px; padding: 46px 5.5vw 80px; margin: auto; display: grid; grid-template-columns: 180px 1fr; gap: 7vw; }
.sidebar-heading, .toolbar { display: flex; justify-content: space-between; align-items: flex-start; }
.sidebar-heading { padding-bottom: 18px; font-size: 12px; border-bottom: 1px solid var(--line); }
.mono, .product-code { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.category-nav { display: grid; gap: 2px; margin-top: 12px; }
.category-nav button { text-align: left; border: 0; background: none; color: var(--muted); padding: 11px 0; position: relative; transition: .2s; }
.category-nav button::after { content: ''; width: 0; height: 1px; position: absolute; bottom: 5px; left: 0; background: var(--accent); transition: .25s; }
.category-nav button.active, .category-nav button:hover { color: var(--ink); }
.category-nav button.active::after { width: 34px; }
.sidebar-note { margin-top: 105px; padding-top: 18px; border-top: 1px solid var(--line); }
.sidebar-note p { font-family: var(--serif); font-size: 13px; line-height: 1.6; color: var(--muted); margin-top: 12px; }
.toolbar { margin-bottom: 27px; align-items: end; }
.toolbar h2, .admin-header h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; margin: 7px 0 0; letter-spacing: -.02em; }
.toolbar-controls { display: flex; gap: 20px; align-items: center; }
.search-box { border-bottom: 1px solid #b9bab4; display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--muted); }
.search-box input { width: 150px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-box input::placeholder { color: #a0a19c; }
.ghost-button { border-bottom: 1px solid #b9bab4; padding: 6px 0; color: var(--ink); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 18px; }
.product-card { min-width: 0; cursor: pointer; animation: rise .45s both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.product-image { aspect-ratio: 4 / 4.6; position: relative; overflow: hidden; background: #ddd; }
.product-image img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.product-card:hover img { transform: scale(1.045); }
.card-badge { position: absolute; left: 13px; top: 13px; padding: 5px 8px; background: rgba(255,254,250,.86); font-family: var(--mono); font-size: 9px; letter-spacing: .04em; }
.card-info { padding: 12px 1px 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.card-info h3 { font-family: var(--serif); font-size: 17px; font-weight: 500; margin: 0 0 5px; }
.card-info p { margin: 0; color: var(--muted); font-size: 11px; }
.card-price { font-family: var(--mono); font-size: 11px; padding-top: 3px; }
.empty-state { text-align: center; padding: 90px 0; color: var(--muted); }
.empty-state span { font-size: 28px; color: var(--accent); }.empty-state h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); margin: 15px 0 7px; }.hidden { display: none !important; }
.catalog-pagination { display: flex; justify-content: center; align-items: center; gap: 16px; padding-top: 42px; }
.catalog-pagination .mini-button:disabled { opacity: .35; cursor: default; }
.admin-view { max-width: 1200px; margin: auto; padding: 72px 5.5vw 90px; }
.admin-header { display: flex; align-items: end; justify-content: space-between; padding-bottom: 34px; border-bottom: 1px solid var(--line); }.admin-header h1 { font-size: 48px; margin: 6px 0 10px; }.admin-header p:last-child { color: var(--muted); margin: 0; }
.dark-button, .outline-button { border: 1px solid var(--ink); padding: 11px 16px; background: var(--ink); color: var(--white); transition: .2s; }.dark-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }.outline-button { background: transparent; color: var(--ink); }.outline-button:hover { background: var(--ink); color: var(--white); }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); margin-bottom: 40px; }.admin-stats > div { padding: 24px 25px; border-right: 1px solid var(--line); }.admin-stats > div:first-child { padding-left: 0; }.admin-stats > div:last-child { border: 0; }.admin-stats span { color: var(--muted); font-size: 12px; display: block; margin-bottom: 10px; }.admin-stats strong { font-family: var(--mono); font-size: 22px; font-weight: 400; }.status-text { font-family: var(--sans) !important; font-size: 14px !important; }.status-text i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #6f9677; margin-right: 8px; }
.admin-grid { display: grid; grid-template-columns: 280px 1fr; gap: 30px; }.admin-panel { border-top: 2px solid var(--ink); }.panel-heading { display: flex; justify-content: space-between; align-items: start; padding: 20px 0; }.panel-heading h2 { font-family: var(--serif); font-size: 25px; font-weight: 500; margin: 6px 0 0; }.panel-heading .dark-button, .panel-heading .outline-button { font-size: 12px; padding: 8px 11px; }
.category-admin-list, .product-admin-list { border-top: 1px solid var(--line); }.category-admin-item, .product-admin-item { border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }.category-admin-item { padding: 14px 0; }.category-admin-item span { color: var(--muted); font-size: 13px; }.item-actions { display: flex; gap: 7px; }.mini-button { background: none; border: 0; color: var(--muted); font-size: 12px; padding: 3px; }.mini-button:hover { color: var(--accent-dark); }.product-admin-item { padding: 10px 0; }.admin-product-preview { width: 43px; height: 51px; object-fit: cover; }.admin-product-name { flex: 1; }.admin-product-name strong, .admin-product-name span { display: block; }.admin-product-name strong { font-family: var(--serif); font-size: 15px; font-weight: 500; }.admin-product-name span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.admin-product-toolbar { display: flex; align-items: end; gap: 14px; padding: 0 0 16px; flex-wrap: wrap; }.admin-product-toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }.admin-product-toolbar select, .admin-search-field input { min-width: 125px; border: 1px solid var(--line); background: var(--white); padding: 7px 9px; color: var(--ink); }.admin-search-field input { width: 170px; }.admin-pagination { display: flex; justify-content: center; align-items: center; gap: 16px; padding-top: 20px; }.admin-pagination .mini-button:disabled { opacity: .35; cursor: default; }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; padding: 30px; display: grid; place-items: center; background: rgba(22,24,23,.45); backdrop-filter: blur(5px); }.product-modal { width: min(850px, 100%); max-height: 90vh; overflow: auto; display: grid; grid-template-columns: .92fr 1fr; background: var(--white); position: relative; animation: modal-in .3s both; }.product-modal .modal-image { min-height: 560px; background-size: cover; background-position: center; }.modal-details { padding: 58px 53px 44px; display: flex; flex-direction: column; justify-content: center; }.close-button { position: absolute; z-index: 2; right: 18px; top: 13px; background: transparent; border: 0; font-size: 26px; font-weight: 200; color: var(--muted); }.pill { color: var(--accent-dark); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; }.modal-details h2 { font-family: var(--serif); font-weight: 500; font-size: 39px; line-height: 1.1; margin: 14px 0 8px; }.modal-description { margin: 30px 0; color: var(--muted); line-height: 1.8; max-width: 330px; }.detail-meta { display: flex; gap: 38px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; }.detail-meta span, .detail-meta strong { display: block; }.detail-meta span { color: var(--muted); font-size: 10px; margin-bottom: 6px; }.detail-meta strong { font-weight: 500; font-size: 12px; }.modal-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 29px; }.modal-footer > strong { font-family: var(--mono); font-weight: 400; }.copy-button { border: 0; background: var(--accent); color: var(--white); padding: 12px 15px; transition: .2s; }.copy-button:hover { background: var(--accent-dark); }.copy-button span { margin-left: 9px; }
.editor-modal { width: min(620px, 100%); max-height: 90vh; overflow: auto; background: var(--white); padding: 45px; position: relative; animation: modal-in .3s both; }.editor-modal h2 { font-family: var(--serif); font-size: 33px; font-weight: 500; margin: 8px 0 28px; }.editor-modal form { display: grid; gap: 17px; }.editor-modal label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }.editor-modal input, .editor-modal select, .editor-modal textarea { width: 100%; border: 1px solid var(--line); background: #fbfaf6; outline: none; padding: 10px 11px; color: var(--ink); }.editor-modal input:focus, .editor-modal select:focus, .editor-modal textarea:focus { border-color: var(--accent); }.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.editor-actions { display: flex; justify-content: end; gap: 12px; margin-top: 8px; }.editor-actions .ghost-button { border-bottom: 0; }
.auth-copy { color: var(--muted); line-height: 1.7; margin: -12px 0 25px; }.auth-error { color: var(--accent-dark); font-size: 12px; margin: -5px 0 0; }
.toast { position: fixed; z-index: 50; bottom: 25px; left: 50%; translate: -50% 20px; opacity: 0; pointer-events: none; padding: 11px 16px; background: var(--ink); color: var(--white); font-size: 12px; transition: .25s; }.toast.show { opacity: 1; translate: -50% 0; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 800px) { .topbar { height: 66px; padding: 0 5vw; }.view-switch { font-size: 0; padding: 9px; }.view-switch .icon { font-size: 15px; margin: 0; }.catalog-intro { padding: 55px 8vw 45px; min-height: 390px; display: block; }.intro-aside { margin-top: 36px; }.catalog-layout { display: block; padding: 34px 5vw 60px; }.sidebar { margin-bottom: 36px; }.category-nav { display: flex; gap: 22px; overflow: auto; }.category-nav button { white-space: nowrap; }.sidebar-note { display: none; }.toolbar { display: block; }.toolbar-controls { justify-content: space-between; margin-top: 20px; }.product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 12px; }.card-info { display: block; }.card-price { margin-top: 7px; }.admin-view { padding: 50px 5vw; }.admin-header { display: block; }.admin-header .dark-button { margin-top: 25px; }.admin-stats > div { padding: 20px 12px; }.admin-stats > div:first-child { padding-left: 0; }.admin-stats strong { font-size: 17px; }.admin-grid { display: block; }.admin-panel + .admin-panel { margin-top: 45px; }.modal-backdrop { padding: 15px; }.product-modal { display: block; max-height: 94vh; }.product-modal .modal-image { min-height: 280px; }.modal-details { padding: 30px 25px 28px; }.modal-details h2 { font-size: 30px; }.editor-modal { padding: 38px 24px 25px; }.form-row { grid-template-columns: 1fr; gap: 17px; } }
@media (max-width: 390px) { .product-grid { grid-template-columns: 1fr; }.toolbar-controls { display: block; }.search-box { margin-bottom: 14px; }.search-box input { width: 100%; } }
.modal-thumbnails { position: absolute; left: 17px; bottom: 17px; display: flex; gap: 7px; max-width: 40%; overflow-x: auto; }
.modal-thumbnail { width: 44px; height: 50px; flex: 0 0 auto; padding: 0; border: 2px solid transparent; background: var(--white); }
.modal-thumbnail.active { border-color: var(--accent); }
.modal-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.upload-field span { color: var(--muted); font-size: 10px; margin-left: 5px; }
.upload-field input { padding: 8px 0; border: 0; background: transparent; }
.editor-image-preview { display: flex; gap: 8px; flex-wrap: wrap; }
.editor-image-preview img { width: 54px; height: 62px; object-fit: cover; }
@media (max-width: 800px) { .modal-thumbnails { max-width: calc(100% - 30px); } }
@media (max-width: 800px) {
  .modal-backdrop { padding: 10px; }
  .product-modal { max-height: calc(100vh - 20px); overflow: hidden; }
  .product-modal .modal-image { height: min(42vh, 330px); min-height: 0; background-size: contain; background-repeat: no-repeat; background-color: #ece9e2; }
  .modal-thumbnails { left: 12px; top: calc(min(42vh, 330px) - 54px); bottom: auto; max-width: calc(100% - 30px); }
  .modal-details { padding: 18px 25px 20px; }
  .modal-details h2 { font-size: 27px; margin: 9px 0 5px; }
  .modal-description { margin: 14px 0; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .detail-meta { padding: 10px 0; }
  .modal-footer { margin-top: 14px; }
  .copy-button { padding: 10px 13px; }
}
@media (max-width: 800px) and (max-height: 700px) {
  .product-modal .modal-image { height: 29vh; }
  .modal-thumbnails { top: calc(29vh - 54px); }
  .modal-details { padding-top: 13px; padding-bottom: 14px; }
  .modal-description { margin: 9px 0; -webkit-line-clamp: 2; }
  .detail-meta { padding: 7px 0; }
  .modal-footer { margin-top: 9px; }
}
