@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-cyrillic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f7f5f2;
  --surface: #fffefc;
  --surface-soft: #f3f0ec;
  --surface-warm: #fff8f4;
  --sidebar: #191918;
  --sidebar-soft: #252523;
  --text: #191918;
  --text-secondary: #6f6b67;
  --text-muted: #96918c;
  --line: #e8e2dc;
  --line-strong: #d9d1c9;
  --accent: #ff4b38;
  --accent-dark: #d93627;
  --accent-soft: #fff0eb;
  --success: #367a46;
  --success-soft: #edf7ef;
  --warning: #a36419;
  --warning-soft: #fff5e6;
  --danger: #be352d;
  --danger-soft: #fff0ee;
  --info: #356c9f;
  --info-soft: #edf5fb;
  --shadow: 0 18px 55px rgba(76, 59, 46, .12);
  --sidebar-width: 242px;
  --topbar-height: 76px;
  --context-width: 318px;
  --radius: 14px;
  --radius-small: 9px;
  font-family: "Manrope", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { background: var(--page); color: var(--text); overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
.is-hidden { display: none !important; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 75, 56, .28);
  outline-offset: 2px;
}

.loading-view,
.login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.loading-view { gap: 20px; align-content: center; }
.loading-logo { width: 178px; user-select: none; -webkit-user-drag: none; }
.loading-track { width: 180px; height: 3px; border-radius: 99px; background: var(--line); overflow: hidden; }
.loading-track span {
  display: block;
  width: 46%;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  animation: loading 1.1s ease-in-out infinite alternate;
}
@keyframes loading { from { transform: translateX(-15%); } to { transform: translateX(135%); } }

.login-view {
  grid-template-columns: minmax(280px, 460px) minmax(360px, 480px);
  gap: 9vw;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 75, 56, .11), transparent 25%),
    linear-gradient(135deg, #f7f5f2, #fffefa);
}
.login-brand { align-self: center; }
.login-brand img { width: 260px; display: block; user-select: none; -webkit-user-drag: none; }
.login-brand > span { display: block; width: 44px; height: 2px; margin: 28px 0 20px; background: var(--accent); }
.login-brand strong { display: block; font-size: 22px; font-weight: 650; }
.login-card {
  width: 100%;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 252, .94);
  box-shadow: var(--shadow);
}
.login-heading { margin-bottom: 28px; }
.login-heading p { margin: 0 0 8px; color: var(--accent); font-size: 13px; font-weight: 750; }
.login-heading h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.04em; }
.login-heading span { color: var(--text-secondary); font-size: 14px; }

.field { display: grid; gap: 8px; margin-bottom: 17px; color: var(--text-secondary); font-size: 13px; font-weight: 650; }
.field input,
.field textarea,
.field select,
.input,
.select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 520;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.field input:focus,
.field textarea:focus,
.field select:focus,
.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 75, 56, .11);
  outline: none;
}
.password-field { position: relative; display: block; }
.password-field input { padding-right: 46px; }
.password-field .icon-button { position: absolute; top: 4px; right: 4px; }
.remember-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 2px 0 20px;
  color: var(--text-secondary);
  font-size: 13px;
}
.remember-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.form-error {
  margin: 0 0 16px;
  padding: 11px 12px;
  border-radius: var(--radius-small);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}

.button,
.icon-button,
.profile-button,
.date-button {
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.button:active,
.icon-button:active,
.profile-button:active,
.date-button:active { transform: scale(.98); }
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-small);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.button-secondary:hover { border-color: var(--accent); color: var(--accent-dark); }
.button-ghost { background: transparent; color: var(--text-secondary); }
.button-ghost:hover { background: var(--surface-soft); color: var(--text); }
.button-danger { background: var(--danger-soft); color: var(--danger); }
.button-small { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.button-full { width: 100%; }
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-secondary);
  font-size: 19px;
}
.icon-button:hover { background: var(--surface-soft); color: var(--text); }

