:root {
  --red: #a51c29;
  --red-dark: #78131d;
  --ink: #302a28;
  --muted: #827a76;
  --line: #eee8e2;
  --paper: #fbf8f5;
  --white: #fff;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.eyebrow { color: var(--red); font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; position: relative; border: 1px solid #c59c5b; color: var(--red); font: 24px var(--serif); }
.brand-mark span { position: absolute; right: 3px; bottom: 1px; color: #c59c5b; font: 12px var(--sans); }
.auth-screen { min-height: 100vh; padding: 36px 20px; display: grid; place-items: center; background: radial-gradient(ellipse at 9% 12%, #f1e4dc 0, transparent 40%), radial-gradient(ellipse at 92% 93%, #eadfd1 0, transparent 37%), #fbf8f5; }
.auth-card { width: min(100%, 440px); padding: 42px clamp(24px, 7vw, 48px); border: 1px solid #eee6de; background: #fffefa; box-shadow: 0 24px 80px #49211912; }
.auth-brand, .sidebar-brand { margin-bottom: 43px; display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font: 23px var(--serif); }
.auth-brand img { width: 52px; height: 52px; object-fit: contain; }
.sidebar-brand small { margin-top: 5px; display: block; color: var(--red); font: 700 8px var(--sans); letter-spacing: .2em; }
.auth-card h1 { margin: 12px 0; font: 500 44px/1.08 var(--serif); }
.auth-card h1 em, .topbar h1 em { color: var(--red); font-weight: 400; }
.auth-intro { margin-bottom: 28px; color: var(--muted); font-size: 13px; }
.setup-notice { padding: 12px 14px; border-left: 2px solid #c49a58; color: #695b46; background: #faf4e9; font-size: 12px; }
.field { min-width: 0; margin-bottom: 17px; display: flex; flex-direction: column; gap: 7px; color: #49423e; font-size: 12px; font-weight: 600; }
.field small, .check-field small { color: #958b85; font-size: 10px; font-weight: 400; line-height: 1.5; }
.field input, .field textarea, .field select, .search-field input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #e8e0d9; border-radius: 0; outline: 0; color: var(--ink); background: #fff; transition: border-color .2s, box-shadow .2s; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .search-field input:focus { border-color: #b98589; box-shadow: 0 0 0 3px #a51c2910; }
.field input:disabled { background: #f5f1ed; }
.primary-button { min-height: 44px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 20px; border: 0; color: white; background: var(--red); text-decoration: none; font-size: 11px; font-weight: 600; transition: background .2s, transform .2s; }
.primary-button:hover { transform: translateY(-1px); background: var(--red-dark); }
.auth-card .primary-button { width: 100%; margin-top: 4px; }
.status-message, .dashboard-status { min-height: 20px; margin: 8px 0 0; color: #33735c; font-size: 11px; }
.status-message.is-error, .dashboard-status.is-error { color: var(--red); }
.auth-footnote { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: #968d87; font-size: 10px; line-height: 1.65; }

.dashboard { min-height: 100vh; }
.sidebar { width: 244px; min-height: 100vh; padding: 30px 19px 22px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; color: #f5efea; background: #302725; }
.sidebar-brand { margin: 0 0 50px 5px; color: white; font-size: 19px; }
.sidebar-brand img { width: 42px; height: 42px; object-fit: contain; }
.sidebar-label { padding: 0 12px; color: #a99a92; font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.side-nav { margin-top: 14px; display: grid; gap: 4px; }
.nav-button { min-height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 12px; border: 0; color: #d8cec7; background: transparent; text-align: left; text-decoration: none; font-size: 12px; transition: background .2s, color .2s; }
.nav-button > span { width: 20px; color: #d4ae79; font-size: 16px; text-align: center; }
.nav-button:hover, .nav-button.is-current { color: white; background: #ffffff12; }
.nav-button.is-current { box-shadow: inset 2px 0 #d9b57e; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 17px; }
.sidebar-bottom > a, .logout-button { padding: 0 10px; display: flex; align-items: center; justify-content: space-between; border: 0; color: #e5d6cd; background: transparent; font-size: 11px; text-align: left; }
.sidebar-bottom > a span { color: #d9b57e; }
.logout-button { justify-content: flex-start; gap: 10px; color: #fff; }
.logout-button span { color: #d9b57e; font-size: 16px; }
.sidebar-bottom p { margin: 9px 10px 0; color: #a99a92; font-size: 8px; letter-spacing: .12em; line-height: 1.9; }
.dashboard-main { min-height: 100vh; margin-left: 244px; padding: 0 clamp(22px, 4vw, 58px) 60px; }
.topbar { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 5px 0 0; font: 500 28px var(--serif); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.store-link { color: var(--red); font-size: 11px; font-weight: 600; }
.store-link span { padding-left: 7px; }
.admin-avatar { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid #e5c4ba; border-radius: 50%; color: var(--red); background: #f9eeeb; font: 17px var(--serif); }
.local-notice { margin: 22px 0 2px; padding: 11px 15px; display: flex; align-items: center; gap: 10px; border: 1px solid #efe3cd; color: #755e37; background: #faf5ea; font-size: 10px; }
.local-notice span { color: #bb8b40; }
.dashboard-status { margin-top: 7px; }
.dashboard-section { display: none; padding-top: 25px; }
.dashboard-section.is-visible { display: block; }
.welcome-panel { min-height: 0; margin-top: 8px; padding: 26px clamp(24px, 4vw, 50px); overflow: hidden; color: white; background: linear-gradient(110deg, #6e1d26, #a51c29 67%, #8d2930); }
.welcome-panel h2 { margin: 0 0 8px; font: 500 clamp(27px, 2.8vw, 36px)/1.13 var(--serif); }
.welcome-panel h2 em { color: #f0c998; font-weight: 400; }
.welcome-panel p { margin: 0; color: #f6e5df; font-size: 12px; }
.welcome-art { width: 200px; height: 200px; margin-right: 4%; position: relative; display: grid; place-items: center; border: 1px solid #ffffff5c; border-radius: 50%; color: #f4d0a6; font: 104px var(--serif); }
.welcome-art > span:first-child { position: absolute; top: 20px; right: 25px; font: 23px var(--sans); }
.welcome-art i { position: absolute; bottom: -16px; font: normal 7px var(--sans); letter-spacing: .19em; }
.stat-grid { margin: 22px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat-card { min-height: 132px; padding: 18px; position: relative; border: 1px solid var(--line); background: var(--white); }
.stat-card > span:first-child { color: #8d817a; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.stat-card strong { margin: 10px 0 3px; display: block; color: #392d29; font: 28px var(--serif); }
.stat-card small { color: #8e8580; font-size: 9px; }
.stat-icon { position: absolute; top: 16px; right: 16px; color: #c59c5b; font-size: 16px; }
.overview-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 16px; }
.panel { padding: 23px; border: 1px solid var(--line); background: var(--white); }
.panel-heading { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel h2, .section-title-row h2 { margin: 5px 0 0; color: #342b28; font: 500 24px var(--serif); }
.quiet-button { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; border: 1px solid #e8ded6; color: #6a5650; background: white; text-decoration: none; font-size: 10px; }
.quiet-button:hover, .icon-button:hover { border-color: #c79496; color: var(--red); }
.recent-list { display: grid; }
.recent-product { min-height: 68px; display: flex; align-items: center; gap: 12px; border-top: 1px solid #f1ece8; }
.recent-product img { width: 47px; height: 47px; padding: 3px; object-fit: cover; background: #f4f0e9; }
.recent-product div { flex: 1; }
.recent-product strong, .recent-product small { display: block; }
.recent-product strong { font: 15px var(--serif); }
.recent-product small { color: #928780; font-size: 9px; }
.quick-panel { padding: 23px 20px; }
.quick-panel h2 { margin-bottom: 12px; }
.quick-panel > a { width: 100%; min-height: 64px; padding: 10px 0; display: flex; align-items: center; gap: 12px; border-top: 1px solid #f1ece8; color: #4a3e39; text-decoration: none; text-align: left; }
.quick-panel > button > span:first-child { width: 35px; height: 35px; display: grid; place-items: center; color: var(--red); background: #fbf0ee; }
.quick-panel > button > span:nth-child(2) { flex: 1; }
.quick-panel strong, .quick-panel small { display: block; }
.quick-panel strong { font-size: 11px; }
.quick-panel small { margin-top: 3px; color: #968b85; font-size: 9px; }
.quick-panel b { color: #b38d58; }
.section-title-row { margin: 7px 0 21px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-title-row h2 { margin: 5px 0; font-size: 34px; }
.section-title-row p { margin: 0; color: #8b807a; font-size: 11px; }
.product-editor { margin-bottom: 18px; }
.icon-button { width: 34px; height: 34px; border: 1px solid #eee5de; color: #735d55; background: white; font-size: 21px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 17px; }
.field-wide { grid-column: 1 / -1; }
.check-field { margin: 3px 0 7px; grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 10px; }
.check-field input { margin-top: 3px; accent-color: var(--red); }
.check-field strong, .check-field small { display: block; }
.check-field strong { font-size: 11px; }
.image-preview { margin-top: 8px; display: flex; gap: 9px; }
.image-preview img { width: 67px; height: 67px; padding: 3px; border: 1px solid var(--line); object-fit: cover; background: #f6f1ed; }
.file-hint, .field-hint { color: #958b85; font-size: 10px; line-height: 1.6; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.table-panel { padding: 0; }
.table-toolbar { min-height: 65px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: #958b85; font-size: 10px; }
.search-field { width: min(100%, 280px); display: flex; align-items: center; gap: 9px; color: #8f817a; }
.search-field input { min-height: 36px; border: 0; background: #faf8f6; font-size: 11px; }
.product-row { min-height: 85px; padding: 12px 18px; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(100px, .6fr) auto auto; align-items: center; gap: 14px; border-bottom: 1px solid #f1ece8; }
.product-row > form { margin: 0; }
.product-row:last-child { border-bottom: 0; }
.product-row-main { min-width: 0; display: flex; align-items: center; gap: 12px; }
.product-row-main img { width: 54px; height: 54px; padding: 3px; object-fit: cover; background: #f6f1ed; }
.product-row-main strong, .product-row-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-row-main strong { font: 15px var(--serif); }
.product-row-main small, .product-meta { color: #978d87; font-size: 9px; }
.featured-toggle { min-height: 30px; padding: 0 9px; border: 1px solid #e9e1d9; color: #847970; background: white; font-size: 9px; white-space: nowrap; }
.featured-toggle.is-featured { border-color: #eed8af; color: #896127; background: #fcf7ed; }
.row-actions { display: flex; gap: 7px; }
.row-actions > a, .row-actions button { min-height: 30px; padding: 0 9px; display: inline-flex; align-items: center; border: 1px solid #eee5de; color: #695a53; background: white; font-size: 9px; }
.row-actions .delete-button { color: #a84449; }
.empty-state { padding: 34px 18px; color: #928780; font-size: 11px; text-align: center; }
.category-layout, .arrival-layout { display: grid; grid-template-columns: minmax(250px, .75fr) minmax(0, 1.25fr); align-items: start; gap: 18px; }
.inline-form { margin-top: 20px; }
.category-list { display: grid; }
.category-row { min-height: 53px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #f1ece8; }
.category-row strong { font: 16px var(--serif); }
.category-row span { margin-left: auto; color: #9a8f88; font-size: 9px; }
.category-row button { padding: 5px 8px; border: 1px solid #eee5de; color: #a84449; background: white; font-size: 9px; }
.gold-panel { max-width: 760px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 30px; align-items: center; }
.gold-preview { min-height: 205px; padding: 25px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; color: white; background: linear-gradient(140deg, #6e1d26, #a51c29); }
.gold-preview .eyebrow { color: #efcf9d; }
.gold-preview-rate { margin-top: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.gold-preview-rate strong { font: 28px var(--serif); }
.gold-preview small { color: #f3ded6; font-size: 10px; }
.gold-sparkle { position: absolute; right: 18px; top: 14px; color: #e6c286; font-size: 24px; }
.currency-input { display: flex; align-items: center; border: 1px solid #e8e0d9; background: white; }
.currency-input > span { padding-left: 12px; color: #8a7568; }
.currency-input input { border: 0; box-shadow: none !important; }
.last-updated { margin: 14px 0 0; color: #9b9088; font-size: 9px; }
#arrival-form { display: grid; gap: 2px; }
.arrival-limit { color: #94877f; font-size: 10px; }
.arrival-list { display: grid; gap: 9px; }
.arrival-item { min-height: 75px; padding: 8px; display: flex; align-items: center; gap: 11px; border: 1px solid #f0eae5; }
.arrival-item img { width: 65px; height: 58px; object-fit: cover; background: #f5f0eb; }
.arrival-item div { flex: 1; min-width: 0; }
.arrival-item strong, .arrival-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arrival-item strong { font: 14px var(--serif); }
.arrival-item small { color: #958b85; font-size: 9px; }
.arrival-item button { padding: 6px 8px; border: 1px solid #eee5de; color: #a84449; background: white; font-size: 9px; }
.password-panel { max-width: 740px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 30px; }
.password-panel p { color: #948982; font-size: 11px; line-height: 1.7; }
.password-panel form { display: grid; }
.password-panel .primary-button { justify-self: start; }
.security-note { max-width: 740px; margin-top: 15px; color: #948982; font-size: 10px; line-height: 1.8; }

@media (max-width: 1120px) {
  .sidebar { width: 210px; padding-right: 13px; padding-left: 13px; }
  .dashboard-main { margin-left: 210px; padding-right: 25px; padding-left: 25px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { width: 100%; min-height: auto; padding: 12px 15px; position: sticky; z-index: 4; top: 0; }
  .sidebar-brand { margin: 0 0 9px; font-size: 16px; }
  .sidebar-brand img { width: 36px; height: 36px; }
  .sidebar-label { display: none; }
  .sidebar-bottom { margin-top: 8px; display: block; }
  .sidebar-bottom > a, .sidebar-bottom p { display: none; }
  .sidebar-bottom form { display: flex; justify-content: flex-end; }
  .logout-button { min-height: 36px; padding: 0 10px; border: 1px solid #ffffff3d; }
  .side-nav { margin: 0; display: flex; gap: 5px; overflow-x: auto; }
  .nav-button { min-height: 36px; padding: 0 9px; flex: 0 0 auto; gap: 6px; font-size: 10px; }
  .nav-button > span { width: auto; font-size: 13px; }
  .dashboard-main { margin: 0; padding: 0 16px 38px; }
  .topbar { min-height: 79px; }
  .topbar h1 { font-size: 22px; }
  .store-link { font-size: 9px; }
  .topbar-actions { gap: 9px; }
  .admin-avatar { width: 30px; height: 30px; }
  .local-notice { margin-top: 13px; align-items: flex-start; font-size: 9px; }
  .welcome-panel { padding: 22px 20px; }
  .welcome-panel h2 { font-size: 29px; }
  .welcome-art { width: 100px; height: 100px; margin: 0 3% 0 0; font-size: 58px; }
  .welcome-art > span:first-child { top: 6px; right: 12px; font-size: 14px; }
  .welcome-art i { bottom: -14px; font-size: 5px; white-space: nowrap; }
  .stat-grid { gap: 9px; }
  .stat-card { min-height: 112px; padding: 13px; }
  .stat-card strong { font-size: 23px; }
  .panel { padding: 17px; }
  .category-layout, .arrival-layout, .gold-panel, .password-panel { grid-template-columns: 1fr; }
  .product-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .product-meta { display: none; }
  .product-row > form { grid-column: 1; justify-self: start; margin-left: 54px; }
  .featured-toggle { justify-self: start; }
  .row-actions { grid-column: 2; grid-row: 1 / span 2; }
  .section-title-row { align-items: flex-start; }
  .section-title-row h2 { font-size: 28px; }
}
@media (max-width: 420px) {
  .welcome-art { display: none; }
  .welcome-panel h2 { font-size: 29px; }
  .section-title-row .primary-button { padding: 0 10px; font-size: 9px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide, .check-field { grid-column: 1; }
  .product-row-main img { width: 45px; height: 45px; }
}
