:root{
  --bg: #150a29;
  --bg-2: #1c0f36;
  --panel: #1f1240;
  --panel-2: #261651;
  --line: #362266;
  --text: #ece8f7;
  --muted: #9c8fc2;
  --purple: #8b2fc9;
  --blue: #3a6fd8;
  --teal: #17a7a0;
  --green: #2fa84f;
  --orange: #f2942c;
  --coral: #e8484d;
  --yellow: #f4c430;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{
  background: radial-gradient(1200px 700px at 15% -10%, #2a1553 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height:100vh;
  display:flex;
}
h1,h2,h3,.brand-word{ font-family:'Sora', sans-serif; }
.mono{ font-family:'JetBrains Mono', monospace; }

/* ---- Sidebar ---- */
.sidebar{
  width: 250px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  display:flex; flex-direction:column; gap: 6px;
  position: sticky; top:0; height:100vh;
}
.brand{ display:flex; align-items:center; gap:10px; margin-bottom: 26px; padding: 0 6px;}
.brand svg{ width:34px; height:34px; flex-shrink:0; }
.brand-word{ font-size:15px; font-weight:800; letter-spacing:0.5px; line-height:1.1; }
.brand-word span{ display:block; font-family:'Inter'; font-weight:500; font-size:10px; color:var(--muted); letter-spacing:1.5px; }

.navgroup-label{ font-size:11px; text-transform:uppercase; letter-spacing:1.2px; color:var(--muted); margin:16px 10px 8px; }
.navitem{
  display:flex; align-items:center; gap:12px;
  padding: 11px 12px; border-radius:10px;
  color: var(--muted); text-decoration:none; font-size:14px; font-weight:500;
  cursor:pointer; border: 1px solid transparent;
  transition: all .15s ease;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.navitem:hover{ background: var(--panel); color: var(--text); }
.navitem.active{
  background: linear-gradient(90deg, rgba(139,47,201,0.25), rgba(58,111,216,0.12));
  color: var(--text);
  border-color: var(--line);
}
.navitem .dot{ width:7px; height:7px; border-radius:1px; transform:rotate(45deg); flex-shrink:0; }

.sidebar-foot{ margin-top:auto; padding: 14px 12px; border-top:1px solid var(--line); font-size:12px; color:var(--muted); }

/* ---- Main ---- */
.main{ flex:1; padding: 30px 40px 60px; max-width: 1280px; }
.topbar{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom: 28px; flex-wrap:wrap; gap:14px;}
.topbar h1{ font-size: 26px; font-weight:800; }
.topbar p{ color:var(--muted); font-size:14px; margin-top:4px; }
.pill-user{ display:flex; align-items:center; gap:10px; background:var(--panel); border:1px solid var(--line); padding:8px 14px; border-radius:999px; font-size:13px; }
.pill-user .av{ width:26px; height:26px; border-radius:50%; background:conic-gradient(var(--purple),var(--blue),var(--teal),var(--green),var(--orange),var(--coral),var(--yellow),var(--purple)); }

.view{ display:none; }
.view.active{ display:block; animation: fade .25s ease; }
@keyframes fade{ from{opacity:0; transform:translateY(4px);} to{opacity:1; transform:translateY(0);} }

/* Stat cards */
.grid-stats{ display:grid; grid-template-columns: repeat(4, 1fr); gap:16px; margin-bottom:28px; }
.stat-card{
  background: var(--panel); border:1px solid var(--line); border-radius:14px; padding:18px 20px;
  position:relative; overflow:hidden;
}
.stat-card::before{ content:''; position:absolute; top:0; left:0; width:100%; height:3px; }
.stat-card.c1::before{ background: linear-gradient(90deg,var(--purple),var(--blue)); }
.stat-card.c2::before{ background: linear-gradient(90deg,var(--teal),var(--green)); }
.stat-card.c3::before{ background: linear-gradient(90deg,var(--orange),var(--coral)); }
.stat-card.c4::before{ background: linear-gradient(90deg,var(--yellow),var(--orange)); }
.stat-label{ font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:0.6px; }
.stat-value{ font-size:28px; font-weight:800; margin-top:6px; font-family:'Sora'; }
.stat-delta{ font-size:12px; margin-top:6px; }
.stat-delta.up{ color:#5fd68a; } .stat-delta.down{ color:var(--coral); }

.panel{ background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:22px; }
.panel + .panel{ margin-top:20px; }
.panel h3{ font-size:15px; margin-bottom:14px; display:flex; align-items:center; gap:8px;}
.tri{ width:9px; height:9px; clip-path: polygon(50% 0,100% 100%,0 100%); display:inline-block; }

.two-col{ display:grid; grid-template-columns: 1.4fr 1fr; gap:20px; }

/* activity list */
.item-row{ display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); font-size:13px; }
.item-row:last-child{ border-bottom:none; }
.item-thumb{ width:38px; height:38px; border-radius:8px; flex-shrink:0; }
.item-row .grow{ flex:1; }
.item-row .net{ font-size:11px; color:var(--muted); }
.badge{ font-size:11px; padding:3px 9px; border-radius:999px; border:1px solid var(--line); }
.badge.ok{ color:#5fd68a; border-color:#2a6b45; }
.badge.pending{ color:var(--yellow); border-color:#6b5a1a; }

/* Buttons */
.btn{ border:none; border-radius:10px; padding:11px 18px; font-weight:600; font-size:13.5px; cursor:pointer; font-family:'Inter'; display:inline-flex; align-items:center; gap:8px; }
.btn-primary{ background: linear-gradient(90deg, var(--purple), var(--blue)); color:white; }
.btn-ghost{ background: transparent; border:1px solid var(--line); color:var(--text); }
.btn:active{ transform: scale(0.98); }

/* Generator */
.gen-layout{ display:grid; grid-template-columns: 380px 1fr; gap:20px; }
label{ font-size:12.5px; color:var(--muted); display:block; margin: 14px 0 6px; }
label:first-child{ margin-top:0; }
input[type=text], textarea, select{
  width:100%; background: var(--bg-2); border:1px solid var(--line); border-radius:10px;
  padding:10px 12px; color:var(--text); font-family:'Inter'; font-size:13.5px;
}
textarea{ resize:vertical; min-height:70px; }
.swatch-row{ display:flex; gap:8px; margin-top:4px; }
.swatch{ width:26px; height:26px; border-radius:50%; cursor:pointer; border:2px solid transparent; }
.swatch.sel{ border-color:white; }
.format-row{ display:flex; gap:8px; flex-wrap:wrap; }
.format-chip{ border:1px solid var(--line); border-radius:8px; padding:7px 12px; font-size:12.5px; cursor:pointer; color:var(--muted); }
.format-chip.sel{ border-color:var(--purple); color:var(--text); background:rgba(139,47,201,0.15); }

.canvas-wrap{ min-height: 480px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:16px; }
.creative-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:14px; width:100%; }
.creative-card{
  aspect-ratio: 4/5; border-radius:14px; position:relative; overflow:hidden;
  display:flex; align-items:flex-end; padding:14px; font-weight:700; font-size:13px;
  border:1px solid var(--line);
}
.creative-card .tag{ position:absolute; top:10px; right:10px; background:rgba(0,0,0,0.35); font-size:10px; padding:3px 8px; border-radius:6px; font-weight:500; }
.spin{ width:38px; height:38px; border-radius:50%; border:3px solid var(--line); border-top-color: var(--purple); animation: spin 0.8s linear infinite; }
@keyframes spin{ to{ transform: rotate(360deg); } }
.empty-state{ text-align:center; color:var(--muted); font-size:13.5px; max-width:280px; }

/* Scheduler */
.sched-toolbar{ display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; flex-wrap:wrap; gap:12px;}
.network-filter{ display:flex; gap:8px; flex-wrap:wrap; }
.net-chip{ display:flex; align-items:center; gap:6px; border:1px solid var(--line); border-radius:999px; padding:6px 12px; font-size:12px; color:var(--muted); cursor:pointer; }
.net-chip.sel{ color:var(--text); border-color:var(--blue); background:rgba(58,111,216,0.12); }
.net-dot{ width:8px; height:8px; border-radius:50%; }

.week-grid{ display:grid; grid-template-columns: repeat(7, 1fr); gap:10px; }
.day-col{ background:var(--bg-2); border:1px solid var(--line); border-radius:12px; padding:10px; min-height:220px; }
.day-col h4{ font-size:12px; color:var(--muted); font-weight:600; margin-bottom:8px; text-transform:uppercase; }
.post-chip{ border-radius:8px; padding:7px 8px; font-size:11.5px; margin-bottom:6px; color:white; font-weight:600; display:flex; gap:6px; align-items:center; }

.accounts-grid{ display:grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap:14px; }
.acc-card{ background:var(--bg-2); border:1px solid var(--line); border-radius:12px; padding:16px; display:flex; flex-direction:column; gap:10px;}
.acc-top{ display:flex; align-items:center; gap:10px; }
.acc-icon{ width:36px; height:36px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:15px; }
.acc-name{ font-weight:600; font-size:14px; }
.acc-sub{ font-size:11.5px; color:var(--muted); }

.note{ background: rgba(242,148,44,0.08); border:1px solid #6b4a1a; border-radius:12px; padding:14px 16px; font-size:12.5px; color:#e8c896; line-height:1.5; margin-top:18px;}
.note b{ color:var(--yellow); }

@media(max-width: 980px){
  .sidebar{ display:none; }
  .gen-layout,.two-col{ grid-template-columns:1fr; }
  .grid-stats{ grid-template-columns: repeat(2,1fr); }
  .main{ padding:20px; }
}