/* Lifewheel WhatsApp Cloud Suite — design system */
:root {
  --green: #059669; --green-dark: #047857; --green-light: #ecfdf5; --green-ring: rgba(16,185,129,.22);
  --bg: #f4f6f9; --card: #fff; --text: #0f172a; --text-2: #334155; --muted: #64748b; --border: #e5e8ee; --border-2: #eef1f5;
  --red: #dc2626; --red-light: #fef2f2; --amber: #b45309; --amber-light: #fffbeb; --blue: #2563eb; --blue-light: #eff6ff;
  --violet: #6d28d9; --violet-light: #f5f3ff;
  --side: #0b1220; --side-2: #111a2e; --side-text: #a5b0c4;
  --radius: 14px; --shadow-sm: 0 1px 2px rgba(15,23,42,.05); --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.12);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.55; letter-spacing: -.005em; }
a { color: var(--green); text-decoration: none; font-weight: 500; }
a:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
::selection { background: #a7f3d0; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: var(--muted); font-weight: 500; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #d1fae5; border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 256px; flex-shrink: 0; background: radial-gradient(120% 60% at 0% 0%, #12301f 0%, transparent 55%), linear-gradient(180deg, var(--side) 0%, #0a0f1c 100%);
  color: var(--side-text); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid #1a2336; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; color: #fff; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: #6ee7b7; letter-spacing: .01em; }
.brand svg.logo { display: none; }
.brand::before { content: ""; width: 38px; height: 38px; flex-shrink: 0; background: url("/logo.png") center / contain no-repeat; filter: drop-shadow(0 4px 14px rgba(168,85,247,.35)); }
.nav { flex: 1; overflow-y: auto; }
.nav-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: #5b6880; font-weight: 600; padding: 16px 12px 6px; }
.nav-group:first-child { padding-top: 0; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; font-size: 15.5px; border-radius: 10px; color: var(--side-text); font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: rgba(255,255,255,.05); color: #e2e8f0; text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, rgba(16,185,129,.2), rgba(16,185,129,.06)); color: #fff; box-shadow: inset 0 0 0 1px rgba(52,211,153,.18); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #34d399; }
.nav a.active .ico { color: #34d399; }
.ico { width: 18px; height: 18px; flex-shrink: 0; }
.side-foot { border-top: 1px solid #1c2638; padding-top: 14px; margin-top: 10px; }
.live { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #7dd3b0; background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.18); padding: 7px 10px; border-radius: 9px; margin-bottom: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.me { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #34d399, #0ea5e9); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.me-mail { flex: 1; min-width: 0; font-size: 12.5px; color: #cbd5e1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me a { color: #64748b; display: flex; padding: 6px; border-radius: 8px; }
.me a:hover { color: #fff; background: rgba(255,255,255,.07); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 36px; min-height: 60px;
  background: rgba(244,246,249,.82); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.crumbs { font-size: 14.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.crumbs b { color: var(--text); font-weight: 600; }
.crumbs .sep { color: #cbd5e1; }
.top-actions .ico { width: 15px; height: 15px; }
.main { padding: 28px 36px 60px; max-width: 1240px; width: 100%; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- type ---------- */
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.028em; margin: 0 0 4px; line-height: 1.25; }
h2 { font-size: 18.5px; font-weight: 650; letter-spacing: -.015em; margin: 0 0 12px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sub { color: var(--muted); margin: 0 0 24px; font-size: 16px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; font-weight: 400; margin-top: 3px; line-height: 1.5; }
.back { font-size: 13px; color: var(--muted); }
p { margin: 0 0 10px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.card:hover { box-shadow: var(--shadow); }
.card { transition: box-shadow .2s; }
.step-num { display: inline-flex; width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, #10b981, #047857); color: #fff; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; margin-right: 8px; box-shadow: 0 4px 10px -3px rgba(5,150,105,.5); }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: 15px; color: var(--text-2); }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=url], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #dbe0e8; border-radius: 10px; font-size: 16px; background: #fff; font-family: inherit; color: var(--text);
  transition: border-color .15s, box-shadow .15s; box-shadow: 0 1px 2px rgba(15,23,42,.03); }
input::placeholder, textarea::placeholder { color: #9aa5b5; }
input:hover, select:hover, textarea:hover { border-color: #c5ccd8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 4px var(--green-ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
textarea { resize: vertical; line-height: 1.55; }
input[type=file] { font-family: inherit; font-size: 13.5px; color: var(--muted); padding: 14px; border: 1.5px dashed #cfd6e0; border-radius: 12px; width: 100%; background: #fafbfc; cursor: pointer; }
input[type=file]:hover { border-color: #10b981; background: var(--green-light); }
input[type=file]::file-selector-button { font-family: inherit; font-weight: 600; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 7px 14px; margin-right: 12px; cursor: pointer; color: var(--text); }

/* ---------- buttons ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 18px; border-radius: 10px; border: 1px solid #047857;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%); color: #fff; font-size: 15.5px; font-weight: 600; cursor: pointer; font-family: inherit; letter-spacing: -.005em;
  box-shadow: 0 1px 2px rgba(5,150,105,.3), inset 0 1px 0 rgba(255,255,255,.18); transition: transform .08s, box-shadow .15s, background .15s; white-space: nowrap; }
button:hover, .btn:hover { background: linear-gradient(180deg, #0ea472 0%, #047857 100%); color: #fff; text-decoration: none; box-shadow: 0 4px 14px -4px rgba(5,150,105,.55), inset 0 1px 0 rgba(255,255,255,.18); }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--green-ring); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--text-2); border-color: #dbe0e8; box-shadow: var(--shadow-sm); }
button.secondary:hover, .btn.secondary:hover { background: #f8fafc; border-color: #c5ccd8; color: var(--text); box-shadow: 0 2px 6px -2px rgba(15,23,42,.12); }
button.danger { background: #fff; color: var(--red); border-color: #f5c2c2; box-shadow: none; }
button.danger:hover { background: var(--red-light); border-color: #ef9a9a; color: #b91c1c; }
button.small, .btn.small { padding: 7px 13px; font-size: 14px; border-radius: 8px; }
button.block { width: 100%; padding: 12px; margin-top: 18px; }

/* ---------- layout helpers ---------- */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }
.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.center { display: flex; align-items: center; justify-content: center; min-height: 60vh; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; background: #f8fafc; white-space: nowrap; }
th:first-child { border-top-left-radius: 10px; } th:last-child { border-top-right-radius: 10px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fbfc; }
tr[onclick]:hover td { background: #f0fdf7; }
td b { font-weight: 600; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #f1f5f9; color: #475569; white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.green, .badge.read, .badge.delivered, .badge.done { background: var(--green-light); color: var(--green-dark); }
.badge.sent, .badge.running { background: var(--blue-light); color: var(--blue); }
.badge.failed { background: var(--red-light); color: var(--red); }
.badge.pending, .badge.sending, .badge.paused, .badge.scheduled { background: var(--amber-light); color: var(--amber); }
.badge.running::before { animation: pulse 2s infinite; }
.badge.funnel { background: var(--violet-light); color: var(--violet); border: 1px solid #e9e3fb; }
.badge.funnel::before { border-radius: 2px; transform: rotate(45deg); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: linear-gradient(180deg, #fff, #fafbfd); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: linear-gradient(90deg, #10b981, #34d399); opacity: .0; transition: opacity .2s; }
.stat:hover::after { opacity: 1; }
.stat b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.stat input[type=number] { display: inline-block; }
.progress { height: 6px; background: #edf1f5; border-radius: 6px; overflow: hidden; margin-top: 6px; }
.progress div { height: 100%; background: linear-gradient(90deg, #10b981, #34d399); border-radius: 6px; transition: width .4s; }

/* ---------- notices ---------- */
.notice { padding: 12px 14px; border-radius: 10px; background: var(--amber-light); color: #78350f; font-size: 15px; margin: 12px 0; border: 1px solid #fde68a; }
.notice.info { background: var(--blue-light); color: #1e3a8a; border-color: #dbeafe; }
.notice.error { background: var(--red-light); color: #991b1b; border-color: #fecaca; }
.notice.ok { background: var(--green-light); color: #065f46; border-color: #a7f3d0; }

/* ---------- WhatsApp preview ---------- */
.preview { background: #efeae2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cg fill='%23d9d2c5' fill-opacity='.45'%3E%3Ccircle cx='8' cy='8' r='1.5'/%3E%3Ccircle cx='38' cy='28' r='1.2'/%3E%3Ccircle cx='20' cy='48' r='1'/%3E%3C/g%3E%3C/svg%3E");
  border-radius: 14px; padding: 18px; border: 1px solid #e4ddd2; }
.bubble { background: #fff; border-radius: 4px 12px 12px 12px; padding: 8px 10px 8px; max-width: 380px; white-space: pre-wrap; box-shadow: 0 1px .5px rgba(11,20,26,.13); font-size: 15.5px; line-height: 1.45; color: #111b21; position: relative; }
.bubble::before { content: ""; position: absolute; left: -7px; top: 0; border-top: 8px solid #fff; border-left: 8px solid transparent; }
.bubble .media { background: linear-gradient(135deg, #d5dde3, #c2ccd4); border-radius: 8px; height: 140px; display: flex; align-items: center; justify-content: center; color: #4b5563; margin-bottom: 8px; font-weight: 600; overflow: hidden; }
.bubble .media img { width: 100%; height: 100%; object-fit: cover; }
.bubble .footer { color: #8696a0; font-size: 12.5px; margin-top: 4px; }
.bubble .btns { border-top: 1px solid #e9edef; margin: 8px -10px -8px; padding: 9px 10px; color: #027eb5; text-align: center; font-size: 14px; font-weight: 500; }
.bubble a { color: #027eb5; text-decoration: underline; word-break: break-all; }
.bubble .var { font-weight: 600; background: #fff4c2; border-radius: 3px; padding: 0 2px; }
.bubble code { background: #f0f2f5; padding: 0 3px; font-family: var(--mono); font-size: 12.5px; }

/* ---------- code ---------- */
code, .code { background: #f1f5f9; color: #0f3d2e; padding: 2px 7px; border-radius: 6px; font-family: var(--mono); font-size: 13.5px; word-break: break-all; border: 1px solid #e6ebf1; }
pre.code { display: block; padding: 14px 16px; white-space: pre-wrap; background: #0b1220; color: #a7f3d0; border: 1px solid #1c2638; border-radius: 12px; line-height: 1.6; }
.copy-row { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.copy-row code { flex: 1; padding: 9px 12px; }

/* ---------- misc ---------- */
.varmap { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); background: repeating-linear-gradient(135deg, #fafbfc 0 10px, #f6f8fa 10px 20px); border-radius: 12px; border: 1px dashed #dde3ea; }
#toast { position: fixed; bottom: 24px; right: 24px; z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
#toast div { background: #0f172a; color: #fff; padding: 12px 16px 12px 14px; border-radius: 12px; max-width: 420px; box-shadow: 0 12px 32px -8px rgba(15,23,42,.45); font-weight: 500; font-size: 15px;
  border-left: 4px solid #34d399; animation: toastin .25s ease-out; }
#toast div.error { background: #fff; color: #991b1b; border: 1px solid #fecaca; border-left: 4px solid var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- media library ---------- */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.mtile { border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: #fff; display: flex; flex-direction: column; gap: 4px; transition: transform .15s, box-shadow .15s; }
.mtile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mtile img, .mtile .ficon { width: 100%; height: 116px; object-fit: cover; border-radius: 8px; background: #eef1f4; }
.mtile .ficon { display: flex; align-items: center; justify-content: center; font-size: 40px; }
.mname { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-bg { position: fixed; inset: 0; background: rgba(2,6,23,.5); backdrop-filter: blur(3px); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; animation: toastin .2s; }
.modal { background: #fff; border-radius: 16px; padding: 22px; width: min(920px, 100%); max-height: 85vh; overflow: auto; box-shadow: 0 30px 60px -20px rgba(2,6,23,.45); }

/* ---------- login ---------- */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; color: #cbd5e1; padding: 48px 56px; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(60% 50% at 15% 10%, rgba(16,185,129,.35), transparent 60%), radial-gradient(50% 40% at 90% 90%, rgba(14,165,233,.25), transparent 60%), #0b1220; }
.auth-hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%); pointer-events: none; }
.auth-hero > * { position: relative; z-index: 1; }
.brand.big { font-size: 18px; padding: 0 0 40px; }
.brand.big::before { width: 48px; height: 48px; }
.auth-hero h2 { display: block; color: #fff; font-size: 34px; line-height: 1.15; letter-spacing: -.035em; font-weight: 750; max-width: 480px; margin: 0 0 14px; }
.auth-hero > p { font-size: 15.5px; max-width: 460px; color: #94a3b8; margin-bottom: 30px; }
.feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 470px; }
.feats li { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #94a3b8; }
.feats li span { font-size: 18px; width: 34px; height: 34px; border-radius: 9px; background: rgba(16,185,129,.14); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feats b { display: block; color: #f1f5f9; font-size: 14px; font-weight: 600; }
.auth-foot { margin-top: 36px; font-size: 12px; color: #64748b; letter-spacing: .02em; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login { width: 100%; max-width: 380px; }
.login h1 { font-size: 28px; }
.or { display: flex; align-items: center; gap: 12px; color: #94a3b8; font-size: 12px; margin: 16px 0 -4px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.or + button.block { margin-top: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 14px; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-group { display: none; }
  .nav a { padding: 7px 10px; font-size: 13px; }
  .nav a.active::before { display: none; }
  .side-foot { display: none; }
  .topbar { padding: 10px 18px; }
  .main { padding: 20px 18px 40px; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 24px; }
  .auth-hero h2 { font-size: 26px; }
  .varmap { grid-template-columns: 1fr; }
}
.stat.wide { grid-column: span 2; background: linear-gradient(135deg, #ecfdf5, #fff 70%); border-color: #bbf7d0; }
.stat.wide b { color: var(--green-dark); }
.stat input.rate { width: 72px; padding: 3px 6px; font-size: 12px; border-radius: 6px; margin: 0 2px; }

/* ================= Loader ================= */
.lw-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 50vh; color: var(--muted); font-weight: 500; }
.boot .lw-loader { min-height: 100vh; }
.lw-orbit { position: relative; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; }
.lw-orbit img { width: 54px; height: 54px; animation: lwspin 2.4s cubic-bezier(.6,.1,.4,.9) infinite; filter: drop-shadow(0 6px 16px rgba(168,85,247,.35)); }
.lw-orbit i { position: absolute; inset: 0; border-radius: 50%; animation: lwspin 1.6s linear infinite; }
.lw-orbit i::before { content: ""; position: absolute; top: -3px; left: 50%; width: 9px; height: 9px; margin-left: -4px; border-radius: 50%; background: #10b981; box-shadow: 0 0 12px #34d399; }
.lw-orbit i:nth-child(3) { animation-duration: 2.2s; animation-direction: reverse; inset: 8px; }
.lw-orbit i:nth-child(3)::before { background: #f59e0b; box-shadow: 0 0 12px #fbbf24; }
.lw-orbit i:nth-child(4) { animation-duration: 3s; inset: -8px; }
.lw-orbit i:nth-child(4)::before { background: #8b5cf6; box-shadow: 0 0 12px #a78bfa; }
.lw-loader-t { font-size: 15px; letter-spacing: .02em; animation: lwfade 1.6s ease-in-out infinite; }
@keyframes lwspin { to { transform: rotate(360deg); } }
@keyframes lwfade { 50% { opacity: .45; } }

/* ================= Sending scene ================= */
.send-scene { display: flex; align-items: center; gap: 6px; height: 150px; padding: 0 6px; }
.ss-hub { position: relative; width: 84px; height: 84px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 24px; background: #fff; box-shadow: 0 10px 30px -10px rgba(15,23,42,.35); }
.ss-hub img { width: 58px; height: 58px; animation: lwspin 6s linear infinite; }
.ss-ring { position: absolute; inset: -6px; border-radius: 28px; border: 2px solid rgba(16,185,129,.5); animation: ring 1.8s ease-out infinite; }
.ss-ring.r2 { animation-delay: .9s; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.ss-path { position: relative; flex: 1; height: 60px; }
.ss-path svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ss-path path { fill: none; stroke: #a7f3d0; stroke-width: 2; stroke-dasharray: 6 8; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -28; } }
.ss-bub { position: absolute; top: 50%; left: 0; font-size: 22px; transform: translate(-50%, -50%); animation: fly 1.8s ease-in-out var(--d) infinite; opacity: 0; filter: drop-shadow(0 4px 6px rgba(0,0,0,.15)); }
@keyframes fly { 0% { opacity: 0; left: 2%; top: 55%; } 12% { opacity: 1; } 30% { top: 5%; } 70% { top: 95%; } 88% { opacity: 1; } 100% { opacity: 0; left: 98%; top: 50%; transform: translate(-50%, -50%) scale(.6); } }
.ss-phones { display: flex; gap: 8px; flex-shrink: 0; }
.ss-phone { position: relative; width: 44px; height: 80px; border-radius: 10px; background: linear-gradient(180deg, #1f2937, #0f172a); padding: 12px 5px 5px; box-shadow: 0 8px 20px -8px rgba(15,23,42,.5); animation: buzz 1.8s ease-in-out var(--d) infinite; }
.ss-notch { position: absolute; top: 4px; left: 50%; width: 14px; height: 3px; margin-left: -7px; border-radius: 2px; background: #374151; }
.ss-msg { height: 10px; border-radius: 4px; background: #dcf8c6; margin-bottom: 4px; animation: pop 1.8s ease-out var(--d) infinite; transform-origin: left; }
.ss-msg.s2 { width: 70%; background: #fff; animation-delay: calc(var(--d) + .2s); }
.ss-phone b { position: absolute; bottom: 6px; right: 6px; color: #53bdeb; font-size: 11px; animation: pop 1.8s ease-out calc(var(--d) + .4s) infinite; }
@keyframes pop { 0%, 40% { transform: scaleX(0); opacity: 0; } 60%, 100% { transform: scaleX(1); opacity: 1; } }
@keyframes buzz { 0%, 55%, 100% { transform: translateY(0); } 60% { transform: translateY(-4px) rotate(-3deg); } 66% { transform: translateY(0) rotate(2deg); } }
.send-scene.small { height: 96px; transform-origin: left center; }
.send-scene.small .ss-hub { width: 60px; height: 60px; border-radius: 18px; } .send-scene.small .ss-hub img { width: 40px; height: 40px; }
.send-scene.small .ss-phone { width: 34px; height: 60px; }
.sending-card { display: flex; align-items: center; gap: 24px; background: linear-gradient(120deg, #ecfdf5, #fff 60%); border-color: #bbf7d0; }
.sending-card .send-scene { width: 420px; max-width: 60%; }
.send-modal { width: min(560px, 100%); text-align: center; padding: 28px 30px 30px; }
.send-modal .send-scene { margin-bottom: 10px; }
.so-title { justify-content: center; font-size: 22px; margin-top: 6px; }
.so-check { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: #10b981; color: #fff; align-items: center; justify-content: center; font-size: 17px; animation: pop2 .4s ease-out; }
@keyframes pop2 { from { transform: scale(0); } 70% { transform: scale(1.2); } to { transform: scale(1); } }
.so-bar { height: 8px; margin-top: 16px; }
.send-ov.out { opacity: 0; transition: opacity .3s; }

/* ================= Chats ================= */
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: #ef4444; color: #fff; font-style: normal; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.nav-badge[hidden] { display: none; }
.main:has(.chat-wrap) { max-width: none; padding: 0; animation: none; }
.chat-wrap { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - 61px); background: #fff; }
.chat-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: #fbfcfd; }
.chat-list-head { padding: 18px 16px 12px; display: grid; gap: 10px; border-bottom: 1px solid var(--border); }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 7px 8px; font-size: 13.5px; background: #fff; color: var(--text-2); border: 1px solid #dbe0e8; box-shadow: none; }
.seg button.on { background: var(--green-light); color: var(--green-dark); border-color: #a7f3d0; }
.chat-items { overflow-y: auto; flex: 1; }
.chat-skel { height: 64px; margin: 10px 14px; border-radius: 12px; background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 50%, #eef1f5 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.chat-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-2); color: var(--text); font-weight: 400; transition: background .12s; }
.chat-item:hover { background: #f1f5f9; text-decoration: none; color: var(--text); }
.chat-item.active { background: #e7f8ef; box-shadow: inset 3px 0 0 #10b981; }
.av { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 70% 55%), hsl(calc(var(--h) + 40) 70% 45%)); }
.ci-mid { flex: 1; min-width: 0; }
.ci-top { display: flex; justify-content: space-between; gap: 8px; }
.ci-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ci-top span { font-size: 12.5px; color: var(--muted); flex-shrink: 0; }
.ci-bot { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.ci-bot span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.unread .ci-top b, .chat-item.unread .ci-bot span { color: var(--text); font-weight: 600; }
.chat-item.unread .ci-top span { color: #10b981; font-weight: 600; }
.pill { background: #10b981; color: #fff; font-style: normal; font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: #efeae2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='%23d9d2c5' fill-opacity='.4'%3E%3Ccircle cx='10' cy='10' r='1.6'/%3E%3Ccircle cx='50' cy='35' r='1.3'/%3E%3Ccircle cx='25' cy='65' r='1.1'/%3E%3Ccircle cx='70' cy='70' r='1.4'/%3E%3C/g%3E%3C/svg%3E"); }
.chat-empty { margin: auto; text-align: center; max-width: 380px; padding: 30px; }
.ce-art { position: relative; width: 150px; height: 150px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle, #fff 55%, transparent 56%); }
.ce-art img { width: 84px; animation: lwspin 14s linear infinite; }
.ce-b { position: absolute; background: #fff; border-radius: 14px; padding: 6px 10px; font-size: 15px; box-shadow: 0 6px 16px -6px rgba(0,0,0,.25); animation: floaty 3s ease-in-out infinite; }
.ce-b.b1 { top: 6px; right: -16px; } .ce-b.b2 { bottom: 14px; left: -26px; color: #53bdeb; font-weight: 700; animation-delay: 1s; } .ce-b.b3 { bottom: -4px; right: 0; animation-delay: 2s; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--border); }
.back-m { display: none; font-size: 22px; }
.win { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.win.open { background: var(--green-light); color: var(--green-dark); }
.win.closed { background: var(--amber-light); color: var(--amber); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px 6% 10px; display: flex; flex-direction: column; gap: 3px; }
.day { text-align: center; margin: 12px 0 8px; }
.day span { background: #fff; color: #54656f; font-size: 12.5px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.b-row { display: flex; } .b-row.out { justify-content: flex-end; }
.b { max-width: min(560px, 75%); padding: 7px 10px 6px; border-radius: 10px; font-size: 15.5px; line-height: 1.45; box-shadow: 0 1px .5px rgba(11,20,26,.13); background: #fff; color: #111b21; word-wrap: break-word; animation: bin .2s ease-out; }
.b.in { border-top-left-radius: 2px; } .b.out { background: #d9fdd3; border-top-right-radius: 2px; }
.b.failed { background: #fde8e8; }
@keyframes bin { from { opacity: 0; transform: translateY(6px); } }
.b-text { white-space: pre-wrap; }
.b-text a { color: #027eb5; }
.b-meta { font-size: 11.5px; color: #667781; text-align: right; margin-top: 2px; display: flex; justify-content: flex-end; gap: 6px; align-items: center; }
.b-by { margin-right: auto; color: #8696a0; }
.tick { color: #8696a0; letter-spacing: -3px; font-weight: 700; } .tick.read { color: #53bdeb; } .tick.fail { color: var(--red); letter-spacing: 0; }
.b-err { font-size: 12.5px; color: var(--red); margin-top: 4px; }
.b-img { display: block; max-width: 320px; max-height: 320px; border-radius: 8px; margin-bottom: 4px; }
.b-img.sticker { max-width: 140px; background: none; }
.b audio { width: 280px; max-width: 100%; display: block; }
.b-doc { display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,.05); border-radius: 8px; padding: 10px 12px; color: var(--text); margin-bottom: 4px; }
.b-tag { font-size: 13px; color: #54656f; margin-bottom: 2px; }
.b-react { font-size: 13px; color: #667781; padding: 0 12px; } .b-react.out { text-align: right; }
.composer { display: flex; gap: 10px; align-items: flex-end; padding: 12px 16px; background: #f0f2f5; position: relative; }
.composer textarea { resize: none; border-radius: 22px; padding: 11px 16px; min-height: 46px; max-height: 160px; line-height: 1.45; }
.composer.locked textarea { background: #f8f1e1; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; padding: 0; background: #fff; color: var(--text-2); border: 1px solid #dbe0e8; font-size: 20px; box-shadow: none; flex-shrink: 0; }
.icon-btn:hover { background: #fff; color: var(--text); }
.send-btn { width: 46px; height: 46px; border-radius: 50%; padding: 0; font-size: 18px; flex-shrink: 0; }
.send-btn.flying { animation: sendfly .5s ease-in; }
@keyframes sendfly { 50% { transform: translate(14px, -10px) rotate(-20deg); opacity: .2; } 51% { transform: translate(-10px, 8px); } }
.att-menu { position: absolute; bottom: 66px; left: 16px; background: #fff; border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(15,23,42,.35); padding: 6px; display: grid; z-index: 5; animation: toastin .15s; }
.att-menu button, .att-menu label { background: none; color: var(--text); border: none; box-shadow: none; justify-content: flex-start; padding: 10px 14px; margin: 0; font-weight: 500; cursor: pointer; border-radius: 8px; font-size: 15px; }
.att-menu button:hover, .att-menu label:hover { background: #f1f5f9; color: var(--text); }
.att-chip { display: flex; gap: 10px; align-items: center; padding: 8px 16px; background: #fff; border-top: 1px solid var(--border); font-size: 14.5px; }
.mini-spin { width: 16px; height: 16px; border: 2px solid #d1fae5; border-top-color: #10b981; border-radius: 50%; animation: lwspin .8s linear infinite; }
@media (max-width: 900px) {
  .chat-wrap { grid-template-columns: 1fr; height: calc(100vh - 120px); }
  .chat-wrap.has-open .chat-list { display: none; }
  .chat-wrap:not(.has-open) .chat-pane { display: none; }
  .back-m { display: block; }
  .sending-card { flex-direction: column; } .sending-card .send-scene { max-width: 100%; width: 100%; }
}

/* ================= Team ================= */
.role { display: inline-block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; vertical-align: middle; }
.role.owner { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.role.admin { background: #e0e7ff; color: #3730a3; }
.role.member { background: #e2e8f0; color: #334155; }
.me-mail small.role { display: table; margin-top: 2px; font-size: 10px; padding: 1px 6px; }
.team-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 4px; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.team-row:last-child { border-bottom: none; }
.team-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.perm-chips span { font-size: 13px; background: var(--green-light); color: var(--green-dark); border: 1px solid #bbf7d0; padding: 2px 9px; border-radius: 999px; }
.perm-chips span.all { background: #eef2ff; color: #3730a3; border-color: #e0e7ff; }
.perm-chips span.none { background: #f8fafc; color: var(--muted); border-color: var(--border); }
.role-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.role-opt, .perm-opt { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px; margin: 0; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; }
.role-opt b, .perm-opt b { display: block; color: var(--text); }
.role-opt span, .perm-opt span { display: block; color: var(--muted); font-size: 14px; }
.role-opt.on { border-color: #10b981; background: var(--green-light); }
.role-opt.disabled { opacity: .5; cursor: not-allowed; }
.role-opt input, .perm-opt input { margin-top: 4px; accent-color: #059669; width: 18px; height: 18px; flex-shrink: 0; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.perm-opt:has(input:checked) { border-color: #10b981; background: var(--green-light); }
/* template 👁 preview */
.eye-btn { display: inline-flex; align-items: center; gap: 5px; }
.tpl-view { width: min(460px, 100%); }
.tpl-view-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.tpl-phone { border-radius: 22px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 20px 40px -24px rgba(2,6,23,.45); }
.tpl-phone-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #075e54; color: #fff; }
.tpl-phone-top img { width: 34px; height: 34px; border-radius: 50%; background: #fff; padding: 3px; }
.tpl-phone-top small { display: block; font-size: 12px; opacity: .8; }
.tpl-phone-body { padding: 14px 4px; background: #efe7dd; max-height: 62vh; overflow-y: auto; }
.tpl-phone-body .preview { background: transparent; padding: 0 10px; border: 0; margin: 0 0 6px; }
.tpl-phone-body .media { height: auto !important; max-height: none !important; overflow: visible; }
.tpl-phone-body .media img { width: 100%; height: auto !important; max-height: 420px; object-fit: contain; display: block; border-radius: 8px; }
/* full template messages inside chats */
.b-foot { font-size: 13px; color: #8696a0; margin-top: 4px; }
.b-btns { display: flex; flex-direction: column; margin: 8px -10px -2px; border-top: 1px solid rgba(0,0,0,.08); }
.b-btns span { text-align: center; color: #027eb5; font-size: 14.5px; padding: 7px 8px; font-weight: 500; }
.b-btns span + span { border-top: 1px solid rgba(0,0,0,.08); }
.b-media-ph { background: rgba(0,0,0,.06); border-radius: 8px; padding: 26px 12px; text-align: center; color: #54656f; font-weight: 600; margin-bottom: 6px; }
.b:has(.b-btns), .b:has(.b-foot), .b:has(.b-media-ph) { max-width: min(400px, 85%); }
/* chatbot hand-over in Chats */
.ci-hand { font-size: 12.5px; font-weight: 600; color: #c2410c; margin: 1px 0 2px; }
.ci-hand.open { color: #0369a1; }
.hand-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 16px; background: #fff7ed; border-bottom: 1px solid #fed7aa; color: #9a3412; font-size: 14.5px; }
.hand-bar.open { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.b-tap { font-size: 14.5px; color: #54656f; }
.b-btns a { text-align: center; color: #027eb5; font-size: 14.5px; padding: 7px 8px; font-weight: 600; text-decoration: none; }
.seg .pill { margin-left: 4px; font-style: normal; }
.pill[hidden] { display: none !important; }
.bot-flow { margin-top: 14px; }
/* why messages failed */
.why-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.why { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.why-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.why-n { background: #fef2f2; color: #b91c1c; font-weight: 700; border-radius: 999px; padding: 2px 10px; font-size: 14px; }
.why-bar { height: 6px; background: #f1f5f9; border-radius: 99px; overflow: hidden; } .why-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f87171, #ef4444); }
.why p { margin: 0; font-size: 14px; color: #475569; line-height: 1.5; }
.why-ok { font-size: 13px; color: #047857; font-weight: 600; } .why-no { font-size: 13px; color: #9a3412; font-weight: 600; }
/* 🩺 WhatsApp health pill (top bar on every page) */
.topbar { gap: 14px; }
.hp { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 6px 14px 6px 12px; font-size: 13.5px; font-weight: 600; box-shadow: none; white-space: nowrap; order: 2; margin-left: auto;
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.hp:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(5,150,105,.6); background: #ecfdf5; }
.hp.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; } .hp.bad { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.hp-pulse { width: 9px; height: 9px; border-radius: 50%; background: #10b981; position: relative; }
.hp-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #10b981; animation: hpPulse 1.8s ease-out infinite; }
.hp.warn .hp-pulse, .hp.warn .hp-pulse::after { background: #f59e0b; border-color: #f59e0b; } .hp.bad .hp-pulse, .hp.bad .hp-pulse::after { background: #ef4444; border-color: #ef4444; }
.hp.warn .hp-pulse::after, .hp.bad .hp-pulse::after { background: transparent; }
@keyframes hpPulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.hp-sep { width: 1px; height: 14px; background: currentColor; opacity: .25; }
.topbar .crumbs { order: 1; } .topbar .top-actions { order: 3; }
.hp-modal { width: min(720px, 100%); }
.hp-card { border: 1px solid var(--border); border-left: 5px solid #10b981; border-radius: 16px; padding: 14px 16px; margin-top: 14px; }
.hp-card.warn { border-left-color: #f59e0b; } .hp-card.bad { border-left-color: #ef4444; }
.hp-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.hp-big { font-weight: 700; border-radius: 999px; padding: 4px 12px; font-size: 13.5px; background: #ecfdf5; color: #047857; }
.hp-big.warn { background: #fffbeb; color: #b45309; } .hp-big.bad { background: #fef2f2; color: #b91c1c; }
.hp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hp-grid > div { background: #f8fafc; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.hp-grid span { color: var(--muted); font-size: 12.5px; font-weight: 600; } .hp-grid b { font-size: 15.5px; } .hp-grid small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.hp-errs { margin-top: 10px; background: #fef2f2; color: #991b1b; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 900px) { .hp-txt, .hp-sep { display: none; } .hp-grid { grid-template-columns: 1fr 1fr; } }
/* sidebar menu scrolls when the screen is short (so Setup is always reachable) */
.nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2a3a52 transparent; margin-right: -6px; padding-right: 6px; }
.nav::-webkit-scrollbar { width: 6px; } .nav::-webkit-scrollbar-thumb { background: #2a3a52; border-radius: 6px; }
.nav a { padding: 8px 12px; } .nav-group { padding: 12px 12px 5px; }

/* 👁 broadcast preview */
.pv-modal { width: min(980px, 100%); }
.pv-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 22px; margin-top: 10px; }
.pv-phone { border: 6px solid #0b1220; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 40px -24px rgba(2,6,23,.6); }
.pv-top { display: flex; align-items: center; gap: 10px; background: #075e54; color: #fff; padding: 9px 12px; }
.pv-top small { display: block; font-size: 11.5px; opacity: .8; }
.pv-body { background: #efe7dd; min-height: 300px; max-height: 60vh; overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; align-items: flex-end; }
.pv-b { background: #d9fdd3; border-radius: 10px 3px 10px 10px; max-width: 92%; padding: 5px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.pv-img { width: 100%; border-radius: 7px; display: block; max-height: 320px; object-fit: cover; }
.pv-doc { background: rgba(0,0,0,.05); border-radius: 7px; padding: 12px; font-weight: 600; }
.pv-t { padding: 5px 6px 0; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.pv-t a { color: #027eb5; }
.pv-time { text-align: right; font-size: 11px; color: #667781; padding: 2px 6px 1px; }
.pv-h { font-size: 15px; margin: 4px 0 8px; } .pv-h:not(:first-child) { margin-top: 18px; }
.lk-list { display: flex; flex-direction: column; gap: 8px; }
.lk { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; font-size: 13.5px; }
.lk.warn { border-color: #fecaca; background: #fef2f2; }
.lk-kind { font-weight: 600; white-space: nowrap; } .lk-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0369a1; }
.lk-ok { color: #047857; font-size: 12.5px; white-space: nowrap; } .lk-warn { color: #b91c1c; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pv-stats { display: flex; flex-wrap: wrap; gap: 8px; } .pv-stats span { background: #f1f5f9; border-radius: 10px; padding: 6px 12px; font-size: 13.5px; } .pv-stats b { margin-left: 4px; }
@media (max-width: 860px) { .pv-grid { grid-template-columns: 1fr; } }
.pop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
/* 🔎 template filters */
.tf-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #f8fafc; border: 1px solid var(--border); border-radius: 14px; padding: 10px; }
.tf-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; }
.tf-search input { border: none !important; box-shadow: none !important; padding: 9px 0 !important; margin: 0 !important; background: transparent !important; }
.tf-bar select { width: auto; margin: 0; min-width: 150px; }
.tf-count { font-size: 13.5px; color: var(--muted); margin: 10px 2px 6px; }
#tf_rows mark { background: #fef08a; border-radius: 3px; padding: 0 1px; }

/* broadcasts status tabs */
.btabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.btab { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; border-radius: 999px; padding: 7px 14px; font-weight: 600; cursor: pointer; font-size: 14px; }
.btab span { background: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 4px; font-size: 12px; color: #64748b; }
.btab.on { background: var(--green, #16a34a); color: #fff; border-color: transparent; }
.btab.on span { color: var(--green, #16a34a); }
