/* PolyWallet -- Common Stylesheet
 * Shared styles loaded by every page
 * Extracted from base.css + inline <style> blocks across all templates
 */

/* ==================== COLOR TOKENS ==================== */
:root {
  /* Backgrounds */
  --bg-base: #0b0e11;
  --bg-card: #111318;
  --bg-nav: #12151c;
  --bg-elevated: #161a1f;
  --bg-hover: #1a1f26;
  --bg-input: #0a0a0b;
  --bg-auth: #111113;
  --bg-sidebar: #0d1117;
  --bg-row-alt: #0f1217;
  --bg-filter: #0d1014;
  /* Borders */
  --border: #1e2228;
  --border-strong: #2a2f38;
  --border-input: #374151;
  /* Text */
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #8b93a0;
  --text-dimmer: #6b7280;
  --text-disabled: #4b5563;
  --text-white: #fafafa;
  /* Brand accent (same in both themes) */
  --green: #00c076;
  --green-hover: #00a868;
  --green-dim: rgba(0,192,118,0.12);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.12);
  /* Glow / overlay */
  --green-glow: rgba(0,192,118,0.04);
  --blue-glow: rgba(59,130,246,0.03);
  --overlay: rgba(0,0,0,0.6);
  --overlay-soft: rgba(0,0,0,0.4);
  --shadow: rgba(0,0,0,0.25);
  /* Tag backgrounds */
  --tag-whale-bg: #1e3a5f;
  --tag-smart-bg: #1a3d2e;
  --tag-degen-bg: #4a2020;
  --tag-sniper-bg: #3d3520;
  --tag-new-bg: #2d2040;
  /* Side pills */
  --side-yes-bg: #0d3321;
  --side-no-bg: #3b1111;
}

/* ==================== LIGHT THEME ==================== */
[data-theme="light"] {
  --bg-base: #f4f4f4;
  --bg-card: #ffffff;
  --bg-nav: #ffffff;
  --bg-elevated: #f0f0f2;
  --bg-hover: #e8e8eb;
  --bg-input: #f5f5f5;
  --bg-auth: #ffffff;
  --bg-sidebar: #f0f0f2;
  --bg-row-alt: #fafafa;
  --bg-filter: #f5f5f7;
  --border: #e6e6e6;
  --border-strong: #d1d5db;
  --border-input: #d1d5db;
  --text-primary: #1a1a1a;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-dimmer: #9ca3af;
  --text-disabled: #6b7280;
  --text-white: #1a1a1a;
  --green-glow: rgba(0,192,118,0.06);
  --blue-glow: rgba(0,0,0,0);
  --overlay: rgba(0,0,0,0.5);
  --overlay-soft: rgba(0,0,0,0.2);
  --shadow: rgba(0,0,0,0.08);
  --tag-whale-bg: #dbeafe;
  --tag-smart-bg: #d1fae5;
  --tag-degen-bg: #fee2e2;
  --tag-sniper-bg: #fef3c7;
  --tag-new-bg: #ede9fe;
  --side-yes-bg: #dcfce7;
  --side-no-bg: #fee2e2;
}

/* ==================== RESET & BASE ==================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
/* Body floor is 13px per DESIGN.md "The 13px Floor Rule". Dense data
   surfaces (tables, quick-stats, filter chips) opt down to 11-12px
   explicitly. Reading prose stays at 13px+. */
html, body { background: var(--bg-base); color: var(--text-primary); font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; line-height: 1.4; overflow-x: hidden; }
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(ellipse at 10% 0%, var(--green-glow) 0%, transparent 50%), radial-gradient(ellipse at 90% 100%, var(--blue-glow) 0%, transparent 50%); pointer-events: none; z-index: 0; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ==================== MAIN CONTENT ==================== */
.main-content { margin-top: 54px; padding: 12px 16px; }
.main-content.constrained { max-width: 1200px; margin-left: auto; margin-right: auto; }

