/**
 * MAXIMO-SEO — premium-upgrade.css
 * Comprehensive UI/UX polish layer (loaded LAST)
 * Targets: auth screen, dashboard, sidebar, cards, buttons, responsive, states
 * Design direction: premium SaaS dark dashboard — polished, modern, crisp
 */

/* ==================================================================
   §0  DESIGN TOKEN REFINEMENTS
   ================================================================== */
:root {
  /* Slightly richer surface palette for depth differentiation */
  --surface-glass: rgba(255, 255, 255, 0.035);
  --surface-glass-hover: rgba(255, 255, 255, 0.065);
  --accent-gradient: linear-gradient(135deg, #7c5cff 0%, #6ea0ff 100%);
  --accent-gradient-hover: linear-gradient(135deg, #8f73ff 0%, #7cb8ff 100%);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(124, 92, 255, 0.28);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.28);
  --transition-smooth: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}


/* ==================================================================
   §1  AUTH SCREEN — Premium Split Layout
   ================================================================== */

/* Full-screen overlay with subtle gradient */
#authOverlay.auth-overlay {
  background: linear-gradient(
    135deg,
    rgba(10, 13, 23, 0.97) 0%,
    rgba(15, 20, 36, 0.98) 50%,
    rgba(10, 13, 23, 0.99) 100%
  );
  backdrop-filter: blur(40px);
}

/* Auth container — wider on desktop for 2-column feel */
#authOverlay .auth-container {
  max-width: 440px;
  padding: 44px 36px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.06),
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

/* Subtle glow accent on auth container */
#authOverlay .auth-container::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 0 0 4px 4px;
  opacity: 0.6;
}

/* Brand section refinement */
#authOverlay .auth-brand {
  margin-bottom: 32px;
  position: relative;
}

#authOverlay .auth-brand .name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#authOverlay .auth-brand .sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.2px;
}

/* Auth title */
#authOverlay .auth-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

/* Input fields — more refined */
#authOverlay .field {
  padding: 13px 16px;
  background: rgba(10, 13, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#authOverlay .field:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(10, 13, 23, 0.7);
}

#authOverlay .field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
  background: rgba(10, 13, 23, 0.8);
}

#authOverlay .field::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

/* Field labels — stronger */
#authOverlay .field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.1px;
}

/* Primary button in auth — gradient + lift */
#authOverlay .btn-primary {
  background: var(--accent-gradient);
  border: none;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  letter-spacing: 0.2px;
}

#authOverlay .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.4);
  opacity: 0.95;
}

#authOverlay .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.25);
}

/* Google button — cleaner */
#authOverlay .btn[onclick*="Google"],
#authOverlay #googleSignInBtnRegister {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
  transition: background 0.2s ease, border-color 0.2s ease !important;
}

#authOverlay .btn[onclick*="Google"]:hover,
#authOverlay #googleSignInBtnRegister:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

/* Auth submit button — full width */
#authOverlay .auth-submit-btn {
  width: 100%;
  margin-top: 14px;
}

/* Auth divider — structured */
#authOverlay .auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: 0.7;
}

#authOverlay .auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Auth Google button — dark theme variant */
#authOverlay .auth-google-btn {
  width: 100%;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s ease, border-color 0.2s ease;
  margin-bottom: 0;
}

#authOverlay .auth-google-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Auth download icon — SVG styled */
#authOverlay .auth-download-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Auth switch link */
#authOverlay .auth-switch {
  margin-top: 20px;
  font-size: 13px;
}

#authOverlay .auth-switch a {
  font-weight: 600;
  transition: color 0.15s ease;
}

/* Download banner — more subtle */
#authOverlay .auth-download-banner {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin-top: 24px;
  padding: 16px;
}


/* ==================================================================
   §2  HEADER — Refined
   ================================================================== */
