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

    :root {
      --primary: #1E40AF;
      --primary-dark: #1E3A8A;
      --accent: #EA580C;
      --accent-hover: #C2410C;
      --sidebar-bg: #2d3748;
      --sidebar-text: #94a3b8;
      --sidebar-active-bg: rgba(255,255,255,0.07);
      --bg: #F8F5F1;
      --card: #fff;
      --text: #1A1A2E;
      --muted: #5B5B73;
      --border: #E8E2D8;
      --green: #15803D;
      --red: #dc2626;
      --radius: 12px;
      --sidebar-width: 240px;
    }

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

    /* ======== SIDEBAR ======== */
    #sidebar {
      width: var(--sidebar-width);
      min-width: var(--sidebar-width);
      background: var(--sidebar-bg);
      display: flex;
      flex-direction: column;
      height: 100vh;
      position: sticky;
      top: 0;
      overflow-y: auto;
      z-index: 50;
      transition: transform 0.25s ease;
    }

    .sidebar-logo {
      padding: 20px 20px 16px;
      font-size: 1.2rem;
      font-weight: 800;
      color: #fff;
      letter-spacing: -.3px;
      border-bottom: 1px solid rgba(255,255,255,0.07);
      margin-bottom: 8px;
      display: block;
      text-decoration: none;
    }
    .sidebar-logo span { color: var(--primary); }

    .sidebar-nav { flex: 1; padding: 0 10px; }
    .sidebar-divider { border: none; border-top: 1px solid rgba(255,255,255,0.07); margin: 8px 10px; }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 12px;
      border-radius: 8px;
      cursor: pointer;
      color: var(--sidebar-text);
      font-size: .875rem;
      font-weight: 500;
      transition: background 0.12s, color 0.12s;
      border: none;
      background: none;
      width: 100%;
      text-align: left;
      border-left: 3px solid transparent;
      margin-bottom: 2px;
    }
    .nav-item:hover { background: var(--sidebar-active-bg); color: #fff; }
    .nav-item.active {
      background: var(--sidebar-active-bg);
      color: #fff;
      border-left-color: var(--primary);
    }
    .nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

    .sidebar-bottom {
      padding: 12px 10px 20px;
      border-top: 1px solid rgba(255,255,255,0.07);
    }
    .btn-upgrade {
      display: block;
      width: 100%;
      background: #1E40AF;
      color: #fff;
      border: none;
      border-radius: 10px;
      padding: 12px 16px;
      font-size: .9rem;
      font-weight: 700;
      cursor: pointer;
      text-align: center;
      text-decoration: none;
      transition: background 0.12s;
      font-family: inherit;
      line-height: 1.3;
    }
    .btn-upgrade:hover { background: var(--primary-dark); }
    .btn-upgrade-sub {
      display: block;
      font-size: .78rem;
      font-weight: 400;
      color: rgba(255,255,255,0.75);
      margin-top: 4px;
    }

    /* ======== MAIN LAYOUT ======== */
    #appShell { display: none; width: 100%; min-height: 100vh; }
    #appShellInner { display: flex; width: 100%; min-height: 100vh; }

    #mainWrapper {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      min-height: 100vh;
    }

    #topBar {
      background: var(--card);
      border-bottom: 1px solid var(--border);
      padding: 0 24px;
      height: 56px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      z-index: 40;
    }
    .hamburger {
      display: none;
      background: none;
      border: none;
      cursor: pointer;
      padding: 6px;
      border-radius: 6px;
      color: var(--text);
      font-size: 1.3rem;
      line-height: 1;
    }
    .hamburger:hover { background: var(--bg); }
    .topbar-logo { font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
    .topbar-logo span { color: var(--primary); }
    #userEmailTop { font-size: .85rem; color: var(--muted); }

    #mainContent {
      flex: 1;
      padding: 32px;
      max-width: 960px;
      width: 100%;
      margin: 0 auto;
    }

    /* ======== TYPOGRAPHY ======== */
    .page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
    .page-subtitle { color: var(--muted); font-size: .9rem; margin-bottom: 28px; }

    /* ======== VIEWS ======== */
    .view { display: none; }
    .view.active { display: block; }

    #sidebarOverlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.4);
      z-index: 45;
    }

    /* ======== RESPONSIVE ======== */
    @media (max-width: 768px) {
      #sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 50;
      }
      #sidebar.open { transform: translateX(0); }
      #sidebarOverlay.show { display: block; }
      .hamburger { display: block; }
      #mainContent { padding: 20px 16px; }
      .stats-row { grid-template-columns: 1fr 1fr; }
      #topBar { padding: 0 16px; }
      .topbar-logo { display: none; }
    }

    @media (max-width: 480px) {
      .stats-row { grid-template-columns: 1fr; }
      .bot-actions { flex-wrap: wrap; }
    }