.app-shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}
.sidebar {
  position: relative;
  z-index: 40;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  overflow: hidden;
  background: var(--sidebar);
  color: #f5f3ef;
}
.sidebar-brand { display: flex; align-items: center; min-height: 44px; padding: 2px 9px 17px; }
.sidebar-brand img {
  width: 116px;
  filter: brightness(0) invert(1);
  user-select: none;
  -webkit-user-drag: none;
}
.main-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #403e3b transparent;
}
.nav-group-label {
  display: block;
  padding: 14px 12px 7px;
  color: #77736e;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #aaa7a2;
  cursor: pointer;
  font-size: 12px;
  font-weight: 580;
  text-align: left;
  transition: background .16s ease, color .16s ease;
}
.nav-item i { width: 18px; font-size: 17px; text-align: center; }
.nav-item:hover { background: #242321; color: #fff; }
.nav-item.is-active { background: rgba(255, 75, 56, .17); color: #ff7b6d; }
.nav-item.is-disabled { opacity: .48; }
.nav-item .external { margin-left: auto; font-size: 13px; }
.sidebar-bottom { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid #302f2d; }
.restaurant-picker { display: grid; gap: 7px; }
.restaurant-picker label { color: #77736e; font-size: 10px; font-weight: 720; }
.select-dark { position: relative; display: flex; align-items: center; }
.select-dark > i { position: absolute; left: 10px; z-index: 1; color: #9b9893; }
.select-dark select {
  width: 100%;
  height: 40px;
  padding: 7px 26px 7px 32px;
  border: 1px solid #393735;
  border-radius: 8px;
  background: #222220;
  color: #efede9;
  font-size: 11px;
  appearance: none;
}
.sidebar-add {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed #46433f;
  border-radius: 8px;
  background: transparent;
  color: #aaa7a2;
  cursor: pointer;
  font-size: 10px;
}
.sidebar-add:hover { color: #fff; border-color: #7b746d; }
.plan-card {
  padding: 11px;
  border: 1px solid rgba(255, 75, 56, .48);
  border-radius: 9px;
  background: rgba(255, 75, 56, .07);
}
.plan-card strong { display: block; margin-bottom: 3px; font-size: 11px; }
.plan-card span { color: #9d9994; font-size: 9px; }
.plan-card button {
  float: right;
  margin-top: -23px;
  border: 0;
  background: transparent;
  color: #ff7769;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.workspace { min-width: 0; height: 100dvh; display: grid; grid-template-rows: var(--topbar-height) minmax(0, 1fr); }
.topbar {
  position: relative;
  z-index: 25;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 242, .92);
  backdrop-filter: blur(15px);
}
.page-heading { min-width: 0; margin-right: auto; }
.page-heading h1 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.page-heading p { margin: 3px 0 0; color: var(--text-muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.date-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
}
.profile-wrap { position: relative; }
.profile-button {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 5px;
  border-radius: 10px;
  background: transparent;
  font-size: 12px;
  font-weight: 680;
}
.profile-button:hover { background: var(--surface-soft); }
.profile-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 16px;
}
.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 208px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.profile-menu button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}
.profile-menu button:hover { background: var(--surface-soft); }
.profile-menu .danger { color: var(--danger); }
.mobile-menu { display: none; }

.content-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--context-width);
  overflow: hidden;
}
.main-content {
  min-width: 0;
  overflow: auto;
  padding: 24px 28px 40px;
  scroll-behavior: smooth;
}
.context-panel {
  min-width: 0;
  overflow-y: auto;
  padding: 24px 20px;
  border-left: 1px solid var(--line);
  background: rgba(255, 254, 252, .58);
}

.page-stack { display: grid; gap: 18px; max-width: 1420px; margin: 0 auto; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}
.metric-card,
.panel,
.empty-state,
.action-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.metric-card { min-height: 112px; display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-content: center; padding: 17px; }
.metric-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
}
.metric-card strong { display: block; margin-top: 3px; font-size: 21px; letter-spacing: -.035em; }
.metric-card span { display: block; color: var(--text-muted); font-size: 10px; }
.metric-card small { color: var(--success); font-size: 9px; font-weight: 750; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .85fr); gap: 14px; }
.panel { overflow: hidden; }
.panel-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
}
.panel-header > div { min-width: 0; margin-right: auto; }
.panel-header h2 { margin: 0; font-size: 14px; }
.panel-header p { margin: 3px 0 0; color: var(--text-muted); font-size: 10px; }
.panel-body { padding: 17px; }
.panel-body-flush { padding: 0; }
.panel-footer { padding: 11px 17px; border-top: 1px solid var(--line); background: #fcfaf7; }

.chart-wrap { min-height: 240px; display: grid; align-items: end; }
.chart {
  width: 100%;
  min-height: 220px;
  overflow: visible;
}
.chart-grid-line { stroke: #eee8e2; stroke-width: 1; }
.chart-area { fill: url("#chartFill"); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart-label { fill: var(--text-muted); font-size: 9px; font-family: Manrope, sans-serif; }
.bar-chart { height: 220px; display: flex; align-items: end; gap: 10px; padding-top: 16px; }
.bar-column { min-width: 0; flex: 1; display: grid; gap: 6px; justify-items: center; }
.bar-column span {
  width: min(34px, 75%);
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--accent), #ff887b);
}
.bar-column small { color: var(--text-muted); font-size: 9px; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  background: #fcfaf7;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
}
.data-table td { padding: 11px 13px; border-bottom: 1px solid #f0ebe6; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fdf9f6; }
.data-table .name-cell { font-weight: 690; }
.data-table .muted { color: var(--text-muted); }
.table-action {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
}
.table-action:hover { background: var(--surface-soft); color: var(--text); }

.status,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 730;
  white-space: nowrap;
}
.status-success { background: var(--success-soft); color: var(--success); }
.status-warning { background: var(--warning-soft); color: var(--warning); }
.status-danger { background: var(--danger-soft); color: var(--danger); }
.status-info { background: var(--info-soft); color: var(--info); }
.status-accent { background: var(--accent-soft); color: var(--accent-dark); }

.credential-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.credential-note i { font-size: 22px; }
.credential-note div { display: grid; gap: 2px; }
.credential-note span { color: var(--text-muted); font-size: 12px; }
.credential-note.is-ready { border-color: rgba(41, 157, 100, .28); background: var(--success-soft); color: var(--success); }
.credential-note.is-warning { border-color: rgba(213, 148, 27, .28); background: var(--warning-soft); color: var(--warning); }

.list-stack { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 18px;
}
.list-copy { min-width: 0; flex: 1; }
.list-copy strong { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-copy span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 9px; }

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 42px;
  text-align: center;
}
.empty-state > div { max-width: 420px; }
.empty-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 30px;
}
.empty-state h2 { margin: 0 0 8px; font-size: 18px; }
.empty-state p { margin: 0 auto 18px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }

.onboarding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.action-card { display: flex; align-items: center; gap: 13px; padding: 16px; }
.action-card i { font-size: 24px; color: var(--accent); }
.action-card div { min-width: 0; flex: 1; }
.action-card strong { display: block; font-size: 12px; }
.action-card span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 9px; line-height: 1.45; }

