/* Anonim Tanishuv Market — Admin panel styles (module web_admin).
   Palette shared with the Mini App: alabaster canvas, white cards, obsidian ink,
   neon pink → violet → blue brand gradient. Desktop-first, usable on phones. */

:root {
  --bg-canvas: #F5F4F0;
  --bg-surface: #FFFFFF;
  --bg-subtle: #EAE8E1;
  --bg-pill: #F1EFEA;
  --bg-hover: #FAF9F6;
  --ink: #141518;
  --ink-soft: #22242A;
  --ink-2: #1C1E23;
  --text-primary: #141518;
  --text-secondary: #686C77;
  --text-muted: #9498A3;
  --pink: #FF2E93;
  --pink-soft: #FFE6F2;
  --pink-dark: #C0136A;
  --blue: #3D6BFF;
  --blue-soft: #E7EDFF;
  --blue-dark: #2346C8;
  --violet: #9B46FF;
  --violet-soft: #F1E8FF;
  --grad: linear-gradient(120deg, #FF2E93 0%, #9B46FF 55%, #3D6BFF 100%);
  --grad-soft: linear-gradient(120deg, #FFE6F2 0%, #EFE6FF 55%, #E7EDFF 100%);
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --success-dark: #166534;
  --warn: #D97706;
  --warn-soft: #FEF3C7;
  --warn-dark: #92400E;
  --danger: #E11D48;
  --danger-soft: #FFE4E6;
  --danger-dark: #9F1239;
  --border-soft: rgba(20, 21, 24, 0.07);
  --border-med: rgba(20, 21, 24, 0.12);
  --border-strong: rgba(20, 21, 24, 0.18);
  --shadow-card: 0 1px 2px rgba(20, 21, 24, 0.04), 0 4px 16px rgba(20, 21, 24, 0.045);
  --shadow-float: 0 16px 40px rgba(20, 21, 24, 0.16), 0 2px 6px rgba(20, 21, 24, 0.06);
  --shadow-pink: 0 8px 22px rgba(255, 46, 147, 0.28);
  --radius-card: 18px;
  --radius-input: 12px;
  --radius-pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --side-w: 252px;
  --top-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-canvas); color: var(--text-primary);
  font-family: var(--font); font-size: 14px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--pink-soft); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--bg-canvas); z-index: 100; }
