/* FlipLens App Stylesheet */
/* Design System Variables */

:root {
  /* Colors */
  --orange: #F97316;
  --orange-dk: #C2410C;
  --orange-lt: #FED7AA;
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F5F5F2;
  --border: #E8E5DF;
  --text: #1C1917;
  --text-2: #57534E;
  --text-3: #A8A29E;
  --sidebar-bg: #1C1917;
  --success: #16A34A;
  --warning: #D97706;
  --info: #2563EB;
  --danger: #DC2626;

  /* Typography */
  --font-heading: 'Cabinet Grotesk', system-ui, sans-serif;
  --font-body: 'Satoshi', system-ui, sans-serif;

  /* Border Radius */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Shadows */
  --sh-sm: 0 1px 3px rgba(0,0,0,0.06);
  --sh: 0 4px 16px rgba(0,0,0,0.08);
  --sh-lg: 0 12px 40px rgba(0,0,0,0.12);

  /* Spacing */
  --sidebar-width: 230px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

/* Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
  padding-top: 62px;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: white;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  background: var(--bg);
}

/* Navigation */
.sidebar-nav {
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-item i {
  margin-right: 12px;
  font-size: 18px;
}

.nav-item span {
  font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 24px;
}

.user-info {
  margin-bottom: 16px;
}

.user-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.user-plan {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Page Layout */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
}

.page-header {
  margin-bottom: 24px;
}

.page-h1 {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 8px 0;
  color: var(--text);
}

.page-sub {
  font-size: 18px;
  color: var(--text-2);
  margin: 0;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 24px;
  padding: 32px;
  background: white;
  border: 1px solid rgba(232,229,223,0.9);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(31, 28, 25, 0.05);
  margin-bottom: 32px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 16px;
}

.dashboard-hero h2 {
  margin: 0 0 18px;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 2.4vw, 2.8rem);
  line-height: 1.05;
}

.hero-text {
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 24px;
}

.plan-pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  margin-left: 8px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-stats {
  display: grid;
  gap: 16px;
  align-content: center;
}

.stat-card {
  padding: 20px 24px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid rgba(232,229,223,0.9);
  text-align: left;
}

.stat-card .stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 6px;
}

.stat-card .stat-label {
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

/* Cards */
.dashboard-card,
.result-card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--sh);
  margin-bottom: 24px;
}

.dashboard-card h3,
.result-card h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--text);
}

/* Stats */
.stats-strip {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.stat-pill {
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px 24px;
  box-shadow: var(--sh-sm);
  text-align: center;
  flex: 1;
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
}

.action-buttons a {
  flex: 1;
  text-align: center;
}

/* Recent/Saved Lists */
.recent-list,
.saved-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-item,
.saved-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}

.recent-keyword,
.saved-keyword {
  font-weight: 500;
  color: var(--text);
}

.recent-score,
.saved-score {
  font-size: 12px;
  color: var(--text-2);
  background: var(--orange-lt);
  padding: 4px 8px;
  border-radius: var(--r-sm);
}

.recent-date {
  font-size: 12px;
  color: var(--text-3);
}

.view-all {
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
  margin-top: 8px;
  display: inline-block;
}

/* Search Hero */
.search-hero {
  text-align: center;
  margin-bottom: 48px;
}

.search-bar {
  max-width: 600px;
  margin: 32px auto 0;
  position: relative;
}

.search-bar-input {
  width: 100%;
  padding: 16px 60px 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  font-size: 16px;
  background: var(--surface);
  transition: border-color 0.2s;
}

.search-bar-input:focus {
  outline: none;
  border-color: var(--orange);
}

.search-bar-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  bottom: 8px;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  padding: 0 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.search-bar-btn:hover {
  background: var(--orange-dk);
}

.search-tips {
  margin-top: 16px;
}

.search-tips p {
  color: var(--text-2);
  font-size: 14px;
}