/* Skip link: keyboard users tab past the fixed nav to the page body.
   Hidden visually until focused, then snaps into view at the top-left. */
.skip-link {
  position: absolute;
  top: -48px;
  left: 8px;
  background: var(--green);
  color: var(--bg-base);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.15s ease-out;
}
.skip-link:focus, .skip-link:focus-visible { top: 8px; outline: 2px solid var(--bg-base); outline-offset: 2px; }

/* ==================== TOP NAV ==================== */
.top-nav { position: fixed; top: 0; left: 0; right: 0; height: 54px; background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-nav) 50%, var(--bg-card) 100%); border-bottom: 1px solid rgba(0,192,118,0.12); z-index: 50; display: flex; align-items: center; padding: 0 20px; gap: 0; }
.nav-logo { font-weight: 700; font-size: 17px; color: var(--text-primary); letter-spacing: -0.3px; margin-right: 28px; white-space: nowrap; cursor: pointer; text-decoration: none; }
.nav-logo span { color: var(--green); }
.nav-links { display: flex; gap: 2px; }
.nav-links a { padding: 5px 14px; font-size: 13px; font-weight: 500; color: var(--text-muted); text-decoration: none; border-radius: 4px; transition: all 0.15s; white-space: nowrap; }
.nav-links a:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-links a.active { color: var(--green); background: rgba(0,192,118,0.08); }
.nav-links a.nav-telegram { color: #26a5e4; }
.nav-links a.nav-telegram:hover { color: #fff; background: #26a5e4; }
.nav-links a.nav-telegram svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; fill: currentColor; }
.mobile-nav .mobile-nav-link.nav-telegram { color: #26a5e4; }
.mobile-nav .mobile-nav-link.nav-telegram svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; fill: currentColor; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-right span { color: var(--text-muted); font-size: 12px; }
.nav-right a { color: var(--text-muted); font-size: 12px; text-decoration: none; }
.nav-right a:hover { color: var(--text-primary); }
.nav-search { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px 4px 28px; font-size: 11px; color: var(--text-primary); width: 200px; outline: none; font-family: 'IBM Plex Sans', sans-serif; position: relative; }
.nav-search:focus { border-color: var(--border-strong); }
.search-wrap { position: relative; }
.search-wrap i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-disabled); font-size: 11px; pointer-events: none; }



/* ==================== USER MENU ==================== */
.user-menu { position: relative; flex-shrink: 0; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(0,192,118,0.1); border: 1.5px solid rgba(0,192,118,0.35); color: var(--green); font-weight: 700; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-family: 'IBM Plex Sans', sans-serif; transition: background 0.15s, border-color 0.15s; user-select: none; padding: 0; }
.user-avatar:hover { background: rgba(0,192,118,0.18); border-color: rgba(0,192,118,0.6); }
.user-dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px var(--shadow); z-index: 200; overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s; }
.user-dropdown.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.user-dropdown-header { padding: 10px 14px 8px; border-bottom: 1px solid var(--border); }
.user-dropdown-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.user-dropdown-plan { margin-top: 5px; }
.user-dropdown-item { display: flex; align-items: center; gap: 9px; padding: 8px 14px; color: var(--text-secondary); font-size: 12px; text-decoration: none; background: none; border: none; width: 100%; text-align: left; cursor: pointer; font-family: 'IBM Plex Sans', sans-serif; transition: background 0.1s, color 0.1s; }
.user-dropdown-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.user-dropdown-item i { width: 14px; text-align: center; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.user-dropdown-item:hover i { color: var(--text-secondary); }
.user-dropdown-item.item-danger { color: var(--red); }
.user-dropdown-item.item-danger:hover { background: var(--red-dim); color: var(--red); }
.user-dropdown-item.item-danger i { color: var(--red); }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 3px 0; }
/* Theme icon in dropdown */
.user-dropdown-item .icon-sun { display: inline-block; }
.user-dropdown-item .icon-moon { display: none; }
[data-theme="light"] .user-dropdown-item .icon-sun { display: none; }
[data-theme="light"] .user-dropdown-item .icon-moon { display: inline-block; }
/* ==================== THEME TOGGLE ==================== */
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; transition: color 0.15s, border-color 0.15s, background 0.15s; flex-shrink: 0; }
.theme-toggle:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-elevated); }
[data-theme="light"] .theme-toggle .fa-sun { display: none; }
[data-theme="light"] .theme-toggle .fa-moon { display: inline-block; }
.theme-toggle .fa-moon { display: none; }
.theme-toggle .fa-sun { display: inline-block; }
/* ==================== UTILITY CLASSES ==================== */
.mono { font-family: 'IBM Plex Mono', monospace; }
.green { color: var(--green); }
.red { color: var(--red); }
.yellow { color: #eab308; }
.muted { color: var(--text-disabled); }
.secondary { color: var(--text-muted); }
.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }
.scroll-x { overflow-x: auto; }
/* Used on the sort-direction icon in table headers (originally inline). */
.sort-icon { font-size: 8px; opacity: 0.4; margin-left: 2px; }