.context-title { margin-bottom: 16px; }
.context-title h2 { margin: 0; font-size: 14px; }
.context-title p { margin: 5px 0 0; color: var(--text-muted); font-size: 10px; line-height: 1.5; }
.context-section { padding: 15px 0; border-top: 1px solid var(--line); }
.context-section h3 { margin: 0 0 10px; font-size: 10px; }
.context-nav { display: grid; gap: 5px; }
.context-nav button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 10px;
  text-align: left;
}
.context-nav button:hover,
.context-nav button.is-active { background: var(--accent-soft); color: var(--accent-dark); }
.context-stat { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 10px; }
.context-stat span { color: var(--text-muted); }
.context-stat strong { text-align: right; }
.progress-row { margin-top: 11px; }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--text-secondary); font-size: 9px; }
.progress-line { height: 5px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.progress-line span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.review-list { display: grid; gap: 10px; }
.review-card { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.review-head { display: flex; gap: 10px; align-items: center; }
.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent);
  font-weight: 800;
}
.review-head div { flex: 1; min-width: 0; }
.review-head strong { display: block; font-size: 11px; }
.review-head span { color: var(--text-muted); font-size: 9px; }
.stars { color: #e6a327; letter-spacing: 1px; font-size: 11px; }
.review-card p { margin: 12px 0 0; color: var(--text-secondary); font-size: 11px; line-height: 1.6; }
.review-reply { margin-top: 12px; padding: 11px; border-radius: 9px; background: var(--surface-soft); font-size: 10px; line-height: 1.5; }

.heatmap { display: grid; grid-template-columns: 72px repeat(6, minmax(46px, 1fr)); gap: 5px; align-items: center; }
.heatmap-label { color: var(--text-muted); font-size: 9px; }
.heatmap-cell {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 75, 56, calc(.05 + var(--load) * .007));
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 700;
}