/* Score Display */
.score-card {
  text-align: center;
  margin-bottom: 24px;
}

.score-card h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--text);
}

.score-display {
  margin-bottom: 16px;
}

.score-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
}

.score-number.score-success { color: var(--success); }
.score-number.score-warning { color: var(--warning); }
.score-number.score-info { color: var(--info); }
.score-number.score-danger { color: var(--danger); }

.score-label {
  font-size: 16px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.confidence-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.confidence-badge.high { background: var(--success); color: white; }
.confidence-badge.medium { background: var(--warning); color: white; }
.confidence-badge.low { background: var(--danger); color: white; }

/* Score Breakdown */
.score-breakdown {
  margin-bottom: 24px;
}

.score-bar {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  overflow: hidden;
  height: 24px;
}

.score-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.score-fill.demand { background: var(--info); }
.score-fill.competition { background: var(--warning); }
.score-fill.profit { background: var(--success); }

.score-bar span {
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

/* Suggestions */
.suggestions-section {
  margin-bottom: 24px;
}

.suggestions-section h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text);
}

.suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-chip:hover {
  background: var(--orange-lt);
  border-color: var(--orange);
  color: var(--orange-dk);
}

/* Result Actions */
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Buttons */
.btn-primary {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  padding: 12px 24px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--orange-dk);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 24px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--text-2);
}

.btn-full {
  width: 100%;
}

.btn-save-niche {
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-save-niche:hover {
  background: #15803d;
}

.btn-saved {
  background: var(--text-3);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  padding: 12px 24px;
  font-weight: 600;
  cursor: not-allowed;
}

/* ———— Subscription Popup Modal ———— */

.subscription-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.subscription-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.subscription-popup-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-2);
  z-index: 10;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.popup-close:hover {
  background: var(--surface-2);
}

.popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.popup-image {
  background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  padding: 40px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px 0 0 16px;
  min-height: 400px;
}

.image-placeholder {
  text-align: center;
  color: #fff;
}

.image-placeholder i {
  font-size: 60px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.9;
}

.image-placeholder p {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.popup-content {
  padding: 40px;
}

.popup-content h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
}

.popup-subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 24px 0;
}

.popup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  position: relative;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.discount-code-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: 8px;
  justify-content: space-between;
}

.discount-label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.discount-code {
  font-size: 16px;
  font-weight: 700;
  color: var(--orange);
  font-family: 'Courier New', monospace;
  flex: 1;
}

.copy-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--orange);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.copy-btn:hover {
  background: rgba(249, 115, 22, 0.1);
}

