/* ═══════════════════════════════════════════════════════════════════
   InstaScheduler — Dashboard CSS (v2 redesign, SHARK BOT-inspired)
   Mantém todos os nomes de classe legados; substitui o visual.
═══════════════════════════════════════════════════════════════════ */

:root {
  /* Background layers */
  --bg-deep: #060810;
  --bg: #0a0d18;
  --bg2: #0e1325;
  --surf: #131a30;
  --surf2: #1a223e;
  --surf3: #232c52;

  /* Brand */
  --acc: #6366f1;
  --acc2: #818cf8;
  --acc3: #a5b4fc;
  --cyn: #06b6d4;
  --cyn2: #22d3ee;
  --pink: #ec4899;

  /* Status */
  --grn: #10b981;
  --grn2: #34d399;
  --red: #f43f5e;
  --red2: #fb7185;
  --yel: #f59e0b;
  --yel2: #fbbf24;
  --blu: #3b82f6;

  /* Text */
  --txt: #f8fafc;
  --txt2: #94a3b8;
  --txt3: #64748b;
  --txt4: #475569;

  /* Borders */
  --brd: rgba(99, 102, 241, 0.12);
  --brd2: rgba(99, 102, 241, 0.24);
  --brd-soft: rgba(255, 255, 255, 0.06);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 30px rgba(0,0,0,0.32);
  --shadow-acc: 0 12px 32px rgba(99, 102, 241, 0.32);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, var(--acc) 0%, var(--cyn) 100%);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(6,182,212,0.05));
  --grad-card: linear-gradient(180deg, var(--surf) 0%, var(--bg2) 100%);

  /* Radius */
  --r-sm: 8px;
  --r: 12px;
  --rl: 16px;
  --r-xl: 22px;

  /* Layout */
  --sidebar-w: 264px;
  --topbar-h: 78px;

  /* Easings */
  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--txt);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(at 15% 8%, rgba(99,102,241,0.10) 0%, transparent 50%),
    radial-gradient(at 85% 30%, rgba(6,182,212,0.08) 0%, transparent 55%),
    radial-gradient(at 50% 100%, rgba(236,72,153,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar (webkit) */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.4); }

/* ═══════════════════════════════════════════════════════════════════
   AUTH
═══════════════════════════════════════════════════════════════════ */
#auth-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; position: relative; overflow: hidden;
  z-index: 1;
}
#auth-screen::before {
  content: ''; position: absolute;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(99,102,241,0.16) 0%, transparent 70%);
  top: -180px; right: -120px; pointer-events: none;
}
#auth-screen::after {
  content: ''; position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(6,182,212,0.10) 0%, transparent 70%);
  bottom: -100px; left: -100px; pointer-events: none;
}

.auth-box {
  background: var(--grad-card);
  border: 1px solid var(--brd);
  border-radius: var(--r-xl);
  padding: 40px;
  width: 440px; max-width: calc(100vw - 32px);
  position: relative; z-index: 1;
  box-shadow: var(--shadow-lg);
}

.auth-logo { text-align: center; margin-bottom: 28px; }

.auth-logo-ic {
  width: 60px; height: 60px;
  background: var(--grad-primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: var(--shadow-acc), 0 0 0 1px rgba(255,255,255,0.06) inset;
}

.auth-logo h1 {
  font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em;
}
.auth-logo p { color: var(--txt2); font-size: 0.88rem; margin-top: 4px; }

.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; text-align: center;
  padding: 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem; font-weight: 600;
  color: var(--txt2);
  transition: all 0.2s var(--ease);
  user-select: none;
}
.auth-tab.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 0.78rem; color: var(--txt2); font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.auth-field input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--brd);
  color: var(--txt);
  padding: 12px 14px;
  border-radius: var(--r);
  font-size: 0.92rem; font-family: inherit;
  transition: all 0.2s var(--ease);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--acc);
  background: var(--surf);
}

.auth-btn {
  width: 100%;
  background: var(--grad-primary);
  color: #fff; border: none;
  padding: 14px;
  border-radius: var(--r);
  font-size: 0.96rem; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  margin-top: 6px;
  box-shadow: 0 8px 22px rgba(99,102,241,0.3);
}
.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(99,102,241,0.45);
}

.auth-ref {
  margin-top: 14px; text-align: center;
  font-size: 0.82rem; color: var(--txt3);
}
.auth-ref a { color: var(--acc2); text-decoration: none; font-weight: 600; }
.auth-ref a:hover { color: var(--acc3); }

.msg-err {
  background: rgba(244,63,94,0.1);
  border: 1px solid rgba(244,63,94,0.28);
  color: #fda4af;
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 0.86rem;
  margin-bottom: 14px;
}
.msg-ok {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: #6ee7b7;
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 0.86rem;
  margin-bottom: 14px;
}

