:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e4e6ec;
  --text: #171923;
  --muted: #6b7180;
  --accent: #d6246e;
  --accent-soft: #fde7f0;
  --side: #14151b;
  --side-text: #a3a8b8;
  --green: #15803d; --green-bg: #dcfce7;
  --red: #b91c1c; --red-bg: #fee2e2;
  --amber: #a16207; --amber-bg: #fef3c7;
  --blue: #1d4ed8; --blue-bg: #dbeafe;
  --teal: #0f766e; --teal-bg: #ccfbf1;
  --gray: #4b5563; --gray-bg: #eceef2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f13; --surface: #16181e; --surface-2: #1b1d24; --line: #262933; --text: #e8eaf0; --muted: #8a90a0;
    --accent: #ff4d8d; --accent-soft: #3a1526; --side: #0a0b0e;
    --green: #86efac; --green-bg: #12321f; --red: #fca5a5; --red-bg: #3b1515; --amber: #fcd34d; --amber-bg: #3a2c0b;
    --blue: #93c5fd; --blue-bg: #13274a; --teal: #5eead4; --teal-bg: #0d302c; --gray: #b4b9c6; --gray-bg: #23262f;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; display: flex; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* sidebar */
.sidebar { width: 232px; flex-shrink: 0; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand b { color: #fff; display: block; font-size: 15px; }
.brand small { font-size: 12px; }
.logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; }
.sidebar nav a:hover { background: #1f2129; color: #fff; text-decoration: none; }
.sidebar nav a.active { background: #262833; color: #fff; }
.sidebar nav svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.sidebar .logout { margin-top: auto; color: var(--side-text); font-size: 13px; padding: 8px 10px; }
.nav-toggle, .burger, .nav-backdrop { display: none; }

main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 700; }
.topbar .auto { margin-left: auto; font-size: 12px; color: var(--muted); }
.content { padding: 24px 28px 48px; max-width: 1500px; }

/* cards & grid */
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 20px; }
.two { grid-template-columns: 1.4fr 1fr; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card > .head h2 { font-size: 15px; margin: 0; font-weight: 600; }
.card > .head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card > .body { padding: 18px; }
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat.accent .value { color: var(--accent); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .muted, .muted { color: var(--muted); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.clip { max-width: 260px; overflow-wrap: break-word; word-break: break-word; }
.comment { font-style: italic; max-width: 280px; }
.empty { padding: 36px; text-align: center; color: var(--muted); }

/* badges */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--gray-bg); color: var(--gray); white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.teal { background: var(--teal-bg); color: var(--teal); }
.badge.pink { background: var(--accent-soft); color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; margin-right: 6px; vertical-align: middle; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }

/* forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 5px; }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=url], input[type=time], input[type=datetime-local], input[type=email], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field { margin-bottom: 14px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: 14px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filters .f { flex: 0 1 150px; min-width: 120px; }
.filters .f.grow { flex: 1 1 240px; }
.filters input, .filters select { height: 38px; padding-top: 0; padding-bottom: 0; }
.bulk { display: flex; gap: 8px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.status-select { padding: 4px 8px; font-size: 12px; width: auto; }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 18px; background: var(--green-bg); color: var(--green); font-weight: 500; }
.flash.err { background: var(--red-bg); color: var(--red); }
.note { padding: 12px 14px; border-radius: 8px; background: var(--blue-bg); color: var(--blue); font-size: 13px; margin-bottom: 16px; }
.key { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 3px 7px; border-radius: 6px; }

/* bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.bars .stack { width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 0 0; overflow: hidden; }
.bars .s { background: #8b93a7; }
.bars .y { background: var(--accent); }
.bars .lbl { font-size: 10px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.progress { height: 6px; background: var(--gray-bg); border-radius: 4px; overflow: hidden; min-width: 90px; margin-top: 4px; }
.progress span { display: block; height: 100%; background: var(--accent); }

.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { padding: 8px 18px; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; gap: 10px; }
.log-list li:last-child { border-bottom: 0; }
.log-list time { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 70px; }
.pager { display: flex; gap: 6px; padding: 12px 18px; align-items: center; border-top: 1px solid var(--line); }

details.notes summary { cursor: pointer; color: var(--muted); font-size: 12px; }
details.notes textarea { min-height: 60px; margin: 6px 0; font-size: 13px; }

/* leads: lists column */
.leads-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.leads-main { display: grid; gap: 16px; min-width: 0; }
.lists { position: sticky; top: 84px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.lists nav { overflow-y: auto; padding: 6px; }
.lists nav a { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 10px; border-radius: 8px; color: var(--text); }
.lists nav a:hover { background: var(--surface-2); text-decoration: none; }
.lists nav a.active { background: var(--accent-soft); }
.lists nav a.active .ln { color: var(--accent); }
.lists .ln { font-weight: 600; font-size: 13px; overflow-wrap: break-word; min-width: 0; }
.lists .lc { font-size: 12px; color: var(--muted); font-weight: 600; }
.lists .lm { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.lists .lm .badge { font-size: 10px; padding: 1px 6px; }
.list-head .lh-top { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.list-head .lh-top > div:first-child { flex: 1 1 300px; min-width: 0; }
.list-head .rename { display: block; }
.list-head .rename input { border: 1px solid transparent; background: transparent; font-size: 20px; font-weight: 700; padding: 2px 6px; margin: 4px 0 0 -7px; width: 100%; }
.list-head .rename input:hover { border-color: var(--line); }
.list-head .rename input:focus { background: var(--surface); }
.lh-stats { display: flex; gap: 28px; margin-top: 12px; flex-wrap: wrap; }
.lh-stats b { font-size: 20px; display: block; }
.lh-stats span { font-size: 12px; color: var(--muted); }
.list-tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.list-tags a { font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); padding: 0 7px; border-radius: 10px; }
.list-tags a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 1100px) {
  .leads-layout { grid-template-columns: 1fr; }
  .lists { position: static; max-height: 300px; }
}

/* multi-user additions */
.area-admin .sidebar { background: #0f1a2b; }
.area-admin .sidebar nav a.active { background: #1c2c45; }
.area-admin .logo { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.sidebar nav a .count { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.plan-chip { display: flex; align-items: center; gap: 8px; margin: -6px 4px 16px; padding: 8px 10px; border-radius: 8px; background: #1f2129; color: #fff; font-size: 13px; font-weight: 600; }
.plan-chip:hover { text-decoration: none; background: #262833; }
.plan-chip svg { width: 16px; height: 16px; fill: #fbbf24; }
.plan-chip em { margin-left: auto; font-style: normal; font-size: 11px; color: #fff; background: var(--accent); padding: 1px 8px; border-radius: 10px; }
.side-foot { margin-top: auto; padding: 8px 10px 0; border-top: 1px solid #23252e; }
.side-foot .who { color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { display: block; color: var(--side-text); font-weight: 400; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.side-foot .logout { margin: 0; padding: 8px 0 0; display: block; }
.impersonate { background: #fef3c7; color: #92400e; padding: 9px 28px; font-size: 13px; }
.impersonate a { color: #92400e; font-weight: 700; text-decoration: underline; }
.note.warn { background: var(--amber-bg); color: var(--amber); }
.usage { margin-bottom: 12px; }
.usage .ul { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.usage .ul span { color: var(--muted); }
.usage.warn .progress span { background: #f59e0b; }
.locked { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 500; margin-bottom: 16px; }
.locked svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.locked a { margin-left: auto; font-weight: 700; }
.is-locked { opacity: .55; pointer-events: none; filter: grayscale(.4); }
.premium-tag { font-size: 10px; font-weight: 700; background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 10px; margin-left: 6px; vertical-align: 1px; }
.getting-started { margin-bottom: 16px; border-color: var(--accent); }
.getting-started h2 { margin: 0 0 8px; font-size: 16px; }
.getting-started ol { margin: 0; padding-left: 20px; line-height: 2.1; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; align-items: start; }
.plan.current { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.plan .plan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan h2 { margin: 0; font-size: 18px; }
.plan .price { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.plan .feat { list-style: none; padding: 0; margin: 14px 0 16px; font-size: 13px; }
.plan .feat li { padding: 5px 0 5px 24px; position: relative; border-top: 1px solid var(--line); }
.plan .feat li::before { content: '•'; position: absolute; left: 6px; color: var(--muted); }
.plan .feat li.yes::before { content: '✓'; color: var(--green); font-weight: 700; left: 4px; }
.plan .feat li.no { color: var(--muted); text-decoration: line-through; }
.plan .feat li.no::before { content: '✕'; left: 5px; }
.plan details.req summary { list-style: none; justify-content: center; }
.plan details.req summary::-webkit-details-marker { display: none; }
.plan details.req[open] summary { display: none; }
.btn.block { width: 100%; justify-content: center; }
.crumbs { margin-bottom: 12px; font-size: 13px; }
.user-head .uh-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sub-h { font-size: 13px; margin: 14px 0 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.req-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.danger-zone { border-color: var(--red-bg); }
.login-box.wide { max-width: 760px; }
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: 13px; }
.legal-links { margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted); }
.legal h2 { font-size: 16px; margin: 22px 0 6px; }
.legal p, .legal li { line-height: 1.65; }

.switch-area { display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 0 10px; margin: 14px 2px 0; padding: 10px; border-radius: 8px; border: 1px dashed #3b3f4c; color: #fff; font-weight: 600; font-size: 13px; }
.switch-area:hover { background: #1f2129; text-decoration: none; }
.switch-area svg { width: 18px; height: 18px; fill: #93c5fd; grid-row: span 2; }
.switch-area small { grid-column: 2; color: var(--side-text); font-weight: 400; font-size: 11px; }
.plan-edit { display: flex; gap: 4px; align-items: center; margin-bottom: 3px; }
.bulk .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.pay-method { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; background: var(--surface-2); }
.pm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pm-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line); font-size: 13px; }
.pm-row span { color: var(--muted); }
.pm-row b { overflow-wrap: anywhere; }

/* Buyer / Seller / Spam marks */
.marks { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
td.lead-cell { min-width: 200px; }
.mark { white-space: nowrap; }
.mark { font: 600 11px Inter, system-ui, sans-serif; padding: 2px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.mark:hover { color: var(--text); border-color: var(--muted); }
.mark.buyer.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.mark.seller.on { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
.mark.spam.on { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.activity-feed li { align-items: flex-start; }
.activity-feed time { min-width: 80px; }


/* ---------- checkout ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.co-main { display: grid; gap: 16px; min-width: 0; }
.co-summary { position: sticky; top: 84px; }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; margin-right: 6px; vertical-align: 1px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.opt { position: relative; cursor: pointer; margin: 0; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-box { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 400; height: 100%; }
.opt-box b { font-size: 14px; }
.opt input:checked + .opt-box { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.opt input:focus-visible + .opt-box { outline: 2px solid var(--accent); }
.opt .save { align-self: flex-start; margin-top: 4px; font-size: 11px; font-weight: 700; background: var(--green-bg); color: var(--green); padding: 1px 8px; border-radius: 10px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { flex: 1; margin: 0; cursor: pointer; }
.tab input { position: absolute; opacity: 0; pointer-events: none; }
.tab span { display: block; text-align: center; padding: 8px 10px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); }
.tab input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pay-details { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); }
.send-amount { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; margin-bottom: 8px; }
.send-amount b { font-size: 22px; color: var(--accent); }
.usdt { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.qr { background: #fff; padding: 8px; border-radius: 8px; line-height: 0; }
.qr:empty { display: none; }
.usdt-info { flex: 1; min-width: 220px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--line); border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); font-weight: 400; cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop input { max-width: 100%; }
.drop img { max-height: 180px; max-width: 100%; border-radius: 8px; }
.req { color: var(--red); }
.sum-row, .sum-total { display: flex; justify-content: space-between; padding: 6px 0; }
.sum-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 18px; }
.sum-total b { color: var(--accent); }
.plan .price small { font-size: 14px; font-weight: 500; color: var(--muted); }

/* ---------- invoices & orders ---------- */
.invoice { max-width: 860px; }
.inv-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.inv-brand { padding: 0; color: var(--text); }
.inv-brand b { color: var(--text); }
.inv-meta { text-align: right; }
.inv-meta h2 { margin: 0 0 6px; }
.inv-to { margin: 16px 0; display: flex; flex-direction: column; }
.inv-table td, .inv-table th { padding: 10px 12px; }
.inv-total td { font-weight: 700; font-size: 16px; border-top: 2px solid var(--text); }
.proof-thumb { display: block; max-width: 100%; max-height: 260px; border-radius: 8px; border: 1px solid var(--line); margin-top: 6px; }
.orders { display: grid; }
.order { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.order:last-child { border-bottom: 0; }
.order-proof img { width: 100%; max-height: 320px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.order-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.order-amount { font-size: 24px; font-weight: 700; margin: 4px 0; }
.order-actions { display: grid; gap: 8px; margin-top: 12px; }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.inline-form input[type=text] { flex: 1; min-width: 180px; width: auto; }
tr.unread td { background: var(--accent-soft); }

/* ---------- complaints ---------- */
.ticket-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.steps { display: flex; list-style: none; margin: 0; padding: 0; gap: 0; counter-reset: s; }
.steps li { position: relative; padding: 0 18px 0 30px; font-size: 12px; font-weight: 600; color: var(--muted); counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-bg); color: var(--muted); font-size: 11px; }
.steps li.done { color: var(--text); }
.steps li.done::before { content: '✓'; background: var(--green-bg); color: var(--green); }
.steps li.now::before { background: var(--accent); color: #fff; content: counter(s); }
.thread { display: grid; gap: 12px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.msg.mine { justify-self: end; background: var(--accent-soft); border-color: transparent; }
.msg.from-admin:not(.mine) { background: var(--blue-bg); border-color: transparent; }
.msg-head { display: flex; gap: 8px; align-items: baseline; font-size: 12px; margin-bottom: 4px; }
.msg-body { white-space: normal; overflow-wrap: anywhere; }
.msg-img { display: block; max-width: 260px; max-height: 220px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); }

@media (max-width: 980px) {
  .checkout { grid-template-columns: 1fr; }
  .co-summary { position: static; order: -1; }
  .order { grid-template-columns: 1fr; }
  .msg { max-width: 100%; }
}
@media print {
  .sidebar, .topbar, .nav-backdrop, .no-print, .impersonate, .flash { display: none !important; }
  body { background: #fff; display: block; }
  .content { padding: 0; }
  .card { border: 0; box-shadow: none; }
}

/* login */
.login-page { display: grid; place-items: center; width: 100%; padding: 20px; }
.login-box { width: 100%; max-width: 380px; padding: 28px; }
.login-box .brand { color: var(--text); padding: 0 0 20px; }
.login-box .brand b { color: var(--text); }

@media (max-width: 980px) { .two { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 20; }
  .burger { display: flex; flex-direction: column; gap: 4px; cursor: pointer; padding: 4px; }
  .burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; }
  .topbar { padding: 14px 16px; }
  .content { padding: 16px 16px 40px; }
}

/* no-reload marks */
tr[data-lead].busy .marks { opacity: .5; pointer-events: none; }
tr[data-lead].gone { opacity: .35; }
tr[data-lead].gone td { text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #1f2330; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 99; display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.err { background: #b42318; }
.toast button { background: none; border: 1px solid rgba(255,255,255,.5); color: #fff; border-radius: 6px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 13px; }

.speed-presets { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Auto Post ---------- */
.subtabs { display: flex; gap: 4px; margin: -4px 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subtabs a { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs a:hover { color: var(--text); text-decoration: none; }
.subtabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.pill-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pill-tabs a { padding: 5px 11px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 13px; }
.pill-tabs a.on { background: var(--accent-soft); color: var(--accent); }
.pill-tabs a:hover { text-decoration: none; color: var(--text); }
.stat .value small { font-size: 14px; color: var(--muted); font-weight: 500; }
.steps-list { margin: 8px 0 12px; padding-left: 20px; }
.steps-list li { margin: 6px 0; }
.steps-list li.done { color: var(--muted); text-decoration: line-through; }
.acc { display: flex; align-items: center; gap: 10px; }
.acc img, .acc-pic { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--gray-bg); flex-shrink: 0; }
.acc span small { display: block; color: var(--muted); font-size: 12px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.acc.pickable { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.acc.pickable:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.acc-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-pick { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 8px; cursor: pointer; font-weight: 500; }
.acc-pick img { width: 22px; height: 22px; border-radius: 50%; }
.acc-pick small { color: var(--muted); font-size: 11px; font-weight: 600; }
.acc-pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.acc-pick.off { opacity: .55; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg > label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; cursor: pointer; font-weight: 500; font-size: 13.5px; color: var(--text); margin: 0; }
.seg > label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.seg.seg-col { flex-direction: column; align-items: stretch; }
.seg.seg-col > label { flex-wrap: wrap; }
.seg.seg-col input[type=datetime-local] { width: auto; padding: 4px 8px; }
.seg.days > label { min-width: 54px; justify-content: center; }
.inline-check { display: inline-flex; gap: 4px; align-items: center; font-weight: 400; }
details.adv { margin: 6px 0 14px; }
details.adv summary { cursor: pointer; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.num-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; margin-right: 6px; vertical-align: 1px; }
.ai-status { margin-left: 8px; font-size: 13px; }
.ai-status.err, .err-text { color: var(--red); }
.ai-sample { margin-top: 14px; border: 1px dashed var(--line); border-radius: 10px; padding: 14px; background: var(--surface-2); }
.ai-sample p { margin: 6px 0; }
.ai-sample .tags { color: var(--blue); font-size: 13px; }
.over { color: var(--red) !important; font-weight: 600; }

.composer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.composer-main { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 16px; }
.preview-col { position: sticky; top: 16px; }
.media-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.media-grid .thumb { position: relative; width: 120px; height: 120px; border-radius: 10px; overflow: hidden; background: var(--gray-bg); border: 1px solid var(--line); }
.media-grid .thumb img, .media-grid .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-grid .thumb .n { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
.media-grid .thumb .vid { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; border-radius: 4px; padding: 1px 6px; }
.media-grid .thumb button { position: absolute; top: 5px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.media-grid .thumb .x { right: 5px; }
.media-grid .thumb .l { right: 33px; }
.empty-media { color: var(--muted); padding: 22px; border: 1px dashed var(--line); border-radius: 10px; width: 100%; text-align: center; }
.media-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ai-image { border-top: 1px solid var(--line); padding-top: 14px; }

.phone { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 14px 34px -18px rgba(0,0,0,.35); font-size: 13px; }
.ph-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.ph-av { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af) center / cover; }
.ph-media { background: var(--gray-bg); display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: hidden; }
.ph-media.shape-portrait { aspect-ratio: 4 / 5; }
.ph-media.shape-landscape { aspect-ratio: 1.91 / 1; }
.ph-media.shape-reel { aspect-ratio: 9 / 16; max-height: 520px; }
.ph-media img, .ph-media video { width: 100%; height: 100%; object-fit: cover; }
.ph-dots { display: flex; gap: 4px; justify-content: center; padding-top: 8px; }
.ph-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.ph-dots i.on { background: var(--blue); }
.ph-bar { padding: 8px 12px 2px; font-size: 16px; }
.ph-cap { padding: 4px 12px 14px; white-space: pre-wrap; word-break: break-word; }
.ph-tags { color: var(--blue); margin-top: 4px; }
.result-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.result-row:last-of-type { border-bottom: 0; }

.post-list { display: grid; }
.post-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: start; }
.post-row:first-child { border-top: 0; }
.pthumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--gray-bg); display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.pthumb img, .pthumb video { width: 100%; height: 100%; object-fit: cover; }
.pthumb i { position: absolute; right: 5px; top: 5px; background: rgba(0,0,0,.6); color: #fff; font-style: normal; font-size: 11px; border-radius: 999px; padding: 0 6px; }
.pmeta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; }
.pcap { display: block; color: var(--text); margin: 6px 0; }
.pcap:hover { text-decoration: none; color: var(--accent); }
.paccs { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-chip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: var(--muted); }
.acc-chip.s-done { border-color: var(--green); color: var(--green); }
.acc-chip.s-error { border-color: var(--red); color: var(--red); }
.perr { color: var(--red); font-size: 12.5px; margin-top: 6px; }
.pact { justify-content: flex-end; }
@media (max-width: 1000px) {
  .composer { grid-template-columns: 1fr; }
  .preview-col { position: static; max-width: 380px; }
  .post-row { grid-template-columns: 64px minmax(0, 1fr); }
  .pthumb { width: 64px; height: 64px; }
  .pact { grid-column: 1 / -1; justify-content: flex-start; }
}
.check { align-items: flex-start; flex-wrap: wrap; margin: 8px 0; }
.check .muted { flex-basis: 100%; padding-left: 24px; font-weight: 400; font-size: 12.5px; }
.seg.seg-col input[type=datetime-local] { width: auto; }
