:root {
  --bg: #f6f2ec;
  --paper: #fbf9f5;
  --cream: #efe7dc;
  --line: #e4dbcf;
  --taupe: #a89a8c;
  --taupe-dark: #7d6f63;
  --brown: #3b2a21;
  --ink: #161210;
  --muted: #8a7e73;
  --good: #5d7356;
  --warn: #a5703a;
  --bad: #9a4a3f;
  --serif: "Didot", "Bodoni 72", "Bodoni Moda", "Playfair Display", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --r: 14px;
  --shadow: 0 1px 2px rgba(43, 33, 28, .04), 0 12px 32px -18px rgba(43, 33, 28, .22);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px;
  -webkit-font-smoothing: antialiased; line-height: 1.5; }
body { min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: .01em; margin: 0; }
h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.1; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: 11px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.serif { font-family: var(--serif); }

/* ---------- layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 36px 26px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; background: var(--paper); }
.brand { font-family: var(--serif); font-size: 21px; letter-spacing: .28em; white-space: nowrap; }
nav { margin-top: 46px; display: flex; flex-direction: column; gap: 2px; }
nav a { text-decoration: none; padding: 10px 12px; border-radius: 10px; color: var(--taupe-dark); font-size: 14px;
  letter-spacing: .02em; transition: background .2s, color .2s; display: flex; justify-content: space-between; }
nav a:hover { background: var(--cream); color: var(--ink); }
nav a.active { background: var(--ink); color: var(--paper); }
nav a .badge { font-size: 11px; opacity: .8; }
.side-foot { margin-top: auto; font-size: 13px; color: var(--muted); }
.who { margin-bottom: 6px; }
.topbar { display: none; }
.view { padding: 48px clamp(18px, 4vw, 64px) 80px; max-width: 1320px; width: 100%; min-width: 0; animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 34px; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 640px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section { margin-top: 46px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; gap: 12px; }

/* ---------- cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow); }
.stat .label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: var(--serif); font-size: 32px; margin-top: 10px; line-height: 1.1; }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.stat.dark { background: var(--brown); color: var(--paper); border-color: var(--brown); }
.stat.dark .label, .stat.dark .sub { color: #d6c8b8; }

.hero { background: linear-gradient(135deg, #2b211c 0%, #3b2a21 60%, #4a382c 100%); color: var(--paper); border-radius: 22px;
  padding: 38px 40px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08); }
.hero .eyebrow { color: #cdbca9; }
.hero h2 { font-size: 34px; margin-top: 10px; }
.countdown { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.countdown div { text-align: center; min-width: 74px; padding: 14px 8px; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; }
.countdown b { display: block; font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1; }
.countdown span { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: #cdbca9; }

/* ---------- product cards */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 22px; }
.pcard { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; box-shadow: var(--shadow); cursor: pointer; position: relative; }
.pcard:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(43,33,28,.05), 0 24px 40px -22px rgba(43,33,28,.35); }
.pcard .img { aspect-ratio: 4/5; background: var(--cream); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pcard .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; mix-blend-mode: multiply; }
.pcard:hover .img img { transform: scale(1.04); }
.pcard .img { position: relative; }
.pcard .img .ph { font-family: var(--serif); font-size: 44px; color: var(--taupe); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pcard .img img { position: relative; z-index: 1; }
.pcard .tags, .pcard .acts { z-index: 2; }
.pcard .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard .shop { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.pcard .name { font-family: var(--serif); font-size: 17.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 8px; }
.price { font-size: 17px; font-weight: 500; }
.old { text-decoration: line-through; color: var(--muted); font-size: 13px; }
.pcard .tags { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.pcard .acts { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; }
.pcard.bought { opacity: .62; }
.pcard.set { box-shadow: 6px 6px 0 -1px var(--paper), 6px 6px 0 0 var(--line), 0 12px 32px -18px rgba(43, 33, 28, .22); }
.pcard .img.mosaic { display: grid; gap: 2px; background: var(--line); }
.pcard .img.mosaic img { min-height: 0; }
.pcard .img.mosaic.m2 { grid-template-columns: 1fr 1fr; }
.pcard .img.mosaic.m3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pcard .img.mosaic.m3 img:first-child { grid-row: 1 / 3; }
.pcard .img.mosaic.m4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(251,249,245,.92); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 15px; transition: transform .2s, background .2s; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.icon-btn:hover { transform: scale(1.08); }
.icon-btn.on { background: var(--ink); color: var(--paper); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px;
  background: var(--cream); color: var(--brown); white-space: nowrap; border: 1px solid transparent; }
.chip.dark { background: var(--ink); color: var(--paper); }
.chip.sale { background: #efe1d2; color: #7a4a24; }
.chip.ok { background: #e3e8de; color: var(--good); }
.chip.warn { background: #f1e2cf; color: var(--warn); }
.chip.bad { background: #f0dcd8; color: var(--bad); }
.chip.line { background: transparent; border-color: var(--line); color: var(--taupe-dark); }
.stars { color: var(--brown); letter-spacing: 1px; font-size: 13px; }
.stars .off { color: var(--line); }

/* ---------- forms */
.btn { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 11px 20px; border-radius: 999px;
  cursor: pointer; font-size: 13.5px; letter-spacing: .04em; transition: all .2s; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { background: var(--brown); border-color: var(--brown); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.danger { background: transparent; color: var(--bad); border-color: #e3c8c2; }
.btn.small { padding: 7px 14px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: wait; }
.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); font-size: 13px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
input[type=text], input[type=url], input[type=number], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px;
  letter-spacing: normal; text-transform: none; color: var(--ink); outline: none; transition: border .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--taupe); box-shadow: 0 0 0 3px rgba(168,154,140,.18); }
textarea { min-height: 84px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--taupe-dark); }
.seg button.on { background: var(--ink); color: var(--paper); }
.star-input button { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--line); padding: 0 2px; }
.star-input button.on { color: var(--brown); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
.filters input[type=search] { max-width: 260px; }
.filters select { width: auto; }

/* ---------- table / list */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.list-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--taupe); margin-top: 8px; flex: none; }
.thumb { width: 46px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--cream); flex: none; }

/* ---------- modal */
.modal { position: fixed; inset: 0; background: rgba(22,18,16,.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; animation: fadebg .25s ease; }
@keyframes fadebg { from { opacity: 0; } }
.modal-card { background: var(--paper); border-radius: 22px; width: 100%; max-width: 760px; padding: 34px 36px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.45);
  animation: pop .35s cubic-bezier(.2,.8,.2,1); position: relative; }
.modal-card.wide { max-width: 980px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.close { position: absolute; right: 18px; top: 16px; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--muted); line-height: 1; }
.detail { display: grid; grid-template-columns: 300px 1fr; gap: 30px; }
.detail .img { border-radius: 16px; overflow: hidden; background: var(--cream); aspect-ratio: 4/5; display: flex; align-items: center; justify-content: center; }
.detail .img img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; margin: 18px 0; }
.kv div span { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.notice { background: var(--cream); border-radius: 12px; padding: 13px 16px; font-size: 13.5px; color: var(--brown); }
.notice.bad { background: #f3e3df; color: var(--bad); }
.notice.ok { background: #e6ebe1; color: var(--good); }

/* ---------- toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 30px); background: var(--ink); color: var(--paper); padding: 12px 22px;
  border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .35s cubic-bezier(.2,.8,.2,1); z-index: 99; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; text-align: center; }
.auth-card .brand { font-size: 28px; margin-bottom: 8px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 30px; text-align: left; }

/* ---------- charts */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--sans); font-size: 11px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; margin-top: 12px; color: var(--taupe-dark); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-anim { transform-origin: bottom; animation: grow .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { transform: scaleY(0); } }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 8px; }
.progress { height: 8px; border-radius: 999px; background: var(--cream); overflow: hidden; }
.progress div { height: 100%; background: var(--brown); border-radius: 999px; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.progress div.over { background: var(--bad); }
code { background: var(--cream); padding: 2px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }

/* ---------- responsive */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 270px; transform: translateX(-100%); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
  .side.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.25); }
  .side .brand { display: none; }
  .side nav { margin-top: 10px; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; padding: 14px 18px; background: rgba(246,242,236,.92);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); justify-content: space-between; align-items: center; }
  .topbar .brand { font-size: 16px; }
  .burger { background: none; border: 0; width: 34px; height: 34px; display: flex; flex-direction: column; justify-content: center; gap: 6px; cursor: pointer; }
  .burger span { display: block; height: 1.5px; background: var(--ink); width: 22px; }
  .view { padding: 28px 16px 70px; }
  .hero { grid-template-columns: 1fr; padding: 28px 22px; }
  .countdown { justify-content: flex-start; }
  .countdown div { min-width: 0; flex: 1; }
  .countdown b { font-size: 28px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; }
  .detail .img { max-height: 380px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-card { padding: 26px 18px; border-radius: 18px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pcard .body { padding: 12px; }
  .pcard .name { font-size: 15px; }
  .stat .value { font-size: 25px; }
  .card { padding: 18px; }
  .filters input[type=search] { max-width: none; }
}
@media (max-width: 420px) { .g4 { grid-template-columns: 1fr 1fr; gap: 10px; } .stat .value { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