/* ═══════════════════════════════════════════════════════════════════
   MAINTENANCE
═══════════════════════════════════════════════════════════════════ */
#maint-screen {
  display: none; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.maint-box {
  background: var(--grad-card);
  border: 1px solid var(--brd);
  border-radius: var(--r-xl);
  padding: 50px 40px;
  text-align: center; max-width: 480px;
  box-shadow: var(--shadow-lg);
}
.maint-box h2 {
  font-size: 1.5rem; font-weight: 800;
  margin: 18px 0 10px; letter-spacing: -0.01em;
}
.maint-box p {
  color: var(--txt2); font-size: 0.95rem; line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════════ */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-width: 0;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--brd);
  display: flex; flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow: hidden;
}

.s-head {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--brd);
}

.s-logo {
  display: flex; align-items: center; gap: 10px;
}
.s-logo-ic {
  width: 36px; height: 36px;
  background: var(--grad-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(99,102,241,0.4), 0 0 0 1px rgba(255,255,255,0.08) inset;
}
.s-logo-t {
  font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em;
}

.s-user {
  display: flex; align-items: center; gap: 9px;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.s-user:hover {
  background: var(--surf2);
  border-color: var(--brd2);
}
.s-av {
  width: 32px; height: 32px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
}
.s-ui { flex: 1; min-width: 0; }
.s-un {
  font-size: 0.85rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.s-ur {
  font-size: 0.72rem; color: var(--txt3);
  margin-top: 1px;
}
.s-plan-badge {
  font-size: 0.62rem; font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: auto;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

/* sidebar nav */
nav.snav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.2) transparent;
}
nav.snav::-webkit-scrollbar { width: 4px; }

.sidebar::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 110px;
  height: 24px;
  pointer-events: none;
  background: linear-gradient(to top, var(--bg2), transparent);
  z-index: 1;
}

.ns {
  font-size: 0.66rem; font-weight: 800;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 14px 12px 6px;
  user-select: none;
}

.ni {
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 11px;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 2px;
  border-radius: var(--r-sm);
  font-size: 0.86rem; font-weight: 600;
  color: var(--txt2);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  position: relative;
  user-select: none;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
}
.ni svg {
  width: 17px; height: 17px;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--txt3);
  transition: color 0.18s var(--ease);
}
/* Title text node auto-places em (col 2, row 1) */
.ni::after {
  content: attr(data-sub);
  grid-column: 2;
  grid-row: 2;
  font-size: 0.7rem;
  color: var(--txt3);
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.ni:not([data-sub])::after { content: none; }

/* Item sem subtítulo: vira 1 linha (centrado) */
.ni:not([data-sub]) {
  grid-template-rows: 1fr;
}
.ni:not([data-sub]) svg { grid-row: 1; }

.ni:hover {
  background: var(--surf);
  color: var(--txt);
}
.ni:hover svg { color: var(--acc2); }
.ni.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.18) 0%, rgba(99,102,241,0.04) 100%);
  color: var(--txt);
  box-shadow: inset 3px 0 0 var(--acc);
}
.ni.active svg { color: var(--acc2); }
.ni.active::after { color: var(--txt2); }

