/* Inaya & Arya Dashboard — v6 static frontend (example data)
   Owner: dashboard design system. No real-account wiring. */

:root {
  --bg: #f4f3f9;
  --bg-top: #efeafb;
  --surface: #ffffff;
  --surface-2: #faf9fd;
  --surface-3: #f6f5fb;
  --ink: #1f1d2b;
  --muted: #7a7790;
  --faint: #9a97ad;
  --line: #efeaf9;
  --line-2: #e7e4f2;
  --purple: #7c3aed;
  --purple-2: #8b5cf6;
  --purple-soft: #f3e8ff;
  --pink: #ec4899;
  --pink-soft: #fce7f3;
  --gradient: linear-gradient(90deg, #8b5cf6, #ec4899);
  --gradient-135: linear-gradient(135deg, #8b5cf6, #ec4899);
  --shadow: 0 6px 24px rgba(60, 40, 120, 0.06);
  --shadow-lg: 0 16px 40px rgba(60, 40, 120, 0.10);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 11px;
  --header-h: auto;
  --ok: #15803d;
  --ok-bg: #e9f8ef;
  --ok-line: #bfe9cf;
  --warn-bg: #fff8dd;
  --warn-ink: #854d0e;
  --warn-line: #fde68a;
  --info-bg: #eff6ff;
  --info-ink: #1d4ed8;
  --danger: #be123c;
  --danger-bg: #ffe4e6;
  --pending: #e11d48;
  --font: "Inter", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --mono: "ui-monospace", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #12111a;
  --bg-top: #1a1626;
  --surface: #1c1a27;
  --surface-2: #23212f;
  --surface-3: #2a2736;
  --ink: #f4f2fb;
  --muted: #a8a5b8;
  --faint: #8b889c;
  --line: #2c2a3a;
  --line-2: #3a374a;
  --purple-soft: #2a1f46;
  --pink-soft: #3a1d32;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45);
  --ok-bg: #16351f;
  --ok-line: #1f6b3a;
  --warn-bg: #3a3114;
  --warn-ink: #fde68a;
  --warn-line: #6b5420;
  --info-bg: #1a2744;
  --info-ink: #93c5fd;
  --danger-bg: #3f1520;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 280px);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--purple); }
code, .mono { font-family: var(--mono); }

.app { max-width: 1440px; margin: 0 auto; padding: 18px 20px 80px; }

/* ========== Header ========== */
.topbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 16px 18px 14px;
  position: sticky;
  top: 10px;
  z-index: 40;
  backdrop-filter: blur(12px);
}
.topbar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--gradient-135);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}
.brand h1 {
  font-size: 22px; font-weight: 750; letter-spacing: -0.03em;
  white-space: nowrap;
}
.ex-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ffe4ef;
  color: #be185d;
  border: 1px solid #ffc2d6;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  white-space: nowrap;
}
[data-theme="dark"] .ex-badge {
  background: #3a1d2c; color: #fda4af; border-color: #6b2340;
}
.topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
}
.theme-label { font-size: 12px; color: var(--muted); }
.theme-toggle {
  display: flex; align-items: center;
  height: 38px; padding: 3px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  gap: 2px;
}
.theme-toggle button {
  width: 36px; height: 30px; border-radius: 9px;
  font-size: 15px; color: var(--muted);
  display: grid; place-items: center;
}
.theme-toggle button.on {
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 700;
}

