/* ============================================================
   沐足汇 · 内容中台
   Design tokens align with the public website
   ============================================================ */

:root {
  --ink: #15181c;
  --ink-2: #202a34;
  --forest: #1b2a3a;
  --pine: #24527a;
  --jade: #4a7fa8;
  --paper: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #efeae1;
  --surface-3: #e5ddd0;
  --copper: #b23a2e;
  --copper-2: #d97a2b;
  --danger: #b23a2e;
  --muted: #5b646b;
  --muted-2: #7c858c;
  --line: #ded5c8;
  --line-soft: #eee8dd;
  --red: #b23a2e;
  --red-deep: #8e2c24;
  --blue: #24527a;
  --blue-2: #4a7fa8;
  --blue-soft: #dce8f2;
  --orange: #d97a2b;
  --orange-soft: #f6e2cc;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: "Inter", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Roboto Mono", Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 18px 45px rgba(21, 24, 28, 0.1);
  --shadow-lg: 0 40px 100px rgba(21, 24, 28, 0.22);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { height: 100%; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: block; }
h1, h2, h3, h4, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }

::selection { background: var(--copper); color: var(--ink); }

:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- primitives ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--copper);
}
.eyebrow::before { content: ""; width: 14px; height: 1px; background: currentColor; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 8px 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600;
  transition: background .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: #c9bda8; box-shadow: 0 6px 16px rgba(18,33,29,.08); }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--forest); border-color: var(--forest); }
.btn.copper { background: var(--copper); border-color: var(--copper); color: var(--ink); }
.btn.copper:hover { background: var(--copper-2); border-color: var(--copper-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; color: var(--ink); }
.btn.danger { border-color: #e7c2b8; background: #fff7f4; color: var(--danger); }
.btn.danger:hover { background: #fbe9e3; }
.btn.small { min-height: 30px; padding: 5px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 16px; height: 16px; }

.tag, .status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 13px; line-height: 1.5; white-space: nowrap;
  color: var(--muted);
}
.status.published { color: #2f6b52; border-color: #bcd8c8; background: #f0f8f3; }
.status.draft { color: #8a6425; border-color: #e6d3a9; background: #fff9ea; }
.status.offline, .status.archived { color: #777; border-color: #d9d9d9; background: #f5f5f3; }
.status.new { color: #8a4b26; border-color: #e6c4ad; background: #fff5ee; }
.status.contacted { color: #38617a; border-color: #bfd4df; background: #f1f8fb; }
.status.quoted { color: #7a5c1e; border-color: #e4d2a2; background: #fff9e8; }
.status.won { color: #2f6b52; border-color: #bcd8c8; background: #f0f8f3; }
.status.closed { color: #777; border-color: #d9d9d9; background: #f5f5f3; }
.tag { border-radius: 2px; background: var(--surface-2); color: var(--muted); }

.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 2000;
  display: grid; gap: 8px; width: min(360px, calc(100vw - 40px));
}
.toast {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 14px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow);
  font-size: 14px; animation: toast-in .3s var(--ease);
}
.toast.success { border-color: #bcd8c8; }
.toast.error { border-color: #e7c2b8; color: var(--danger); }
.toast svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--jade); }
.toast.error svg { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- login ---------- */

.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--paper);
}
.login__brand {
  position: relative; overflow: hidden; padding: 46px 54px;
  background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login__brand::before {
  content: ""; position: absolute; inset: 0;
  background: url('/assets/store-space-brand-v2.jpg') center/cover;
  opacity: .34;
}
.login__brand::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,22,18,.75), rgba(8,22,18,.92));
}
.login__brand > * { position: relative; z-index: 1; }
.login__mark { display: flex; align-items: center; gap: 12px; }
.login__mark svg { width: 40px; height: 40px; color: var(--copper-2); }
.login__mark strong { display: block; font-family: var(--serif); font-size: 22px; letter-spacing: .1em; }
.login__mark span { display: block; font-family: var(--mono); font-size: 13px; letter-spacing: .18em; color: rgba(245,241,232,.5); }
.login__copy h1 { font-family: var(--serif); font-size: clamp(38px, 4vw, 62px); line-height: 1.08; max-width: 560px; }
.login__copy p { max-width: 430px; margin-top: 20px; font-size: 14px; line-height: 1.9; color: rgba(245,241,232,.62); }
.login__stats { display: flex; gap: 40px; padding-top: 22px; border-top: 1px solid rgba(245,241,232,.18); }
.login__stats strong { display: block; font-family: var(--serif); font-size: 28px; font-weight: 400; color: var(--copper-2); }
.login__stats span { font-size: 13px; letter-spacing: .08em; color: rgba(245,241,232,.5); }
.login__panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login__form { width: min(380px, 100%); }
.login__form h2 { font-family: var(--serif); font-size: 34px; margin: 10px 0 8px; }
.login__form > p { font-size: 14px; color: var(--muted); margin-bottom: 26px; }
.login__error { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #e7c2b8; background: #fff7f4; color: var(--danger); font-size: 13px; line-height: 1.7; }
.login__hint { margin-top: 20px; padding: 10px 12px; border: 1px dashed var(--line); font-size: 13px; line-height: 1.7; color: var(--muted); }
.login__foot { margin-top: 22px; text-align: center; font-size: 13px; color: var(--muted-2); letter-spacing: .06em; }

/* ---------- shell ---------- */

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; padding: 18px 12px 14px; z-index: 40;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.sidebar__brand svg { width: 30px; height: 30px; color: var(--copper-2); }
.sidebar__brand strong { display: block; font-family: var(--serif); font-size: 19px; letter-spacing: .08em; }
.sidebar__brand span { display: block; font-family: var(--mono); font-size: 13px; letter-spacing: .18em; color: rgba(245,241,232,.4); }
.workspace {
  display: flex; align-items: center; gap: 9px; margin: 0 4px 16px; padding: 9px 10px;
  border: 1px solid rgba(245,241,232,.14); background: rgba(245,241,232,.04);
}
.workspace__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 0 4px rgba(111,157,134,.14); }
.workspace strong { display: block; font-size: 13px; font-weight: 600; }
.workspace span { display: block; font-size: 13px; color: rgba(245,241,232,.4); }
.sidebar__nav { flex: 1; overflow: auto; padding-right: 2px; }
.nav-label { padding: 14px 12px 5px; font-family: var(--mono); font-size: 13px; letter-spacing: .16em; color: rgba(245,241,232,.32); }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border: 0; background: transparent; color: rgba(245,241,232,.62);
  text-align: left; font-size: 14px; transition: background .2s, color .2s, transform .2s;
}
.nav-item svg { width: 15px; height: 15px; flex: none; opacity: .7; }
.nav-item:hover { color: var(--paper); background: rgba(245,241,232,.06); transform: translateX(2px); }
.nav-item.active { color: var(--ink); background: var(--copper); }
.nav-item.active svg { opacity: 1; }
.nav-badge { margin-left: auto; min-width: 18px; padding: 1px 5px; border-radius: 999px; background: rgba(245,241,232,.12); font-family: var(--mono); font-size: 13px; text-align: center; }
.nav-item.active .nav-badge { background: rgba(18,33,29,.16); }
.sidebar__foot { border-top: 1px solid rgba(245,241,232,.12); padding-top: 10px; margin-top: 8px; }
.user-card { display: flex; align-items: center; gap: 9px; padding: 6px 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--copper); color: var(--ink); font-size: 13px; font-weight: 800; flex: none;
}
.user-card strong { display: block; font-size: 13px; color: var(--paper); }
.user-card span { display: block; font-size: 13px; color: rgba(245,241,232,.4); }
.sidebar__foot .icon-btn { color: rgba(245,241,232,.5); margin-left: auto; }
.sidebar__foot .icon-btn:hover { background: rgba(245,241,232,.1); color: var(--paper); border-color: transparent; }

.main { min-width: 0; background: var(--paper); }
.topbar {
  position: sticky; top: 0; z-index: 30; min-height: 68px;
  display: flex; align-items: center; gap: 18px; padding: 0 28px;
  background: rgba(243,239,230,.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar__title { min-width: 180px; }
.topbar__title h1 { font-family: var(--serif); font-size: 21px; line-height: 1.2; }
.topbar__title p { margin-top: 2px; font-size: 13px; color: var(--muted-2); }
.topbar__search {
  position: relative; flex: 1; max-width: 420px;
}
.topbar__search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; color: var(--muted-2); }
.topbar__search input {
  width: 100%; height: 36px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 12px 0 34px; font-size: 13px; outline: 0;
}
.topbar__search input:focus { border-color: var(--copper); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.topbar__actions .btn { min-height: 34px; }

.page { padding: 26px 28px 48px; max-width: 1540px; margin: 0 auto; animation: page-in .45s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.page-head h2 { font-family: var(--serif); font-size: 27px; line-height: 1.2; }
.page-head p { margin-top: 5px; color: var(--muted); font-size: 13px; max-width: 620px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- dashboard ---------- */

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  position: relative; overflow: hidden; padding: 15px 16px 13px;
  border: 1px solid var(--line); background: var(--surface);
}
.kpi::after {
  content: ""; position: absolute; width: 90px; height: 90px; right: -38px; bottom: -46px;
  border-radius: 50%; background: rgba(184,129,77,.1);
}
.kpi__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi__label { font-size: 13px; color: var(--muted); }
.kpi__icon { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--copper); }
.kpi__icon svg { width: 13px; height: 13px; }
.kpi__value { margin-top: 10px; font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1; }
.kpi__meta { margin-top: 6px; display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted-2); position: relative; z-index: 1; }
.kpi__meta b { color: #2f6b52; font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 14px; }
.panel { border: 1px solid var(--line); background: var(--surface); padding: 17px; min-width: 0; }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel__head h3 { font-family: var(--serif); font-size: 17px; }
.panel__head p { margin-top: 3px; font-size: 13px; color: var(--muted-2); }
.chart { width: 100%; height: 190px; }
.chart__grid { stroke: var(--line-soft); stroke-width: 1; }
.chart__line { fill: none; stroke: var(--copper); stroke-width: 2; }
.chart__area { fill: url(#chart-fill); }
.chart__dot { fill: var(--surface); stroke: var(--copper); stroke-width: 2; }
.chart__label { fill: var(--muted-2); font-size: 13px; font-family: var(--mono); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--copper); }
.funnel { display: grid; gap: 9px; }
.funnel__row { display: grid; grid-template-columns: 64px 1fr 30px; gap: 8px; align-items: center; font-size: 13px; }
.funnel__bar { height: 7px; background: var(--surface-2); overflow: hidden; }
.funnel__bar i { display: block; height: 100%; background: var(--copper); }
.funnel__row b { font-family: var(--mono); font-size: 13px; text-align: right; color: var(--muted); }
.health { display: flex; align-items: center; gap: 18px; }
.donut {
  width: 104px; height: 104px; border-radius: 50%; flex: none;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--copper) calc(var(--value) * 1%), var(--surface-2) 0);
}
.donut::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.donut strong { position: relative; z-index: 1; font-family: var(--serif); font-size: 24px; font-weight: 500; }
.health__copy strong { display: block; font-size: 13px; }
.health__copy p { margin-top: 4px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick {
  display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line);
  background: var(--surface); text-align: left; font-size: 13px; transition: border-color .2s, transform .2s;
}
.quick:hover { border-color: var(--copper); transform: translateY(-1px); }
.quick svg { width: 14px; height: 14px; color: var(--copper); }
.activity { display: grid; }
.activity__item { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.activity__item:last-child { border-bottom: 0; }
.activity__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--jade); margin-top: 6px; flex: none; }
.activity__item strong { display: block; font-size: 13px; font-weight: 600; }
.activity__item span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted-2); }
.dash-grid .panel + .panel { margin-top: 14px; }
.recent-leads { width: 100%; border-collapse: collapse; }
.recent-leads th, .recent-leads td { padding: 8px 6px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 13px; }
.recent-leads th { color: var(--muted-2); font-weight: 500; }
.recent-leads tr:last-child td { border-bottom: 0; }

/* ---------- toolbar / tables ---------- */

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.search { position: relative; width: min(280px, 100%); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 13px; color: var(--muted-2); }
.search input { width: 100%; height: 34px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px 0 31px; font-size: 13px; outline: 0; }
.search input:focus { border-color: var(--copper); }
.select { height: 34px; border: 1px solid var(--line); background: var(--surface); padding: 0 9px; font-size: 13px; outline: 0; }
.toolbar .spacer { flex: 1; }
.table-wrap { border: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 820px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 13px; }
.table th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: .04em; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #faf6ed; }
.record { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.thumb { width: 42px; height: 48px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); flex: none; }
.thumb.wide { width: 58px; height: 40px; }
.record strong { display: block; font-size: 13px; font-weight: 600; }
.record span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted-2); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 3px; justify-content: flex-end; }
.row-actions .icon-btn { width: 28px; height: 28px; }
.row-actions .icon-btn svg { width: 13px; height: 13px; }
.table-empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; font-size: 13px; color: var(--muted-2); }