/* Sidebar foot */
.s-foot {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--brd);
  background: var(--bg2);
  position: relative;
  z-index: 2;
}
.acc-sel { display: flex; flex-direction: column; gap: 6px; }
.acc-sel label {
  font-size: 0.7rem; color: var(--txt3); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.acc-sel select {
  background: var(--surf);
  border: 1px solid var(--brd);
  color: var(--txt);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 0.85rem; font-family: inherit;
  cursor: pointer;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
.acc-sel select:hover { border-color: var(--brd2); }
.acc-sel select:focus { border-color: var(--acc); }

.logout-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  background: rgba(244,63,94,0.08);
  border: 1px solid rgba(244,63,94,0.2);
  color: var(--red2);
  border-radius: var(--r-sm);
  font-size: 0.82rem; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.logout-btn:hover {
  background: rgba(244,63,94,0.15);
  border-color: rgba(244,63,94,0.36);
  color: #fda4af;
}

/* WhatsApp button no rodapé do sidebar */
.wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  background: rgba(37,211,102,0.1);
  border: 1px solid rgba(37,211,102,0.28);
  color: #25D366;
  border-radius: var(--r-sm);
  font-size: 0.82rem; font-weight: 700;
  text-decoration: none;
  transition: all 0.2s var(--ease);
}
.wa-btn:hover {
  background: rgba(37,211,102,0.18);
  border-color: rgba(37,211,102,0.5);
  color: #4ade80;
}
.wa-btn svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════
   TOPBAR (NEW)
═══════════════════════════════════════════════════════════════════ */
.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 14px 28px;
  min-height: var(--topbar-h);
  border-bottom: 1px solid var(--brd);
  background: rgba(10, 13, 24, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0;
  z-index: 50;
}

.tb-stat {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  background: var(--grad-soft);
  border: 1px solid var(--brd);
  border-radius: var(--r);
}
.tb-stat-ic {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--grn), #059669);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(16,185,129,0.3);
}
.tb-stat-ic svg { width: 18px; height: 18px; }
.tb-stat-text { flex: 1; min-width: 0; }
.tb-stat-label {
  font-size: 0.66rem; font-weight: 700;
  color: var(--txt3); letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; justify-content: space-between; gap: 8px;
  margin-bottom: 4px;
}
.tb-stat-label strong { color: var(--grn2); font-size: 0.7rem; }
.tb-stat-bar {
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  margin-bottom: 4px;
}
.tb-stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--grn), var(--cyn));
  border-radius: 2px;
  transition: width 0.6s var(--ease);
}
.tb-stat-value {
  font-size: 0.86rem; font-weight: 700;
  display: flex; align-items: baseline; gap: 4px;
}
.tb-stat-value strong { font-size: 0.95rem; letter-spacing: -0.01em; }
.tb-stat-value span { color: var(--txt3); font-weight: 500; font-size: 0.78rem; }

.tb-greet {
  text-align: center;
  min-width: 0;
}
.tb-greet h1 {
  font-size: 1.18rem; font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-greet h1 strong {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.tb-date {
  font-size: 0.7rem; color: var(--txt3);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 2px; font-weight: 600;
}

.tb-actions {
  display: flex; gap: 8px; align-items: center;
}
.tb-action {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surf);
  border: 1px solid var(--brd);
  display: flex; align-items: center; justify-content: center;
  color: var(--txt2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s var(--ease);
  position: relative;
}
.tb-action:hover {
  background: var(--surf2);
  border-color: var(--brd2);
  color: var(--txt);
  transform: translateY(-1px);
}
.tb-action svg { width: 18px; height: 18px; }
.tb-action .dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg2);
}

/* ═══════════════════════════════════════════════════════════════════
   PAGES & PAGE HEADER
═══════════════════════════════════════════════════════════════════ */
.page {
  display: none;
  padding: 28px;
  flex: 1;
  animation: pageIn 0.4s var(--ease);
}
.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ph {
  margin-bottom: 24px;
}
.ph h1 {
  font-size: 1.85rem; font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, var(--txt) 0%, var(--txt2) 200%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ph p {
  color: var(--txt2); font-size: 0.92rem;
  margin-top: 4px; line-height: 1.5;
  max-width: 720px;
}
.ph-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 24px;
}
.ph-row .ph { margin-bottom: 0; }

/* Filter tabs (pill style) */
.tabs {
  display: inline-flex;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.tab {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.84rem; font-weight: 600;
  color: var(--txt2);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  user-select: none;
  border: none;
  background: transparent;
  font-family: inherit;
}
.tab:hover { color: var(--txt); }
.tab.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* ═══════════════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════════════ */
.card {
  background: var(--grad-card);
  border: 1px solid var(--brd);
  border-radius: var(--rl);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s var(--ease);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--brd2);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(99,102,241,0.06), transparent 60%);
  pointer-events: none;
}
.card > * { position: relative; }