.boot img { width: 56px; height: 56px; border-radius: 16px; box-shadow: var(--shadow-pink); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-med); border-top-color: var(--pink); animation: spin .8s linear infinite; }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin;
  background: var(--ink); color: #E9E9EC; padding: 18px 14px 18px;
  display: flex; flex-direction: column; gap: 6px; z-index: 40;
}
.side::before {
  content: ""; position: absolute; left: -60px; top: -80px; width: 260px; height: 220px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 46, 147, .28), rgba(155, 70, 255, .12) 55%, transparent);
  filter: blur(6px);
}
.side-brand { position: relative; display: flex; align-items: center; gap: 11px; padding: 2px 8px 10px; }
.side-brand img { width: 38px; height: 38px; border-radius: 12px; }
.side-brand b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.side-brand span { display: block; font-size: 11.5px; color: #A3A6B0; font-weight: 600; letter-spacing: .02em; }
.nav-group { position: relative; padding: 9px 8px 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #757985; font-weight: 700; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  min-height: 36px; padding: 7px 10px; border-radius: 11px; border: 0; background: none;
  color: #C9CBD2; font-size: 13.5px; font-weight: 600; text-align: left; text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.nav-item.active svg.i { color: #FF7DBA; }
.nav-item .grow { flex: 1; min-width: 0; }
.nav-badge { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--pink); color: #fff; font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 6px; }
.side-me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.side-me .avatar { background: var(--grad); color: #fff; }
.side-me .grow b { display: block; color: #fff; font-size: 13px; }
.side-me .grow span { display: block; color: #8D909A; font-size: 11.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgba(245, 244, 240, .82); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border-soft);
}
.topbar .menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.crumbs h1 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a.back { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; color: var(--text-secondary); background: var(--bg-surface); border: 1px solid var(--border-soft); }
.crumbs a.back:hover { color: var(--ink); text-decoration: none; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.market-pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 700; text-decoration: none !important; border: 1px solid transparent; }
.market-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.market-pill.on { background: var(--success-soft); color: var(--success-dark); }
.market-pill.off { background: var(--warn-soft); color: var(--warn-dark); }
.lang-switch { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); background: var(--bg-subtle); }
.lang-switch button { border: 0; background: none; height: 26px; min-width: 36px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 800; color: var(--text-secondary); }
.lang-switch button.on { background: var(--bg-surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.content { padding: 24px 28px 48px; width: 100%; max-width: 1480px; }
.scrim { display: none; }

/* ---------- generic ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.muted { color: var(--text-secondary); }
.faint { color: var(--text-muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 700; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pre { white-space: pre-wrap; word-break: break-word; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.divider { height: 1px; background: var(--border-soft); margin: 14px 0; }
.num { font-variant-numeric: tabular-nums; }
.danger-text { color: var(--danger); }
.success-text { color: var(--success-dark); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; }
.page-head h2 { font-size: 24px; font-weight: 850; letter-spacing: -.03em; }

.card { background: var(--bg-surface); border-radius: var(--radius-card); border: 1px solid var(--border-soft); box-shadow: var(--shadow-card); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.card-sub { font-size: 12.5px; color: var(--text-secondary); }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.stack > * + * { margin-top: 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 12px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 700; white-space: nowrap; text-decoration: none !important;
  background: var(--bg-surface); color: var(--ink); border-color: var(--border-med);
  transition: transform .08s, box-shadow .15s, background .15s, border-color .15s, opacity .15s;
  position: relative; user-select: none;
}
.btn:hover:not(:disabled) { border-color: var(--border-strong); background: var(--bg-hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-pink); }
.btn-primary:hover:not(:disabled) { background: var(--grad); filter: saturate(1.15) brightness(1.04); border-color: transparent; }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover:not(:disabled) { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-pill); border-color: transparent; color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #C8103C; border-color: #C8103C; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger-dark); border-color: transparent; }
.btn-danger-soft:hover:not(:disabled) { background: #FFD3D9; border-color: transparent; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled) { background: #12893E; border-color: #12893E; }
.btn-soft { background: var(--bg-pill); border-color: transparent; }
.btn-soft:hover:not(:disabled) { background: var(--bg-subtle); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 10px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 9px; gap: 5px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-icon.btn-xs { width: 28px; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading > * { visibility: hidden; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(20,21,24,.25); border-top-color: var(--ink); animation: spin .7s linear infinite; }
.btn-primary.loading::after, .btn-dark.loading::after, .btn-danger.loading::after, .btn-success.loading::after { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: 14px; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.field-label .req { color: var(--pink); }
.field-hint { font-size: 12px; color: var(--text-muted); }
.field-error { font-size: 12px; color: var(--danger); font-weight: 600; display: none; }
.field.invalid .field-error { display: block; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-input);
  border: 1px solid var(--border-med); background: var(--bg-surface); color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s; font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus { border-color: rgba(61, 107, 255, .6); box-shadow: 0 0 0 3px rgba(61, 107, 255, .14); }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--bg-pill); color: var(--text-secondary); }
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23686C77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.input-sm, .select.input-sm { height: 34px; font-size: 13px; border-radius: 10px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-addon { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--border-med); border-left: 0; border-radius: 0 var(--radius-input) var(--radius-input) 0; background: var(--bg-pill); color: var(--text-secondary); font-size: 13px; font-weight: 600; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .field + .field { margin-top: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }
.search {
  position: relative; display: flex; align-items: center; min-width: 220px;
}
.search svg.i { position: absolute; left: 11px; color: var(--text-muted); pointer-events: none; }
.search .input { padding-left: 36px; height: 38px; }
.counter { font-size: 11.5px; color: var(--text-muted); text-align: right; margin-left: auto; }
.counter.over { color: var(--danger); font-weight: 700; }

.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; border-radius: 13px; background: #D5D3CD; border: 0; padding: 0; transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.3,.7,.4,1); }
.switch.on { background: var(--success); }
.switch.on::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; }
.switch.lg { width: 60px; height: 34px; border-radius: 17px; }
.switch.lg::after { width: 28px; height: 28px; }
.switch.lg.on::after { transform: translateX(26px); }
.check-row { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--pink); }

/* ---------- segmented / tabs / chips ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-subtle); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border: 0; border-radius: 10px; background: none; color: var(--text-secondary); font-weight: 700; font-size: 13px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--bg-surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20,21,24,.1); }
.tab .cnt { min-width: 20px; height: 19px; padding: 0 6px; border-radius: 10px; background: rgba(20,21,24,.07); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.tab.active .cnt { background: var(--pink-soft); color: var(--pink-dark); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar > div, .toolbar > span { min-width: 0; max-width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: var(--radius-pill); border: 1px solid var(--border-med); background: var(--bg-surface); font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.chip button { border: 0; background: none; padding: 0; display: inline-flex; color: var(--text-muted); }
.chip button:hover { color: var(--danger); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 750; white-space: nowrap; background: var(--bg-pill); color: var(--ink-soft); vertical-align: middle; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; display: none; }
.badge.dot::before { display: inline-block; }
.b-pink { background: var(--pink-soft); color: var(--pink-dark); }
.b-blue { background: var(--blue-soft); color: var(--blue-dark); }
.b-violet { background: var(--violet-soft); color: #6B21C8; }
.b-green { background: var(--success-soft); color: var(--success-dark); }
.b-amber { background: var(--warn-soft); color: var(--warn-dark); }
.b-red { background: var(--danger-soft); color: var(--danger-dark); }
.b-dark { background: var(--ink); color: #fff; }
.b-gray { background: var(--bg-pill); color: var(--text-secondary); }
.b-grad { background: var(--grad); color: #fff; }
.verified { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; background: var(--blue); color: #fff; align-items: center; justify-content: center; flex: none; vertical-align: -2px; }
.verified svg.i { width: 11px; height: 11px; stroke-width: 3.2; }
.stars { display: inline-flex; gap: 1px; color: #F5A524; font-size: 13px; letter-spacing: 1px; }
.stars .off { color: #DAD7CF; }

/* ---------- avatars / thumbs ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--grad-soft); color: var(--pink-dark); font-weight: 800; font-size: 13px; overflow: hidden; }
.avatar.sq { border-radius: 11px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.xl { width: 84px; height: 84px; font-size: 26px; border-radius: 22px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--bg-pill); flex: none; border: 1px solid var(--border-soft); }
.thumb.sm { width: 34px; height: 34px; border-radius: 8px; }
.thumb.lg { width: 64px; height: 64px; border-radius: 13px; }
.thumb-ph { display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); }
.cell-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-main .t { font-weight: 700; color: var(--ink); min-width: 0; }
.cell-main .s { font-size: 12px; color: var(--text-secondary); }
.thumbs-stack { display: inline-flex; }
.thumbs-stack .thumb { margin-left: -10px; border: 2px solid #fff; }
.thumbs-stack .thumb:first-child { margin-left: 0; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 750; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: bottom; background: var(--bg-surface); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: var(--bg-hover); }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl td.fin-shop a { display: block; max-width: 240px; }
.tbl tr.expand td { background: #FBFAF7; }
.tbl.compact th, .tbl.compact td { padding: 9px 12px; }
.tbl.compact th:first-child, .tbl.compact td:first-child { padding-left: 14px; }
.tbl.compact th:last-child, .tbl.compact td:last-child { padding-right: 14px; }
.list-foot { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--border-soft); }
.list-end { padding: 14px; text-align: center; color: var(--text-muted); font-size: 12.5px; border-top: 1px solid var(--border-soft); }

/* ---------- states ---------- */
.skel { background: linear-gradient(90deg, #EFEDE7 0%, #F7F6F2 40%, #EFEDE7 80%); background-size: 300% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-line { height: 12px; }
.skel-row td { padding: 16px 14px; }
.empty { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic { width: 58px; height: 58px; border-radius: 18px; background: var(--grad-soft); color: var(--pink-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.empty .ic svg.i { width: 26px; height: 26px; }
.empty h3 { font-size: 16px; font-weight: 800; }
.empty p { color: var(--text-secondary); max-width: 380px; font-size: 13.5px; }
.empty.err .ic { background: var(--danger-soft); color: var(--danger); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-dark); font-size: 13px; font-weight: 600; }
.notice.warn { background: var(--warn-soft); color: var(--warn-dark); }
.notice.danger { background: var(--danger-soft); color: var(--danger-dark); }
.notice.success { background: var(--success-soft); color: var(--success-dark); }
.notice.pink { background: var(--pink-soft); color: var(--pink-dark); }
.notice svg.i { margin-top: 1px; }

/* ---------- KPIs ---------- */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .lbl { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); display: flex; align-items: center; gap: 7px; }
.kpi .val { font-size: 26px; font-weight: 850; letter-spacing: -.035em; margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .val small { font-size: 14px; font-weight: 700; color: var(--text-secondary); letter-spacing: 0; margin-left: 3px; }
.kpi .meta { margin-top: 6px; font-size: 12.5px; color: var(--text-secondary); }
.kpi .ico { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-pill); color: var(--ink-soft); }
.kpi.hero { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.hero::after { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 200px; background: radial-gradient(closest-side, rgba(255,46,147,.45), rgba(61,107,255,.2) 60%, transparent); pointer-events: none; }
.kpi.hero .lbl, .kpi.hero .meta, .kpi.hero .val small { color: #B7B9C2; }
.kpi.hero .ico { background: rgba(255,255,255,.1); color: #fff; }
.pending-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none !important; color: inherit; transition: transform .15s, box-shadow .15s; }
.pending-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
.pending-card .ico { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.pending-card .n { font-size: 24px; font-weight: 850; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.pending-card .l { font-size: 12.5px; color: var(--text-secondary); font-weight: 650; margin-top: 4px; }
.pending-card.hot .n { color: var(--pink); }
.meter { height: 8px; border-radius: 6px; background: var(--bg-pill); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 6px; background: var(--grad); }
.stat-list { display: flex; flex-direction: column; gap: 12px; }
.stat-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 52px; gap: 10px; align-items: center; font-size: 13px; }
.stat-row b { text-align: right; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 9px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-secondary); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mini-stat { padding: 12px 14px; border-radius: 14px; background: var(--bg-pill); }
.mini-stat .l { font-size: 11.5px; color: var(--text-secondary); font-weight: 700; }
.mini-stat .v { font-size: 17px; font-weight: 850; margin-top: 3px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- chart ---------- */
.chart { position: relative; width: 100%; height: 260px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-l { stroke: rgba(20,21,24,.06); stroke-width: 1; }
.chart .axis-t { fill: var(--text-muted); font-size: 10.5px; font-family: var(--font); }
.chart .bar { fill: url(#cg-bar); transition: opacity .15s; }
.chart .bar.dim { opacity: .35; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 9px 11px; border-radius: 11px; font-size: 12px; line-height: 1.5; box-shadow: var(--shadow-float); white-space: nowrap; transform: translate(-50%, -100%); margin-top: -10px; z-index: 2; }
.chart-tip b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-secondary); font-weight: 650; flex-wrap: wrap; row-gap: 4px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- modal / drawer ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-bg { position: absolute; inset: 0; background: rgba(20, 21, 24, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .18s ease; }
.modal {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--bg-surface); border-radius: 22px; box-shadow: 0 30px 80px rgba(20,21,24,.3); animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
.modal.sm { max-width: 420px; }
.modal.lg { max-width: 760px; }
.modal.xl { max-width: 1040px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { flex: 1; font-size: 17px; font-weight: 800; letter-spacing: -.02em; min-width: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.modal-wrap.drawer { justify-content: flex-end; padding: 0; }
.modal-wrap.drawer .modal { max-width: 640px; height: 100vh; max-height: 100vh; border-radius: 22px 0 0 22px; animation: slide-in .25s cubic-bezier(.2,.8,.3,1); }
.modal-wrap.drawer .modal-body { flex: 1; }
.modal-err { margin-bottom: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
body.modal-open { overflow: hidden; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 420px; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-float); font-size: 13.5px; font-weight: 600; animation: toast-in .25s cubic-bezier(.2,.9,.3,1.2); }
.toast .ti { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: rgba(255,255,255,.12); }
.toast.ok .ti { background: var(--success); }
.toast.err .ti { background: var(--danger); }
.toast.warn .ti { background: var(--warn); }
.toast .ti svg.i { width: 13px; height: 13px; stroke-width: 3; }
.toast.out { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- uploader ---------- */
.uploader { position: relative; border: 1.5px dashed var(--border-strong); border-radius: 16px; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; cursor: pointer; transition: border-color .15s, background .15s; min-height: 120px; }
.uploader:hover, .uploader.drag { border-color: var(--pink); background: var(--pink-soft); }
.uploader.square { width: 148px; height: 148px; min-height: 0; }
.uploader.square .up-empty { gap: 4px; padding: 8px; font-size: 11.5px; line-height: 1.3; }
.uploader.square .up-empty svg.i { width: 20px; height: 20px; }
.uploader.square .up-empty .tiny { font-size: 10.5px; line-height: 1.3; }
.uploader.wide { aspect-ratio: 2.4 / 1; width: 100%; }
.uploader .up-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px; color: var(--text-secondary); font-size: 12.5px; font-weight: 650; }
.uploader .up-empty svg.i { width: 24px; height: 24px; color: var(--pink); }
.uploader img.up-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.uploader .up-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 6px; border-radius: 4px; background: rgba(255,255,255,.7); overflow: hidden; }
.uploader .up-bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .1s; }
.uploader .up-actions { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.uploader .up-actions .btn { background: rgba(255,255,255,.92); }
.uploader input[type=file] { display: none; }

/* ---------- gallery / lightbox ---------- */
.gallery-main { position: relative; border-radius: 16px; overflow: hidden; background: var(--bg-pill); aspect-ratio: 1 / 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.gallery-strip { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.gallery-strip button { border: 2px solid transparent; padding: 0; border-radius: 11px; background: none; flex: none; }
.gallery-strip button.on { border-color: var(--pink); }
.gallery-strip img { width: 58px; height: 58px; object-fit: cover; border-radius: 9px; }
.lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(10, 10, 12, .92); display: flex; align-items: center; justify-content: center; padding: 30px; animation: fade .15s; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; }
.lightbox .btn { position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border-soft); }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -22px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg-surface); border: 3px solid var(--text-muted); }
.tl-item.ok .tl-dot { border-color: var(--success); }
.tl-item.bad .tl-dot { border-color: var(--danger); }
.tl-item.pay .tl-dot { border-color: var(--blue); }
.tl-title { font-weight: 700; font-size: 13.5px; }
.tl-time { font-size: 12px; color: var(--text-muted); }
.tl-note { font-size: 13px; color: var(--text-secondary); margin-top: 3px; padding: 7px 10px; background: var(--bg-pill); border-radius: 10px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.login::before, .login::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.login::before { width: 520px; height: 520px; left: -160px; top: -160px; background: #FFC2DF; }
.login::after { width: 560px; height: 560px; right: -180px; bottom: -200px; background: #C9D6FF; }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 34px 32px 28px; border-radius: 28px; background: rgba(255,255,255,.86); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 30px 80px rgba(20,21,24,.14); }
.login-card .logo { width: 60px; height: 60px; border-radius: 18px; box-shadow: var(--shadow-pink); }
.login-card h1 { font-size: 25px; font-weight: 850; letter-spacing: -.035em; margin-top: 18px; }
.login-card .sub { color: var(--text-secondary); margin-top: 6px; font-size: 14px; }
.login-card form { margin-top: 22px; }
.login-card .input { height: 48px; font-size: 16px; border-radius: 14px; }
.code-input { text-align: center; letter-spacing: .5em; font-family: var(--mono); font-size: 24px !important; font-weight: 700; padding-left: .5em !important; }
.login-foot { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.login-lang { position: absolute; top: 18px; right: 18px; z-index: 2; }

/* ---------- moderation split ---------- */
.mod-split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.mod-list { max-height: calc(100vh - 210px); overflow-y: auto; }
.mod-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border-soft); background: none; text-align: left; }
.mod-item:hover { background: var(--bg-hover); }
.mod-item.on { background: var(--pink-soft); }
.mod-item .t { font-weight: 700; font-size: 13.5px; }
.mod-preview { position: sticky; top: calc(var(--top-h) + 16px); }
.mod-body { display: grid; grid-template-columns: minmax(220px, 40%) minmax(0, 1fr); gap: 24px; }
.mod-body > div { min-width: 0; }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mod-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: rgba(255,255,255,.22); font-size: 11px; font-family: var(--mono); }
.btn:not(.btn-primary):not(.btn-dark):not(.btn-danger):not(.btn-success) .kbd { background: var(--bg-pill); color: var(--text-secondary); }
.price-big { font-size: 26px; font-weight: 850; letter-spacing: -.03em; }
.price-old { color: var(--text-muted); text-decoration: line-through; font-weight: 600; }

/* ---------- categories ---------- */
.cat-tree { padding: 6px 0; }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border-soft); }
.cat-row:last-child { border-bottom: 0; }
.cat-row.child { padding-left: 64px; background: #FCFBF9; }
.cat-row .cat-ic { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; background: var(--grad-soft); flex: none; display: flex; align-items: center; justify-content: center; color: var(--pink-dark); font-weight: 800; }
.cat-row.child .cat-ic { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.cat-row.off .cat-name { color: var(--text-muted); }
.cat-name { font-weight: 750; }
.cat-ord { display: flex; flex-direction: column; gap: 2px; }
.cat-ord .btn { height: 18px; width: 26px; border-radius: 6px; padding: 0; }
.cat-ord .btn svg.i { width: 13px; height: 13px; }
.cat-tools { display: flex; align-items: center; gap: 12px; flex: none; }

/* ---------- banners ---------- */
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.banner-card { overflow: hidden; display: flex; flex-direction: column; }
.banner-img { position: relative; aspect-ratio: 2.4 / 1; background: var(--bg-pill); overflow: hidden; }
.banner-img img { width: 100%; height: 100%; object-fit: cover; }
.banner-img .ov { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,21,24,.62), rgba(20,21,24,0) 70%); color: #fff; padding: 16px 18px; display: flex; flex-direction: column; justify-content: flex-end; }
.banner-img .ov b { font-size: 17px; font-weight: 850; letter-spacing: -.02em; }
.banner-img .ov span { font-size: 12.5px; opacity: .88; margin-top: 2px; }
.banner-img .st { position: absolute; top: 10px; left: 10px; }
.banner-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.banner-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }

/* ---------- reviews / complaints ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { padding: 16px 20px; border-bottom: 1px solid var(--border-soft); display: flex; gap: 14px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item.dim { background: #FBFAF7; }
.feed-item.dim .feed-text { color: var(--text-secondary); }
.feed-text { font-size: 13.5px; line-height: 1.5; margin-top: 6px; }
.feed-photos { display: flex; gap: 6px; margin-top: 8px; }
.feed-photos button { border: 0; padding: 0; background: none; border-radius: 9px; overflow: hidden; }
.feed-photos img { width: 56px; height: 56px; object-fit: cover; }
.reply-box { margin-top: 10px; padding: 9px 12px; border-left: 3px solid var(--blue); background: var(--blue-soft); border-radius: 0 10px 10px 0; font-size: 13px; }
.feed-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex: none; }

/* ---------- broadcast ---------- */
.composer-tools { display: flex; gap: 4px; padding: 6px; border: 1px solid var(--border-med); border-bottom: 0; border-radius: var(--radius-input) var(--radius-input) 0 0; background: var(--bg-hover); flex-wrap: wrap; }
.composer-tools .btn { height: 30px; min-width: 32px; padding: 0 9px; font-size: 13px; }
.composer-tools + .textarea { border-radius: 0 0 var(--radius-input) var(--radius-input); min-height: 220px; font-family: var(--mono); font-size: 13px; }
.tg-preview { background: #E6EBEE url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='4' cy='4' r='1.4' fill='%23d3dbe0'/%3E%3C/svg%3E"); border-radius: 16px; padding: 18px; min-height: 180px; }
.tg-bubble { max-width: 440px; background: #fff; border-radius: 14px 14px 14px 4px; padding: 10px 12px 8px; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,.08); white-space: pre-wrap; word-break: break-word; }
.tg-bubble a { color: #2481CC; }
.tg-bubble code { font-family: var(--mono); font-size: 12.5px; background: #F2F2F2; padding: 1px 4px; border-radius: 4px; }
.tg-bubble .tg-time { display: block; text-align: right; font-size: 11px; color: #9AA5AE; margin-top: 2px; }
.tg-bot { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12.5px; font-weight: 700; color: #5C6B77; }
.tg-bot img { width: 26px; height: 26px; border-radius: 50%; }
.progress { height: 7px; border-radius: 5px; background: var(--bg-pill); overflow: hidden; min-width: 90px; display: flex; }
.progress i { display: block; height: 100%; background: var(--success); }
.progress i.f { background: var(--danger); }

/* ---------- audit ---------- */
.json { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--ink); color: #E6E6EA; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; overflow-x: auto; white-space: pre; max-height: 420px; }
.json .k { color: #FF8CC6; }
.json .s { color: #B8E986; }
.json .n { color: #8AB4FF; }
.json .b { color: #FFC66D; }
.json .z { color: #9498A3; }

/* ---------- settings ---------- */
.hero-switch { display: flex; align-items: center; gap: 20px; padding: 24px; border-radius: var(--radius-card); position: relative; overflow: hidden; }
.hero-switch.on { background: linear-gradient(120deg, #E9FBEF, #F2FFF5); border: 1px solid #BDEFCB; }
.hero-switch.off { background: var(--grad-soft); border: 1px solid #F1D5E6; }
.hero-switch .hs-ic { width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; flex: none; background: #fff; box-shadow: var(--shadow-card); }
.hero-switch h3 { font-size: 19px; font-weight: 850; letter-spacing: -.02em; }
.hero-switch p { color: var(--text-secondary); margin-top: 4px; font-size: 13.5px; max-width: 620px; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.set-row:last-child { border-bottom: 0; }
.set-row.field { flex-direction: row; }
.set-row.field + .set-row.field { margin-top: 0; }
.set-row .ctl .field-error { margin-top: 6px; }
.set-row .grow b { display: block; font-size: 14px; }
.set-row .grow label { display: block; cursor: pointer; }
.set-row .grow span { display: block; color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; }
.set-row .ctl { width: 240px; flex: none; }

/* ---------- detail header ---------- */
.d-head { display: flex; gap: 18px; align-items: center; padding: 20px; }
.d-head h2 { font-size: 22px; font-weight: 850; letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-cover { height: 140px; background: var(--grad-soft); border-radius: var(--radius-card) var(--radius-card) 0 0; overflow: hidden; }
.d-cover img { width: 100%; height: 100%; object-fit: cover; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1366px) {
  /* laptop widths: tighter table cells so wide lists fit without horizontal scroll */
  .tbl th { padding: 12px 9px; letter-spacing: .03em; }
  .tbl td { padding: 11px 9px; }
}
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .mod-body { grid-template-columns: minmax(0, 1fr); }
  .mod-body .gallery-main { max-width: 420px; }
}
@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  /* Shadow only while open: the blur of a closed off-canvas drawer would leak onto the page edge. */
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-105%); transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s; box-shadow: none; }
  body.nav-open .side { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.3); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(20,21,24,.4); }
  .topbar { padding: 0 16px; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 18px 16px 40px; }
  .mod-split { grid-template-columns: minmax(0, 1fr); }
  .mod-list { max-height: 300px; }
  .mod-preview { position: static; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --top-h: 56px; }
  body { font-size: 14px; }
  .crumbs h1 { font-size: 17px; }
  .market-pill .txt, .top-actions .hide-sm { display: none; }
  .market-pill { padding: 0 10px; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .pending-card { padding: 12px; gap: 10px; }
  .pending-card > svg.i { display: none; }
  .pending-card .ico { width: 38px; height: 38px; border-radius: 12px; }
  .card-head { flex-wrap: wrap; }
  .card-head .tabs { width: 100%; }
  .card-head .tabs .tab { flex: 1; justify-content: center; }
  .kpi .val { font-size: 20px; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head h2 { font-size: 21px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .search { min-width: 0; flex: 1 1 100%; }
  .toolbar > .select, .toolbar > .input { flex: 1 1 140px; }
  .set-row { flex-wrap: wrap; }
  .set-row .ctl { width: 100%; }
  .d-head { flex-wrap: wrap; }
  .d-actions { justify-content: flex-start; width: 100%; }
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal, .modal.lg, .modal.xl, .modal.sm { max-width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; }
  .modal-wrap.drawer .modal { border-radius: 22px 22px 0 0; height: 94vh; max-height: 94vh; }
  #toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: none; }
  /* tables → cards */
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
  .tbl.cards tr:last-child { border-bottom: 0; }
  .tbl.cards td { border: 0; padding: 3px 0 !important; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: right; }
  .tbl.cards td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; font-weight: 650; text-align: left; flex: none; }
  .tbl.cards td.lead { display: block; text-align: left; padding-bottom: 6px !important; }
  .tbl.cards td.lead::before, .tbl.cards td[data-label=""]::before { display: none; }
  .tbl.cards td.actions { justify-content: flex-end; padding-top: 8px !important; }
  .tbl.cards td.r { text-align: right; }
  .tbl.cards tr.skel-row td::before { display: none; }
  .tbl.cards tr.expand td { display: block; }
  .tbl.cards td.fin-shop a { max-width: none; }
  .feed-item { flex-direction: column; }
  .feed-side { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .cat-row { padding: 10px 14px; }
  .cat-row.child { padding-left: 30px; }
  .banner-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: 96px minmax(0, 1fr) 44px; }
  .hero-switch { flex-wrap: wrap; padding: 18px; }
  .chart { height: 210px; }
}
@media (max-width: 600px) {
  /* category rows: name + slug get the full first line, tools go below */
  .cat-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); column-gap: 10px; row-gap: 8px; }
  .cat-row .cat-main { grid-column: 3; }
  .cat-row .cat-tools { grid-column: 1 / -1; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
  .cat-row .cat-slug { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