/* ==================== BUTTONS ==================== */
.btn { font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s; text-decoration: none; }
.btn:hover { border-color: var(--border-strong); color: var(--text-primary); background: var(--bg-hover); }
.btn-sm { padding: 4px 8px; font-size: 10px; }
.btn-accent { border-color: rgba(0,192,118,0.3); color: var(--green); }
.btn-accent:hover { background: rgba(0,192,118,0.08); }
.btn-primary { background: var(--green); color: var(--bg-base); border-color: var(--green); font-weight: 600; }
.btn-primary:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); }
.btn-warning { color: #eab308; }
.btn-warning:hover { background: rgba(234,179,8,0.1); border-color: rgba(234,179,8,0.3); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-add { background: rgba(0,192,118,0.12); color: var(--green); font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; font-weight: 600; padding: 5px 14px; border-radius: 6px; border: 1px solid rgba(0,192,118,0.25); cursor: pointer; white-space: nowrap; transition: all 0.15s; letter-spacing: 0.2px; }
.btn-add:hover { background: rgba(0,192,118,0.2); border-color: rgba(0,192,118,0.4); color: var(--green); }
.btn-icon { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; font-size: 14px; }
.btn-icon:hover { color: var(--text-primary); }

/* ==================== FORM INPUTS ==================== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.form-group input, .form-group select { width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; color: var(--text-primary); font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; outline: none; transition: border-color 0.15s; }
.form-group input:focus, .form-group select:focus { border-color: rgba(0,192,118,0.4); }
.form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b93a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.form-group .hint { font-size: 10px; color: var(--text-disabled); margin-top: 4px; }
.form-group .input-prefix { display: flex; align-items: center; }
.form-group .input-prefix span { background: var(--bg-base); border: 1px solid var(--border); border-right: none; border-radius: 6px 0 0 6px; padding: 9px 10px; color: var(--text-disabled); font-size: 13px; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
.form-group .input-prefix input { border-radius: 0 6px 6px 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ==================== BADGE STYLES ==================== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 10px; font-weight: 600; }
.badge-green { background: rgba(0,192,118,0.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-yellow { background: rgba(234,179,8,0.15); color: #eab308; }
.badge-blue { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-gray { background: rgba(107,114,128,0.15); color: var(--text-secondary); }
.badge-active { background: rgba(0,192,118,0.1); color: var(--green); border: 1px solid rgba(0,192,118,0.2); }

/* ==================== TAG PILLS ==================== */
.tag { display: inline-block; font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 3px; margin-right: 3px; text-transform: uppercase; letter-spacing: 0.3px; }
.tag-whale { background: var(--tag-whale-bg); color: #60a5fa; }
.tag-smart { background: var(--tag-smart-bg); color: #34d399; }
.tag-degen { background: var(--tag-degen-bg); color: #f87171; }
.tag-sniper { background: var(--tag-sniper-bg); color: #fbbf24; }
.tag-new { background: var(--tag-new-bg); color: #a78bfa; }

/* ==================== OUTCOME PILLS ==================== */
.outcome { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 3px; }
.outcome-won { background: var(--tag-smart-bg); color: #34d399; }
.outcome-lost { background: var(--tag-degen-bg); color: #f87171; }
.outcome-open { background: var(--tag-whale-bg); color: #60a5fa; }
.outcome-exited { background: var(--tag-new-bg); color: #a78bfa; }
.outcome-pending { background: var(--tag-sniper-bg); color: #fbbf24; }

/* ==================== SIDE PILLS ==================== */
.side-pill, .live-side-pill { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 3px; }
.side-yes { background: var(--side-yes-bg); color: var(--green); }
.side-no { background: var(--side-no-bg); color: var(--red); }

/* ==================== TYPE PILLS ==================== */
.type-buy { color: var(--green); font-weight: 600; }
.type-sell { color: var(--red); font-weight: 600; }
.type-redeem { color: #eab308; font-weight: 600; }

/* ==================== AVATARS ==================== */
.avatar { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--bg-base); }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-card { width: 28px; height: 28px; font-size: 11px; }
.avatar-xl { width: 88px; height: 88px; font-size: 26px; border: 2px solid var(--border); border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--bg-base); }
.avatar img, .avatar-xl img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ==================== BANNERS ==================== */
/* Impersonation banner: amber-on-white warning shown across every
   authenticated page (product + admin) while an admin is impersonating
   a user. Loaded from common.css so non-admin pages get it too. */
.impersonate-banner { background: #b45309; color: #fff; text-align: center; padding: 8px 16px; font-size: 12px; font-weight: 600; position: relative; z-index: 100; }
.impersonate-banner a { color: #fff; text-decoration: underline; margin-left: 12px; }

/* Used across product surfaces to prompt or inform without
   blocking the page. Variants by role, all share rounded edges
   and consistent vertical rhythm with main-content. */
.banner-warn { background: #92400e; color: #fbbf24; padding: 8px 16px; text-align: center; font-size: 13px; border-radius: 6px; margin-bottom: 12px; }
.banner-warn form { display: inline; margin-left: 8px; }
.banner-warn .btn-pill-warn { background: none; border: 1px solid #fbbf24; color: #fbbf24; padding: 2px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; font-family: 'IBM Plex Sans', sans-serif; }
.banner-info { background: #1a2d40; color: #93c5fd; padding: 8px 16px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; border: 1px solid rgba(37,99,235,0.2); }

/* ==================== ICON LINKS / FADED HOVER ==================== */
/* Replaces inline onmouseover/onmouseout JS hover patterns scattered
   in scout/leaderboard rows. Two opacity floors: subtler (.4) for the
   secondary Polymarket-icon link, friendlier (.7) for the @X handle. */
.opacity-fade { opacity: 0.4; transition: opacity 0.15s; }
.opacity-fade:hover { opacity: 1; }
.opacity-fade-soft { opacity: 0.7; transition: opacity 0.15s; }
.opacity-fade-soft:hover { opacity: 1; }

/* ==================== POLYMARKET BUTTON ==================== */
/* Used on the trader detail page to deep-link to the corresponding
   Polymarket profile. Brand-colored, distinct from product CTAs. */
.btn-polymarket { background: #2e5cff; border-color: #2e5cff; color: #ffffff; }
.btn-polymarket:hover { background: #2547cc; border-color: #2547cc; color: #ffffff; }

/* ==================== FLASH MESSAGES ==================== */
.flash-msg { background: rgba(0,192,118,0.1); border: 1px solid rgba(0,192,118,0.25); color: var(--green); font-size: 12px; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.flash-msg.error { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); color: var(--red); }
.flash-msg.success { background: rgba(0,192,118,0.1); border: 1px solid rgba(0,192,118,0.25); color: var(--green); }

/* ==================== ERROR BOX ==================== */
.error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: var(--red); font-size: 12px; padding: 8px 12px; border-radius: 6px; margin-bottom: 16px; }
.success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #4ade80; font-size: 12px; padding: 8px 12px; border-radius: 6px; margin-bottom: 16px; }

/* ==================== MODAL ==================== */
.modal-overlay { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 22px; width: 420px; max-width: 90vw; }
.modal h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--text-primary); }
.modal input { width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px; padding: 9px 11px; color: var(--text-primary); font-family: 'IBM Plex Mono', monospace; font-size: 12px; outline: none; }
.modal input:focus { border-color: var(--green); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.modal-status { font-size: 11px; color: var(--green); margin-top: 8px; min-height: 16px; }

/* ==================== TOAST ==================== */
.toast-container { position: fixed; top: 56px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 6px; }
.toast { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; font-size: 12px; color: var(--text-primary); box-shadow: 0 4px 12px var(--overlay-soft); animation: toastIn 0.2s ease-out; }
.toast.success { border-color: rgba(0,192,118,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ==================== ANIMATIONS ==================== */
@keyframes spin { to { transform: rotate(360deg); } }
/* The single permitted pulse in the system: live-tracking dot opacity blink.
   See DESIGN.md "The No-Pulse Rule" — new pulses are forbidden. */
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ==================== AUTH PAGE STYLES ==================== */
/* Two-layer shadow: a subtle green-tinted ambient halo (signals brand,
   bounded so it doesn't drift toward "marketing"), plus a real dark
   shadow with no y-offset so the card looks "floating" rather than
   "below the fold" when vertically centered on canvas. */
.auth-card { background: var(--bg-auth); border: 1px solid var(--border-strong); border-radius: 12px; padding: 32px; width: 100%; max-width: 448px; box-shadow: 0 0 0 1px rgba(0,192,118,0.06), 0 24px 56px -16px rgba(0,0,0,0.55), 0 8px 16px -8px rgba(0,0,0,0.35); position: relative; z-index: 1; }
.auth-card-header { text-align: center; margin-bottom: 32px; }
.auth-card .btn-primary { width: 100%; background: var(--green); color: var(--bg-base); border: none; border-radius: 8px; padding: 12px 16px; font-family: 'IBM Plex Sans', sans-serif; font-size: 16px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.auth-card .btn-primary:hover { background: var(--green-hover); }
.auth-card .form-group { margin-bottom: 16px; }
.auth-card .form-group label { font-size: 14px; color: var(--text-white); font-weight: 400; text-transform: none; letter-spacing: 0; }
.auth-card .form-group input { padding: 12px 16px; font-size: 16px; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text-white); }
.auth-card .form-group input::placeholder { color: var(--text-muted); }
.auth-card .form-group input:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--green); }
.auth-card .form-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.auth-card .form-label-row label { margin-bottom: 0; }
.auth-card .forgot-link { font-size: 14px; color: var(--green); text-decoration: none; }
.auth-card .forgot-link:hover { text-decoration: underline; }
.logo { text-align: center; font-size: 26px; font-weight: 700; }
.logo span { color: var(--green); }
.title { font-size: 24px; font-weight: 700; color: var(--text-white); margin-top: 24px; margin-bottom: 0; text-align: center; }
.subtitle { font-size: 16px; font-weight: 400; color: var(--text-muted); margin-top: 8px; margin-bottom: 0; text-align: center; }
.divider { position: relative; margin: 24px 0; text-align: center; }
.divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border-strong); }
.divider span { position: relative; background: var(--bg-auth); padding: 0 8px; color: var(--text-muted); font-size: 14px; }
.btn-oauth { width: 100%; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 8px; padding: 12px 16px; color: var(--text-primary); font-family: 'IBM Plex Sans', sans-serif; font-size: 16px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px; transition: all 0.15s; margin-bottom: 12px; text-decoration: none; }
.btn-oauth:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-oauth-light { background: #ffffff; border-color: #d1d5db; color: #1f2937; }
.btn-oauth-light:hover { background: #f3f4f6; border-color: #d1d5db; color: #1f2937; }
.btn-oauth img { width: 18px; height: 18px; }
.footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-muted); }
.footer a { color: var(--green); text-decoration: none; font-weight: 500; }
.footer a:hover { text-decoration: underline; }
.note { text-align: center; margin-top: 16px; font-size: 11px; color: var(--text-muted); }
.back-link { font-size: 11px; color: var(--text-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.back-link:hover { color: var(--text-primary); }

/* 2FA specific */
.step { margin-bottom: 20px; }
.step-label { font-size: 12px; font-weight: 600; color: var(--green); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.step-text { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.qr-wrap { text-align: center; margin-bottom: 16px; }
.qr-wrap img { border-radius: 8px; background: #fff; padding: 8px; }
.secret-key { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--text-primary); text-align: center; word-break: break-all; margin-bottom: 8px; }
.secret-label { font-size: 11px; color: var(--text-muted); text-align: center; margin-bottom: 20px; }
.status-row { text-align: center; margin-bottom: 16px; }
.status-text { font-size: 12px; color: var(--text-muted); text-align: center; margin-bottom: 24px; }
.form-label-text { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.divider-line { height: 1px; background: var(--border); margin: 20px 0; }

/* Recovery codes */
.warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); color: #f59e0b; font-size: 12px; padding: 10px 12px; border-radius: 6px; margin-bottom: 20px; line-height: 1.5; }
.warning i { margin-right: 4px; }
.codes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.code { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; padding: 10px; font-family: 'IBM Plex Mono', monospace; font-size: 14px; text-align: center; color: var(--text-primary); letter-spacing: 1px; }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; padding: 10px; font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.copied { background: rgba(0,192,118,0.15) !important; border-color: rgba(0,192,118,0.3) !important; color: var(--green) !important; }

/* Message page card */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 36px; width: 440px; max-width: calc(100vw - 32px); position: relative; z-index: 1; }
.card .icon { font-size: 36px; margin-bottom: 16px; }
.card .icon.success { color: var(--green); }
.card .icon.error { color: var(--red); }
.card h2 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
a.btn { text-decoration: none; }

/* Verification required */
.email-addr { color: var(--text-primary); font-weight: 600; }
.btn-verify { display: inline-block; background: #3b82f6; color: #ffffff; padding: 10px 24px; border-radius: 6px; border: none; font-weight: 600; font-size: 13px; cursor: pointer; font-family: 'IBM Plex Sans', sans-serif; }
.btn-verify:hover { background: #2563eb; }
.flash { background: #1e3a2f; color: #34d399; padding: 8px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.links { margin-top: 20px; }
.links a { color: var(--text-muted); font-size: 12px; text-decoration: none; }
.links a:hover { color: var(--text-primary); }

/* ==================== ONBOARDING ==================== */
.section { margin-bottom: 20px; }
.section-title { font-size: 11px; font-weight: 600; color: var(--green); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.section-title i { font-size: 12px; }
.btn-row { display: flex; gap: 10px; margin-top: 24px; align-items: stretch; }
.btn-row .btn-primary { width: auto; flex: 1; font-size: 13px; padding: 10px 16px; }
.btn-row .btn-secondary { flex: 0 0 auto; }
.btn-skip { flex: 0; background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); border-radius: 6px; padding: 10px 20px; font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.btn-skip:hover { color: var(--text-primary); border-color: var(--border-strong); }
.tz-detected { font-size: 11px; color: var(--green); margin-top: 4px; }

/* ==================== SETTINGS PAGE ==================== */
.settings-layout { display: flex; max-width: 960px; margin: 74px auto 32px; gap: 24px; padding: 0 24px; position: relative; z-index: 1; }
.settings-sidebar { width: 200px; flex-shrink: 0; }
.sidebar-tab { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none; color: var(--text-muted); font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; font-weight: 500; padding: 9px 12px; border-radius: 6px; cursor: pointer; transition: all 0.15s; text-align: left; }
.sidebar-tab:hover { color: var(--text-primary); background: var(--bg-card); }
.sidebar-tab.active { color: var(--text-primary); background: var(--bg-elevated); }
.sidebar-tab i { width: 16px; text-align: center; font-size: 12px; }
.settings-content { flex: 1; min-width: 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.settings-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 24px; margin-bottom: 16px; }
.settings-card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.settings-card-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.provider-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.provider-row:last-child { border-bottom: none; }
.provider-info { display: flex; align-items: center; gap: 12px; }
.provider-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); border: 1px solid var(--border); }
.provider-name { font-size: 13px; font-weight: 600; }
.provider-detail { font-size: 11px; color: var(--text-muted); }
.provider-badge { font-size: 10px; color: var(--green); background: rgba(0,192,118,0.1); padding: 2px 8px; border-radius: 8px; font-weight: 500; }
.sessions-table { width: 100%; border-collapse: collapse; }
.sessions-table th { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.sessions-table td { font-size: 12px; padding: 10px; border-bottom: 1px solid var(--bg-card); vertical-align: middle; }
.sessions-table tr:hover td { background: var(--bg-card); }
.session-current { font-size: 10px; color: var(--green); background: rgba(0,192,118,0.1); padding: 2px 8px; border-radius: 8px; font-weight: 500; margin-left: 6px; }
.session-browser { color: var(--text-primary); }
.session-ip { font-family: 'IBM Plex Mono', monospace; color: var(--text-muted); font-size: 11px; }
.session-time { color: var(--text-muted); font-size: 11px; }
.setup-2fa-link { display: inline-flex; align-items: center; gap: 6px; color: var(--green); text-decoration: none; font-size: 12px; font-weight: 500; margin-top: 12px; }
.setup-2fa-link:hover { text-decoration: underline; }

/* ==================== BILLING / PRICING ==================== */
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 12px; }
.nav-link:hover { color: var(--text-primary); }
/* Current-plan summary card on /billing. The plan-card classes below
   are shared with the landing pricing grid. */
.current-plan { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 32px; }
.current-plan h3 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.current-plan-name { font-size: 20px; font-weight: 700; }
.current-plan-name.premium { color: var(--green); }
.current-plan-name.free { color: var(--text-primary); }
/* Plan-card grid + card. Shared between landing /pricing and /billing. */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 880px; margin: 0 auto; }
.plan-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 32px; position: relative; display: flex; flex-direction: column; transition: border-color 0.2s; }
.plan-card:hover { border-color: var(--border-strong); }
.plan-card.recommended { border-color: rgba(0,192,118,0.4); background: linear-gradient(160deg, rgba(0,192,118,0.05) 0%, var(--bg-card) 60%); }
.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--green); color: var(--bg-base); font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 99px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.5px; }
.plan-name { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.plan-price { font-size: 36px; font-weight: 800; color: var(--text-primary); letter-spacing: -1px; margin-bottom: 4px; line-height: 1; font-family: 'IBM Plex Sans', sans-serif; }
.plan-price span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.plan-price-old { font-size: 18px; font-weight: 500; color: var(--text-muted); text-decoration: line-through; margin-right: 8px; }
.plan-savings { font-size: 12px; color: var(--green); margin-bottom: 24px; }
.plan-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.plan-features { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan-features li { font-size: 13px; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.plan-features li i.fa-check { color: var(--green); font-size: 12px; flex-shrink: 0; }
.plan-features li i.fa-times { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.plan-features li.disabled { color: var(--text-muted); }
.btn-plan { display: block; text-align: center; padding: 11px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; transition: background 0.15s, border-color 0.15s; border: 1px solid; font-family: 'IBM Plex Sans', sans-serif; cursor: pointer; }
.btn-plan-ghost { color: var(--text-muted); background: transparent; border-color: var(--border); }
.btn-plan-ghost:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-elevated); }
.btn-plan-primary { color: var(--bg-base); background: var(--green); border-color: var(--green); }
.btn-plan-primary:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn-plan-current { color: var(--text-muted); background: var(--bg-elevated); border-color: var(--border); cursor: default; }

/* ==================== HAMBURGER / MOBILE NAV ==================== */
.hamburger-btn { display: none; } /* hidden on desktop */

.mobile-nav {
  display: none;
  position: fixed; top: 54px; left: 0; right: 0; z-index: 49;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px var(--overlay-soft);
  flex-direction: column;
}
.mobile-nav.open { display: flex; }

.mobile-nav-link {
  padding: 14px 18px; color: var(--text-secondary); font-size: 14px; font-weight: 500;
  text-decoration: none; border-bottom: 1px solid var(--bg-sidebar);
  transition: color 0.15s, background 0.15s;
  display: flex; align-items: center; gap: 10px;
}
.mobile-nav-link:last-child { border-bottom: none; }
.mobile-nav-link:hover { color: var(--text-primary); background: var(--bg-elevated); }
.mobile-nav-link.active { color: var(--green); background: rgba(0,192,118,0.07); }

/* ==================== MOBILE RESPONSIVE (common) ==================== */
@media (max-width: 768px) {
  /* Auth cards */
  .auth-card { width: calc(100vw - 24px); padding: 24px; }

  /* Billing cards */
  .plans { grid-template-columns: 1fr !important; }

  /* Settings */
  .settings-layout { flex-direction: column; }
  .settings-sidebar { width: 100%; display: flex; gap: 4px; overflow-x: auto; }
  .sidebar-tab { white-space: nowrap; padding: 8px 10px; font-size: 12px; }
  .form-row { grid-template-columns: 1fr; }

  /* Nav */
  .top-nav { flex-wrap: nowrap; height: 44px; padding: 0 10px; gap: 6px; }
  .nav-logo { margin-right: 8px; font-size: 13px; flex-shrink: 0; }
  .nav-links { display: none; }
  .nav-right { gap: 5px; }
  .nav-right .search-wrap { display: none; }
  .nav-user { font-size: 10px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-logout { font-size: 10px; padding: 3px 6px; }

  /* Hamburger */
  .hamburger-btn {
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text-secondary); font-size: 16px;
    cursor: pointer; padding: 4px 6px; border-radius: 4px;
    transition: color 0.15s, background 0.15s; flex-shrink: 0;
  }
  .hamburger-btn:hover { color: var(--text-primary); background: var(--bg-elevated); }
  .hamburger-btn[aria-expanded="true"] { color: var(--text-primary); background: var(--bg-elevated); }
  .mobile-nav { top: 44px; }

  /* Modal */
  .modal { width: calc(100vw - 24px); max-width: 380px; padding: 18px; }
}

/* ==================== TOAST CONTAINER (from _toasts.html) ==================== */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; align-items: flex-end; }

/* ==================== FOCUS STATES (Accessibility) ==================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ==================== REDUCED MOTION (system-wide) ==================== */
/* Honors prefers-reduced-motion across every product surface. Each animation
   that exists in the system collapses to a near-zero duration; loaded
   animations (pulse-dot, shimmer, spin) stop iterating; transforms used as
   hover affordances flatten. Per-surface CSS may add further specifics. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==================== PAGE BODY VARIANTS ==================== */
body.page-centered { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
body.page-full { min-height: 100vh; }

/* Admin body */
body.admin-body { display: flex; flex-direction: column; }