.ct {
  font-size: 0.75rem; font-weight: 800;
  color: var(--txt3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}

/* Stat (metric) layout — for big numbers */
.stat {
  display: flex; flex-direction: column;
  padding: 22px 24px;
  background: var(--grad-card);
  border: 1px solid var(--brd);
  border-radius: var(--rl);
  box-shadow: var(--shadow-card);
  transition: all 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(99,102,241,0.1), transparent 70%);
  top: -40px; right: -30px;
  pointer-events: none;
}
.stat:hover {
  transform: translateY(-2px);
  border-color: var(--brd2);
  box-shadow: var(--shadow);
}
.stat-l {
  font-size: 0.76rem; font-weight: 700;
  color: var(--txt3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  position: relative;
}
.stat-l svg { width: 16px; height: 16px; opacity: 0.7; }
.stat-v {
  font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  background: linear-gradient(180deg, var(--txt) 0%, var(--txt2) 200%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
.stat-v.acc { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-v.grn { color: var(--grn2); background: none; -webkit-text-fill-color: var(--grn2); }
.stat-v.red { color: var(--red2); background: none; -webkit-text-fill-color: var(--red2); }

.stat .delta, .stat-d {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.78rem; font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  position: relative;
  width: fit-content;
}
.stat .delta.up, .stat-d.up { background: rgba(16,185,129,0.12); color: var(--grn2); }
.stat .delta.down, .stat-d.down { background: rgba(244,63,94,0.12); color: var(--red2); }

/* Stat row grid */
.sr {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════════════ */
.fg { margin-bottom: 14px; }
.fg label {
  display: block;
  font-size: 0.78rem; font-weight: 600;
  color: var(--txt2);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.fg input,
.fg textarea,
.fg select {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--brd);
  color: var(--txt);
  padding: 10px 13px;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s var(--ease);
}
.fg input:focus,
.fg textarea:focus,
.fg select:focus {
  outline: none;
  border-color: var(--acc);
  background: var(--surf);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
.fg textarea {
  resize: vertical;
  min-height: 84px;
  font-family: inherit;
  line-height: 1.5;
}
.fg input[readonly] { background: var(--bg2); cursor: not-allowed; opacity: 0.85; }

.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-size: 0.88rem; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: var(--surf);
  color: var(--txt);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; }

.btn-p {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99,102,241,0.28);
}
.btn-p:hover {
  box-shadow: 0 10px 24px rgba(99,102,241,0.42);
}

.btn-d {
  background: linear-gradient(135deg, var(--red), #e11d48);
  color: #fff;
  box-shadow: 0 6px 16px rgba(244,63,94,0.28);
}
.btn-d:hover { box-shadow: 0 10px 24px rgba(244,63,94,0.42); }

.btn-g {
  background: var(--surf);
  border: 1px solid var(--brd);
  color: var(--txt);
}
.btn-g:hover {
  background: var(--surf2);
  border-color: var(--brd2);
}

.btn-s {
  background: linear-gradient(135deg, var(--grn), #059669);
  color: #fff;
  box-shadow: 0 6px 16px rgba(16,185,129,0.28);
}
.btn-s:hover { box-shadow: 0 10px 24px rgba(16,185,129,0.42); }

.btn-w {
  background: linear-gradient(135deg, var(--yel), #d97706);
  color: #fff;
  box-shadow: 0 6px 16px rgba(245,158,11,0.28);
}
.btn-w:hover { box-shadow: 0 10px 24px rgba(245,158,11,0.42); }

.btn-sm { padding: 7px 12px; font-size: 0.8rem; gap: 5px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-xs { padding: 4px 9px; font-size: 0.75rem; gap: 4px; }
.btn-xs svg { width: 12px; height: 12px; }

.btn:disabled, .btn[disabled] {
  opacity: 0.5; cursor: not-allowed; transform: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════════════ */
.b {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.b-pend { background: rgba(99,102,241,0.14); color: var(--acc2); border: 1px solid rgba(99,102,241,0.28); }
.b-pub { background: rgba(16,185,129,0.14); color: var(--grn2); border: 1px solid rgba(16,185,129,0.28); }
.b-fail { background: rgba(244,63,94,0.14); color: var(--red2); border: 1px solid rgba(244,63,94,0.28); }
.b-proc { background: rgba(245,158,11,0.14); color: var(--yel2); border: 1px solid rgba(245,158,11,0.28); }
.b-wait { background: rgba(148,163,184,0.14); color: var(--txt2); border: 1px solid rgba(148,163,184,0.28); }
.b-admin { background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(236,72,153,0.18)); color: var(--yel2); border: 1px solid rgba(245,158,11,0.32); }
.b-user { background: rgba(148,163,184,0.14); color: var(--txt2); border: 1px solid rgba(148,163,184,0.28); }
.b-act { background: rgba(16,185,129,0.14); color: var(--grn2); border: 1px solid rgba(16,185,129,0.28); }
.b-inact { background: rgba(148,163,184,0.1); color: var(--txt3); border: 1px solid rgba(148,163,184,0.18); }

.plan-tag-basic { background: rgba(6,182,212,0.16); color: var(--cyn2); border: 1px solid rgba(6,182,212,0.32); }
.plan-tag-pro { background: rgba(99,102,241,0.16); color: var(--acc2); border: 1px solid rgba(99,102,241,0.32); }
.plan-tag-agency { background: rgba(245,158,11,0.16); color: var(--yel2); border: 1px solid rgba(245,158,11,0.32); }
.plan-tag-start { background: rgba(148,163,184,0.14); color: var(--txt2); border: 1px solid rgba(148,163,184,0.28); }

/* ═══════════════════════════════════════════════════════════════════
   BOXES (inline messages)
═══════════════════════════════════════════════════════════════════ */
.ibox, .ebox, .wbox {
  padding: 14px 18px;
  border-radius: var(--r);
  font-size: 0.9rem; line-height: 1.55;
  margin-bottom: 14px;
  border: 1px solid;
  display: block;
}
.ibox {
  background: rgba(99,102,241,0.06);
  border-color: rgba(99,102,241,0.22);
  color: var(--acc3);
}
.ebox {
  background: rgba(244,63,94,0.06);
  border-color: rgba(244,63,94,0.22);
  color: #fda4af;
}
.wbox {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.22);
  color: var(--yel2);
}
.ibox strong, .ebox strong, .wbox strong { color: var(--txt); }
.ibox code, .ebox code, .wbox code {
  background: rgba(255,255,255,0.05);
  padding: 1px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84em;
}

/* ═══════════════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════════════ */
.tw {
  background: var(--bg);
  border-radius: var(--r);
  overflow: auto;
  border: 1px solid var(--brd);
}
.tw table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
}
.tw thead {
  background: var(--surf);
  position: sticky; top: 0;
  z-index: 1;
}
.tw th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.7rem; font-weight: 800;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--brd);
  white-space: nowrap;
}
.tw td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--brd);
  vertical-align: middle;
  color: var(--txt);
}
.tw tbody tr {
  transition: background 0.15s;
}
.tw tbody tr:hover { background: rgba(99,102,241,0.04); }
.tw tbody tr:last-child td { border-bottom: none; }
.tw td code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78em;
  color: var(--txt2);
  background: rgba(255,255,255,0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   TIMING SLOTS
═══════════════════════════════════════════════════════════════════ */
.tslots {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 10px;
}
.tslot {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--txt);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.tslot:hover {
  background: var(--surf2);
  border-color: var(--brd2);
}
.tslot button, .tslot .x {
  width: 18px; height: 18px;
  background: rgba(244,63,94,0.16);
  color: var(--red2);
  border: none;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
  line-height: 1;
}
.tslot button:hover { background: rgba(244,63,94,0.32); }

/* ═══════════════════════════════════════════════════════════════════
   TOGGLE
═══════════════════════════════════════════════════════════════════ */
.tog {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}
.tog input { opacity: 0; width: 0; height: 0; }
.tsl {
  position: absolute;
  inset: 0;
  background: var(--surf3);
  border-radius: 999px;
  transition: background 0.25s var(--ease);
}
.tsl::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s var(--ease);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.tog input:checked + .tsl {
  background: var(--grad-primary);
}
.tog input:checked + .tsl::before {
  transform: translateX(18px);
}

.tog-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--r-sm);
}
.tog-row label:first-child {
  font-size: 0.86rem; font-weight: 600;
  color: var(--txt);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   UPLOAD
═══════════════════════════════════════════════════════════════════ */
.upzone {
  border: 2px dashed var(--brd2);
  border-radius: var(--rl);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  background: var(--surf);
}
.upzone:hover, .upzone.drag {
  border-color: var(--acc);
  background: rgba(99,102,241,0.05);
}
.up-ic {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--grad-soft);
  border: 1px solid var(--brd2);
  display: flex; align-items: center; justify-content: center;
  color: var(--acc2);
}
.up-ic svg { width: 24px; height: 24px; }
.upfn {
  margin-top: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  color: var(--acc2);
  word-break: break-all;
}

/* ═══════════════════════════════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════════════════════════════ */
.prog {
  width: 100%;
  height: 6px;
  background: var(--surf2);
  border-radius: 3px;
  overflow: hidden;
}
.prog-b {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 3px;
  transition: width 0.6s var(--ease);
}

/* ═══════════════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════════════ */
.empty {
  text-align: center;
  padding: 50px 30px;
  color: var(--txt3);
  font-size: 0.92rem;
  background: var(--surf);
  border: 1px dashed var(--brd2);
  border-radius: var(--rl);
}

/* ═══════════════════════════════════════════════════════════════════
   FILE PATH (like /watch/...)
═══════════════════════════════════════════════════════════════════ */
.fpath {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--cyn2);
  background: rgba(6,182,212,0.06);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(6,182,212,0.2);
  word-break: break-all;
}

/* Random order cell (in accounts table) */
.rand-order-cell {
  display: flex; align-items: center; gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 0.88rem; font-weight: 600;
  background: var(--surf);
  border: 1px solid var(--brd);
  box-shadow: var(--shadow-lg);
  color: var(--txt);
  min-width: 220px;
  max-width: 360px;
  pointer-events: auto;
  animation: toastIn 0.3s var(--ease);
}
.toast.success {
  background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(16,185,129,0.06));
  border-color: rgba(16,185,129,0.4);
  color: var(--grn2);
}
.toast.error {
  background: linear-gradient(135deg, rgba(244,63,94,0.18), rgba(244,63,94,0.06));
  border-color: rgba(244,63,94,0.4);
  color: var(--red2);
}
.toast.info {
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(99,102,241,0.06));
  border-color: rgba(99,102,241,0.4);
  color: var(--acc2);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════
   BOTS TELEGRAM (sub-tabs + modal foot)