.popup-message {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.popup-message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.popup-message.error {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.popup-btn {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}

.popup-notice {
  font-size: 12px;
  color: var(--text-2);
  margin: 12px 0 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.popup-notice i {
  font-size: 14px;
  opacity: 0.7;
}

@media (max-width: 600px) {
  .subscription-popup-content {
    width: 95%;
    max-height: 95vh;
  }

  .popup-grid {
    grid-template-columns: 1fr;
  }

  .popup-image {
    border-radius: 16px 16px 0 0;
    min-height: 200px;
  }

  .popup-content {
    padding: 24px;
  }

  .popup-content h2 {
    font-size: 22px;
  }

  .image-placeholder i {
    font-size: 48px;
  }
}

/* Auth Styles */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #0f3473;
}

.auth-form-col {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 14px;
  background: #eef2f9;
}

.auth-card {
  width: 100%;
  max-width: 760px;
  padding: 24px 30px 26px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 32px rgba(10, 35, 83, 0.1);
  border: 1px solid #dce5f0;
}

.auth-brand-col {
  min-height: 100vh;
  background:
    radial-gradient(800px 440px at 72% 14%, rgba(66, 122, 222, 0.28), transparent 72%),
    radial-gradient(760px 460px at 15% 90%, rgba(23, 74, 156, 0.4), transparent 76%),
    linear-gradient(135deg, #133a7a 0%, #0f2f69 48%, #0d275c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 44px;
  color: white;
  position: relative;
  overflow: hidden;
}

.auth-brand-col::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 96px 96px;
}

.auth-brand-col::after {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  background: rgba(85, 142, 242, 0.16);
  border-radius: 50%;
  right: -140px;
  top: -140px;
}

.auth-brand {
  position: relative;
  z-index: 1;
  width: min(700px, 100%);
}

.auth-brand h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(1.8rem, 2.4vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 10px;
}

.auth-brand p {
  font-size: 1.01rem;
  opacity: 0.92;
  margin: 0;
  line-height: 1.55;
}

.brand-features {
  list-style: none;
  padding: 0;
  margin: 18px 0 0 0;
}

.brand-features li {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 1.07rem;
  margin-bottom: 8px;
  opacity: 0.95;
}

.brand-features li i {
  color: #22c55e;
  font-size: 1.1em;
}

.auth-brand-sub {
  color: rgba(218, 232, 255, 0.88);
  max-width: 58ch;
}

.auth-brand-nav {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin-bottom: 20px;
}

.auth-brand-nav a {
  color: #d5e6ff;
  font-size: 0.95rem;
  font-weight: 600;
}

.auth-header {
  text-align: left;
  margin: 14px 0 18px;
}

.auth-header h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(2rem, 2.5vw, 2.45rem);
  font-weight: 700;
  margin: 0 0 10px 0;
  color: #1e2738;
}

.auth-header p {
  color: #687891;
  margin: 0;
  line-height: 1.55;
}

.auth-shell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-shell-logo {
  font-family: 'DM Sans', sans-serif;
  font-size: 3.05rem;
  font-weight: 700;
  color: #2c64d9;
  line-height: 1;
}

.auth-system-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid #dbe4ef;
  background: #f8fafc;
  color: #4d5f76;
  font-size: 0.92rem;
  font-weight: 600;
}

.auth-system-status i {
  color: #1ac257;
  font-size: 0.62rem;
}

.auth-social-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-social-btn {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dce3ee;
  border-radius: 9px;
  background: #fff;
  color: #3f4f66;
  font-size: 0.98rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-divider {
  position: relative;
  text-align: center;
  color: #8392a8;
  margin: 12px 0 14px;
  font-size: 0.95rem;
  font-weight: 600;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #e1e7ef;
}

.auth-divider span {
  position: relative;
  background: #fff;
  padding: 0 16px;
}

.field-box {
  margin-bottom: 14px;
}

.field-box label {
  display: block;
  font-weight: 600;
  margin-bottom: 7px;
  color: #2f3f58;
  font-size: 0.96rem;
}

.field-box input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #d8e0ea;
  border-radius: 9px;
  font-size: 0.98rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-box input:focus {
  outline: none;
  border-color: #6791e1;
  box-shadow: 0 0 0 3px rgba(74, 126, 219, 0.16);
}

.field-box select {
  width: 100%;
  padding: 15px 18px;
  border: 2px solid var(--border);
  border-radius: 16px;
  font-size: 15px;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-box select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.12);
}

.mobile-row {
  display: block;
}

.mobile-row.mobile-row-split {
  display: grid;
  grid-template-columns: 42% 58%;
  gap: 10px;
}

.mobile-row .iti {
  width: 100%;
}

