:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #181820;
  --bg4: #1e1e28;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #f0f0f5;
  --muted: #8888a0;
  --dim: #555568;
  --accent: #7c5cfc;
  --accent2: #a78bfa;
  --accent3: #c4b5fd;
  --tiktok: #ff2d55;
  --insta: #e1306c;
  --youtube: #ff0000;
  --success: #22d3a0;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 99px; }

.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform .3s ease;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.7);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-open .sidebar {
  transform: translateX(0);
}

.logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub { font-size: 11px; color: var(--dim); margin-top: 2px; letter-spacing: 0.5px; }

nav { flex: 1; padding: 16px 10px; overflow-y: auto; }
.nav-label {
  font-size: 10px; letter-spacing: 1.5px; color: var(--dim);
  padding: 8px 10px 4px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  font-size: 14px; color: var(--muted);
  cursor: pointer; transition: all .15s;
  margin-bottom: 2px; border: none; background: none;
  width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(124,92,252,0.15); color: var(--accent2); }
.nav-item svg { flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 99px; font-weight: 600;
}

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius); cursor: pointer; transition: background .15s;
}
.user-pill:hover { background: var(--bg3); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #f472b6);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; }
.user-plan { font-size: 11px; color: var(--muted); }

.main {
  margin-left: 220px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--text);
  transition: transform .3s ease, opacity .2s ease;
}

body.sidebar-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.sidebar-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

body.sidebar-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 16px; flex: 1;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.content { padding: 28px; flex: 1; }

.view { display: none; }
.view.active { display: block; animation: fadeIn .2s ease; }

.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
}
.section-title { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 700; }
.section-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 14px; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.stat-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-num { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; }
.stat-change { font-size: 12px; color: var(--success); margin-top: 4px; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 20px; }
  .content { padding: 24px 20px 80px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 700px) {
  .grid-4 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .sidebar {
    width: min(320px, 85vw);
    min-width: 0;
  }
  .topbar {
    height: auto;
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .page-title {
    order: 2;
    width: 100%;
    font-size: 15px;
  }
  .topbar-actions {
    order: 3;
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
  }
  .topbar-actions .btn { width: auto; }
  .content { padding: 20px 16px 72px; }
  .card { padding: 18px; }
  .stat-card { padding: 16px 18px; }
  .upload-zone { padding: 40px 24px; }
  .section-title { font-size: 17px; }
  .section-sub { font-size: 12px; }
}

@media (max-width: 480px) {
  .topbar-actions .btn.btn-primary {
    padding: 9px 12px;
  }
  .topbar-actions .btn svg {
    margin-right: 0;
  }
  .topbar-actions .btn .btn-label {
    display: none;
  }
  .content { padding-bottom: 64px; }
  .card { padding: 16px; }
}