═══════════════════════════════════════════════════════════════════ */
.bots-tabs {
  display: flex;
  gap: 4px;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.bots-tab {
  flex: 1;
  min-width: 130px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem; font-weight: 600;
  color: var(--txt2);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  user-select: none;
  border: none;
  background: transparent;
  font-family: inherit;
  letter-spacing: -0.005em;
}
.bots-tab:hover { color: var(--txt); background: rgba(99,102,241,0.06); }
.bots-tab.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.32);
}
.bots-tab .bt-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  flex-shrink: 0;
}
.bots-tab .bt-icon svg { width: 16px; height: 16px; }
.bots-tab .bt-label { white-space: nowrap; }

@media (max-width: 760px) {
  .bots-tabs { gap: 3px; }
  .bots-tab { min-width: auto; padding: 9px 12px; font-size: 0.8rem; gap: 6px; }
  .bots-tab .bt-label { display: none; }
}

.bots-modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 26px 22px;
  border-top: 1px solid var(--brd);
}

/* ── PostFlow Dashboard rich layout ─────────────────────────── */

/* Top stats row (6 cards) */
.pf-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.pf-stat {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s var(--ease);
}
.pf-stat:hover { transform: translateY(-2px); border-color: var(--brd2); }
.pf-stat-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.pf-stat-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pf-stat-icon svg { width: 14px; height: 14px; }
.pf-stat-label {
  font-size: 0.74rem; font-weight: 700;
  color: var(--txt2);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.pf-stat-value {
  font-size: 1.65rem; font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
}

/* Color variants */
.pf-stat-grn .pf-stat-icon { background: rgba(16,185,129,0.12); color: var(--grn2); border: 1px solid rgba(16,185,129,0.28); }
.pf-stat-grn .pf-stat-value { color: var(--grn2); }
.pf-stat-cyn .pf-stat-icon { background: rgba(6,182,212,0.12); color: var(--cyn2); border: 1px solid rgba(6,182,212,0.28); }
.pf-stat-cyn .pf-stat-value { color: var(--cyn2); }
.pf-stat-pur .pf-stat-icon { background: rgba(99,102,241,0.12); color: var(--acc2); border: 1px solid rgba(99,102,241,0.28); }
.pf-stat-pur .pf-stat-value { color: var(--acc2); }
.pf-stat-yel .pf-stat-icon { background: rgba(245,158,11,0.14); color: var(--yel2); border: 1px solid rgba(245,158,11,0.3); }
.pf-stat-yel .pf-stat-value { color: var(--yel2); }
.pf-stat-red .pf-stat-icon { background: rgba(244,63,94,0.12); color: var(--red2); border: 1px solid rgba(244,63,94,0.28); }
.pf-stat-red .pf-stat-value { color: var(--red2); }

/* Members analytics card */
.pf-members-card {
  background: var(--grad-card);
  border: 1px solid var(--brd);
  border-radius: var(--rl);
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}
.pf-members-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.pf-members-title {
  display: flex; align-items: center; gap: 12px;
  color: var(--txt);
}
.pf-members-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(6,182,212,.16));
  border: 1px solid rgba(99,102,241,.3);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pf-members-icon-wrap svg { width: 18px; height: 18px; color: var(--acc2); }
