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

body {
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid #1e1e1e;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}

header .meta {
  font-size: 12px;
  color: #555;
}

.refresh-btn {
  background: #fe2c55;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.refresh-btn:hover { opacity: 0.85; }
.refresh-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 20px 28px;
}

.card {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ababab;
  margin-bottom: 6px;
}

.card .value {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.card .sub {
  font-size: 11px;
  color: #444;
  margin-top: 4px;
}

.table-wrap {
  padding: 0 28px 40px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #555;
  border-bottom: 2px solid #1e1e1e;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
thead th:hover { color: #aaa; }
thead th.sorted-asc::after { content: " ↑"; color: #fe2c55; }
thead th.sorted-desc::after { content: " ↓"; color: #fe2c55; }

tbody tr {
  border-bottom: 2px solid #2a2a2a;
  transition: background 0.1s;
}
tbody tr:hover { background: #141414; }

tbody td {
  padding: 6px 12px;
  color: #ccc;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
  color: #e0e0e0;
  font-size: 14px;
}

td.num { text-align: right; font-family: 'SF Mono', 'Fira Code', monospace; }
.div-left { border-left: 2px solid #2a2a2a !important; }
tbody td + td, thead tr:last-child th + th { border-left: 1px solid #1e1e1e; }
td.compact, th.compact { padding-left: 6px; padding-right: 6px; font-size: 11px; }
td.tight, th.tight { padding-left: 6px; padding-right: 6px; text-align: center; }


/* Color coding for views */
.views-high  { color: #4ade80 !important; }
.views-mid   { color: #facc15 !important; }
.views-low   { color: #f87171 !important; }

/* Color coding for completion */
.comp-high   { color: #4ade80 !important; }
.comp-mid    { color: #facc15 !important; }
.comp-low    { color: #f87171 !important; }

.filters {
  display: flex;
  gap: 8px;
  padding: 0 28px 16px;
}

.filter-btn {
  background: #111;
  border: 1px solid #1e1e1e;
  color: #666;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { color: #ccc; border-color: #333; }
.filter-btn.active { background: #fe2c55; border-color: #fe2c55; color: #fff; }

.section-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 28px 16px;
}
.section-toggles .label { font-size: 11px; color: #444; margin-right: 4px; text-transform: uppercase; letter-spacing: 0.08em; }
.sec-btn {
  background: #fe2c55;
  border: 1px solid #fe2c55;
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sec-btn:hover { opacity: 0.85; }
.sec-btn.hidden { background: #111; border-color: #1e1e1e; color: #666; }

.views-mode-btn {
  background: transparent; border: 1px solid #333; color: #555;
  padding: 3px 8px; border-radius: 10px; font-size: 10px;
  cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; transition: all 0.15s;
}
.views-mode-btn:hover:not(:disabled) { color: #aaa; border-color: #555; }
.views-mode-btn.active { background: #fe2c55; border-color: #fe2c55; color: #fff; }
.views-mode-btn:disabled { opacity: 0.25; cursor: default; }
.mode-toggle {
  display: flex; background: #2a2a2a; border-radius: 12px; padding: 2px; gap: 0;
  border: 1px solid #3a3a3a;
}
.mode-toggle .views-mode-btn {
  border: none; border-radius: 10px; color: #666;
}
.mode-toggle .views-mode-btn:hover:not(:disabled):not(.active) { color: #aaa; background: transparent; }
.mode-toggle .views-mode-btn.active { background: #555; color: #fff; }
.mode-toggle .views-mode-btn.active:hover { background: #555; color: #fff; }

.followers-val {
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  font-size: 48px; font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  color: #fff; font-variant-numeric: tabular-nums;
}
.followers-toggle { background: #131313; border: none; border-radius: 8px; padding: 3px; }
.followers-toggle .views-mode-btn { border: none; border-radius: 5px; color: #ababab; }
.followers-toggle .views-mode-btn:hover:not(:disabled):not(.active) { background: transparent; color: #e0e0e0; }
.followers-toggle .views-mode-btn.active { background: #262626; color: #fff; }
.followers-toggle .views-mode-btn.active:hover { background: #262626; color: #fff; }
.teal-mode-toggle { background: #131313; border: none; border-radius: 8px; padding: 3px; }
.teal-mode-toggle .views-mode-btn { border: none; border-radius: 5px; color: #ababab; }
.teal-mode-toggle .views-mode-btn:hover:not(:disabled):not(.active) { background: transparent; color: #e0e0e0; }
.teal-mode-toggle .views-mode-btn.active { background: #00F0FF; color: #000; }
.teal-mode-toggle .views-mode-btn.active:hover { background: #00F0FF; color: #000; }

.empty-state {
  text-align: center;
  padding: 60px 0;
  color: #444;
}
.empty-state p { margin-top: 8px; font-size: 13px; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #f87171; color: #f87171; }
.toast.success { border-color: #4ade80; color: #4ade80; }

#paywall-page {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
#paywall-page.open { display: flex; }
#pricing-table { visibility: hidden; }

.settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.settings-overlay.open { display: flex; }
.settings-modal {
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 28px 32px;
  width: 480px;
  max-width: 95vw;
}
.settings-modal h2 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.settings-modal .subtitle { font-size: 12px; color: #666; margin-bottom: 24px; }
.settings-modal label { display: block; font-size: 12px; color: #888; margin-bottom: 6px; margin-top: 16px; }
.settings-modal input {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 8px 12px;
  color: #e0e0e0;
  font-size: 13px;
  font-family: monospace;
}
.settings-modal input:focus { outline: none; border-color: #444; }
.settings-modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.settings-modal .guide { font-size: 11px; color: #555; margin-top: 20px; line-height: 1.6; border-top: 1px solid #1e1e1e; padding-top: 16px; }
.settings-modal .guide a { color: #888; }

.tab-btn {
  background: transparent; border: none; color: #555;
  padding: 6px 14px; border-radius: 6px; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
  letter-spacing: 0.02em;
}
.tab-btn:hover { color: #aaa; }
.tab-btn.active { background: #1e1e1e; color: #fff; }

/* Remove Clerk checkout backdrop */
body > div:not(#dashboard):not(#paywall-page):not(.settings-overlay):not(#toast) { background: transparent !important; }

@media (max-width: 768px) {
  #account-cards { grid-template-columns: 1fr !important; padding: 12px 16px !important; }

  header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
  }
  header h1 { font-size: 15px; }
  #account-header-controls .followers-toggle,
  #account-header-controls .mode-toggle { display: none; }
  #account-last-updated { display: none; }
}