.mobile-row .iti input {
  padding-left: 54px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7c8ca2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.password-toggle:hover {
  background: #f1f5fb;
  color: #3f5f95;
}

.password-toggle i {
  font-size: 16px;
  pointer-events: none;
}

.field-error {
  min-height: 18px;
  margin: 8px 4px 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px rgba(220,38,38,0.1) !important;
}

.field-box input[readonly] {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: #ddd6ce;
  cursor: not-allowed;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.checkbox-box {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: #5f7290;
  line-height: 1.35;
}

.checkbox-box input {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  margin-top: 2px;
}

.auth-inline-link {
  color: #4f79d9;
  font-size: 0.93rem;
  font-weight: 600;
}

.auth-primary-btn {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #8eb4ef 0%, #82a8ea 100%);
  color: #f7fbff;
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 0 -1px 0 rgba(50, 90, 155, 0.35), 0 6px 16px rgba(79, 120, 189, 0.22);
}

.auth-primary-btn:hover {
  filter: brightness(1.02);
}

.auth-footer {
  text-align: center;
  margin-top: 18px;
}

.auth-footer p {
  margin: 0;
  color: #8594a8;
  font-size: 0.97rem;
}

.auth-footer a,
.checkbox-box a {
  color: #4f79d9;
  font-weight: 600;
}

.auth-news-card {
  margin-top: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #24355a;
  border: 1px solid rgba(196, 216, 250, 0.7);
  padding: 14px 16px;
}

.auth-news-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.auth-news-copy {
  margin: 6px 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #556d96;
}

.auth-logo-cloud {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-logo-cloud span {
  border: 1px solid rgba(175, 200, 240, 0.42);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #d4e5ff;
  text-align: center;
  padding: 8px 6px;
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-quote-block {
  margin-top: 22px;
  border-left: 4px solid #3e8cff;
  padding-left: 14px;
}

.auth-quote-block h3 {
  margin: 0;
  color: #6ab0ff;
  font-size: 2rem;
  font-family: 'DM Sans', sans-serif;
}

.auth-quote-block p {
  margin-top: 8px;
  color: #b9d2f7;
  font-size: 0.95rem;
}

.auth-quote-author {
  color: #e5f0ff;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .auth-wrap {
    grid-template-columns: 1fr;
    background: #eef2f9;
  }

  .auth-brand-col {
    min-height: auto;
    padding: 24px 18px;
  }

  .auth-card {
    max-width: 840px;
  }
}

@media (max-width: 768px) {
  .auth-form-col {
    padding: 10px;
  }

  .auth-card {
    padding: 16px;
  }

  .auth-shell-logo {
    font-size: 2.35rem;
  }

  .auth-system-status {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .auth-header h1 {
    font-size: 1.8rem;
  }

  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-brand-nav {
    justify-content: flex-start;
  }

  .auth-logo-cloud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ——————————————————————————————————————————— */
/* DASHBOARD REDESIGN - eRank Style */
/* ——————————————————————————————————————————— */

/* Dashboard Container */
.dashboard-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Welcome Header */
.dashboard-welcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 20px;
}

.welcome-header h1 {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 900;
  margin: 0;
  color: var(--text);
}

.welcome-subtitle {
  font-size: 16px;
  color: var(--text-2);
  margin: 4px 0 0 0;
}

.welcome-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-badge {
  display: inline-flex;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--orange-lt);
  color: var(--orange-dk);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Top Action Cards */
.dashboard-top-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.action-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--sh-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.action-card:hover {
  border-color: var(--orange);
  box-shadow: var(--sh);
}

.action-card-primary {
  background: linear-gradient(135deg, var(--orange) 0%, #ec4899 100%);
  border-color: var(--orange);
  color: white;
  position: relative;
  overflow: hidden;
}

.action-card-primary::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  pointer-events: none;
}

.action-card-primary .action-card-title,
.action-card-primary .action-card-desc,
.action-card-primary .action-card-note {
  color: white;
  position: relative;
  z-index: 1;
}

.action-card-content {
  flex: 1;
}

.action-card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text);
}

.action-card-desc {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 12px 0;
  color: var(--text-2);
}

.action-card-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
  margin: 0 0 18px 0;
}

.action-card-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 48px;
  opacity: 0.1;
}

.action-card-primary .action-card-icon {
  opacity: 0.15;
  color: white;
}

/* Lookup Form */
.lookup-form {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.lookup-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px;
  background: var(--bg);
  transition: border-color 0.2s;
}