.pf-members-h {
  font-size: 1rem; font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--txt);
  line-height: 1.2;
}
.pf-members-sub {
  font-size: 0.78rem; color: var(--txt3);
  font-weight: 500;
  margin-top: 2px;
}

.pf-period-tabs {
  display: inline-flex;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: 999px;
  padding: 3px;
  gap: 1px;
  overflow-x: auto;
  max-width: 100%;
}
.pf-period-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--txt2);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  user-select: none;
  border: none;
  background: transparent;
  font-family: inherit;
  white-space: nowrap;
}
.pf-period-tab:hover { color: var(--txt); }
.pf-period-tab.active {
  background: var(--yel);
  color: #1a1a1a;
  font-weight: 700;
}

.pf-members-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.pf-member-stat {
  padding: 14px 14px 12px;
  border-radius: var(--r);
  text-align: left;
  border: 1px solid;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 0;
}
.pf-member-grn {
  background: rgba(16,185,129,0.06);
  border-color: rgba(16,185,129,0.22);
}
.pf-member-red {
  background: rgba(244,63,94,0.06);
  border-color: rgba(244,63,94,0.22);
}
.pf-member-neu {
  background: rgba(148,163,184,0.06);
  border-color: rgba(148,163,184,0.22);
}
.pf-member-stat-row {
  display: flex; align-items: center; gap: 8px;
}
.pf-member-chip {
  width: 22px; height: 22px;
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 800;
  line-height: 1;
}
.pf-chip-grn { background: rgba(16,185,129,0.18); color: var(--grn2); }
.pf-chip-red { background: rgba(244,63,94,0.18); color: var(--red2); }
.pf-chip-neu { background: rgba(148,163,184,0.18); color: var(--txt2); }
.pf-member-tag {
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--txt3);
}
.pf-member-grn .pf-member-value { color: var(--grn2); }
.pf-member-red .pf-member-value { color: var(--red2); }
.pf-member-neu .pf-member-value { color: var(--txt); }
.pf-member-value {
  font-size: 1.7rem; font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 2px 0 4px;
  font-variant-numeric: tabular-nums;
}
.pf-member-bar {
  height: 4px; border-radius: 999px;
  background: rgba(255,255,255,.04);
  overflow: hidden;
}
.pf-member-bar-fill {
  height: 100%; border-radius: 999px;
  transition: width 0.4s var(--ease);
}
.pf-bar-grn { background: linear-gradient(90deg, rgba(16,185,129,.7), var(--grn2)); }
.pf-bar-red { background: linear-gradient(90deg, rgba(244,63,94,.7), var(--red2)); }
.pf-bar-neu { background: linear-gradient(90deg, rgba(148,163,184,.5), rgba(148,163,184,.8)); }
.pf-member-label {
  font-size: 0.72rem; font-weight: 500;
  color: var(--txt3);
  margin-top: 2px;
}