.app-header {
  height: 60px;
  padding: 0 20px;
  background: rgba(10, 13, 23, 0.9);
  backdrop-filter: blur(28px) saturate(1.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-header::after {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(124, 92, 255, 0.2) 30%,
    rgba(124, 92, 255, 0.35) 50%,
    rgba(124, 92, 255, 0.2) 70%,
    transparent 100%
  );
}

/* Brand refinement */
.brand .logo {
  filter: drop-shadow(0 0 6px rgba(124, 92, 255, 0.3));
}

.brand-text .name {
  font-size: 16px;
  letter-spacing: -0.3px;
}

/* Header buttons — more glass-like */
.app-header .btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 13px;
  padding: 6px 12px;
  transition: all var(--transition-smooth);
}

.app-header .btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Header tab buttons — refined */
.header-tab-btn {
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.18s ease;
}

.header-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.header-tab-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(124, 92, 255, 0.3);
}


/* ==================================================================
   §3  SIDEBAR — Tighter, More Scannable
   ================================================================== */
.tab-nav {
  width: 256px;
  padding: 12px 10px;
  background: var(--bg-secondary);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* Category headers — more compact */
.nav-category-header {
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 8px;
  min-height: 38px;
}

/* Category items — tighter */
.nav-category-items .tab-btn {
  padding: 7px 12px;
  font-size: 12.5px;
  min-height: 34px;
  border-radius: 7px;
}

.nav-category-items .tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.nav-category-items .tab-btn.active {
  font-weight: 600;
  border: 1px solid transparent;
}

/* Sidebar scrollbar — thinner */
.tab-nav::-webkit-scrollbar {
  width: 3px;
}

.tab-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}


/* ==================================================================
   §4  DASHBOARD — Premium Layout
   ================================================================== */

/* Dashboard container — better max-width */
.dashboard-container {
  max-width: 1280px;
  padding: 28px 32px;
}

/* Page title refinement */
.dashboard-header .page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.dashboard-header .page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* Stats grid — more visual weight */
.stats-grid {
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  transition: all 0.22s ease;
}

.stat-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

/* Stat values — bigger, gradient accent */
.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
  letter-spacing: 0.1px;
}

/* Stat icon — visual polish */
.stat-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 92, 255, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(124, 92, 255, 0.1);
}

/* Dashboard row — refined */
.dashboard-row {
  gap: 18px;
  margin-bottom: 18px;
}

/* Dashboard cards — more depth */
.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.dashboard-card .card-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.01);
}

.dashboard-card .card-header h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.dashboard-card .card-body {
  padding: 16px 20px;
}

/* Quick actions — cleaner grid */
.quick-actions-grid {
  gap: 10px;
}

.quick-action-btn {
  padding: 16px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.quick-action-btn:hover {
  background: rgba(124, 92, 255, 0.08);
  border-color: rgba(124, 92, 255, 0.2);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.quick-action-btn .qa-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 2px;
}

/* Empty states — more inviting */
.empty-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  gap: 8px;
}

.empty-state-box .empty-icon {
  font-size: 32px;
  opacity: 0.6;
  margin-bottom: 4px;
}

.empty-state-box h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

.empty-state-box p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  max-width: 280px;
  line-height: 1.5;
}

/* Tips carousel — refined */
.tip-card {
  display: none;
  gap: 14px;
  padding: 16px;
  background: rgba(124, 92, 255, 0.04);
  border: 1px solid rgba(124, 92, 255, 0.1);
  border-radius: 12px;
}

.tip-card.active {
  display: flex;
  align-items: flex-start;
}

.tip-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 92, 255, 0.08);
  border-radius: 10px;
}

.tip-content strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tip-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.tips-nav {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.tip-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}

.tip-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

/* Grow Flow streak — refined */
.grow-flow-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #f59e0b;
}


/* ==================================================================
   §5  GLOBAL CARD & PANEL REFINEMENTS
   ================================================================== */

/* Cards — consistent treatment */
.card,
.panel,
.tool-card {
  border-radius: 14px;
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

/* Card headers — uniform */
.card > .card-header,
.panel > .panel-header,
.card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Card header h3 — consistent size */
.card-header h3,
.panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}


