/* =============================================================================
   DoggyJi Admin Portal
   Dark / light theme, Nunito headings and Montserrat body, as in the app.
   Layout: fixed sidebar on desktop, off-canvas sidebar under 1024px.
   ============================================================================= */

:root {
  --teal: #23C1C3;
  --teal-strong: #1EAEB0;
  --teal-soft: rgba(35, 193, 195, 0.14);
  --purple: #8B5CF6;
  --purple-soft: rgba(139, 92, 246, 0.14);
  --amber: #F5A524;
  --amber-soft: rgba(245, 165, 36, 0.15);
  --red: #EF4444;
  --red-soft: rgba(239, 68, 68, 0.14);
  --green: #10B981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --blue: #3B82F6;
  --blue-soft: rgba(59, 130, 246, 0.14);
  --slate-soft: rgba(148, 163, 184, 0.16);

  --font-heading: 'Nunito', system-ui, sans-serif;
  --font-body: 'Montserrat', system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0A0F1D;
  --bg-elev: #111a2e;
  --bg-sidebar: #0d1424;
  --bg-card: #121c33;
  --bg-hover: #182543;
  --bg-input: #0e1628;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #F1F5F9;
  --text-2: #A3B1C6;
  --text-3: #6B7A90;
  --shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.55);
  --shadow-modal: 0 25px 60px -12px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #F3F6FA;
  --bg-elev: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-hover: #F1F5F9;
  --bg-input: #FFFFFF;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;
  --shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.12);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.3);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 800; letter-spacing: -0.01em; }