.restaurant-card { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 17px; }
.restaurant-logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
}
.restaurant-card h2 { margin: 0 0 4px; font-size: 15px; }
.restaurant-card p { margin: 0; color: var(--text-muted); font-size: 10px; }

.product-cell { display: flex; align-items: center; gap: 10px; }
.product-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 9px;
  background: var(--surface-soft);
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-muted); font-size: 18px; }

.promotion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.promotion-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.promotion-cover {
  min-height: 100px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 78% 15%, rgba(255,255,255,.42), transparent 28%),
    linear-gradient(135deg, var(--accent), #ff887b);
  color: #fff;
  font-size: 26px;
}
.promotion-body { padding: 14px; }
.promotion-body h3 { margin: 0 0 5px; font-size: 12px; }
.promotion-body p { margin: 0 0 11px; min-height: 30px; color: var(--text-muted); font-size: 9px; line-height: 1.5; }
.promotion-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; }

.site-builder { display: grid; grid-template-columns: minmax(320px, .72fr) minmax(420px, 1.28fr); gap: 14px; }
.site-controls { padding: 16px; }
.site-preview-shell { padding: 10px; background: #e9e5df; }
.site-preview {
  min-height: 520px;
  overflow: hidden;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(63, 48, 38, .13);
}
.site-preview-head { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 0 18px; border-bottom: 1px solid #eee; }
.site-preview-logo { font-size: 14px; font-weight: 800; }
.site-preview-head nav { margin-left: auto; display: flex; gap: 14px; color: #777; font-size: 8px; }
.site-preview-cart { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: var(--accent); color: #fff; }
.site-preview-hero { min-height: 135px; display: flex; align-items: end; padding: 20px; background: linear-gradient(120deg, #20201f, #4c423a); color: #fff; }
.site-preview-hero h3 { max-width: 280px; margin: 0; font-size: 21px; line-height: 1.05; }
.site-preview-categories { display: flex; gap: 7px; padding: 14px 16px; overflow: hidden; }
.site-preview-categories span { padding: 6px 9px; border-radius: 7px; background: #f4f1ed; font-size: 7px; white-space: nowrap; }
.site-preview-products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 18px; }
.site-preview-product { min-width: 0; }
.site-preview-product div { aspect-ratio: 1.18; border-radius: 8px; background: #f1eee9; overflow: hidden; }
.site-preview-product img { width: 100%; height: 100%; object-fit: cover; }
.site-preview-product strong { display: block; margin-top: 6px; font-size: 7px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.site-preview-product span { color: var(--accent); font-size: 7px; font-weight: 800; }

.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.integration-card { min-height: 155px; display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.integration-logo { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-soft); color: var(--accent); font-size: 21px; font-weight: 800; }
.integration-card h3 { margin: 12px 0 4px; font-size: 12px; }
.integration-card p { margin: 0 0 14px; color: var(--text-muted); font-size: 9px; line-height: 1.5; }
.integration-card footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); }
.settings-tabs { padding: 12px; border-right: 1px solid var(--line); }
.settings-tabs button {
  width: 100%;
  min-height: 38px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 10px;
  text-align: left;
}
.settings-tabs button.is-active,
.settings-tabs button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.settings-form { padding: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 13px; }
.form-section { margin-bottom: 20px; }
.form-section h3 { margin: 0 0 12px; font-size: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.switch-row div strong { display: block; font-size: 10px; }
.switch-row div span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 9px; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.switch-row.is-disabled { opacity: .62; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(24, 22, 20, .48);
  backdrop-filter: blur(4px);
}
.modal {
  position: fixed;
  z-index: 90;
  top: 50%;
  left: 50%;
  width: min(680px, calc(100vw - 28px));
  max-height: min(820px, calc(100dvh - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  transform: translate(-50%, -50%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(40, 31, 25, .28);
}
.modal-header { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-header > div { min-width: 0; flex: 1; }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-header p { margin: 4px 0 0; color: var(--text-muted); font-size: 10px; }
.modal-body { overflow-y: auto; padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 11px;
  line-height: 1.5;
  animation: toast-in .2s ease-out;
}
.toast i { margin-top: 1px; color: var(--success); font-size: 17px; }
.toast.is-error i { color: var(--danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.skeleton {
  min-height: 16px;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(90deg, #eee9e3, #faf7f3, #eee9e3);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.sidebar-backdrop { display: none; }

@media (max-width: 1240px) {
  :root { --context-width: 278px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .site-builder { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .context-panel { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  body { overflow: hidden; }
  .login-view { grid-template-columns: 1fr; gap: 28px; }
  .login-brand { text-align: center; }
  .login-brand img { width: 190px; margin: 0 auto; }
  .login-brand > span { margin: 20px auto 14px; }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(292px, calc(100vw - 48px));
    transform: translateX(-102%);
    transition: transform .22s cubic-bezier(.16, 1, .3, 1);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    border: 0;
    background: rgba(20, 19, 18, .45);
  }
  .workspace { height: 100dvh; }
  .topbar { padding: 0 13px; }
  .mobile-menu { display: inline-grid; }
  .date-button,
  .topbar-actions > .icon-button { display: none; }
  .profile-button > span:not(.profile-mark),
  .profile-button > .ph-caret-down { display: none; }
  .main-content { padding: 16px 14px 32px; }
  .page-heading h1 { font-size: 17px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { min-height: 96px; grid-template-columns: 34px 1fr; gap: 9px; padding: 12px; }
  .metric-icon { width: 34px; height: 34px; font-size: 17px; }
  .metric-card strong { font-size: 17px; }
  .onboarding-grid,
  .promotion-grid,
  .integration-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-tabs { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-tabs button { width: auto; white-space: nowrap; }
  .heatmap { grid-template-columns: 58px repeat(6, minmax(34px, 1fr)); gap: 3px; }
  .heatmap-cell { min-height: 38px; }
  .site-preview-products { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .login-view { padding: 18px; }
  .login-card { padding: 24px 20px; }
  .login-brand { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 82px; }
  .panel-header { align-items: flex-start; flex-wrap: wrap; }
  .panel-header .button { width: 100%; }
  .restaurant-card { grid-template-columns: 44px 1fr; }
  .restaurant-card > .button { grid-column: 1 / -1; }
  .site-preview { min-height: 420px; }
  .modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .modal-actions { display: grid; }
}

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