.lookup-input:focus {
  outline: none;
  border-color: var(--orange);
  background: white;
}

.btn-lookup {
  padding: 12px 24px;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-lookup:hover {
  background: var(--orange-dk);
}

.btn-action {
  display: inline-block;
  padding: 12px 24px;
  background: white;
  color: var(--orange);
  border: 2px solid var(--orange);
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}

.action-card-primary .btn-action {
  color: white;
  background: rgba(255,255,255,0.2);
  border-color: white;
}

.action-card-primary .btn-action:hover {
  background: white;
  color: var(--orange);
}

/* Main Dashboard Grid */
.dashboard-grid-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.grid-col-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.grid-col-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Card Styling */
.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--sh-sm);
  transition: all 0.2s;
}

.dashboard-card:hover {
  box-shadow: var(--sh);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--surface-2);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.card-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
  text-decoration: none;
  transition: color 0.2s;
}

.card-link:hover {
  color: var(--orange-dk);
}

/* Usage Stats Card */
.usage-card {
  background: linear-gradient(135deg, rgba(249,115,22,0.05) 0%, rgba(249,115,22,0.02) 100%);
  border: 2px solid rgba(249,115,22,0.15);
}

.usage-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.usage-stat {
  text-align: center;
  padding: 16px 12px;
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
}

.usage-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 6px;
}

.usage-label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.usage-progress {
  margin-top: 16px;
}

.progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), #ec4899);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Search List */
.search-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--r);
  transition: all 0.2s;
}

.search-item:hover {
  background: linear-gradient(90deg, rgba(249,115,22,0.05), rgba(249,115,22,0.02));
  border-left: 4px solid var(--orange);
  padding-left: 12px;
}

.search-info {
  flex: 1;
}

.search-keyword {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.search-date {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}

.search-score {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: right;
}

.score-value {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--orange);
}

.score-label {
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  font-weight: 600;
}

.view-more-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
  text-decoration: none;
  transition: color 0.2s;
}

.view-more-link:hover {
  color: var(--orange-dk);
}

/* Niches List */
.niches-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.niche-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--r);
  border-left: 4px solid transparent;
  transition: all 0.2s;
}

.niche-item:hover {
  border-left-color: var(--orange);
  background: linear-gradient(90deg, rgba(249,115,22,0.05), rgba(249,115,22,0.02));
}

.niche-keyword {
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.niche-score {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--orange);
  min-width: 40px;
  text-align: right;
}

.count-badge {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: white;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

/* Quick Actions Card */
.quick-actions-card {
  flex-direction: column;
}

.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--r);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

.action-btn i {
  font-size: 24px;
  color: var(--text-2);
}

.action-btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
}

.action-btn-primary i {
  color: white;
}

.action-btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
}

.action-btn:hover i {
  color: white;
}

/* Upgrade Card */
.upgrade-card {
  background: linear-gradient(135deg, rgba(249,115,22,0.1) 0%, rgba(249,115,22,0.05) 100%);
  border: 2px solid var(--orange-lt);
  border-radius: var(--r-lg);
  padding: 28px;
  text-align: center;
}

.upgrade-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text);
}

.upgrade-text {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 20px 0;
}

.btn-upgrade {
  display: inline-block;
  padding: 12px 28px;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
}