/* Section header */
.pf-section {
  font-size: 1.05rem; font-weight: 800;
  letter-spacing: -0.01em;
  margin: 8px 0 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--txt);
}
.pf-section svg { width: 18px; height: 18px; color: var(--acc2); }

/* Group cards grid */
.pf-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.pf-group-card {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: flex; flex-direction: column; gap: 12px;
}
.pf-group-card:hover {
  transform: translateY(-3px);
  border-color: var(--brd2);
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}
.pf-group-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px;
}
.pf-group-name {
  font-size: 0.98rem; font-weight: 700;
  color: var(--txt);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.pf-group-bot {
  font-size: 0.74rem; color: var(--txt3);
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.pf-group-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 10px;
}
.pf-mini-stat { text-align: center; }
.pf-mini-v {
  font-size: 1.3rem; font-weight: 800;
  color: var(--yel2);
  line-height: 1;
  letter-spacing: -0.02em;
}
.pf-mini-stat:nth-child(2) .pf-mini-v { color: var(--cyn2); }
.pf-mini-stat:nth-child(3) .pf-mini-v { color: var(--acc2); }
.pf-mini-l {
  font-size: 0.62rem; font-weight: 700;
  color: var(--txt3);
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.pf-group-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pf-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.74rem; font-weight: 600;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.22);
  color: var(--yel2);
}
.pf-pill svg { width: 11px; height: 11px; flex-shrink: 0; }
.pf-pill-react {
  background: rgba(255,255,255,0.04);
  border-color: var(--brd);
  color: var(--txt);
  font-size: 0.92rem;
  letter-spacing: 0;
}

.pf-group-foot {
  display: flex; gap: 12px; align-items: center;
  font-size: 0.74rem; font-weight: 600;
}
.pf-foot-label { color: var(--txt3); letter-spacing: 0.05em; }
.pf-foot-grn { color: var(--grn2); }
.pf-foot-red { color: var(--red2); }

