    /* ── App layout ── */
    #app-screen {
      display: none;
      min-height: 100vh;
    }

    /* Sidebar */
    .sidebar {
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      width: 240px;
      background: var(--surface);
      border-right: 1px solid var(--border);
      padding: 24px 16px;
      display: flex;
      flex-direction: column;
      z-index: 10;
    }

    .sidebar-logo {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 0 8px;
      margin-bottom: 32px;
    }

    .sidebar-logo .icon {
      width: 36px;
      height: 36px;
      background: linear-gradient(135deg, var(--primary), #818cf8);
      border-radius: 10px;
      display: grid;
      place-items: center;
      font-size: 18px;
    }

    .sidebar-logo span {
      font-size: 15px;
      font-weight: 700;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      border-radius: 10px;
      margin-bottom: 4px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      color: var(--text-dim);
      transition: all .2s;
      border: 1px solid transparent;
    }

    .nav-item:hover {
      background: var(--card);
      color: var(--text);
    }

    .nav-item.active {
      background: rgba(99, 102, 241, .15);
      color: var(--primary);
      border-color: rgba(99, 102, 241, .25);
    }

    .nav-item .nav-icon {
      font-size: 17px;
      width: 22px;
      text-align: center;
    }

    .sidebar-bottom {
      margin-top: auto;
    }

    .user-pill {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      background: var(--card);
      border-radius: 10px;
      border: 1px solid var(--border);
    }

    .user-avatar {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--primary), #818cf8);
      display: grid;
      place-items: center;
      font-size: 14px;
      font-weight: 700;
    }

    .user-info p {
      font-size: 13px;
      font-weight: 600;
    }

    .user-info span {
      font-size: 11px;
      color: var(--text-dim);
    }

    .btn-logout {
      margin-top: 10px;
      width: 100%;
      background: transparent;
      border: 1px solid var(--border);
      border-radius: 10px;
      color: var(--text-dim);
      padding: 8px;
      font-size: 13px;
      cursor: pointer;
      transition: all .2s;
      font-family: inherit;
    }

    .btn-logout:hover {
      border-color: var(--danger);
      color: var(--danger);
    }

    /* Main content */
    .main {
      margin-left: 240px;
      min-height: 100vh;
    }

    .topbar {
      padding: 20px 28px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--surface);
      position: sticky;
      top: 0;
      z-index: 5;
    }

    .topbar h2 {
      font-size: 18px;
      font-weight: 700;
    }

    .topbar p {
      font-size: 13px;
      color: var(--text-dim);
    }

    .content {
      padding: 28px;
    }

    /* Pages */
    .page {
      display: none;
    }

    .page.active {
      display: block;
    }

    /* Stats grid */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 16px;
      margin-bottom: 28px;
    }

    .stat-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .stat-label {
      font-size: 12px;
      color: var(--text-dim);
      font-weight: 500;
    }

    .stat-val {
      font-size: 30px;
      font-weight: 700;
    }

    .stat-val.green {
      color: var(--success);
    }

    .stat-val.yellow {
      color: var(--warn);
    }

    .stat-val.red {
      color: var(--danger);
    }

    .stat-val.purple {
      color: var(--primary);
    }

    /* Section card */
    .section-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      margin-bottom: 24px;
      overflow: hidden;
    }

    .section-header {
      padding: 18px 22px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .section-header h3 {
      font-size: 15px;
      font-weight: 700;
    }

    .section-header p {
      font-size: 13px;
      color: var(--text-dim);
    }

    /* Add Account Form */
    .add-form {
      padding: 22px;
      display: grid;
      grid-template-columns: 1fr 1fr auto;
      gap: 14px;
      align-items: end;
    }

    @media (max-width: 700px) {
      .add-form {
        grid-template-columns: 1fr;
      }
    }

    /* Accounts table */
    .accounts-table {
      width: 100%;
      border-collapse: collapse;
    }

    .accounts-table th {
      text-align: left;
      padding: 10px 18px;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: .05em;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
    }

    .accounts-table td {
      padding: 14px 18px;
      font-size: 13px;
      border-bottom: 1px solid rgba(37, 41, 52, .6);
      vertical-align: middle;
    }

    .accounts-table tr:last-child td {
      border-bottom: none;
    }

    .accounts-table tr:hover td {
      background: rgba(255, 255, 255, .02);
    }

    /* Badges */
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 10px;
      border-radius: 100px;
      font-size: 11px;
      font-weight: 600;
    }

    .badge::before {
      content: '';
      width: 6px;
      height: 6px;
      border-radius: 50%;
    }

    .badge.active {
      background: rgba(34, 197, 94, .12);
      color: var(--success);
      border: 1px solid rgba(34, 197, 94, .3);
    }

    .badge.active::before {
      background: var(--success);
    }

    .badge.disabled {
      background: rgba(75, 82, 99, .2);
      color: var(--muted);
      border: 1px solid rgba(75, 82, 99, .4);
    }

    .badge.disabled::before {
      background: var(--muted);
    }

    .badge.cooldown {
      background: rgba(245, 158, 11, .12);
      color: var(--warn);
      border: 1px solid rgba(245, 158, 11, .3);
    }

    .badge.cooldown::before {
      background: var(--warn);
    }

    /* Action group */
    .action-group {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    /* Empty state */
    .empty-state {
      padding: 60px 20px;
      text-align: center;
      color: var(--text-dim);
    }

    .empty-state .emoji {
      font-size: 40px;
      margin-bottom: 12px;
    }

    .empty-state p {
      font-size: 14px;
    }

    /* Loading spinner */
    .spinner {
      display: inline-block;
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255, 255, 255, .2);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin .7s linear infinite;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    /* Toast */
    #toast {
      position: fixed;
      bottom: 28px;
      right: 28px;
      z-index: 999;
      padding: 12px 20px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 500;
      transform: translateY(20px);
      opacity: 0;
      transition: all .3s;
      pointer-events: none;
      max-width: 320px;
    }

    #toast.show {
      transform: translateY(0);
      opacity: 1;
    }

    #toast.success {
      background: rgba(34, 197, 94, .9);
      color: #fff;
    }

    #toast.error {
      background: rgba(239, 68, 68, .9);
      color: #fff;
    }

    #toast.info {
      background: rgba(99, 102, 241, .9);
      color: #fff;
    }

    /* Modal */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .6);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 100;
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s;
    }

    .modal-overlay.open {
      opacity: 1;
      pointer-events: all;
    }

    .modal {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 32px;
      width: 100%;
      max-width: 420px;
      box-shadow: var(--shadow);
      transform: scale(.95);
      transition: transform .2s;
    }

    .modal-overlay.open .modal {
      transform: scale(1);
    }

    .modal h3 {
      font-size: 17px;
      font-weight: 700;
      margin-bottom: 8px;
    }

    .modal p {
      font-size: 13px;
      color: var(--text-dim);
      margin-bottom: 24px;
    }

    .modal-actions {
      display: flex;
      gap: 10px;
      margin-top: 20px;
    }

    .modal-actions .btn {
      flex: 1;
    }

    /* Proxy config info */
    .config-box {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 16px 18px;
      font-size: 13px;
    }

    .config-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 0;
      border-bottom: 1px solid var(--border);
    }

    .config-row:last-child {
      border-bottom: none;
    }

    .config-key {
      color: var(--text-dim);
      font-size: 12px;
    }

    .config-val {
      font-family: monospace;
      font-size: 13px;
      color: var(--primary);
      cursor: pointer;
    }

    .config-val:hover {
      text-decoration: underline;
    }