/* Tabs */
.tabs {
  display: flex; flex-wrap: nowrap; gap: 5px;
  margin-top: 14px; align-items: center;
  overflow-x: auto;
}
.tab {
  height: 32px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 550; color: #3d3a50;
  flex: none;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
[data-theme="dark"] .tab { color: var(--ink); }
.tab:hover { border-color: #d4c8f5; }
.tab.on {
  background: var(--purple);
  color: #fff;
  border-color: transparent;
  font-weight: 650;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28);
}
.tabs .divider {
  width: 1px; height: 22px; background: #ddd6fe; margin: 0 4px; flex: none;
}
[data-theme="dark"] .tabs .divider { background: #3a374a; }
.tab.tint {
  background: #f8eefe;
  border-color: #f1d4fb;
  color: #6d28d9;
}
[data-theme="dark"] .tab.tint {
  background: #2a1f3a;
  border-color: #4c2a5a;
  color: #e9d5ff;
}
.tab.tint.on {
  background: var(--purple);
  color: #fff;
  border-color: transparent;
}

/* ========== Account area ========== */
.account-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  margin-top: 14px;
}
.account-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-row .lbl { font-size: 13px; font-weight: 650; color: var(--ink); }
.chip {
  height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 550; color: var(--ink);
}
.chip.on {
  background: var(--purple);
  color: #fff;
  border-color: transparent;
  font-weight: 650;
}
.help {
  margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.5;
}
.summary-label {
  margin-top: 12px; font-size: 13px; font-weight: 650;
}
.summary-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-top: 8px;
}
.acct-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 96px;
  transition: border-color .15s, box-shadow .15s;
}
.acct-card:hover { border-color: #d4c8f5; box-shadow: var(--shadow); }
.acct-card.on { border-color: #c4b5fd; box-shadow: 0 0 0 3px rgba(139,92,246,.12); }
.acct-card .name {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px;
}
.acct-card .counts { margin-top: 6px; font-size: 13px; }
.acct-card .src { margin-top: 4px; font-size: 11px; color: var(--faint); line-height: 1.4; }
.ig-badge, .fb-badge {
  width: 18px; height: 18px; border-radius: 6px;
  display: inline-grid; place-items: center;
  color: #fff; font-size: 10px; font-weight: 800; flex: none;
}
.ig-badge { background: var(--gradient-135); }
.fb-badge { background: #1877f2; font-size: 11px; }
.c-pending { color: #e11d48; font-weight: 700; }
.c-approved { color: var(--purple); font-weight: 700; }
.c-posted { color: var(--ink); font-weight: 700; }

/* ========== Shared panels ========== */
.page { margin-top: 18px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h2 { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.sub { font-size: 13px; color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--purple-soft); color: var(--purple);
}
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.global { background: #f3e8ff; color: #6d28d9; }
[data-theme="dark"] .pill.global { background: var(--purple-soft); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.panel + .panel, .stack > * + * { margin-top: 14px; }

.stat-grid { display: grid; gap: 10px; }
.stat-grid.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stat-grid.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.stat-grid.g6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.stat-grid.g12 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat .num { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; }
.stat .num.ok { color: #16a34a; }
.stat .num.danger { color: #e11d48; }
.stat .num.purple { color: var(--purple); }
.stat .k { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 550; }

/* ========== Buttons & fields ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 11px;
  font-size: 13px; font-weight: 650;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}
.btn:hover { border-color: #c4b5fd; }
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible, .acct-card:focus-visible {
  outline: 2px solid var(--purple-2); outline-offset: 2px;
}
.btn.primary {
  background: var(--gradient);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(139,92,246,.25);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger-ghost {
  background: #fff1f2; color: #be123c; border-color: #fecdd3;
}
[data-theme="dark"] .btn.danger-ghost { background: var(--danger-bg); color: #fda4af; border-color: #6b2340; }
.btn.ghost { background: var(--surface-3); }
.btn.black {
  background: #171717; color: #fff; border-color: transparent; width: 100%;
  height: 40px; border-radius: 12px;
}
[data-theme="dark"] .btn.black { background: #0a0a0a; border: 1px solid #3f3f46; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 9px; }
.btn-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.field, .select, textarea, input[type="text"], input[type="email"], input[type="url"],
input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"] {
  height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface);
  font-size: 13px; width: 100%; color: var(--ink);
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 70px; }
.select, select.field { appearance: auto; }
.field:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(139,92,246,.35); border-color: #c4b5fd;
}
.flabel {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.file-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-3);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.file-btn input { display: none; }
.file-name { color: var(--muted); font-weight: 500; font-size: 12px; }

/* The 3-button row — IDENTICAL size & position on every product card */
.action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  flex: none;
  margin-top: 10px;
}
.action-row > * {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  width: 100%;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 0;
  line-height: 1;
}
.action-row .store-amazon { background: #232f3e; color: #fff; }
.action-row .store-myntra { background: #ff3f6c; color: #fff; }
.action-row .store-flipkart { background: #2f6fe4; color: #fff; }
.action-row .store-ajio { background: #111827; color: #fff; }
.action-row .save-btn, .action-row .copy-btn, .action-row .view-btn {
  background: var(--gradient);
  color: #fff;
}
.action-row .st-pending {
  background: #f3f1f6; color: #5c5970; font-weight: 600;
}
.action-row .st-approved {
  background: #f3e8ff; color: #6d28d9; font-weight: 600;
}
.action-row .st-posted, .action-row .st-instock {
  background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line) !important; font-weight: 600;
}
.action-row .st-out {
  background: var(--danger-bg); color: var(--danger); font-weight: 600;
}
.action-row .st-unknown, .action-row .st-unused {
  background: #f3f1f6; color: #5c5970; font-weight: 600;
}
[data-theme="dark"] .action-row .st-pending,
[data-theme="dark"] .action-row .st-unknown,
[data-theme="dark"] .action-row .st-unused { background: var(--surface-3); color: var(--muted); }

.dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: currentColor; opacity: .7;
}
.action-row .st-pending .dot { background: #9a97ad; opacity: 1; }
.action-row .st-posted .dot, .action-row .st-instock .dot { background: #22c55e; opacity: 1; }
.action-row .st-approved .dot { background: #8b5cf6; opacity: 1; }
.action-row .st-out .dot { background: #e11d48; opacity: 1; }
.action-row .st-unknown .dot { background: #9a97ad; opacity: 1; }

.store-ico { width: 16px; height: 16px; flex: none; }

/* ========== Product cards ========== */
.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.cards-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }

.pcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex; flex-direction: column; min-width: 0;
}
.pcard-top { display: flex; gap: 12px; min-width: 0; }
.pcard-top img, .thumb {
  width: 92px; height: 92px; object-fit: cover; border-radius: 14px; flex: none;
  background: var(--surface-3);
}
.pcard-info { flex: 1; min-width: 0; }
.pcard-info h3 { font-size: 15px; font-weight: 700; line-height: 1.25; }
.who {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px;
}
.tag {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.tag.inaya { background: #fce7f3; color: #be185d; }
.tag.arya { background: #dbeafe; color: #1d4ed8; }
.tag.pending { background: #f3f1f6; color: #57534e; }
.tag.approved { background: #f3e8ff; color: #6d28d9; }
.tag.posted { background: var(--ok-bg); color: var(--ok); }
.tag.unused { background: #f4f4f5; color: #52525b; }
.tag.cat { background: #f3e8ff; color: #6d28d9; }
[data-theme="dark"] .tag.inaya { background: #3a1d32; color: #fda4af; }
[data-theme="dark"] .tag.arya { background: #1e3a5f; color: #93c5fd; }
.meta-line { font-size: 13px; margin-top: 4px; }
.meta-line .est { color: var(--pink); font-weight: 700; }
.price-line { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.src-line, .hook-line { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hook-line { color: var(--ink); }

.aff-row { margin-top: 10px; }
.aff-lab {
  font-size: 10px; font-weight: 750; letter-spacing: .05em;
  color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.aff-lab .oktick { color: #16a34a; }
.aff-controls { display: flex; gap: 6px; align-items: center; }
.aff-controls input { flex: 1; min-width: 0; height: 34px; font-size: 12px; }
.sel-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px;
}
.pub-strip {
  margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 12px;
}
.pub-ig, .pub-fb {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--ok-bg); color: var(--ok);
  border: 1px solid var(--ok-line);
  border-radius: 999px; padding: 4px 10px;
}
.pub-strip a { font-weight: 700; }
.btn.remove-ind {
  height: 26px; padding: 0 8px; font-size: 11px; border-radius: 999px;
  background: #fff1f2; color: #be123c; border: 1px solid #fecdd3;
}

.metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted);
}
.metrics b { display: block; color: var(--ink); font-size: 14px; }

/* Options panel */
.options-panel { margin-top: 16px; }
.options-grid { display: grid; grid-template-columns: 1fr 1.2fr 1.4fr; gap: 16px; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.opt-chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line-2); color: var(--ink);
}
.opt-chip.on { background: #f3e8ff; border-color: #c4b5fd; color: #6d28d9; font-weight: 650; }

/* Research strip */
.research {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 12.5px; color: var(--muted); margin-bottom: 8px;
}
.research b { color: var(--ink); font-weight: 650; }

/* Week / top */
.type-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; margin-right: 6px;
}
.type-chip.clothing { background: #fce7f3; color: #be185d; }
.type-chip.jewellery { background: #f3e8ff; color: #6d28d9; }
.type-chip.beauty { background: #dbeafe; color: #1d4ed8; }
.banner-warn {
  background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid var(--warn-line);
  border-radius: 12px; padding: 10px 14px; font-size: 13.5px;
}
.banner-info {
  background: #fff7ed; color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 12px; padding: 8px 12px; font-size: 13px;
}
[data-theme="dark"] .banner-info { background: #3a2a14; color: #fdba74; border-color: #6b4a20; }
.banner-blue {
  background: var(--info-bg); color: var(--info-ink);
  border: 1px solid #bfdbfe;
  border-radius: 12px; padding: 10px 14px; font-size: 13px;
}
[data-theme="dark"] .banner-blue { border-color: #1e3a5f; }

/* Automation */
.wf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.wf {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.wf-ok, .wf-off {
  font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.wf-ok { color: var(--ok); }
.wf-off { color: var(--muted); }
.wf-ok::before, .wf-off::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
}
.wf-off::before { background: #d4d4d8; }

/* Facebook feed */
.fb-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; font-size: 12px; }
.fb-card { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.fb-card h3 { font-size: 14px; }
.progress { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.progress .done { color: var(--purple); font-weight: 700; }
.thumbs-8 { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.thumbs-8 img { width: 52px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }

/* Overview */
.seg { display: flex; gap: 4px; background: var(--surface-3); padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); }
.seg button { height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--purple); color: #fff; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
}
.toggle .sw {
  width: 36px; height: 20px; border-radius: 999px; background: #d4d4d8; position: relative; flex: none;
}
.toggle .sw::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  position: absolute; top: 2px; left: 2px; transition: left .15s;
}
.toggle.on .sw { background: var(--purple-2); }
.toggle.on .sw::after { left: 18px; }
.ov-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.plat { display: flex; flex-wrap: wrap; gap: 6px; }
.ov-card { padding: 16px 18px; }
.ov-card .hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ov-card .hd h3 { font-size: 15px; flex: 1; }
.health { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.health.green { background: #22c55e; }
.health.amber { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.18); }
.health.gray { background: #a1a1aa; box-shadow: 0 0 0 4px rgba(161,161,170,.18); }
.ov-metrics { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.ov-metrics.yt { grid-template-columns: repeat(7, minmax(0,1fr)); }
.ov-m .k { font-size: 11px; color: var(--muted); text-transform: lowercase; }
.ov-m .v { font-size: 20px; font-weight: 750; letter-spacing: -0.03em; }
.delta.up { color: #16a34a; font-size: 11px; font-weight: 700; }
.delta.down { color: #e11d48; font-size: 11px; font-weight: 700; }
.sample { font-size: 10px; font-weight: 700; background: #ffedd5; color: #9a3412; padding: 1px 6px; border-radius: 6px; }

/* Schedule */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-toolbar .grow { margin-left: auto; font-size: 12px; color: var(--muted); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.cal .dow { font-size: 11px; color: var(--muted); font-weight: 650; padding: 4px 6px; }
.cal .day {
  min-height: 86px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 8px; font-size: 12px; text-align: left; color: var(--ink);
}
.cal .day.out { color: var(--faint); background: transparent; }
.cal .day.today { border: 2px solid var(--purple); background: #faf5ff; }
[data-theme="dark"] .cal .day.today { background: #2a1f46; }
.cal-ev {
  margin-top: 4px; font-size: 10.5px; font-weight: 650; padding: 3px 6px;
  border-radius: 6px; background: #f3e8ff; color: #6d28d9;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; }
.week-col {
  min-height: 140px; border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  background: var(--surface-2);
}
.week-col.today { border: 2px solid var(--purple); }
.week-col .d { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.list-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Post management */
.pm-card h3 { display: flex; align-items: center; gap: 8px; }
.pm-badges { margin-left: auto; display: flex; gap: 6px; }
.desc { font-size: 12px; color: var(--muted); margin: 8px 0; line-height: 1.5; }
.lock { font-size: 12.5px; color: var(--muted); background: var(--surface-3); border-radius: 10px; padding: 8px 10px; }

/* Affiliate catalog */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.cat-chip {
  text-align: left; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 13px;
}
.cat-chip b { display: block; font-size: 13px; }
.cat-chip span { font-size: 11px; color: #16a34a; font-weight: 650; }
.cat-chip.on { border-color: var(--purple); background: #faf5ff; box-shadow: 0 0 0 2px rgba(139,92,246,.15); }
[data-theme="dark"] .cat-chip.on { background: #2a1f46; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .search { flex: 1; min-width: 180px; }
.group-title { font-size: 15px; font-weight: 750; margin: 16px 0 8px; }
.group-title span { font-weight: 500; color: var(--muted); font-size: 13px; }

/* Carousel */
.photo-row { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; }
.photo-slot {
  position: relative; width: 110px; height: 110px; flex: none;
  border-radius: 12px; overflow: hidden; background: var(--surface-3);
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .n {
  position: absolute; top: 6px; left: 6px; background: #fff; color: #111;
  width: 18px; height: 18px; border-radius: 50%; font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
}
.tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.tpl {
  border: 2px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--surface); text-align: left; padding: 0; color: inherit;
}
.tpl.on { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,92,246,.2); }
.tpl-art {
  height: 130px; display: grid; place-items: center; position: relative;
  padding: 16px;
}
.tpl-art img {
  width: 70px; height: 88px; object-fit: cover; border-radius: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,.15); background: #fff; padding: 3px;
}
.tpl-art .tt {
  position: absolute; top: 10px; left: 0; right: 0; text-align: center;
  font-size: 12px; font-weight: 700;
}
.tpl figcaption { padding: 8px 10px 10px; font-size: 12px; }
.tpl figcaption b { display: block; }
.tpl figcaption span { color: var(--muted); font-size: 11px; }
.preview-row { display: flex; gap: 10px; overflow-x: auto; padding: 8px 0; }
.slide {
  width: 120px; flex: none; background: #fff7ed; border-radius: 10px; padding: 8px;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .slide { background: #2a2419; }
.slide img { width: 100%; height: 130px; object-fit: cover; border-radius: 4px; background: #fff; padding: 3px; }

/* Caption preview result */
.preview-box {
  margin-top: 12px; background: var(--surface-3); border-radius: 12px;
  padding: 12px 14px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.55;
}

/* Disclosure */
details.disc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
details.disc summary { cursor: pointer; font-weight: 650; font-size: 13px; }
details.disc .inner { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ========== Modal & toasts ========== */
.modal-back {
  position: fixed; inset: 0; background: rgba(20,16,35,.45);
  z-index: 80; display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--surface); color: var(--ink);
  border-radius: 20px; box-shadow: var(--shadow-lg);
  width: min(640px, 100%); max-height: min(86vh, 800px);
  overflow: auto; padding: 20px 22px;
}
.modal h3 { font-size: 18px; margin-bottom: 10px; }
.modal-x { float: right; width: 32px; height: 32px; border-radius: 8px; background: var(--surface-3); font-size: 16px; }

#toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px));
}
.toast {
  background: #1f1d2b; color: #fff; border-radius: 12px;
  padding: 10px 14px; font-size: 13px; box-shadow: var(--shadow-lg);
  animation: pop .2s ease;
}
[data-theme="dark"] .toast { background: #f4f2fb; color: #1f1d2b; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.empty { color: var(--muted); font-size: 13px; padding: 12px 0; }

/* Global example flag in header already; tiny corner flag on pages */
.ex-tiny { font-size: 11px; color: var(--faint); }

/* Mobile */
@media (max-width: 1100px) {
  .cards-3, .cards-4, .tpl-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .summary-grid { grid-template-columns: 1fr; }
  .stat-grid.g6, .stat-grid.g12, .stat-grid.g5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .ov-metrics, .ov-metrics.yt { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .wf-grid, .form-grid, .options-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr; }
  .cal .day { min-height: 64px; }
}
@media (max-width: 720px) {
  .app { padding: 10px 10px 80px; }
  .brand h1 { font-size: 18px; }
  .topbar { position: static; }
  .cards-3, .cards-4, .cards-2, .tpl-grid { grid-template-columns: 1fr; }
  .stat-grid.g3, .stat-grid.g6, .stat-grid.g12, .stat-grid.g5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sel-row, .action-row { gap: 8px; }
  .action-row > * { font-size: 12px; padding: 0 4px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .tabs .divider { display: none; }
  .pcard-top img, .thumb { width: 76px; height: 76px; }
  .ov-metrics, .ov-metrics.yt { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