/* ==================================================================
   §6  BUTTON SYSTEM — Polished
   ================================================================== */

/* Primary buttons — gradient */
.btn-primary {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.2);
  transition: all 0.18s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-gradient-hover);
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.35);
  transform: translateY(-1px);
  opacity: 1;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(124, 92, 255, 0.2);
}

/* Secondary / ghost buttons */
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  min-height: 30px;
  border-radius: 7px;
}

/* Focus-visible — consistent ring */
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Cursor pointer on all interactive */
.btn,
.tab-btn,
.nav-category-header,
.quick-action-btn,
.template-filter-btn,
.tip-nav-btn,
[role="button"],
[onclick] {
  cursor: pointer;
}


/* ==================================================================
   §7  FORM SYSTEM — Refined
   ================================================================== */
.field,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
select,
textarea {
  background: rgba(10, 13, 23, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.field:hover,
input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.field:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

/* Labels */
.field-label,
label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}


/* ==================================================================
   §8  TAB CONTENT — Better Spacing
   ================================================================== */
.tab-content.active {
  padding: 24px 28px;
  box-sizing: border-box;
}

/* Page titles within tabs — consistent */
.tab-content .page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.tab-content .page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

/* Section headers within tools */
.section-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
}

.section-header-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}


/* ==================================================================
   §9  TABLE REFINEMENTS
   ================================================================== */
.data-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
}

.data-table td {
  padding: 11px 16px;
  font-size: 13px;
}

.data-table tbody tr {
  transition: background 0.12s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}


/* ==================================================================
   §10  MODAL REFINEMENTS
   ================================================================== */
.modal-content,
.modal-dialog,
[class*="modal-body"] {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}


/* ==================================================================
   §11  RESPONSIVE — Mobile-first hardening
   ================================================================== */