.btn-upgrade:hover {
  background: var(--orange-dk);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state i {
  font-size: 52px;
  color: var(--text-3);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-text {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 16px 0;
}

.btn-secondary-sm {
  display: inline-block;
  padding: 8px 18px;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary-sm:hover {
  background: var(--orange-dk);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .dashboard-grid-main {
    grid-template-columns: 1fr;
  }
  
  .dashboard-top-cards {
    grid-template-columns: 1fr;
  }
  
  .usage-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .actions-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 20px 16px;
  }
  
  .dashboard-welcome {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .welcome-header h1 {
    font-size: 28px;
  }
  
  .dashboard-top-cards {
    grid-template-columns: 1fr;
  }
  
  .usage-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-card {
    padding: 20px;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .actions-grid {
    grid-template-columns: 1fr;
  }
}

.text-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
}

.text-link:hover {
  color: var(--orange);
}

.btn-full {
  width: 100%;
}

.auth-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(229,226,221,0.85);
}

.auth-footer p {
  margin: 0;
  color: var(--text-2);
}

.auth-footer a {
  color: var(--orange);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  font-weight: 500;
}

.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

/* Global Page Loader */
.page-loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 25, 23, 0.36);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.page-loader.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-loader-inner {
  min-width: 220px;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(232, 229, 223, 0.95);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  padding: 24px 20px;
}

.page-loader-spinner {
  width: 42px;
  height: 42px;
  display: inline-block;
  border-radius: 50%;
  border: 4px solid rgba(249, 115, 22, 0.2);
  border-top-color: var(--orange);
  animation: spin-loader 0.8s linear infinite;
}

.page-loader-text {
  margin: 14px 0 0;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

@keyframes spin-loader {
  to {
    transform: rotate(360deg);
  }
}

/* Verification Status Page */
.verify-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 20%, rgba(249,115,22,0.15) 0%, rgba(249,115,22,0) 38%),
    radial-gradient(circle at 88% 10%, rgba(194,65,12,0.13) 0%, rgba(194,65,12,0) 40%),
    linear-gradient(140deg, #fff8f1 0%, #fff 55%, #fff5e8 100%);
}

.verify-card {
  width: 100%;
  max-width: 560px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-lg);
  padding: 42px 36px;
  text-align: center;
}

.verify-card-success {
  border-top: 6px solid var(--success);
}

.verify-card-error {
  border-top: 6px solid var(--danger);
}

.verify-icon-wrap {
  margin-bottom: 16px;
}

.verify-icon-wrap i {
  font-size: 60px;
}

.verify-card-success .verify-icon-wrap i {
  color: var(--success);
}

.verify-card-error .verify-icon-wrap i {
  color: var(--danger);
}

.verify-title {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 36px;
  line-height: 1.1;
  color: var(--text);
}

.verify-message {
  margin: 0 auto 26px;
  max-width: 430px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.65;
}

.verify-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.verify-link {
  color: var(--orange);
  font-weight: 700;
  text-decoration: none;
}

.verify-link:hover {
  text-decoration: underline;
}

/* Loading */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-2);
}

/* Empty States */
.empty-text {
  color: var(--text-2);
  font-style: italic;
}

.empty-text a {
  color: var(--orange);
  text-decoration: none;
}

.empty-text a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    order: 2;
  }

  .main {
    order: 1;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 0 24px;
  }

  .nav-item {
    white-space: nowrap;
    padding: 12px 16px;
  }

  .nav-item span {
    display: none;
  }

  .page-wrap {
    padding: 16px;
  }

  .stats-strip {
    flex-direction: column;
    gap: 12px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-wrap {
    flex-direction: column;
  }

  .auth-brand-col {
    order: -1;
    padding: 32px;
  }

  .auth-form-col {
    padding: 32px;
  }

  .verify-card {
    padding: 30px 22px;
  }

  .verify-title {
    font-size: 30px;
  }
}