/* ---------- cards / media / categories ---------- */

.cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.case-card { border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.case-card__cover { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.case-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.case-card:hover .case-card__cover img { transform: scale(1.03); }
.case-card__cover span { position: absolute; left: 10px; top: 10px; padding: 3px 7px; background: var(--surface); font-size: 13px; }
.case-card__body { padding: 12px 13px 14px; }
.case-card__meta { display: flex; gap: 8px; font-size: 13px; color: var(--muted-2); }
.case-card h3 { font-family: var(--serif); font-size: 18px; margin: 5px 0; }
.case-card p { font-size: 13px; line-height: 1.7; color: var(--muted); }
.case-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.page-list { display: grid; gap: 8px; }
.page-card { display: flex; align-items: center; gap: 14px; padding: 13px 15px; border: 1px solid var(--line); background: var(--surface); }
.page-card__icon { width: 34px; height: 34px; display: grid; place-items: center; background: var(--surface-2); color: var(--copper); flex: none; }
.page-card__icon svg { width: 15px; height: 15px; }
.page-card h3 { font-family: var(--serif); font-size: 17px; }
.page-card p { font-size: 13px; color: var(--muted-2); }
.page-card .spacer { flex: 1; }

.cat-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 14px; align-items: start; }
.cat-tree { border: 1px solid var(--line); background: var(--surface); padding: 8px; max-height: calc(100vh - 190px); overflow: auto; }
.cat-node {
  width: 100%; display: flex; align-items: center; gap: 7px; padding: 7px 8px;
  border: 0; background: transparent; text-align: left; font-size: 13px; color: var(--muted);
  transition: background .15s, color .15s;
}
.cat-node:hover { background: var(--surface-2); color: var(--ink); }
.cat-node.active { background: var(--ink); color: var(--paper); }
.cat-node svg { width: 12px; height: 12px; opacity: .5; }
.cat-node.child { padding-left: 28px; font-size: 13px; }
.cat-node .count { margin-left: auto; font-family: var(--mono); font-size: 13px; opacity: .6; }
.cat-detail { border: 1px solid var(--line); background: var(--surface); padding: 18px; }
.cat-detail h3 { font-family: var(--serif); font-size: 22px; }
.cat-detail__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }

.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.media-card { border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.media-card__preview { position: relative; aspect-ratio: 4/3; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.media-card__preview img { width: 100%; height: 100%; object-fit: cover; }
.media-card__preview svg { width: 24px; color: var(--muted-2); }
.media-card__body { padding: 8px 9px 10px; }
.media-card__body strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card__body span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted-2); }
.media-card__actions { display: flex; gap: 2px; margin-top: 6px; }
.media-card__actions .icon-btn { width: 25px; height: 25px; }
.media-card__actions .icon-btn svg { width: 12px; height: 12px; }
.dropzone {
  border: 1px dashed var(--line); background: var(--surface); padding: 24px; text-align: center;
  margin-bottom: 12px; transition: border-color .2s, background .2s;
}
.dropzone.is-over { border-color: var(--copper); background: #fdf8ee; }
.dropzone svg { width: 26px; height: 26px; margin: 0 auto 8px; color: var(--copper); }
.dropzone strong { display: block; font-size: 14px; }
.dropzone p { margin-top: 4px; font-size: 13px; color: var(--muted-2); }

/* ---------- kanban ---------- */

.kanban { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 10px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
.kanban__col { background: var(--surface-2); border: 1px solid var(--line); min-height: 220px; }
.kanban__head { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.kanban__head strong { font-size: 13px; }
.kanban__head span { font-family: var(--mono); font-size: 13px; color: var(--muted-2); }
.kanban__body { display: grid; gap: 7px; padding: 7px; }
.lead-card { background: var(--surface); border: 1px solid var(--line); padding: 9px 10px; text-align: left; transition: border-color .2s, transform .2s; }
.lead-card:hover { border-color: var(--copper); transform: translateY(-1px); }
.lead-card strong { display: block; font-size: 13px; font-weight: 600; }
.lead-card p { margin-top: 3px; font-size: 13px; color: var(--muted); }
.lead-card__meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 13px; color: var(--muted-2); }
.lead-card__meta b { font-weight: 500; color: var(--copper); }

/* ---------- forms ---------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; }
.field > label, .field > span.label { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.field > label i { color: var(--danger); font-style: normal; }
.input, .textarea, .select-full {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  padding: 8px 10px; font-size: 14px; outline: 0; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select-full:focus { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(184,129,77,.1); }
.textarea { min-height: 78px; resize: vertical; line-height: 1.7; }
.help { font-size: 13px; line-height: 1.6; color: var(--muted-2); }
.form-section { padding: 16px 0; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section h4 { font-family: var(--serif); font-size: 17px; margin-bottom: 10px; }
.form-section > p { font-size: 13px; color: var(--muted-2); margin-bottom: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.check input { width: 15px; height: 15px; accent-color: var(--copper); }
.switch { position: relative; width: 36px; height: 20px; border: 0; border-radius: 999px; background: #d8d3c7; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .2s; }
.switch.on { background: var(--copper); }
.switch.on::after { transform: translateX(16px); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.chips span { padding: 3px 7px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.thumb-row { display: flex; gap: 8px; align-items: flex-start; }
.thumb-preview { width: 92px; height: 108px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); flex: none; }
.thumb-row .input { flex: 1; }

/* ---------- editor ---------- */

.modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; }
.modal__scrim { position: absolute; inset: 0; border: 0; background: rgba(9,24,20,.62); backdrop-filter: blur(5px); }
.editor {
  position: relative; width: min(1080px, 100%); max-height: calc(100vh - 36px);
  display: flex; flex-direction: column; background: var(--paper);
  border: 1px solid rgba(255,253,248,.6); box-shadow: var(--shadow-lg);
  animation: editor-in .35s var(--ease);
}
@keyframes editor-in { from { opacity: 0; transform: translateY(14px) scale(.995); } to { opacity: 1; transform: none; } }
.editor__head { display: flex; align-items: flex-start; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.editor__head h2 { font-family: var(--serif); font-size: 24px; }
.editor__head p { margin-top: 3px; font-size: 13px; color: var(--muted-2); }
.editor__head .spacer { flex: 1; }
.editor__tabs { display: flex; gap: 0; overflow-x: auto; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tab {
  position: relative; border: 0; background: transparent; padding: 11px 13px 13px;
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--copper); transform: scaleX(0); transition: transform .25s var(--ease); }
.tab.active { color: var(--ink); }
.tab.active::after { transform: scaleX(1); }
.editor__body { flex: 1; overflow: auto; padding: 18px 20px 22px; }
.editor__panel { display: none; }
.editor__panel.active { display: block; animation: panel-in .25s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.editor__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.editor__foot .status { margin-right: auto; }

.rich-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px; border: 1px solid var(--line); border-bottom: 0; background: var(--surface-2); }
.rich-toolbar button { min-width: 28px; height: 27px; padding: 0 7px; border: 1px solid transparent; background: transparent; font-size: 13px; color: var(--muted); }
.rich-toolbar button:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.rich-editor { min-height: 220px; padding: 12px; border: 1px solid var(--line); border-bottom: 0; background: var(--surface); outline: 0; font-size: 14px; line-height: 1.85; }
.rich-editor:focus { border-color: var(--copper); }
.rich-editor h2 { font-family: var(--serif); font-size: 20px; margin: 12px 0 8px; }
.rich-editor h3 { font-family: var(--serif); font-size: 17px; margin: 10px 0 6px; }
.rich-editor p { margin: 0 0 8px; }
.rich-editor blockquote { margin: 10px 0; padding: 8px 12px; border-left: 2px solid var(--copper); background: var(--surface-2); }
.rich-editor img { display: block; width: 100%; max-width: 100%; height: auto; margin: 0; border: 0; vertical-align: top; }
.rich-editor p:has(> img) { margin: 0; line-height: 0; }
.rich-editor img + img { margin-top: 0; }
.rich-editor-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: var(--surface); }
.rich-editor-actions > span { margin-right: auto; font-size: 11px; line-height: 1.5; color: var(--muted-2); }
.rich-editor ul, .rich-editor ol { padding-left: 20px; list-style: disc; }

.seo-preview { border: 1px solid var(--line); padding: 12px; background: var(--surface); }
.seo-preview span { display: block; font-size: 13px; color: var(--muted-2); }
.seo-preview strong { display: block; margin-top: 3px; color: #2f5c8a; font-size: 16px; font-weight: 500; }
.seo-preview p { margin-top: 2px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.seo-preview small { display: block; margin-top: 4px; font-size: 13px; color: #2f6b52; }

/* ---------- command palette ---------- */

.palette { position: fixed; inset: 0; z-index: 1200; display: flex; justify-content: center; padding-top: 12vh; }
.palette__scrim { position: absolute; inset: 0; border: 0; background: rgba(9,24,20,.55); backdrop-filter: blur(4px); }
.palette__box { position: relative; width: min(680px, calc(100vw - 32px)); max-height: 64vh; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.palette__search { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.palette__search svg { width: 17px; color: var(--muted-2); }
.palette__search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; }
.palette__results { overflow: auto; padding: 6px; }
.palette__group { padding: 8px 9px 3px; font-family: var(--mono); font-size: 13px; letter-spacing: .14em; color: var(--muted-2); }
.palette__item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 9px; border: 0; background: transparent; text-align: left; font-size: 13px; }
.palette__item:hover { background: var(--surface-2); }
.palette__item svg { width: 13px; color: var(--copper); }
.palette__item small { margin-left: auto; font-size: 13px; color: var(--muted-2); }
.palette__empty { padding: 26px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- settings / users / audit ---------- */

.settings-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); gap: 14px; align-items: start; }
.settings-side { border: 1px solid var(--line); background: var(--surface); padding: 16px; }
.settings-side h3 { font-family: var(--serif); font-size: 18px; }
.settings-side p { margin-top: 6px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.settings-side code { display: block; margin-top: 8px; padding: 7px; background: var(--surface-2); font-family: var(--mono); font-size: 13px; }
.user-table .avatar { width: 26px; height: 26px; font-size: 13px; }
.role-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.role-summary__card { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line); background: var(--surface); }
.role-summary__icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 7px; background: var(--surface-2); color: var(--copper-2); }
.role-summary__icon svg { width: 17px; height: 17px; }
.role-summary__body { min-width: 0; }
.role-summary__body strong { display: block; font-family: var(--serif); font-size: 17px; line-height: 1.2; }
.role-summary__body span { display: block; margin-top: 3px; font-size: 12px; color: var(--copper-2); }
.role-summary__body p { margin-top: 5px; font-size: 11px; line-height: 1.6; color: var(--muted-2); }
.role-summary__card > b { position: absolute; right: 12px; top: 12px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--surface-2); font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--muted); }
.role-matrix-wrap { overflow: auto; border: 1px solid var(--line); }
.role-matrix { width: 100%; min-width: 760px; border-collapse: collapse; }
.role-matrix th, .role-matrix td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.role-matrix thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--muted-2); }
.role-matrix thead th:not(:first-child) { width: 100px; text-align: center; }
.role-matrix tbody tr:last-child td { border-bottom: 0; }
.role-matrix tbody td:first-child { min-width: 220px; }
.role-matrix tbody td:first-child strong { display: block; font-size: 12px; font-weight: 500; }
.role-matrix tbody td:first-child span { display: block; margin-top: 2px; font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.role-matrix tbody td:not(:first-child) { text-align: center; }
.role-matrix__group td { padding: 6px 10px; background: var(--surface-2); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--copper-2); }
.perm-yes { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--jade-soft, #eaf2ec); color: var(--jade, #2d6b4f); font-size: 12px; font-weight: 700; }
.perm-no { color: var(--muted-2); font-size: 13px; }
.audit-list { display: grid; }
.audit-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: start; }
.audit-item time { font-family: var(--mono); font-size: 13px; color: var(--muted-2); }
.audit-item strong { display: block; font-size: 13px; font-weight: 600; }
.audit-item p { margin-top: 2px; font-size: 13px; color: var(--muted); }
.audit-item .tag { justify-self: end; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .shell { grid-template-columns: 216px minmax(0,1fr); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .media-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .kanban { grid-template-columns: repeat(5, minmax(190px, 1fr)); }
}

@media (max-width: 860px) {
  .shell { display: block; padding-bottom: 62px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-102%); transition: transform .3s var(--ease); }
  .sidebar.open { transform: none; }
  .sidebar__brand { padding-top: 20px; }
  .main { min-height: 100vh; }
  .topbar { min-height: 60px; padding: 0 14px; gap: 10px; }
  .topbar__title h1 { font-size: 18px; }
  .topbar__title p { display: none; }
  .topbar__search { display: none; }
  .topbar__actions .btn span { display: none; }
  .page { padding: 16px 14px 32px; }
  .page-head { display: block; }
  .page-actions { margin-top: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cards, .settings-grid, .cat-layout { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .editor { max-height: calc(100vh - 20px); }
  .modal { padding: 10px; }
  .editor__head { padding: 12px 14px; }
  .editor__head h2 { font-size: 20px; }
  .editor__body { padding: 14px; }
  .editor__foot { padding: 10px 14px; flex-wrap: wrap; }
  .login { grid-template-columns: 1fr; }
  .login__brand { min-height: 300px; padding: 28px; }
  .login__copy h1 { font-size: 34px; }
  .login__stats { display: none; }
  .login__panel { padding: 28px 20px; }
  .mobile-menu-btn { display: grid; }
  .role-summary { grid-template-columns: 1fr; }
  .audit-item { grid-template-columns: 1fr auto; }
  .audit-item time { grid-column: 1 / -1; }
}

@media (min-width: 861px) {
  .mobile-menu-btn { display: none; }
}

@media (max-width: 560px) {
  .kpi-grid { gap: 8px; }
  .kpi { padding: 12px; }
  .kpi__value { font-size: 27px; }
  .media-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .quick-grid { grid-template-columns: 1fr; }
  .editor__tabs { padding: 0 10px; }
  .tab { padding: 9px 9px 11px; font-size: 13px; }
  .page-actions .btn { flex: 1; }
  .toolbar .search { width: 100%; }
  .toast-stack { right: 10px; bottom: 10px; }
}

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

/* ============================================================
   Visual refinement · 2026-10-21
   Unified component layer: radius, type scale, surfaces, motion
   ============================================================ */

:root {
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --paper: #f1ece2;
  --surface: #ffffff;
  --surface-2: #f4eee2;
  --line: #e2d9ca;
  --line-soft: #eee7da;
  --copper: #b23a2e;
  --copper-2: #d97a2b;
  --copper-soft: #f3e5d2;
  --ink: #15181c;
  --ink-2: #202a34;
  --jade: #4a7fa8;
  --shadow-sm: 0 6px 20px rgba(21, 24, 28, 0.05);
  --shadow-md: 0 18px 50px rgba(21, 24, 28, 0.1);
}

body {
  font-size: 13.5px;
  background: var(--paper);
}

::selection { background: var(--copper); color: var(--ink); }

* {
  scrollbar-width: thin;
  scrollbar-color: #cbbda8 transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #cbbda8; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* sidebar */
.sidebar {
  width: 256px;
  background:
    radial-gradient(circle at 18% 8%, rgba(184, 129, 77, 0.16), transparent 34%),
    linear-gradient(180deg, #0d1319 0%, #15181c 52%, #0b1016 100%);
  padding: 18px 12px 14px;
  border-right: 1px solid rgba(245, 241, 232, 0.06);
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 241, 232, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 241, 232, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, black, transparent 70%);
  pointer-events: none;
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 4px 10px 16px;
}
.sidebar__logo { width: 228px; height: auto; object-fit: contain; }
.sidebar__edition {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: rgba(245, 241, 232, 0.35);
  padding-left: 1px;
}
.workspace {
  border-radius: var(--radius-sm);
  margin: 0 4px 14px;
  background: rgba(245, 241, 232, 0.055);
  border-color: rgba(245, 241, 232, 0.12);
}
.nav-label { padding: 15px 12px 5px; font-size: 7.5px; }
.nav-item {
  border-radius: 8px;
  margin: 2px 4px;
  padding: 9px 10px;
  font-size: 14px;
  gap: 10px;
}
.nav-item svg { width: 15px; height: 15px; }
.nav-item.active {
  background: linear-gradient(135deg, #d2a46d, #b23a2e);
  color: #10201b;
  box-shadow: 0 6px 18px rgba(184, 129, 77, 0.25);
}
.nav-item.active .nav-badge { background: rgba(21, 24, 28, 0.12); color: #10201b; }
.sidebar__foot { border-top-color: rgba(245, 241, 232, 0.1); }
.avatar {
  background: linear-gradient(135deg, #d97a2b, #9c6b4a);
  color: #10201b;
  box-shadow: 0 0 0 2px rgba(245, 241, 232, 0.12), 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* topbar & page */
.main { background: var(--paper); }
.topbar {
  min-height: 72px;
  padding: 0 30px;
  background: rgba(241, 236, 226, 0.86);
  border-bottom-color: rgba(226, 217, 202, 0.9);
}
.topbar__title h1 { font-size: 22px; letter-spacing: -0.01em; }
.topbar__title p { font-size: 9.5px; }
.topbar__search input {
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 248, 0.72);
  font-size: 13px;
}
.page { padding: 30px 32px 56px; }
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 30px; letter-spacing: -0.02em; }
.page-head p { font-size: 11.5px; max-width: 680px; }

/* buttons & form controls */
.btn {
  border-radius: var(--radius-sm);
  min-height: 38px;
  padding: 8px 15px;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.btn.small { min-height: 31px; padding: 5px 10px; font-size: 13px; }
.btn.primary { background: linear-gradient(135deg, #1b4a3a, #15181c); border-color: #15181c; }
.btn.copper { background: linear-gradient(135deg, #c9945d, #b23a2e); border-color: #b23a2e; color: #15181c; }
.btn:hover { box-shadow: 0 8px 22px rgba(21, 24, 28, 0.1); }
.btn:active { transform: translateY(0) scale(0.99); }
.icon-btn { border-radius: 7px; }
.icon-btn:hover { background: #f2eadb; }
.input, .textarea, .select, .select-full, .search input {
  border-radius: var(--radius-sm);
  border-color: var(--line);
  background: #ffffff;
  font-size: 12.5px;
}
.input, .select, .select-full { min-height: 40px; padding: 9px 11px; }
.textarea { padding: 10px 11px; }
.input:focus, .textarea:focus, .select-full:focus, .select:focus, .search input:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(184, 129, 77, 0.12);
}
.field > label, .field > span.label { font-size: 9.5px; letter-spacing: 0.08em; }
.help { font-size: 9.5px; }
select.select { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, #8c988f 50%), linear-gradient(135deg, #8c988f 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* surfaces */
.panel, .kpi, .table-wrap, .case-card, .media-card, .role-card, .settings-side, .cat-tree, .cat-detail, .page-card, .card {
  border-radius: var(--radius);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.panel { padding: 20px; }
.panel__head h3 { font-size: 18px; }
.panel__head p { font-size: 13px; }

/* KPI */
.kpi-grid { gap: 14px; }
.kpi {
  padding: 18px 18px 16px;
  background: linear-gradient(160deg, #ffffff 0%, #f7f0e2 100%);
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--copper), rgba(184, 129, 77, 0));
}
.kpi:nth-child(2)::before { background: linear-gradient(90deg, #4a7fa8, rgba(111, 157, 134, 0)); }
.kpi:nth-child(3)::before { background: linear-gradient(90deg, #24527a, rgba(28, 81, 64, 0)); }
.kpi:nth-child(4)::before { background: linear-gradient(90deg, #b23a2e, rgba(168, 70, 46, 0)); }
.kpi__icon { width: 32px; height: 32px; border-radius: 50%; background: var(--copper-soft); border-color: transparent; }
.kpi__value { font-size: 40px; margin-top: 12px; }
.kpi__meta { font-size: 9.5px; }

/* tables */
.table-wrap { overflow: hidden; }
.table { min-width: 860px; }
.table th {
  padding: 12px 14px;
  background: #f4ede1;
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7d897f;
}
.table td { padding: 12px 14px; font-size: 13px; border-bottom-color: var(--line-soft); }
.record strong { font-size: 11.5px; }
.record span { font-size: 8.5px; }
.thumb { width: 46px; height: 52px; border-radius: 6px; }
.thumb.wide { width: 62px; height: 42px; }
.status { padding: 4px 9px; font-size: 9.5px; }
.tag { border-radius: 4px; font-size: 13px; }
.toolbar { gap: 9px; margin-bottom: 14px; }
.row-actions .icon-btn { border-radius: 6px; }

/* editor */
.editor {
  width: min(1120px, 100%);
  border-radius: var(--radius-lg);
  background: #f7f2e8;
  box-shadow: 0 40px 120px rgba(8, 14, 20, 0.38);
}
.editor__head {
  padding: 20px 26px 18px;
  background: linear-gradient(180deg, #ffffff, #f8f1e5);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.editor__head h2 { font-size: 27px; }
.editor__head p { font-size: 9.5px; }
.editor__tabs {
  gap: 5px;
  padding: 10px 22px;
  background: #f7f2e8;
  border-bottom-color: var(--line);
}
.tab {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tab::after { display: none; }
.tab:hover { background: rgba(255, 253, 248, 0.8); border-color: var(--line); }
.tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.editor__body { padding: 22px 26px 26px; }
.form-grid { gap: 16px 18px; }
.form-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.form-section h4 { font-size: 17px; }
.editor__foot {
  padding: 13px 24px;
  background: linear-gradient(0deg, #ffffff, #f8f1e5);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.editor__foot .btn { min-height: 38px; }
.thumb-preview { border-radius: 8px; width: 112px; height: 132px; }
.rich-toolbar { border-radius: 8px 8px 0 0; background: #f5eee1; }
.rich-editor { border-radius: 0; min-height: 260px; font-size: 15px; }
.seo-preview { border-radius: 8px; background: #ffffff; }
.chips span { border-radius: 999px; padding: 4px 9px; font-size: 13px; }

/* media */
.media-grid { gap: 12px; }
.media-card { overflow: hidden; }
.media-card__preview { border-radius: 9px 9px 0 0; }
.media-card__body { padding: 10px 11px 12px; }
.media-card__body strong { font-size: 13px; }
.media-card__actions .icon-btn { border-radius: 5px; }
.dropzone { border-radius: var(--radius); background: linear-gradient(135deg, #ffffff, #f7f0e2); }

/* categories */
.cat-layout { gap: 16px; }
.cat-tree { padding: 10px; }
.cat-node { border-radius: 7px; padding: 8px 9px; }
.cat-node.active { background: var(--ink); }
.cat-detail { padding: 22px; }
.cat-detail h3 { font-size: 26px; }
.cat-detail__head { padding-bottom: 16px; }
.cat-detail__stats { display: flex; gap: 20px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cat-detail__stats > div { background: #f7f1e5; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; min-width: 92px; }
.cat-detail__stats strong { display: block; font-family: var(--serif); font-size: 26px; font-weight: 400; line-height: 1; }
.cat-detail__stats span { display: block; font-size: 8.5px; color: var(--muted-2); margin-top: 4px; }

/* leads */
.kanban__col { border-radius: var(--radius); background: #f6efe3; }
.lead-card { border-radius: 8px; box-shadow: 0 4px 12px rgba(21, 24, 28, 0.04); }
.lead-card:hover { box-shadow: 0 10px 26px rgba(21, 24, 28, 0.09); }

/* login */
.login { background: #f4efe5; }
.login__brand { background: #0d1319; }
.login__logo { width: 320px; height: auto; }
.login__mark { flex-direction: column; align-items: flex-start; gap: 8px; }
.login__mark span { font-family: var(--mono); font-size: 13px; letter-spacing: 0.2em; color: rgba(245, 241, 232, 0.45); }
.login__panel { background: radial-gradient(circle at 80% 20%, #ffffff, #efe7d9); }
.login__form { background: rgba(255, 253, 248, 0.55); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-md); }
.login__form h2 { font-size: 36px; }
.login__form .input { min-height: 44px; }

/* palette / toast / modals */
.palette__box { border-radius: var(--radius-lg); }
.palette__item { border-radius: 7px; }
.toast { border-radius: 8px; }
.editor__head .status { margin-top: 4px; }

/* placeholders */
.thumb.is-broken, .media-card__preview img.is-broken { opacity: 0; }
.thumb-preview--empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed #cbbda8;
  background: repeating-linear-gradient(135deg, #f7f1e5, #f7f1e5 8px, #f3ebdd 8px, #f3ebdd 16px);
  color: var(--muted-2);
  font-size: 13px;
  text-align: center;
}
.thumb-preview--empty svg { width: 20px; height: 20px; color: #b09c7e; }
.media-empty {
  display: grid;
  place-items: center;
  gap: 5px;
  color: #a9987f;
  font-size: 13px;
  height: 100%;
  background: repeating-linear-gradient(135deg, #f7f1e5, #f7f1e5 8px, #f3ebdd 8px, #f3ebdd 16px);
}
.media-empty svg { width: 20px; height: 20px; }

@media (max-width: 900px) {
  .sidebar { width: 262px; }
  .sidebar__logo { width: 150px; }
  .topbar { padding: 0 14px; }
  .page { padding: 18px 14px 34px; }
  .editor { border-radius: 12px; }
  .editor__head { padding: 14px 16px; }
  .editor__body { padding: 16px; }
  .editor__tabs { padding: 9px 12px; }
  .login__form { padding: 22px; }
  .cat-detail__stats { flex-wrap: wrap; gap: 8px; }
}

/* image placeholders */
.thumb-preview-box {
  position: relative;
  width: 112px;
  height: 132px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: #f4eee2;
  border: 1px solid var(--line);
}
.thumb-preview-box .thumb-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}
.thumb-empty-label {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: #a9987f;
  font-size: 13px;
  text-align: center;
  background: repeating-linear-gradient(135deg, #f7f1e5, #f7f1e5 8px, #f3ebdd 8px, #f3ebdd 16px);
}
.thumb-empty-label svg { width: 22px; height: 22px; }
.thumb-empty-label em { font-style: normal; }
.thumb-preview-box.is-empty .thumb-empty-label { display: grid; }
.thumb-preview-box.is-empty .thumb-preview { display: none; }
.media-card__preview { position: relative; }
.media-card__preview .media-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #a9987f;
  font-size: 13px;
}
.media-card__preview .media-empty svg { width: 22px; height: 22px; }
.media-card__preview .media-empty em { font-style: normal; }

/* editor preview */
.editor-preview {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.editor-preview__media {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  background: #f4eee2;
}
.editor-preview__media img { width: 100%; height: 100%; object-fit: cover; }
.editor-preview__media > span {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: #a9987f;
  font-size: 13px;
  background: repeating-linear-gradient(135deg, #f7f1e5, #f7f1e5 8px, #f3ebdd 8px, #f3ebdd 16px);
}
.editor-preview__media > span svg { width: 22px; height: 22px; }
.editor-preview__media > span em { font-style: normal; }
.editor-preview__media.is-empty > span { display: grid; }
.editor-preview__copy > span { font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; color: var(--copper); }
.editor-preview__copy h3 { font-family: var(--serif); font-size: 24px; margin: 4px 0 5px; }
.editor-preview__copy p { font-size: 13px; line-height: 1.7; color: var(--muted); max-width: 640px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.editor-preview__copy .chips { margin-top: 8px; }
.editor-preview__copy .status { margin-left: 5px; }
@media (max-width: 700px) {
  .editor-preview { grid-template-columns: 1fr; }
  .editor-preview__media { aspect-ratio: 16/9; }
}

/* 2026-10-21 · logo palette, readable type, no horizontal sidebar scroll */
body { font-size: 15px; line-height: 1.7; }
p { line-height: 1.75; }
.sidebar, .sidebar__nav, .sidebar__brand, .nav-item, .workspace { overflow-x: hidden; }
.sidebar::-webkit-scrollbar:horizontal, .sidebar__nav::-webkit-scrollbar:horizontal { height: 0; display: none; }
.sidebar { scrollbar-width: none; }
.sidebar__nav { scrollbar-width: none; }
.sidebar__nav::-webkit-scrollbar { width: 4px; }
.nav-item { font-size: 14px; min-height: 38px; }
.nav-label { font-size: 10px; letter-spacing: .14em; }
.nav-badge { font-size: 10px; min-width: 22px; }
.workspace strong { font-size: 13px; }
.workspace span { font-size: 10px; }
.topbar__title h1 { font-size: 25px; }
.topbar__title p { font-size: 12px; }
.topbar__search input { font-size: 13px; height: 42px; }
.page-head h2 { font-size: 34px; }
.page-head p { font-size: 13px; }
.eyebrow { font-size: 11px; }
.btn { font-size: 14px; min-height: 42px; padding: 9px 16px; border-radius: 6px; }
.btn.small { font-size: 12px; min-height: 34px; }
.btn.primary { background: linear-gradient(135deg, #24527a, #1b2a3a); border-color: #1b2a3a; color: #fff; }
.btn.copper { background: linear-gradient(135deg, #c94f3d, #b23a2e); border-color: #b23a2e; color: #fff; }
.btn:hover { box-shadow: 0 10px 26px rgba(21,24,28,.14); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.danger { color: var(--red); border-color: #e7bdb5; background: #fff7f4; }
.input, .select, .select-full, .textarea, .search input { font-size: 14px; min-height: 44px; border-radius: 6px; padding: 10px 12px; }
.textarea { min-height: 100px; }
.field > label, .field > span.label { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: #3f484f; }
.help { font-size: 12px; line-height: 1.6; color: var(--muted); }
.table th { font-size: 11px; padding: 13px 14px; }
.table td { font-size: 13px; padding: 13px 14px; }
.record strong { font-size: 14px; }
.record span { font-size: 11px; }
.status { font-size: 11px; padding: 5px 10px; }
.tag { font-size: 11px; }
.mono { font-size: 12px; }
.page-head { margin-bottom: 24px; }
.panel { padding: 22px; }
.panel__head h3 { font-size: 21px; }
.panel__head p { font-size: 12px; }
.kpi__value { font-size: 44px; }
.kpi__meta { font-size: 12px; }
.cat-node { font-size: 13px; min-height: 34px; }
.cat-detail h3 { font-size: 30px; }
.cat-detail__stats strong { font-size: 30px; }
.cat-detail__stats span { font-size: 11px; }
.editor__head h2 { font-size: 30px; }
.editor__head p { font-size: 12px; }
.tab { font-size: 13px; padding: 8px 15px; }
.editor-preview__copy h3 { font-size: 27px; }
.editor-preview__copy p { font-size: 12px; }
.editor-preview__copy > span { font-size: 10px; }
.login__form h2 { font-size: 40px; }
.login__form p { font-size: 14px; }
.login__form .field > label { font-size: 12px; }
.login__form .input { min-height: 48px; font-size: 15px; }
.login__hint { font-size: 12px; }
.toast { font-size: 13px; }
.media-card__body strong { font-size: 12px; }
.media-card__body span { font-size: 11px; }
.settings-grid { gap: 18px; }
.settings-side h3 { font-size: 24px; }
.settings-side p, .settings-side code { font-size: 12px; }
@media (max-width: 900px) {
  .page-head h2 { font-size: 28px; }
  .topbar__title h1 { font-size: 22px; }
  .editor__head h2 { font-size: 24px; }
}
.nav-item.active {
  background: linear-gradient(135deg, #c94f3d, #8e2c24);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(178, 58, 46, 0.24);
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.16); color: #ffffff; }
.nav-item:hover { background: rgba(247,244,238,.07); }
.nav-item.active:hover { background: linear-gradient(135deg, #d45a45, #9e3228); }
.workspace { border-color: rgba(247,244,238,.14); }
.workspace strong { color: #f7f4ee; }
.workspace span { color: rgba(247,244,238,.55); }

/* settings · expanded page hero configuration */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.settings-main { display: grid; gap: 18px; min-width: 0; }
.settings-main .panel { padding: 22px 24px; }
.settings-side { position: sticky; top: 92px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.settings-side h3 { font-size: 26px; margin: 6px 0 8px; }
.settings-side p { font-size: 12px; line-height: 1.75; color: var(--muted); }
.settings-side code { display: block; margin: 12px 0; padding: 10px; background: var(--surface-2); border-radius: 6px; font-size: 11px; line-height: 1.7; color: var(--ink-2); overflow-x: auto; }
.settings-hero-list { display: grid; gap: 0; margin-top: 6px; }
.setting-hero-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(180px, .72fr);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.setting-hero-row:last-child { border-bottom: 0; }
.setting-hero-row__label strong { display: block; font-size: 13px; font-weight: 600; }
.setting-hero-row__label span { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.setting-hero-row__image { display: flex; align-items: center; gap: 8px; min-width: 0; }
.setting-hero-row__image img { width: 66px; height: 42px; object-fit: cover; border-radius: 5px; background: var(--surface-2); flex: none; }
.setting-hero-row__image .input { flex: 1; min-width: 0; }
.setting-hero-row__hint { font-size: 11px; color: var(--muted-2); }
.setting-hero-row__size { display: block; margin-top: 4px; font-family: var(--mono); font-size: 9px; font-weight: 400; color: var(--muted-2); line-height: 1.5; }
@media (max-width: 1100px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-side { position: static; }
}
@media (max-width: 700px) {
  .setting-hero-row { grid-template-columns: 1fr; gap: 7px; padding: 12px 0; }
  .setting-hero-row__image { flex-wrap: wrap; }
  .setting-hero-row__image img { width: 54px; height: 34px; }
  .settings-main .panel { padding: 16px; }
}
.setting-hero-row__empty {
  width: 66px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: repeating-linear-gradient(135deg, #f7f1e5, #f7f1e5 7px, #f1e8d9 7px, #f1e8d9 14px);
  color: #b09c7e;
}
.setting-hero-row__empty svg { width: 18px; height: 18px; }
/* Editor tabs: prevent flex shrink and clipped labels */
.editor { display: flex; flex-direction: column; }
.editor__head, .editor__tabs, .editor__foot { flex: none; }
.editor__tabs { min-height: 48px; align-items: center; overflow-y: hidden; }
.editor__tabs .tab { height: auto; line-height: 1.25; flex: none; }
.editor__body { flex: 1; min-height: 0; }

/* Gallery / video upload fields */
.gallery-field__preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 62px;
  align-items: center;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.gallery-thumb {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb .icon-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(21,24,28,.7);
  color: #fff;
  border-radius: 50%;
}
.gallery-thumb .icon-btn svg { width: 12px; height: 12px; }
.gallery-field__actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 8px; }
.thumb-preview-box video { width: 100%; height: 100%; object-fit: cover; }
.media-card.is-selected { outline: 2px solid var(--red); outline-offset: 1px; }
.media-card__preview { position: relative; }
.media-card__check {
  position: absolute;
  right: 7px;
  top: 7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.setting-hero-row__image { flex-wrap: wrap; }

/* Page block editor */
.page-block {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
}
.page-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.page-block__head .eyebrow { display: block; font-size: 9px; letter-spacing: .12em; color: var(--copper-2); }
.page-block__head strong { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; }
.page-block .form-grid { padding: 12px; }

/* Footer channel QR cards */
.channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
}
.channel-card__qr {
  flex: none;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
}
.channel-card__qr img { width: 100%; height: 100%; object-fit: contain; }
.channel-card__qr span { display: grid; place-items: center; gap: 3px; color: var(--muted-2); font-size: 9px; text-align: center; }
.channel-card__qr svg { width: 20px; height: 20px; }
.channel-card__body { min-width: 0; flex: 1; }