/* Tablet */
@media (max-width: 1024px) {
  .dashboard-container {
    padding: 20px;
    max-width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .dashboard-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tab-content.active {
    padding: 20px;
  }

  /* Sidebar — slide-over */
  .tab-nav {
    width: 280px;
    max-width: 85vw;
  }
}

/* Mobile */
@media (max-width: 640px) {
  body {
    padding-top: 56px;
  }

  /* Header — more compact */
  .app-header {
    height: 56px;
    padding: 0 14px;
  }

  /* Sidebar width */
  .tab-nav {
    width: 280px;
    max-width: 85vw;
  }

  /* Dashboard */
  .dashboard-container {
    padding: 16px;
  }

  .dashboard-header .page-title {
    font-size: 22px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 22px;
    border-radius: 10px;
  }

  .stat-value {
    font-size: 24px;
  }

  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .quick-action-btn {
    padding: 12px 8px;
    font-size: 11px;
    min-height: 70px;
  }

  /* Tab content */
  .tab-content.active {
    padding: 14px;
    padding-bottom: 80px;
  }

  .tab-content .page-title {
    font-size: 20px;
  }

  /* Cards */
  .dashboard-card .card-header {
    padding: 12px 16px;
  }

  .dashboard-card .card-body {
    padding: 14px 16px;
  }

  /* Mobile menu toggle — more refined */
  .mobile-menu-toggle {
    bottom: 16px;
    padding: 11px 20px;
    border-radius: 28px;
    font-size: 13px;
    box-shadow: 0 4px 20px rgba(124, 92, 255, 0.35);
  }

  /* Form row — single column */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Full-width cards on mobile */
  .dashboard-card.full-width {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Small mobile */
@media (max-width: 375px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 11px;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #authOverlay .auth-container {
    padding: 24px 18px;
    margin: 12px;
    border-radius: 16px;
  }

  #authOverlay .auth-brand .name {
    font-size: 20px;
  }
}

/* Large desktop */
@media (min-width: 1440px) {
  .dashboard-container {
    max-width: 1360px;
    padding: 32px 40px;
  }

  .tab-content.active {
    padding: 28px 36px;
  }
}

/* Ultra-wide */
@media (min-width: 1920px) {
  .dashboard-container {
    max-width: 1480px;
  }
}


/* ==================================================================
   §12  INTERACTION STATES — Global
   ================================================================== */

/* Hover state for interactive cards */
.dashboard-card,
.stat-card,
.card,
.panel {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Loading overlay — better backdrop */
.loading-overlay {
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(6px);
}

/* Toast notifications */
.toast,
[class*="toast"],
[class*="notification"] {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Skeleton shimmer — smoother */
.skeleton,
.ux-skeleton {
  border-radius: 8px;
}

/* Disabled state — universal */
button:disabled,
.btn:disabled,
[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}


/* ==================================================================
   §13  MISCELLANEOUS POLISH
   ================================================================== */

/* Better scrollbar globally */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Selection color */
::selection {
  background: rgba(124, 92, 255, 0.35);
  color: #fff;
}

/* Remove border-top from header if any */
.app-header {
  border-top: none;
}

/* Fix overflow issues globally */
.tab-content {
  overflow-x: hidden;
  max-width: 100%;
}

/* Ensure main-wrap has proper background */
.main-wrap {
  min-height: calc(100vh - 60px);
}

/* Card header actions — consistent alignment */
.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Badge refinement */
.badge,
[class*="badge"] {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

/* Template filter buttons */
.template-filter-btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.template-filter-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.template-filter-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(124, 92, 255, 0.25);
}

/* My sites grid */
.my-sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

@media (max-width: 640px) {
  .my-sites-grid {
    grid-template-columns: 1fr;
  }
}


/* ==================================================================
   §14  PREFERS-REDUCED-MOTION
   ================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ==================================================================
   §15  TOOL PAGE PATTERNS
   ================================================================== */

/* Page header — used across tool tabs */
.page-header {
  margin-bottom: 20px;
}

.page-header-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.3;
  margin: 0 0 4px;
}

.page-header-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Panel left/right split layout — used in editor, keyword research, etc. */
.panel-left,
.panel-right {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
}

.panel-left {
  flex: 0 0 380px;
  max-width: 420px;
}

.panel-right {
  flex: 1;
  min-width: 0;
}

@media (max-width: 1024px) {
  .panel-left {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
}

/* Panel header refinement */
.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.panel-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Subtab buttons — used in keyword research, local SEO, etc. */
.kr-subtabs,
[class*="-subtabs"] {
  display: flex;
  gap: 6px;
  padding: 0;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.kr-subtabs::-webkit-scrollbar,
[class*="-subtabs"]::-webkit-scrollbar {
  display: none;
}

.kr-subtab-btn,
[class*="-subtab-btn"] {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: inherit;
}

.kr-subtab-btn:hover,
[class*="-subtab-btn"]:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.kr-subtab-btn.active,
[class*="-subtab-btn"].active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(124, 92, 255, 0.2);
}

/* Tool actions row */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .actions {
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
  }
}

/* Details/summary for collapsible sections */
details.brand-voice-section,
details {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-top: 14px;
  overflow: hidden;
}

details summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s ease;
  list-style: none;
}

details summary:hover {
  background: rgba(255, 255, 255, 0.04);
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '>';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s ease;
  font-size: 11px;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details > :not(summary) {
  padding: 0 16px 16px;
}

/* Collaboration bar */
.collab-session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

/* Row/Col layout for form fields */
.row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.col {
  flex: 1;
  min-width: 0;
}

@media (max-width: 480px) {
  .row {
    flex-direction: column;
    gap: 0;
  }
}

/* Textarea refinement */
.textarea,
textarea.field {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
}


/* ==================================================================
   §16  PRINT STYLES (basic)
   ================================================================== */
@media print {
  .app-header,
  .tab-nav,
  .mobile-menu-toggle,
  .sidebar-overlay,
  #authOverlay {
    display: none !important;
  }

  .main-wrap {
    margin-left: 0 !important;
  }

  body {
    background: #fff;
    color: #000;
    padding: 0;
  }
}