/* --- FlipLens Modern Centered Research Hero (FORCE RE-ADD) --- */
.research-hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding-top: 40px;
  padding-bottom: 40px;
}
.research-hero-title {
  font-family: var(--font-heading);
  font-size: 2.7rem;
  font-weight: 900;
  margin-bottom: 18px;
  color: var(--text);
  text-align: center;
}
.research-hero-desc {
  color: var(--text-2);
  font-size: 1.18rem;
  margin-bottom: 32px;
  text-align: center;
}
.research-hero-searchbar {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 32px;
  box-shadow: 0 4px 24px 0 rgba(31,41,55,0.07);
  border: 2px solid var(--border);
  margin-bottom: 28px;
  padding: 4px 18px 4px 18px;
}
.research-hero-searchbar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.18rem;
  padding: 18px 0;
  outline: none;
  color: var(--text);
}
.research-hero-searchbar .search-icon {
  font-size: 1.4rem;
  color: var(--text-3);
  margin-right: 12px;
}
.research-hero-searchbar button {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 12px 32px;
  font-weight: 700;
  font-size: 1rem;
  margin-left: 10px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font-heading);
}
.research-hero-searchbar button:hover {
  background: var(--orange-dk);
}
.research-pill-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  justify-content: center;
}
.research-pill-tab {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
  border: none;
  transition: background 0.2s, color 0.2s;
  font-family: var(--font-heading);
}
.research-pill-tab.active, .research-pill-tab:hover {
  background: var(--orange);
  color: white;
}
.research-example {
  color: var(--text-3);
  font-size: 1rem;
  margin-top: 24px;
  text-align: center;
}

/* --- FlipLens Modern Table Styles (Product Research) --- */
.research-table-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 48px auto;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(31,41,55,0.06);
  padding: 32px 28px 32px 28px;
  overflow-x: auto;
}
.research-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 1.07rem;
  font-family: var(--font-body);
  color: var(--text);
  background: transparent;
}
.research-table th {
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 700;
  padding: 16px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.research-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.research-table tr:last-child td {
  border-bottom: none;
}
.research-table tbody tr:hover {
  background: var(--surface-2);
  transition: background 0.18s;
}
@media (max-width: 900px) {
  .research-table-wrap {
    padding: 18px 4px;
  }
  .research-table th, .research-table td {
    padding: 10px 6px;
    font-size: 0.97rem;
  }
}

/* --- Top Header Styles --- */
.top-header {
  width: 100%;
  height: 62px;
  background: #fff;
  box-shadow: 0 2px 12px 0 rgba(31,41,55,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
}
.header-logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.45rem;
  color: var(--orange);
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-user {
  font-family: var(--font-body);
  font-size: 1.08rem;
  color: var(--text-2);
  margin-left: 18px;
}

.header-right {
  position: relative;
  display: flex;
  align-items: center;
}

.user-menu-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.user-menu-btn:hover {
  border-color: #d8d2c8;
  box-shadow: 0 6px 18px rgba(28, 25, 23, 0.08);
}

.header-avatar,
.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.sidebar-avatar {
  margin-bottom: 8px;
}

.header-user-name {
  font-weight: 600;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 210px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 18px 35px rgba(28, 25, 23, 0.12);
  padding: 8px;
  display: none;
  z-index: 1200;
}

.user-dropdown.open {
  display: block;
}

.header-right:focus-within .user-dropdown,
.header-right:hover .user-dropdown {
  display: block;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
}

.user-dropdown a:hover {
  background: var(--surface-2);
}

.account-page .account-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.avatar-editor {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.avatar-preview {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-2);
}

.avatar-form small {
  color: var(--text-3);
  font-size: 12px;
}
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-2);
  margin-left: 18px;
  cursor: pointer;
}
@media (max-width: 900px) {
  .app-shell {
    padding-top: 54px;
  }

  .top-header {
    padding: 0 12px;
    height: 54px;
  }
  .sidebar-toggle {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    width: 230px;
    z-index: 1002;
    background: #1C1917;
    transition: left 0.3s;
  }
  .sidebar.open {
    left: 0;
  }
  .main {
    margin-left: 0 !important;
    padding-top: 0;
  }
}

/* Responsive Table */
.research-table-wrap {
  overflow-x: auto;
}
.research-table {
  min-width: 600px;
}
@media (max-width: 700px) {
  .research-table {
    font-size: 0.93rem;
    min-width: 420px;
  }
  .research-table th, .research-table td {
    padding: 8px 4px;
  }
}