/* Pohuy Agency web panel — 11.11 refresh: softer dark palette, depth, avatars, status chips, and the «live» layer
   (strip under the top bar, activity on cards, countdowns, event feed). Loaded after app.css: only overrides + new classes. */

/* ---------- Tokens (dark only, like before; same variable names so every old rule follows) ---------- */
:root {
  --font: "Geist", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --radius: 9px;
  --radius-lg: 14px;

  --bg: #07080b;
  --bg-glow: radial-gradient(1100px 520px at 12% -12%, rgba(120, 104, 255, 0.10), transparent 60%),
             radial-gradient(900px 480px at 100% -10%, rgba(56, 189, 248, 0.07), transparent 60%);
  --surface: #0d0f13;
  --surface-2: #12151a;
  --surface-3: #181c22;
  --hover: #151920;
  --border: #1d2129;
  --border-strong: #2a303a;
  --text: #e8eaee;
  --text-strong: #ffffff;
  --text-muted: #a0a6b1;
  --text-faint: #6a717d;
  --accent-soft: rgba(255, 255, 255, 0.07);
  --ok: #3ddc84;
  --ok-soft: rgba(61, 220, 132, 0.12);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, 0.13);
  --danger: #ff5f5f;
  --danger-soft: rgba(255, 95, 95, 0.13);
  --info: #5aa9ff;
  --info-soft: rgba(90, 169, 255, 0.13);
  --violet: #9b8cff;
  --header-bg: rgba(7, 8, 11, 0.78);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.4);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
body { background-attachment: fixed; }

/* ---------- Surfaces ---------- */
.card { box-shadow: var(--card-shadow); }
.stat {
  box-shadow: var(--card-shadow);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 60%), var(--surface);
  transition: border-color .15s, background-color .15s, transform .15s var(--ease);
}
.stat-value { font-variant-numeric: tabular-nums; }
.page-title { font-size: 20px; letter-spacing: -0.02em; }
.card-head h2 { font-size: 14px; }

/* top bar: brand glow, tab hover pill, animated underline */
.brand-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 4px 18px rgba(155, 140, 255, 0.25); }
.tab { transition: color .15s; }
.tab::before { content: ""; position: absolute; inset: 12px 4px; border-radius: 8px; background: transparent; transition: background .15s; z-index: -1; }
.tab:hover::before { background: var(--hover); }
.tab.active::after { animation: lv-under .25s var(--ease); }
@keyframes lv-under { from { transform: scaleX(.3); opacity: 0; } }

/* buttons, pills */
.btn { transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s; }
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 4px 14px rgba(255, 255, 255, 0.08); }
.pill { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04); }
.pill-ok { box-shadow: inset 0 0 0 1px rgba(61, 220, 132, 0.22); }
.pill-warn { box-shadow: inset 0 0 0 1px rgba(245, 165, 36, 0.24); }
.pill-danger { box-shadow: inset 0 0 0 1px rgba(255, 95, 95, 0.24); }
.pill-info { box-shadow: inset 0 0 0 1px rgba(90, 169, 255, 0.24); }
.pill-info i { animation: lv-pulse 1.6s ease-in-out infinite; }

/* connection indicator (#conn): live text from live.js */
.conn { padding: 4px 10px 4px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-variant-numeric: tabular-nums; }
.conn.ok i { animation: lv-ring 2.4s ease-out infinite; }
.conn.lv-busy i { background: var(--info); }
.conn.err { border-color: rgba(255, 95, 95, 0.35); background: var(--danger-soft); }