a { color: var(--teal); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
button { font: inherit; }
[hidden] { display: none !important; }

.logo {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: inline-flex; align-items: center;
  justify-content: center; font-size: 20px; background: linear-gradient(135deg, var(--teal), #142C73);
  box-shadow: 0 4px 14px rgba(35, 193, 195, .3);
}
.logo-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 28px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--font-heading); font-weight: 800; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: background .15s var(--ease), border-color .15s, opacity .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: #06222A; }
.btn-primary:hover:not(:disabled) { background: var(--teal-strong); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.btn-success { background: var(--green); color: #fff; }
.btn-warning { background: var(--amber); color: #1F1300; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-outline { background: transparent; border-color: rgba(239, 68, 68, .45); color: var(--red); }
.btn-danger-outline:hover:not(:disabled) { background: var(--red-soft); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); display: inline-flex;
  align-items: center; justify-content: center; background: var(--bg-card);
  border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: 16px;
}
.icon-btn:hover { background: var(--bg-hover); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.field .hint { font-size: 11px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border-strong); color: var(--text);
  font: inherit; font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.textarea { resize: vertical; min-height: 84px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--teal); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px 12px; padding-top: 4px; }

/* ── Auth screens ─────────────────────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(600px 400px at 10% 0%, rgba(35, 193, 195, .16), transparent 70%),
    radial-gradient(600px 400px at 100% 100%, rgba(139, 92, 246, .14), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 18px; padding: 32px 28px; box-shadow: var(--shadow);
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand .logo { width: 56px; height: 56px; margin: 0 auto 12px; }
.auth-brand h1 { font-size: 22px; }
.auth-brand p { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; }
.auth-links button { background: none; border: none; color: var(--teal); cursor: pointer; font-weight: 700; }
.auth-note { margin-top: 18px; font-size: 11px; color: var(--text-3); text-align: center; }
.auth-note + .auth-note { margin-top: 8px; }
.auth-note a { color: var(--teal); font-weight: 600; text-decoration: none; }
.auth-note a:hover { text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 44px; }
.password-wrap button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-2); cursor: pointer; padding: 6px; font-size: 12px; font-weight: 700;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--bg-sidebar); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 60;
  transition: transform .25s var(--ease);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; }
.brand .logo { width: 38px; height: 38px; }
.brand-name { font-family: var(--font-heading); font-weight: 900; font-size: 18px; line-height: 1.1; }
.brand-sub { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.me-card {
  margin: 0 14px 6px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--teal-soft); border: 1px solid rgba(35, 193, 195, .25);
}
.me-name { font-weight: 800; font-size: 13px; font-family: var(--font-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 11px; color: var(--teal); font-weight: 700; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 20px; }
.nav-section { font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 13px; margin-bottom: 2px;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active { background: var(--teal-soft); color: var(--teal); font-weight: 800; }
.nav-link .ico { width: 20px; text-align: center; font-size: 15px; }
.nav-count {
  margin-left: auto; min-width: 22px; text-align: center; font-size: 11px; font-weight: 800;
  padding: 1px 7px; border-radius: 999px; background: var(--red); color: #fff;
}
.nav-count.soft { background: var(--slate-soft); color: var(--text-2); }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 20px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }
.scrim { display: none; }

/* ── Cards, toolbars, tabs ────────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head h3 { font-size: 15px; }
.card-head p { font-size: 12px; color: var(--text-2); }
.stack > * + * { margin-top: 16px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.search { min-width: 220px; max-width: 340px; flex: 1; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent;
  color: var(--text-2); font-weight: 700; font-size: 12px; cursor: pointer;
}
.tab:hover { color: var(--text); background: var(--bg-hover); }
.tab.active { background: var(--teal); border-color: var(--teal); color: #06222A; }
.tab .n { opacity: .75; margin-left: 4px; }
.note { font-size: 12px; color: var(--text-3); margin-top: 10px; }

/* ── Metrics ──────────────────────────────────────────────────────────────── */
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; text-decoration: none; color: inherit;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .15s, transform .15s;
}
a.metric:hover { border-color: var(--teal); transform: translateY(-1px); }
.metric-label { font-size: 12px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.metric-value { font-family: var(--font-heading); font-size: 30px; font-weight: 900; line-height: 1.1; }
.metric-sub { font-size: 11px; color: var(--text-3); }
.metric.alert .metric-value { color: var(--red); }
.metric.warn .metric-value { color: var(--amber); }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.nowrap { white-space: nowrap; }
.chart-box { position: relative; height: 260px; padding: 12px 16px 16px; }
.attention { list-style: none; padding: 8px 12px 14px; }
.attention li a {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text);
}
.attention li a:hover { background: var(--bg-hover); }
.attention .n { margin-left: auto; font-family: var(--font-heading); font-weight: 900; }
.all-clear { padding: 24px; text-align: center; color: var(--text-2); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 13px; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-hover); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 6px; }
.cell-main { font-weight: 700; }
.cell-sub { font-size: 12px; color: var(--text-2); }
.cell-clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; background: var(--teal-soft);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--teal); font-size: 12px;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; white-space: nowrap; font-family: var(--font-heading); letter-spacing: .01em;
}
.b-green { background: var(--green-soft); color: var(--green); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-blue { background: var(--blue-soft); color: var(--blue); }
.b-purple { background: var(--purple-soft); color: var(--purple); }
.b-slate { background: var(--slate-soft); color: var(--text-2); }
.b-teal { background: var(--teal-soft); color: var(--teal); }

/* ── States ───────────────────────────────────────────────────────────────── */
.state { padding: 48px 20px; text-align: center; color: var(--text-2); }
.state .ico { font-size: 30px; margin-bottom: 8px; }
.state h4 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.state p { font-size: 13px; max-width: 420px; margin: 0 auto; }
.state .btn { margin-top: 14px; }
.skeleton { padding: 16px 20px; }
.skeleton div {
  height: 14px; border-radius: 6px; margin: 12px 0;
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
.skeleton div:nth-child(2n) { width: 82%; }
.skeleton div:nth-child(3n) { width: 64%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(2, 6, 18, .6);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto;
  animation: fade .15s var(--ease);
}
.modal {
  width: 100%; max-width: 560px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-modal); animation: rise .18s var(--ease);
}
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-head p { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--border); }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.detail { min-width: 0; }
.detail .k { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.detail .v { font-size: 13px; overflow-wrap: anywhere; }
.detail.full { grid-column: 1 / -1; }
.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 18px 0 8px; }
.list-rows { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.quote { background: var(--bg-hover); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.json { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; font-size: 12px; overflow: auto; max-height: 360px; }

/* ── Banners ──────────────────────────────────────────────────────────────── */
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.banner-card { overflow: hidden; display: flex; flex-direction: column; }
/* Staging (opened from localhost): an orange strip so it is never mistaken for production. */
html[data-env="staging"] body::before {
  content: 'STAGING — test data'; position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  z-index: 9999; background: #D97706; color: #fff; font: 800 11px/1 var(--font-heading, sans-serif);
  letter-spacing: .08em; padding: 5px 14px; border-radius: 0 0 8px 8px; pointer-events: none;
}
.push-preview { background: var(--bg-input); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.push-head { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); margin-bottom: 6px; }
.push-head .grow { flex: 1; }
.push-app { width: 18px; height: 18px; border-radius: 5px; background: var(--teal); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }
.push-title { font-weight: 800; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.push-body { font-size: 13px; color: var(--text-2); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.banner-preview {
  position: relative; aspect-ratio: 2.2 / 1; background: #142C73 center / cover no-repeat;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; color: #fff;
}
.banner-preview::before { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0, 0, 0, .6)); }
.banner-preview > * { position: relative; }
.banner-preview h4 { font-size: 18px; line-height: 1.2; }
.banner-preview p { font-size: 12px; opacity: .9; }
.banner-preview .cta { align-self: flex-start; margin-top: 8px; background: #fff; color: #142C73; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; font-family: var(--font-heading); }
.banner-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; }
.banner-meta .actions { margin-left: auto; display: flex; gap: 6px; }
/* Pop-ups: drawn at 9 : 16, as the app shows them, with the ✕ where it sits. */
.popup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.popup-card { overflow: hidden; display: flex; flex-direction: column; }
.popup-preview { position: relative; aspect-ratio: 9 / 16; background: var(--slate-soft); display: grid; place-items: center; overflow: hidden; border-radius: var(--radius); }
.popup-card .popup-preview { border-radius: 0; }
.popup-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.popup-x { pointer-events: none; cursor: default; position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; font-size: 14px; }
.popup-edit { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.popup-edit #puPreview { width: 180px; flex: none; }
@media (max-width: 640px) { .popup-edit { flex-direction: column; } .popup-edit #puPreview { width: 100%; max-width: 260px; } }
.banner-edit-preview { max-width: 520px; margin: 0 auto 18px; border-radius: 12px; overflow: hidden; }
.image-drop { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 12px; display: flex; align-items: center; gap: 12px; }
.image-drop img { width: 120px; aspect-ratio: 2.2 / 1; object-fit: cover; border-radius: 6px; background: var(--bg-hover); }

/* ── Permission matrix ────────────────────────────────────────────────────── */
.matrix td, .matrix th { text-align: center; }
.matrix th { white-space: normal; min-width: 104px; vertical-align: bottom; line-height: 1.3; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.yes { color: var(--green); font-weight: 900; }
.no { color: var(--text-3); }

/* ── Toasts ───────────────────────────────────────────────────────────────── */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  background: var(--bg-elev); border: 1px solid var(--border); border-left: 4px solid var(--teal);
  border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow-modal); font-size: 13px;
  animation: rise .18s var(--ease);
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--amber); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-modal); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(2, 6, 18, .55); z-index: 55; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
}

@media (max-width: 640px) {
  .topbar { padding: 12px 14px; }
  .topbar-title p { display: none; }
  .topbar-title h1 { font-size: 17px; }
  .content { padding: 16px 14px 40px; }
  .detail-grid, .field-row { grid-template-columns: 1fr; }
  .search { max-width: none; min-width: 0; width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 12px 14px; }
  .metric-sub { display: none; }
  .metric-value { font-size: 26px; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; min-height: 100%; }
  .hide-sm { display: none !important; }
}

/* Doggy Ji chat: support conversation and promotion preview */
.support-log { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.support-msg { max-width: 80%; border-radius: 14px; padding: 8px 12px; background: var(--bg-hover); }
.support-msg.staff { align-self: flex-end; background: var(--teal-soft); }
.support-meta { font-size: 11px; color: var(--text-3); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.support-body { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.promo-preview { background: var(--bg-input); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); max-width: 360px; }
.promo-preview img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.promo-pad { padding: 12px 14px; }
.promo-tag { font-size: 11px; font-weight: 700; color: var(--teal); margin-bottom: 4px; }
.promo-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; color: var(--teal); }
.promo-btn { background: var(--teal); color: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 700; }
.product-picks { display: grid; gap: 6px; margin-top: 8px; }
.product-pick { display: flex; gap: 10px; align-items: center; text-align: left; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; cursor: pointer; color: var(--text); }
.product-pick:hover { background: var(--bg-hover); }
.product-pick img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.product-pick > span { display: flex; flex-direction: column; min-width: 0; }
.modal-foot .grow { flex: 1; }