/* Responsive */
@media (max-width: 1100px) {
  .pf-stats { grid-template-columns: repeat(3, 1fr); }
  .pf-groups { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .pf-stats { grid-template-columns: repeat(2, 1fr); }
  .pf-groups { grid-template-columns: 1fr; }
  .pf-members-card { padding: 14px 14px 12px; }
  .pf-members-head { margin-bottom: 12px; }
  .pf-members-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pf-member-stat { padding: 10px 9px 9px; gap: 6px; }
  .pf-member-stat-row { gap: 5px; }
  .pf-member-chip { width: 18px; height: 18px; border-radius: 5px; font-size: 0.78rem; }
  .pf-member-tag { font-size: 0.6rem; letter-spacing: 0.06em; }
  .pf-member-value { font-size: 1.3rem; }
  .pf-member-label { font-size: 0.66rem; }
  .pf-period-tab { padding: 5px 10px; font-size: 0.72rem; }
  .pf-members-icon-wrap { width: 32px; height: 32px; }
  .pf-members-h { font-size: 0.95rem; }
}
@media (max-width: 380px) {
  .pf-member-tag { display: none; }
  .pf-member-value { font-size: 1.2rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   PIX MODAL (subscription checkout)
═══════════════════════════════════════════════════════════════════ */
.pix-modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 9500;
  align-items: center; justify-content: center;
  padding: 16px;
}
.pix-modal.open { display: flex; }
.pix-back {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pix-card {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--grad-card);
  border: 1px solid var(--brd2);
  border-radius: var(--r-xl);
  padding: 30px 26px 26px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: pixIn 0.3s var(--ease);
}
@keyframes pixIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.pix-close {
  position: absolute; top: 12px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surf);
  border: 1px solid var(--brd);
  color: var(--txt2);
  font-size: 1.4rem; line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 3px;
  transition: all 0.2s var(--ease);
}
.pix-close:hover { background: var(--surf2); color: var(--txt); }

.pix-qr {
  width: 280px; height: 280px;
  background: #fff;
  border-radius: 14px;
  padding: 8px;
  margin: 0 auto 16px;
  display: block;
  max-width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.pix-code-wrap { margin-bottom: 16px; }
.pix-code-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--txt3);
  margin-bottom: 6px;
}
.pix-code-row {
  display: flex; gap: 8px; align-items: stretch;
  background: var(--bg);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 8px 8px 8px 12px;
}
.pix-code-row code {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: var(--cyn2);
  word-break: break-all;
  text-align: left;
  line-height: 1.4;
  max-height: 60px;
  overflow-y: auto;
  align-self: center;
}

.pix-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.88rem; font-weight: 600;
  margin-top: 6px;
}
.pix-pending {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--acc2);
}
.pix-ok {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--grn2);
}
.pix-fail {
  background: rgba(244,63,94,0.12);
  border: 1px solid rgba(244,63,94,0.3);
  color: var(--red2);
}
.pix-warn {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--yel2);
}
.pix-spin {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: pixSpin 0.8s linear infinite;
}
@keyframes pixSpin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .pix-card { padding: 22px 18px 18px; }
  .pix-qr { width: 240px; height: 240px; }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════ */

/* Tablet — sidebar narrower, esconde subtítulos */
@media (max-width: 1100px) {
  :root { --sidebar-w: 220px; }
  .ni::after { content: none; }
  .ni { grid-template-rows: 1fr; }
  .ni svg { grid-row: 1; }
  .topbar { grid-template-columns: 1fr auto; padding: 14px 20px; }
  .tb-stat { display: none; }
}

/* Mobile — sidebar overlay, full-width main */
@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .page { padding: 18px; }
  .topbar { padding: 12px 14px 12px 64px; gap: 12px; }
  .tb-greet h1 { font-size: 0.95rem; line-height: 1.2; }
  .tb-date { font-size: 0.62rem; letter-spacing: 0.06em; }
  .tb-action { width: 34px; height: 34px; }
  .tb-action svg { width: 16px; height: 16px; }
  .tb-actions { gap: 6px; }
  .ph h1 { font-size: 1.4rem; }
  .sr { grid-template-columns: 1fr; }
  .f2, .f3 { grid-template-columns: 1fr; }

  /* Mobile menu hamburger button */
  .nav-mobile-btn {
    display: flex;
    position: fixed;
    top: 14px; left: 14px;
    z-index: 250;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--surf);
    border: 1px solid var(--brd);
    align-items: center; justify-content: center;
    color: var(--txt);
    cursor: pointer;
  }

  /* Backdrop when sidebar open */
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 199;
  }
  .sidebar.open ~ .sidebar-backdrop { display: block; }
}

@media (min-width: 761px) {
  .nav-mobile-btn { display: none !important; }
  .sidebar-backdrop { display: none !important; }
}

/* Onboarding steps */
.onb-step {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--brd);
}
.onb-step:last-of-type { border-bottom: 0; }
.onb-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #fff;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.onb-step h4 {
  font-size: 1rem; font-weight: 700;
  margin: 4px 0 4px;
  color: var(--txt);
}
.onb-step p {
  font-size: 0.88rem; color: var(--txt2);
  line-height: 1.55;
  margin: 0;
}
.onb-step a {
  color: var(--acc2); text-decoration: underline;
}
.onb-step code {
  background: var(--surf2); padding: 2px 6px; border-radius: 4px;
  font-size: 0.78rem; font-family: ui-monospace, monospace;
  color: var(--acc2);
  display: inline-block; margin: 2px 0;
  word-break: break-all;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