/* ---------- Account cards ---------- */
.ac-card { position: relative; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.ac-card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow), 0 12px 30px rgba(0, 0, 0, 0.45); }
.ac-card.lv-busy-card { border-color: rgba(90, 169, 255, 0.35); box-shadow: var(--card-shadow), 0 0 0 1px rgba(90, 169, 255, 0.12), 0 10px 32px rgba(90, 169, 255, 0.08); }
.lv-idrow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ac-ava.lv-ava {
  --h: 250;
  background: linear-gradient(140deg, hsl(var(--h) 75% 62%), hsl(calc(var(--h) + 40) 70% 45%));
  border: 0; color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px hsl(var(--h) 60% 50% / .35);
}
.lv-ava.lv-hue-0 { --h: 250; }
.lv-ava.lv-hue-1 { --h: 280; }
.lv-ava.lv-hue-2 { --h: 310; }
.lv-ava.lv-hue-3 { --h: 340; }
.lv-ava.lv-hue-4 { --h: 10; }
.lv-ava.lv-hue-5 { --h: 40; }
.lv-ava.lv-hue-6 { --h: 70; }
.lv-ava.lv-hue-7 { --h: 100; }
.lv-ava.lv-hue-8 { --h: 130; }
.lv-ava.lv-hue-9 { --h: 160; }
.lv-ava.lv-hue-10 { --h: 190; }
.lv-ava.lv-hue-11 { --h: 220; }
.ac-ava.lv-ava.sm { width: 38px; height: 38px; font-size: 15px; }
.ac-nums > div { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button { white-space: nowrap; }
.ac-delta.up { color: var(--ok); }
.ac-delta.down { color: var(--danger); }

/* the «live» block on a card: activity + next publication */
.lv-card { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.lv-act { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--text-muted); min-width: 0; position: relative; }
.lv-act .lv-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-faint); }
.lv-act .lv-text { color: var(--text); font-weight: 600; }
.lv-act .lv-msg { flex-basis: 100%; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 16px; }
.lv-act .lv-extra { color: var(--violet); }
.lv-act.lv-idle .lv-text { color: var(--text-faint); font-weight: 500; }
.lv-act.lv-run .lv-dot { background: var(--info); animation: lv-ring 1.6s ease-out infinite; }
.lv-act.lv-run .lv-text { color: var(--info); }
.lv-act.lv-wait .lv-dot { background: var(--warn); animation: lv-pulse 1.4s ease-in-out infinite; }
.lv-act.lv-wait .lv-text { color: var(--warn); }
.lv-act.lv-queue .lv-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--text-muted); }
.lv-prog { flex-basis: 100%; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; position: relative; margin-left: 16px; }
.lv-prog::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--info), var(--violet)); border-radius: 3px; transition: width .6s var(--ease); }
.lv-p0::after { width: 0%; }
.lv-p1::after { width: 5%; }
.lv-p2::after { width: 10%; }
.lv-p3::after { width: 15%; }
.lv-p4::after { width: 20%; }
.lv-p5::after { width: 25%; }
.lv-p6::after { width: 30%; }
.lv-p7::after { width: 35%; }
.lv-p8::after { width: 40%; }
.lv-p9::after { width: 45%; }
.lv-p10::after { width: 50%; }
.lv-p11::after { width: 55%; }
.lv-p12::after { width: 60%; }
.lv-p13::after { width: 65%; }
.lv-p14::after { width: 70%; }
.lv-p15::after { width: 75%; }
.lv-p16::after { width: 80%; }
.lv-p17::after { width: 85%; }
.lv-p18::after { width: 90%; }
.lv-p19::after { width: 95%; }
.lv-p20::after { width: 100%; }
.lv-next { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.lv-next svg { width: 14px; height: 14px; color: var(--text-faint); }
.lv-next b { color: var(--text-strong); font-variant-numeric: tabular-nums; font-weight: 600; }
.lv-next .lv-at { color: var(--text-faint); }
.lv-next .lv-none { color: var(--text-faint); padding-left: 2px; }

/* phones table: activity only while the phone works */
.lv-act.lv-m-row { flex-basis: 100%; margin-top: 2px; }
.lv-act.lv-m-row.lv-idle { display: none; }
.lv-act.lv-m-row .lv-msg { flex-basis: auto; padding-left: 0; max-width: 260px; }
.lv-act.lv-m-row .lv-prog { display: none; }

/* ---------- The live strip under the top bar ---------- */
.lv-bar { margin: -8px 0 16px; }
.lv-bar-in {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 6px 6px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(90, 169, 255, 0.05), transparent 40%), var(--surface);
  box-shadow: var(--card-shadow);
}
.lv-now { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.lv-now-l { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-weight: 500; }
.lv-chips { display: flex; gap: 6px; overflow-x: auto; min-width: 0; scrollbar-width: none; padding: 2px 0; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.lv-chips::-webkit-scrollbar { display: none; }
.lv-chip {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; flex: none;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-muted); font-size: 12px; white-space: nowrap;
  animation: lv-in .35s var(--ease);
}
.lv-chip:hover { border-color: var(--text-faint); color: var(--text); }
.lv-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.lv-chip b { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.lv-chip-h { color: var(--text-faint); max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.lv-chip.lv-run { border-color: rgba(90, 169, 255, 0.35); background: var(--info-soft); }
.lv-chip.lv-run i { background: var(--info); animation: lv-ring 1.6s ease-out infinite; }
.lv-chip.lv-run .lv-chip-t { color: var(--info); }
.lv-chip.lv-wait { border-color: rgba(245, 165, 36, 0.35); background: var(--warn-soft); }
.lv-chip.lv-wait i { background: var(--warn); }
.lv-chip.lv-wait .lv-chip-t { color: var(--warn); }
.lv-chip.lv-queue i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-muted); }
.lv-chip .lv-prog { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; height: 2px; border-radius: 0; background: transparent; }
.lv-nextpub {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; flex: none; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-muted); font-size: 12px; white-space: nowrap;
}
button.lv-nextpub:hover { border-color: var(--text-faint); color: var(--text); }
.lv-nextpub svg { width: 15px; height: 15px; color: var(--violet); }
.lv-np-who { color: var(--text); font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.lv-np-cd { color: var(--text-strong); font-weight: 650; font-variant-numeric: tabular-nums; min-width: 82px; }
.lv-np-n { color: var(--text-faint); padding-left: 8px; border-left: 1px solid var(--border-strong); }
.lv-np-empty { border-style: dashed; }

/* pulsing «live» dot */
.lv-live { position: relative; width: 10px; height: 10px; flex: none; display: inline-grid; place-items: center; }
.lv-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.lv-live.on i { background: var(--ok); animation: lv-ring 2s ease-out infinite; }

/* ---------- Event feed ---------- */
.lv-feed { overflow: hidden; }
.lv-feed-head { gap: 10px; flex-wrap: wrap; }
.lv-feed-title { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: inherit; min-width: 0; }
.lv-feed-title h2 { white-space: nowrap; }
.lv-chev { width: 16px; height: 16px; color: var(--text-faint); transition: transform .2s var(--ease); }
.lv-feed.closed .lv-chev { transform: rotate(-90deg); }
.lv-feed.closed .lv-list, .lv-feed.closed .lv-feed-foot, .lv-feed.closed .lv-seg { display: none; }
.lv-feed.closed .lv-feed-head { border-bottom: 0; }
.lv-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.lv-seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--text-muted); font-size: 12px; }
.lv-seg button:hover { color: var(--text); }
.lv-seg button.on { background: var(--surface-3); color: var(--text-strong); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.lv-list { list-style: none; margin: 0; padding: 6px 0; max-height: 420px; overflow-y: auto; }
.lv-ev { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 16px; position: relative; }
.lv-ev + .lv-ev::before { content: ""; position: absolute; left: 29px; top: -7px; height: 14px; width: 1px; background: var(--border); }
.lv-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-muted); position: relative; z-index: 1; }
.lv-ic svg { width: 14px; height: 14px; stroke-width: 2; }
.lv-ok .lv-ic { background: var(--ok-soft); color: var(--ok); }
.lv-bad .lv-ic { background: var(--danger-soft); color: var(--danger); }
.lv-warn .lv-ic { background: var(--warn-soft); color: var(--warn); }
.lv-info .lv-ic { background: var(--info-soft); color: var(--info); }
.lv-body { display: flex; flex-direction: column; min-width: 0; }
.lv-h { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-h b { color: var(--text-strong); font-weight: 600; }
.lv-s { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-t { font-size: 11px; color: var(--text-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lv-ev.lv-new { animation: lv-in .45s var(--ease), lv-flash 2.4s ease-out; }
.lv-empty { padding: 14px 16px; }
.lv-feed-foot:empty { display: none; }
.lv-feed-foot { padding: 4px 16px 12px; }

/* ---------- Animations ---------- */
@keyframes lv-ring { 0% { box-shadow: 0 0 0 0 rgba(90, 169, 255, .55); } 70% { box-shadow: 0 0 0 7px rgba(90, 169, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(90, 169, 255, 0); } }
.conn.ok i, .lv-live.on i { animation-name: lv-ring-ok; }
@keyframes lv-ring-ok { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .55); } 70% { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }
@keyframes lv-pulse { 50% { opacity: .35; } }
@keyframes lv-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes lv-flash { 0% { background: rgba(90, 169, 255, 0.14); } 100% { background: transparent; } }
.tabpane:not([hidden]) { animation: lv-fade .22s var(--ease); }
@keyframes lv-fade { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .lv-np-l, .lv-np-n { display: none; }
}
@media (max-width: 700px) {
  .lv-bar { margin: -2px 0 12px; }
  .lv-bar-in { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
  .lv-now { flex-wrap: wrap; gap: 8px; }
  .lv-chips { flex-basis: 100%; }
  .lv-nextpub { justify-content: flex-start; }
  .lv-np-l { display: inline; }
  .lv-np-who { max-width: 40vw; }
  .conn { padding: 4px 8px; }
  .conn span { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  .lv-feed-head { align-items: flex-start; }
  .lv-seg { width: 100%; }
  .lv-seg button { flex: 1; }
  .lv-ev { padding: 8px 12px; gap: 8px; }
  .lv-ev + .lv-ev::before { left: 25px; }
  .ac-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
