/* Copied from user/index.html (dashboard redesign) for the Account pages. */
:root {
      --smn-primary: #4f46e5;
      --smn-primary-light: #8b93f8;
      --smn-primary-dark: #4338ca;
      --smn-success: #22c55e;
      --smn-success-light: #4ade80;
      --smn-warning: #f59e0b;
      --smn-danger: #f87171;
      --smn-info: #38bdf8;
      --smn-bg: #0b0d14;
      --smn-bg-2: #0e1119;
      --smn-card: #141824;
      --smn-card-2: #1a1f2e;
      --smn-text: #e7eaf3;
      --smn-text-muted: #a2abc2;
      --smn-text-dim: #828ba1;
      --smn-border: #242a3b;
      --smn-border-2: #313a52;
      --smn-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
      --smn-gradient-green: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
      --smn-radius: 16px;
      --smn-shadow: 0 1px 2px rgba(0,0,0,.4);
      --smn-shadow-hover: 0 14px 34px -12px rgba(0,0,0,.7);
    }

    * { box-sizing: border-box; }

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      background: var(--smn-bg);
      color: var(--smn-text);
      margin: 0;
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
    }
    ::selection { background: rgba(99,102,241,.36); }
    :focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,.3); border-radius: 8px; }

    .wrapper { display: flex; min-height: 100vh; }

    /* ── Sidebar ── */
    .smn-sidebar {
      width: 260px;
      background: var(--smn-bg-2);
      border-right: 1px solid var(--smn-border);
      color: var(--smn-text-muted);
      display: flex;
      flex-direction: column;
      position: fixed;
      top: 0; left: 0; bottom: 0;
      z-index: 100;
      transition: transform 0.3s;
    }
    .smn-sidebar-brand {
      padding: 22px 22px 14px;
      display: flex;
      align-items: center;
      gap: 11px;
    }
    .smn-sidebar-brand img { height: 32px; width: 32px; }
    .smn-sidebar-brand span {
      font-size: 17.5px;
      font-weight: 700;
      color: #fff;
      letter-spacing: -0.35px;
    }
    .smn-sidebar-nav { list-style: none; padding: 8px 12px; margin: 0; flex: 1; }
    .smn-sidebar-nav .nav-header {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--smn-text-dim);
      padding: 20px 12px 8px;
    }
    .smn-sidebar-nav .nav-link {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 12px;
      border-radius: 10px;
      color: var(--smn-text-muted);
      text-decoration: none;
      font-size: 14px;
      font-weight: 500;
      transition: all 0.2s;
      margin-bottom: 2px;
    }
    .smn-sidebar-nav .nav-link:hover { background: var(--smn-card-2); color: var(--smn-text); }
    .smn-sidebar-nav .nav-link.active {
      background: var(--smn-primary);
      color: #fff;
      box-shadow: 0 6px 16px -6px rgba(79,70,229,.9);
    }
    .smn-sidebar-nav .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

    .smn-sidebar-footer {
      padding: 16px 18px;
      border-top: 1px solid var(--smn-border);
    }
    .smn-user-pill {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border-radius: 10px;
      background: var(--smn-card);
      border: 1px solid var(--smn-border);
      cursor: pointer;
      transition: background 0.2s, border-color .2s;
    }
    .smn-user-pill:hover { background: var(--smn-card-2); border-color: var(--smn-border-2); }
    .smn-user-avatar {
      width: 34px; height: 34px;
      border-radius: 50%;
      background: var(--smn-gradient);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 14px;
      color: #fff;
      flex-shrink: 0;
    }
    .smn-user-info { flex: 1; min-width: 0; }
    .smn-user-name { font-size: 13px; font-weight: 600; color: var(--smn-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .smn-user-email { font-size: 11px; color: var(--smn-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* ── Main content ── */
    .smn-main {
      margin-left: 260px;
      flex: 1;
      padding: 32px;
      min-height: 100vh;
    }

    /* ── Hero card ── */
    .smn-hero {
      background: var(--smn-gradient);
      border-radius: var(--smn-radius);
      padding: 34px 38px;
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 24px;
      margin-bottom: 28px;
      box-shadow: 0 24px 60px -28px rgba(79,70,229,.95);
      position: relative;
      overflow: hidden;
    }
    .smn-hero::after {
      content: '';
      position: absolute;
      top: -50%;
      right: -10%;
      width: 300px;
      height: 300px;
      background: rgba(255,255,255,0.09);
      border-radius: 50%;
    }
    .smn-hero-text h1 {
      margin: 0 0 6px;
      font-size: 26px;
      font-weight: 700;
      letter-spacing: -.025em;
    }
    .smn-hero-text p {
      margin: 0;
      font-size: 15px;
      opacity: 0.88;
    }
    .smn-hero-btn {
      background: #fff;
      color: var(--smn-primary-dark);
      border: none;
      padding: 14px 30px;
      border-radius: 12px;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: all 0.2s;
      box-shadow: 0 8px 22px -8px rgba(0,0,0,0.55);
      white-space: nowrap;
      z-index: 1;
      position: relative;
    }
    .smn-hero-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -8px rgba(0,0,0,0.6); }
    .smn-hero-btn:active { transform: translateY(0); }
    .smn-hero-btn .spinner {
      display: none;
      width: 18px; height: 18px;
      border: 2.5px solid rgba(79,70,229,0.25);
      border-top-color: var(--smn-primary);
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
    }
    .smn-hero-btn.loading .spinner { display: block; }
    .smn-hero-btn.loading .btn-label { display: none; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ── Browser-server readiness (hero) ── */
    .smn-cloud-status {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-top: 12px;
      padding: 5px 12px;
      border-radius: 999px;
      background: rgba(255,255,255,0.14);
      font-size: 13px;
      font-weight: 600;
      position: relative;
      z-index: 1;
    }
    .smn-cloud-status[hidden] { display: none; }
    .smn-cloud-status .dot {
      width: 8px; height: 8px;
      border-radius: 50%;
      background: #fcd34d;
      animation: smnPulse 1.2s ease-in-out infinite;
    }
    .smn-cloud-status.is-ready .dot {
      background: #4ade80;
      box-shadow: 0 0 0 3px rgba(74,222,128,0.25);
      animation: none;
    }
    .smn-cloud-status.is-busy .dot {
      background: #f87171;
      animation: none;
    }
    @keyframes smnPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
    @media (prefers-reduced-motion: reduce) { .smn-cloud-status .dot { animation: none; } }

    /* ── Grid ── */
    .smn-grid { display: grid; gap: 20px; margin-bottom: 28px; }
    .smn-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .smn-grid-2 { grid-template-columns: repeat(2, 1fr); }
    .smn-grid-1-2 { grid-template-columns: 1fr 2fr; }
    .smn-grid-2-1 { grid-template-columns: 2fr 1fr; }

    /* ── Cards ── */
    .smn-card {
      background: var(--smn-card);
      border: 1px solid var(--smn-border);
      border-radius: var(--smn-radius);
      box-shadow: var(--smn-shadow);
      padding: 24px;
      transition: box-shadow 0.3s, border-color 0.3s, background 0.3s;
    }
    .smn-card:hover { box-shadow: var(--smn-shadow-hover); border-color: var(--smn-border-2); }
    .smn-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
    }
    .smn-card-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--smn-text-dim);
      text-transform: uppercase;
      letter-spacing: 0.6px;
      margin: 0;
    }
    .smn-card-icon {
      width: 42px; height: 42px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .smn-card-icon svg { width: 20px; height: 20px; color: #fff; }
    .smn-card-icon.purple { background: var(--smn-gradient); }
    .smn-card-icon.green { background: var(--smn-gradient-green); }
    .smn-card-icon.blue { background: linear-gradient(135deg, #0284c7, #38bdf8); }
    .smn-card-icon.orange { background: linear-gradient(135deg, #ea580c, #f59e0b); }

    .smn-stat-value {
      font-size: 32px;
      font-weight: 700;
      line-height: 1.1;
      letter-spacing: -.03em;
      margin-bottom: 4px;
    }
    .smn-stat-label {
      font-size: 13px;
      color: var(--smn-text-muted);
    }

    /* ── Progress bar ── */
    .smn-progress-wrap { margin-top: 16px; }
    .smn-progress-info {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: var(--smn-text-dim);
      margin-bottom: 6px;
    }
    .smn-progress-track {
      height: 8px;
      background: #222839;
      border-radius: 4px;
      overflow: hidden;
    }
    .smn-progress-bar {
      height: 100%;
      border-radius: 4px;
      transition: width 0.6s ease;
      background: linear-gradient(90deg, #6366f1, #8b93f8);
    }
    .smn-progress-bar.warning { background: linear-gradient(90deg, #ea580c, #f59e0b); }
    .smn-progress-bar.danger { background: linear-gradient(90deg, #dc2626, #ef4444); }

    /* ── Chart ── */
    .smn-chart-container { position: relative; height: 260px; }

    /* ── Proxy health ── */
    .smn-proxy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .smn-proxy-chip {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 10px 13px;
      border-radius: 10px;
      background: var(--smn-bg-2);
      border: 1px solid var(--smn-border);
      color: var(--smn-text-muted);
      font-size: 13px;
      font-weight: 500;
      transition: all 0.2s;
    }
    .smn-proxy-chip:hover { background: var(--smn-card-2); border-color: var(--smn-border-2); color: var(--smn-text); }
    .smn-proxy-dot {
      width: 8px; height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .smn-proxy-dot.up { background: var(--smn-success); box-shadow: 0 0 7px rgba(34,197,94,0.65); }
    .smn-proxy-dot.slow { background: var(--smn-warning); box-shadow: 0 0 7px rgba(245,158,11,0.65); }
    .smn-proxy-dot.down { background: var(--smn-danger); box-shadow: 0 0 7px rgba(239,68,68,0.65); }

    /* ── Seat table ── */
    .smn-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .smn-table th {
      text-align: left;
      padding: 10px 12px;
      font-weight: 600;
      color: var(--smn-text-dim);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-bottom: 1px solid var(--smn-border-2);
    }
    .smn-table td {
      padding: 12px;
      border-bottom: 1px solid var(--smn-border);
      vertical-align: middle;
      color: var(--smn-text-muted);
    }
    .smn-table td strong { color: var(--smn-text); }
    .smn-table tr:last-child td { border-bottom: none; }
    .smn-table tr:hover td { background: var(--smn-card-2); }

    .smn-badge {
      display: inline-block;
      padding: 3px 10px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
    }
    .smn-badge-active { background: rgba(34,197,94,0.14); color: #4ade80; }
    .smn-badge-plan { background: rgba(99,102,241,0.14); color: var(--smn-primary-light); }

    /* ── Plan info ── */
    .smn-plan-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 14px;
      border-radius: 20px;
      background: rgba(99,102,241,0.13);
      border: 1px solid rgba(99,102,241,.3);
      font-size: 13px;
      font-weight: 600;
      color: var(--smn-primary-light);
    }

    /* ── Account section ── */
    .smn-account-row {
      display: flex;
      align-items: center;
      padding: 12px 0;
      border-bottom: 1px solid var(--smn-border);
      font-size: 14px;
    }
    .smn-account-row:last-child { border-bottom: none; }
    .smn-account-row .label {
      width: 140px;
      font-weight: 600;
      color: var(--smn-text-dim);
      flex-shrink: 0;
    }
    .smn-account-row .value { flex: 1; color: var(--smn-text); }

    .smn-verified {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      color: var(--smn-success);
      font-weight: 600;
      font-size: 13px;
    }
    .smn-unverified {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      color: var(--smn-danger);
      font-weight: 600;
      font-size: 13px;
    }

    /* ── Empty state ── */
    .smn-empty {
      text-align: center;
      padding: 32px 16px;
      color: var(--smn-text-dim);
      font-size: 14px;
    }
    .smn-empty svg { width: 40px; height: 40px; color: var(--smn-border-2); margin-bottom: 10px; }

    /* ── Skeleton loading ── */
    .smn-skeleton {
      background: linear-gradient(90deg, #1a1f2e 25%, #242a3b 50%, #1a1f2e 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s infinite;
      border-radius: 8px;
    }
    @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
    .smn-skeleton-text { height: 14px; width: 60%; margin-bottom: 8px; }
    .smn-skeleton-big { height: 36px; width: 80px; margin-bottom: 4px; }

    /* ── Responsive ── */
    @media (max-width: 1200px) {
      .smn-grid-3 { grid-template-columns: repeat(2, 1fr); }
      .smn-grid-1-2, .smn-grid-2-1 { grid-template-columns: 1fr; }
    }
    @media (max-width: 768px) {
      /* visibility keeps the closed menu's links out of the Tab order */
      .smn-sidebar { transform: translateX(-100%); visibility: hidden; transition: transform 0.3s, visibility 0.3s; }
      .smn-sidebar.open { transform: translateX(0); visibility: visible; }
      .smn-main { margin-left: 0; padding: 20px; }
      .smn-grid-3, .smn-grid-2 { grid-template-columns: 1fr; }
      .smn-hero { flex-direction: column; text-align: center; padding: 28px 24px; }
    }

    /* ── Footer ── */
    .smn-footer {
      text-align: center;
      padding: 24px;
      font-size: 13px;
      color: var(--smn-text-dim);
    }

    .smn-logout-btn {
      background: none;
      border: 1px solid var(--smn-border-2);
      color: var(--smn-text-muted);
      padding: 8px 16px;
      border-radius: 8px;
      font-size: 13px;
      cursor: pointer;
      width: 100%;
      margin-top: 12px;
      transition: all 0.2s;
    }
    .smn-logout-btn:hover { background: var(--smn-card-2); border-color: #3f4a68; color: #fff; }

    .smn-persist-row{display:flex;align-items:center;justify-content:space-between;gap:20px;}
    .smn-persist-copy{flex:1;min-width:0;}
    .smn-switch{position:relative;display:inline-block;width:52px;height:28px;flex:none;}
    .smn-switch input{opacity:0;width:0;height:0;}
    .smn-switch-slider{position:absolute;cursor:pointer;inset:0;background:#2b3346;border:1px solid var(--smn-border-2);border-radius:28px;transition:.2s;}
    .smn-switch-slider:before{content:"";position:absolute;height:20px;width:20px;left:3px;top:3px;background:#8b93a8;border-radius:50%;transition:.2s;}
    .smn-switch input:checked + .smn-switch-slider{background:var(--smn-primary);border-color:var(--smn-primary);}
    .smn-switch input:checked + .smn-switch-slider:before{transform:translateX(24px);background:#fff;}
    .smn-switch input:disabled + .smn-switch-slider{opacity:.45;cursor:not-allowed;}
    /* the real checkbox is invisible, so show keyboard focus on the slider */
    .smn-switch input:focus-visible + .smn-switch-slider{outline:2px solid var(--smn-primary-light);outline-offset:2px;}
    .smn-switch-note{margin-top:6px;color:var(--smn-warning);}

    /* the hidden attribute must win over display rules like .smn-badge's */
    [hidden] { display: none !important; }

    /* Mobile menu backdrop: tap it to close the sidebar (z-index just under the sidebar's 100) */
    .smn-backdrop { display: none; position: fixed; inset: 0; background: rgba(5,7,12,.6); z-index: 99; }
    @media (max-width: 768px) { .smn-backdrop.show { display: block; } }

    /* simple-notify, themed for the dark dashboard */
    .sn-notifications-container .sn-notification { background: var(--smn-card-2) !important; border: 1px solid var(--smn-border-2) !important; color: var(--smn-text) !important; }
    .sn-notifications-container .sn-notification-text { color: var(--smn-text-muted) !important; }
    .sn-notifications-container .sn-notification-title { color: var(--smn-text) !important; }
