/* =====================================================
   SEO EMPIRE - DashStack-inspired Design System
   Light + Dark theme via [data-theme] attribute
   ===================================================== */

/* DESIGN TOKENS */
:root,
[data-theme="light"] {
  --bg-page:       #F5F6FA;
  --bg-card:       #FFFFFF;
  --bg-sidebar:    #FFFFFF;
  --bg-topbar:     #FFFFFF;
  --bg-hover:      #F8F9FB;
  --bg-input:      #FFFFFF;
  --bg-table-head: #F8F9FB;
  --text-primary:   #202224;
  --text-secondary: #7E7E7E;
  --text-muted:     #9E9E9E;
  --border:        #E5E7EB;
  --border-light:  #F1F2F5;
  --accent:        #4880FF;
  --accent-hover:  #3A6FE6;
  --accent-light:  #E8F0FF;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.04);
  --shadow:     0 4px 20px rgba(0,0,0,0.05);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.08);
  --success:    #00B69B;
  --success-bg: #E2FFF5;
  --warning:    #FFA756;
  --warning-bg: #FFF5E1;
  --danger:     #EF3826;
  --danger-bg:  #FFE2DE;
  --info:       #6226EF;
  --info-bg:    #EFE8FB;
  --magenta:    #BA29CF;
  --magenta-bg: #FBE2FF;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-page:       #1B2431;
  --bg-card:       #273142;
  --bg-sidebar:    #273142;
  --bg-topbar:     #273142;
  --bg-hover:      #2D3A4F;
  --bg-input:      #1B2431;
  --bg-table-head: #323D4E;
  --text-primary:   #FFFFFF;
  --text-secondary: #A0A0A0;
  --text-muted:     #6B7280;
  --border:        #323D4E;
  --border-light:  #2D3A4F;
  --accent:        #4880FF;
  --accent-hover:  #5A8DFF;
  --accent-light:  rgba(72,128,255,0.15);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.2);
  --shadow:     0 4px 20px rgba(0,0,0,0.3);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.4);
  /* Brighter badge backgrounds for dark mode */
  --success:    #00D9A3;
  --success-bg: rgba(0, 217, 163, 0.18);
  --warning:    #FFB870;
  --warning-bg: rgba(255, 184, 112, 0.18);
  --danger:     #FF5A47;
  --danger-bg:  rgba(255, 90, 71, 0.18);
  --info:       #9B7FFF;
  --info-bg:    rgba(155, 127, 255, 0.18);
  --magenta:    #DA5BF0;
  --magenta-bg: rgba(218, 91, 240, 0.18);
  color-scheme: dark;
}

/* BASE */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* LAYOUT */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.25s ease;
}
.app.sidebar-collapsed { grid-template-columns: 70px 1fr; }

/* SIDEBAR */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border-light);
  min-height: 72px;
}
.brand-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-text { overflow: hidden; }
.brand-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.brand-sub {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
  white-space: nowrap;
}
.app.sidebar-collapsed .brand-text { display: none; }
.app.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 22px 0; }

.nav-section { padding: 16px 12px 8px; }
.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px;
  margin-bottom: 4px;
}
.app.sidebar-collapsed .nav-group-label { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(72,128,255,0.3);
}
.nav-item.active:hover { background: var(--accent-hover); color: #fff; }
.nav-item .icon { width: 20px; height: 20px; flex-shrink: 0; }
.app.sidebar-collapsed .nav-item { justify-content: center; padding: 11px 0; }
.app.sidebar-collapsed .nav-item .nav-label { display: none; }

/* Nav with submenu */
.nav-group { display: flex; flex-direction: column; }
.nav-group .nav-chevron {
  width: 14px; height: 14px;
  margin-left: auto;
  transition: transform 0.2s;
  opacity: 0.7;
}
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-sub {
  display: none;
  flex-direction: column;
  padding: 2px 0 4px 32px;
  margin-top: 2px;
  margin-left: 12px;
  border-left: 2px solid var(--border-light);
}
.nav-group.open .nav-sub { display: flex; }
.nav-sub-item {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  margin: 1px 0;
  transition: all 0.15s;
  text-decoration: none;
}
.nav-sub-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-sub-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}
.app.sidebar-collapsed .nav-sub { display: none !important; }
.app.sidebar-collapsed .nav-chevron { display: none; }

/* TOPBAR */
.topbar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.btn-sidebar-toggle {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.btn-sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.topbar-search { flex: 1; max-width: 560px; position: relative; }
.topbar-search input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 42px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.topbar-search input:focus { border-color: var(--accent); }
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px; height: 18px;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  position: relative;
  transition: all 0.15s;
}
.topbar-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.topbar-icon-btn .badge-dot {
  position: absolute;
  top: 8px; right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-topbar);
}

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 22px;
  transition: background 0.15s;
}
.topbar-profile:hover { background: var(--bg-hover); }
.profile-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--magenta));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.profile-info { line-height: 1.2; }
.profile-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.profile-role { font-size: 11px; color: var(--text-secondary); }

/* profile dropdown */
.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 100;
  display: none;
}
.topbar-profile-wrap { position: relative; }
.topbar-profile-wrap.open .profile-menu { display: block; }
.profile-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}
.profile-menu a:hover { background: var(--bg-hover); }
.profile-menu a.danger { color: var(--danger); }
.profile-menu hr { border: 0; border-top: 1px solid var(--border-light); margin: 6px 0; }

/* MAIN */
.main { display: flex; flex-direction: column; min-width: 0; }
.content { padding: 28px; max-width: 100%; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.page-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* CARDS / PANELS */
.card,
.panel {
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
}
.panel-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.panel-body { padding: 20px 24px; }

/* STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon.icon-purple { background: var(--info-bg); color: var(--info); }
.stat-icon.icon-yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon.icon-green  { background: var(--success-bg); color: var(--success); }
.stat-icon.icon-red    { background: var(--danger-bg); color: var(--danger); }
.stat-icon.icon-blue   { background: var(--accent-light); color: var(--accent); }
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.stat-foot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.stat-trend-up   { color: var(--success); font-weight: 700; }
.stat-trend-down { color: var(--danger);  font-weight: 700; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(72,128,255,0.25);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Back button - clearly visible in both light/dark */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-back:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  color: var(--text-secondary);
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--border); color: var(--text-primary); }
.btn-icon.danger { background: var(--danger-bg); color: var(--danger); }
.btn-icon.danger:hover { background: var(--danger); color: #fff; }
.btn-icon.edit { background: var(--accent-light); color: var(--accent); }
.btn-icon.edit:hover { background: var(--accent); color: #fff; }

/* TAGS / BADGES - solid filled style like Figma e-commerce */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1.4;
}
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-danger  { background: var(--danger-bg);  color: var(--danger); }
.tag-info    { background: var(--info-bg);    color: var(--info); }
.tag-magenta { background: var(--magenta-bg); color: var(--magenta); }
.tag-default { background: #F3F4F6; color: #4B5563; }
[data-theme="dark"] .tag-default { background: rgba(156,163,175,0.18); color: #D1D5DB; }

/* SOLID tags - Figma style: SOFT bg + COLORED text, full pill */
.tag-solid-success { background: #D1FAE5; color: #00B69B; }
.tag-solid-warning { background: #FFE2C0; color: #B45309; }
.tag-solid-danger  { background: #FEE4E2; color: #EF3826; }
.tag-solid-info    { background: #E0E7FF; color: #6226EF; }
.tag-solid-magenta { background: #FAE8FF; color: #BA29CF; }
.tag-solid-default { background: #F3F4F6; color: #6B7280; }
[data-theme="dark"] .tag-solid-success { background: rgba(0,182,155,0.22);  color: #6EE7B7; }
[data-theme="dark"] .tag-solid-warning { background: rgba(255,167,86,0.22); color: #FCD34D; }
[data-theme="dark"] .tag-solid-danger  { background: rgba(239,56,38,0.22);  color: #FCA5A5; }
[data-theme="dark"] .tag-solid-info    { background: rgba(98,38,239,0.22);  color: #C4B5FD; }
[data-theme="dark"] .tag-solid-magenta { background: rgba(186,41,207,0.22); color: #F0ABFC; }
[data-theme="dark"] .tag-solid-default { background: rgba(156,163,175,0.18); color: #D1D5DB; }

/* Brand colors - SOFT (Figma style: soft bg + colored text, full rounded pill) */
.tag-brand-blue   { background: #DBEAFE; color: #1D4ED8; }
.tag-brand-teal   { background: #CCFBF1; color: #0F766E; }
.tag-brand-amber  { background: #FEF3C7; color: #B45309; }
.tag-brand-pink   { background: #FCE7F3; color: #BE185D; }
.tag-brand-indigo { background: #E0E7FF; color: #4338CA; }

/* Brand-specific colors */
.brand-megapari   { background: #EDE9FE; color: #6D28D9; }
.brand-1win       { background: #FFEDD5; color: #C2410C; }
.brand-dbbet      { background: #DBEAFE; color: #1D4ED8; }
.brand-betwinner  { background: #D1FAE5; color: #047857; }
.brand-bet365     { background: #FEE2E2; color: #B91C1C; }
.brand-22bet      { background: #FCE7F3; color: #BE185D; }
.brand-betway     { background: #CCFBF1; color: #0F766E; }
.brand-parimatch  { background: #FEF3C7; color: #B45309; }
.brand-mostbet    { background: #FBCFE8; color: #BE185D; }
.brand-pinnacle   { background: #E0E7FF; color: #4338CA; }

/* Tier badges - clean text style (soft pills) */
.tag-tier-gold   { background: #FEF3C7; color: #B45309; }
.tag-tier-silver { background: #E5E7EB; color: #374151; }
.tag-tier-bronze { background: #FED7AA; color: #9A3412; }
.tag-tier-pbn    { background: #E0E7FF; color: #4338CA; }

[data-theme="dark"] .tag-tier-gold   { background: rgba(245,158,11,0.18);  color: #FCD34D; }
[data-theme="dark"] .tag-tier-silver { background: rgba(156,163,175,0.18); color: #E5E7EB; }
[data-theme="dark"] .tag-tier-bronze { background: rgba(217,119,6,0.20);   color: #FDBA74; }
[data-theme="dark"] .tag-tier-pbn    { background: rgba(99,102,241,0.20);  color: #A5B4FC; }

[data-theme="dark"] .brand-megapari   { background: rgba(124,58,237,0.20); color: #C4B5FD; }
[data-theme="dark"] .brand-1win       { background: rgba(194,65,12,0.20);  color: #FED7AA; }
[data-theme="dark"] .brand-dbbet      { background: rgba(29,78,216,0.20);  color: #93C5FD; }
[data-theme="dark"] .brand-betwinner  { background: rgba(21,128,61,0.20);  color: #86EFAC; }
[data-theme="dark"] .brand-bet365     { background: rgba(185,28,28,0.20);  color: #FCA5A5; }
[data-theme="dark"] .brand-22bet      { background: rgba(190,24,93,0.20);  color: #F9A8D4; }
[data-theme="dark"] .brand-betway     { background: rgba(15,118,110,0.20); color: #5EEAD4; }
[data-theme="dark"] .brand-parimatch  { background: rgba(180,83,9,0.20);   color: #FCD34D; }
[data-theme="dark"] .brand-mostbet    { background: rgba(190,24,93,0.20);  color: #F9A8D4; }
[data-theme="dark"] .brand-pinnacle   { background: rgba(67,56,202,0.20);  color: #A5B4FC; }

/* GEO flag display */
.geo-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-hover);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.geo-flag .geo-code {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* MULTI-SELECT FILTER PILLS */
.filter-multi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-pill input { display: none; }

/* Filter dropdown body container */
.filter-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 100;
  display: none;
}
.filter-item.open .filter-popup { display: block; }
.filter-popup-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding: 0 6px;
}
.filter-popup-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 10px 0 4px;
}
.filter-popup-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.filter-popup-apply {
  padding: 9px 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: 0;
}
.filter-popup-apply:hover { background: var(--accent-hover); }

/* Prev/Next Date buttons */
.date-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
}
.date-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 0;
  text-decoration: none;
}
.date-nav-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.date-nav-btn:disabled,
.date-nav-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* TABLES */
.table-wrap { overflow-x: auto; border-radius: 12px; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead { background: var(--bg-table-head); }
.data-table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-light);
}
.data-table td {
  padding: 16px 20px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table .cell-main { font-weight: 700; color: var(--text-primary); }
.data-table .cell-sub  { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.data-table .mono { font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace; font-size: 13px; }
.data-table .actions { display: flex; gap: 8px; }
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 14px; }

/* FORMS */
.form { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-row label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.req { color: var(--danger); }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row input[type="date"],
.form-row input[type="url"],
.form-row select,
.form-row textarea,
.input,
.select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus,
.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-row textarea { min-height: 80px; resize: vertical; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}

/* Form with sections */
.form-section {
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
}
.form-section:last-child { border-bottom: 0; }
.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title .badge-num {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.form-section-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Input with leading icon */
.input-wrap {
  position: relative;
  display: block;
}
.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  padding-left: 42px !important;
}

/* FILTER BAR */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar .filter-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
}
.filter-divider { width: 1px; height: 28px; background: var(--border); }
.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
  user-select: none;
}
.filter-item:hover { background: var(--bg-hover); }
.filter-item.has-value { color: var(--accent); }
.filter-item .chev { width: 14px; height: 14px; color: var(--text-secondary); }
.filter-reset {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.filter-reset:hover { background: var(--danger-bg); }

.filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 50;
  display: none;
}
.filter-item.open .filter-dropdown { display: block; }
.filter-option {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-option:hover { background: var(--bg-hover); }
.filter-option.selected { background: var(--accent-light); color: var(--accent); font-weight: 700; }

/* CALENDAR */
.calendar-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 18px;
  z-index: 100;
  display: none;
}
.filter-item.open .calendar-popup,
.calendar-popup.open { display: block; }
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.cal-nav {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}
.cal-nav:hover { background: var(--border); color: var(--text-primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 6px 0;
}
.cal-day {
  text-align: center;
  font-size: 13px;
  padding: 8px 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-primary);
  user-select: none;
  transition: background 0.1s;
}
.cal-day:hover { background: var(--bg-hover); }
.cal-day.muted { color: var(--text-muted); }
.cal-day.selected { background: var(--accent); color: #fff; font-weight: 700; }
.cal-day.in-range { background: var(--accent-light); border-radius: 0; }
.cal-day.range-start { border-radius: 50% 0 0 50%; background: var(--accent); color: #fff; font-weight: 700; }
.cal-day.range-end   { border-radius: 0 50% 50% 0; background: var(--accent); color: #fff; font-weight: 700; }
.cal-day.today { font-weight: 800; box-shadow: inset 0 0 0 1px var(--accent); }
.cal-foot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}
.cal-hint { font-size: 11px; color: var(--text-muted); }
.cal-apply {
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}
.pag-info { font-size: 13px; color: var(--text-secondary); }
.pag-controls { display: flex; gap: 6px; }
.pag-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.pag-btn:hover:not(:disabled) { background: var(--border); color: var(--text-primary); }
.pag-btn.active { background: var(--accent); color: #fff; }
.pag-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* FLASH */
.flash {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error   { background: var(--danger-bg);  color: var(--danger); }
.flash-info    { background: var(--info-bg);    color: var(--info); }

/* LOGIN */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  padding: 40px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.login-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; display: block; }
.w-full { width: 100%; justify-content: center; }
.login-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* UTILS */
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.fw-700 { font-weight: 700; }
.hidden { display: none !important; }
.crumbs { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.crumbs span + span::before { content: " / "; margin: 0 6px; opacity: 0.5; }
.crumbs .current { color: var(--text-primary); }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .app { grid-template-columns: 70px 1fr; }
  .sidebar .brand-text,
  .sidebar .nav-label,
  .sidebar .nav-group-label { display: none; }
  .sidebar-brand { justify-content: center; padding: 22px 0; }
  .nav-item { justify-content: center; padding: 11px 0; }
}
@media (max-width: 768px) {
  .content { padding: 16px; }
  .topbar { padding: 0 16px; height: 64px; }
  .topbar-search { display: none; }
  .profile-info { display: none; }
  .page-title { font-size: 22px; }
  .stats-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* COPY CELL with inline copy button */
.copy-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.copy-cell .mono {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.copy-btn {
  width: 24px; height: 24px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  border: 0;
}
.copy-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.copy-btn.copied {
  background: var(--success-bg);
  color: var(--success);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 20px 24px; }
.modal-foot {
  padding: 16px 24px;
  background: var(--bg-hover);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================
 * SITES PAGE COMPONENTS
 * ============================================ */

/* Sortable column headers */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.data-table th.sortable:hover { color: var(--accent); }
.data-table th.sortable .sort-arrows {
  display: inline-flex;
  flex-direction: column;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.4;
}
.data-table th.sortable .sort-arrows svg {
  width: 8px; height: 8px;
  display: block;
}
.data-table th.sortable.asc .sort-up,
.data-table th.sortable.desc .sort-down {
  opacity: 1;
  color: var(--accent);
}
.data-table th.sortable.asc .sort-down,
.data-table th.sortable.desc .sort-up { opacity: 0.3; }
.data-table th.sortable.asc .sort-arrows,
.data-table th.sortable.desc .sort-arrows { opacity: 1; }

/* Checkbox column */
.col-check { width: 40px; padding-right: 0 !important; }
.row-checkbox {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  position: relative;
  vertical-align: middle;
  transition: all 0.15s;
}
.row-checkbox:hover { border-color: var(--accent); }
.row-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.row-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.data-table tbody tr.selected { background: var(--accent-light); }
.data-table tbody tr.selected:hover { background: var(--accent-light); }

/* Clickable stat cards */
.stat-card.clickable {
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.stat-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(72,128,255,0.12);
}
.stat-card.clickable.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}
.stat-card.clickable.active::after {
  content: '';
  position: absolute;
  top: 12px; right: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
}

/* BULK ACTION BAR */
.bulk-action-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(72,128,255,0.25);
  animation: slideIn 0.2s ease-out;
}
.bulk-action-bar.show { display: flex; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.bulk-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 14px;
}
.bulk-count-badge {
  background: rgba(255,255,255,0.25);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
}
.bulk-actions {
  display: flex;
  gap: 8px;
}
.bulk-btn {
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.bulk-btn:hover { background: rgba(255,255,255,0.3); }
.bulk-btn.danger { background: rgba(239,56,38,0.9); }
.bulk-btn.danger:hover { background: #EF3826; }
.bulk-btn.deselect { background: transparent; opacity: 0.85; }
.bulk-btn.deselect:hover { background: rgba(255,255,255,0.15); opacity: 1; }

/* Site domain link */
.site-domain {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.site-domain .site-link {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.site-domain .site-link:hover { color: var(--accent); }
.site-favicon {
  width: 20px; height: 20px;
  border-radius: 5px;
  background: var(--bg-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

/* Sub-filter chips (e.g. by hosting account chips) */
.sub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  align-items: center;
}
.sub-filter-bar .sub-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 4px;
}
.sub-filter-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sub-filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.sub-filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.sub-filter-chip .chip-count {
  background: rgba(0,0,0,0.1);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.sub-filter-chip.active .chip-count { background: rgba(255,255,255,0.25); }

/* ============================================
 * PHASE G: NOTES MODAL + SELECTION CARDS + LINK CELLS
 * ============================================ */

/* Link cells (RG/APK) */
.link-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.15s;
}
.link-icon:hover {
  background: var(--accent);
  color: #fff;
}

/* Notes button with badge */
.notes-btn {
  background: rgba(124, 58, 237, 0.12);
  color: #7C3AED;
  position: relative;
}
.notes-btn:hover {
  background: #7C3AED;
  color: #fff;
}
[data-theme="dark"] .notes-btn {
  background: rgba(124, 58, 237, 0.22);
  color: #C4B5FD;
}
.notes-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg-card);
}

/* Selection cards - hidden by default */
.stat-card.stat-selection {
  display: none;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg-card) 60%);
}
.has-selection .stat-card.stat-selection { display: flex; flex-direction: column; }

/* NOTES MODAL (bigger, with chat thread) */
.notes-modal-card {
  max-width: 580px !important;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}
.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 50vh;
}
.notes-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 32px 12px;
  font-size: 13px;
}
.note-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  animation: noteFadeIn 0.2s ease-out;
}
@keyframes noteFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.note-item .note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}
.note-item .note-user {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.note-item .note-user .user-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.note-item .note-time {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}
.note-item .note-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-wrap;
}
.note-item .note-delete {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  border: 0;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
}
.note-item:hover .note-delete { opacity: 1; }
.note-item .note-delete:hover { background: var(--danger-bg); color: var(--danger); }

.notes-input-bar {
  padding: 14px 18px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.notes-input-bar textarea {
  flex: 1;
  resize: none;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  min-height: 42px;
  max-height: 100px;
}
.notes-input-bar textarea:focus { border-color: var(--accent); }
.notes-input-bar .btn {
  padding: 10px 18px;
  white-space: nowrap;
  flex-shrink: 0;
}


/* ============================================
 * PHASE H: SITE DETAIL PAGE
 * ============================================ */

/* Hero header */
.site-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.site-detail-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.site-detail-favicon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #6366F1 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(72,128,255,0.25);
  letter-spacing: 0.5px;
}
.site-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.site-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Detail sections (inside panels) */
.detail-section {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-light);
}
.detail-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.detail-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-section-icon.icon-blue   { background: rgba(45,127,249,0.12); color: #2D7FF9; }
.detail-section-icon.icon-purple { background: rgba(124,58,237,0.12); color: #7C3AED; }
.detail-section-icon.icon-green  { background: rgba(0,182,155,0.12);  color: #00B69B; }
.detail-section-icon.icon-yellow { background: rgba(245,158,11,0.12); color: #B45309; }
.detail-section-icon.icon-red    { background: rgba(239,56,38,0.12);  color: #EF3826; }
[data-theme="dark"] .detail-section-icon.icon-blue   { background: rgba(45,127,249,0.22); color: #93C5FD; }
[data-theme="dark"] .detail-section-icon.icon-purple { background: rgba(124,58,237,0.22); color: #C4B5FD; }
[data-theme="dark"] .detail-section-icon.icon-green  { background: rgba(0,182,155,0.22);  color: #6EE7B7; }
[data-theme="dark"] .detail-section-icon.icon-yellow { background: rgba(245,158,11,0.22); color: #FCD34D; }
[data-theme="dark"] .detail-section-icon.icon-red    { background: rgba(239,56,38,0.22);  color: #FCA5A5; }

.detail-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.detail-section-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 12px;
  border-bottom: 1px dashed var(--border-light);
  font-size: 13px;
  min-height: 38px;
}
.detail-row:last-child { border-bottom: 0; }
.detail-key {
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
}
.detail-val {
  color: var(--text-primary);
  font-weight: 700;
  text-align: right;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 70%;
  word-break: break-word;
}
.detail-sub {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}
.detail-empty {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  padding: 20px 10px;
  background: var(--bg-hover);
  border-radius: 10px;
  font-style: italic;
}

.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger  { color: var(--danger) !important; }


/* ============================================
 * PHASE I: SEARCH BOX + NOTES BULK + SUB-FILTER DROPDOWN
 * ============================================ */

/* Sexy search box (Figma SS1 style) */
.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 280px;
  max-width: 360px;
  flex: 1;
}
.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-box input[type="text"],
.search-box input[type="search"] {
  width: 100%;
  height: 38px;
  padding: 0 16px 0 40px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: all 0.15s;
}
.search-box input::placeholder { color: var(--text-secondary); font-weight: 500; }
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.search-box.purple input:focus {
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

/* Notes bulk action bar (inside modal) */
.notes-bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--danger-bg, rgba(239,56,38,0.08));
  border-bottom: 1px solid var(--border-light);
  gap: 10px;
  animation: slideIn 0.2s ease-out;
}
.notes-bulk-bar.show { display: flex; }
.notes-bulk-bar .bulk-info {
  display: flex; align-items: center; gap: 8px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}
.notes-bulk-bar .bulk-actions {
  display: flex; gap: 6px;
}
.notes-bulk-bar .bulk-btn {
  padding: 6px 12px;
  font-size: 12px;
}

/* Note item with checkbox */
.note-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.note-item .note-check {
  margin-top: 4px;
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s;
}
.note-item .note-check:hover { border-color: var(--accent); }
.note-item .note-check:checked { background: var(--danger); border-color: var(--danger); }
.note-item .note-check:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 0;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.note-body-wrap { flex: 1; min-width: 0; }
.note-item .note-meta { margin-bottom: 4px; }

/* SUB-FILTER DROPDOWN (replaces ugly chip row) */
.sub-filter-dropdown {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.sub-filter-dropdown .sub-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}
.sub-filter-dropdown .selected-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.sub-filter-dropdown .sub-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-page);
  border: 1.5px dashed var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.sub-filter-dropdown .sub-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.sub-filter-dropdown .sub-trigger svg { width: 14px; height: 14px; }
.sub-filter-dropdown .sub-trigger.has-value {
  background: var(--accent);
  color: #fff;
  border-style: solid;
  border-color: var(--accent);
}
.sub-filter-dropdown .sub-trigger .badge-pill {
  background: rgba(255,255,255,0.25);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.sub-filter-dropdown .sub-trigger:not(.has-value) .badge-pill {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sub-filter-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  z-index: 50;
  display: none;
}
.sub-filter-popup.open { display: block; }
.sub-filter-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.sub-filter-popup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 14px;
}
.sub-filter-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-page);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.sub-filter-pill input[type="checkbox"] { display: none; }
.sub-filter-pill:hover { border-color: var(--accent); }
.sub-filter-pill.selected,
.sub-filter-pill:has(input:checked) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.sub-filter-pill .pill-count {
  background: rgba(0,0,0,0.08);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.sub-filter-pill.selected .pill-count,
.sub-filter-pill:has(input:checked) .pill-count {
  background: rgba(255,255,255,0.25);
}
.sub-filter-popup-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.sub-filter-popup-hint {
  font-size: 11px;
  color: var(--text-secondary);
}
.sub-filter-popup-actions { display: flex; gap: 8px; }

/* Selected summary chips (read-only outside popup) */
.sub-filter-chip-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

/* Override note-item old style for new flex+checkbox layout */
.note-item .note-delete { display: none !important; }  /* old delete button hidden */


/* ============================================
 * PHASE J: ALERTS + HEALTH SCORE + TIMELINE + BULK EDIT
 * ============================================ */

/* Expiry Alerts Banner */
.expiry-alert-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  animation: slideIn 0.3s ease-out;
  border-left: 4px solid;
}
.expiry-alert-banner.urgent {
  background: linear-gradient(90deg, rgba(239,56,38,0.08) 0%, rgba(239,56,38,0.02) 100%);
  border-left-color: var(--danger);
}
.expiry-alert-banner.warning {
  background: linear-gradient(90deg, rgba(255,167,86,0.10) 0%, rgba(255,167,86,0.03) 100%);
  border-left-color: var(--warning);
}
[data-theme="dark"] .expiry-alert-banner.urgent {
  background: linear-gradient(90deg, rgba(239,56,38,0.18) 0%, rgba(239,56,38,0.06) 100%);
}
[data-theme="dark"] .expiry-alert-banner.warning {
  background: linear-gradient(90deg, rgba(255,167,86,0.20) 0%, rgba(255,167,86,0.06) 100%);
}

.expiry-alert-banner .alert-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.expiry-alert-banner.urgent .alert-icon {
  background: rgba(239,56,38,0.15);
  color: var(--danger);
}
.expiry-alert-banner.warning .alert-icon {
  background: rgba(255,167,86,0.20);
  color: var(--warning);
}
.expiry-alert-banner .alert-content { flex: 1; min-width: 0; }
.expiry-alert-banner .alert-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.expiry-alert-banner .alert-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.alert-chip.critical {
  background: var(--danger);
  color: #fff;
  animation: pulse 2s infinite;
}
.alert-chip.urgent {
  background: rgba(239,56,38,0.15);
  color: var(--danger);
}
.alert-chip.warning {
  background: rgba(255,167,86,0.20);
  color: #C2410C;
}
[data-theme="dark"] .alert-chip.urgent { color: #FCA5A5; }
[data-theme="dark"] .alert-chip.warning { color: #FCD34D; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.alert-dismiss {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.alert-dismiss:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Health Score */
.health-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 70px;
}
.health-bar {
  width: 50px;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.health-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.health-score-num {
  font-size: 13px;
  font-weight: 800;
  min-width: 22px;
}

/* Health colors - text only (for numbers and labels) */
.health-excellent { color: #00B69B !important; }
.health-good      { color: #2D7FF9 !important; }
.health-fair      { color: #F59E0B !important; }
.health-poor      { color: #FF8A56 !important; }
.health-critical  { color: #EF3826 !important; }

/* Health bar fill - background colors */
.health-bar-fill.health-excellent { background: #00B69B; }
.health-bar-fill.health-good      { background: #2D7FF9; }
.health-bar-fill.health-fair      { background: #F59E0B; }
.health-bar-fill.health-poor      { background: #FF8A56; }
.health-bar-fill.health-critical  { background: #EF3826; }

.stat-value.health-excellent { color: #00B69B; }
.stat-value.health-good      { color: #2D7FF9; }
.stat-value.health-fair      { color: #F59E0B; }
.stat-value.health-poor      { color: #FF8A56; }
.stat-value.health-critical  { color: #EF3826; }

/* Activity Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-light);
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-icon {
  position: absolute;
  left: -28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--border-light);
  flex-shrink: 0;
}
.timeline-icon.icon-blue   { background: rgba(45,127,249,0.18);  color: #2D7FF9; }
.timeline-icon.icon-green  { background: rgba(0,182,155,0.18);   color: #00B69B; }
.timeline-icon.icon-purple { background: rgba(124,58,237,0.18);  color: #7C3AED; }
.timeline-icon.icon-yellow { background: rgba(245,158,11,0.18);  color: #B45309; }
.timeline-icon.icon-red    { background: rgba(239,56,38,0.18);   color: #EF3826; }

.timeline-body {
  flex: 1;
  padding-left: 16px;
}
.timeline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.timeline-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #7C3AED 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.timeline-user {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.timeline-action-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.action-tag-create  { background: rgba(0,182,155,0.15);  color: #00B69B; }
.action-tag-update  { background: rgba(45,127,249,0.15); color: #2D7FF9; }
.action-tag-delete  { background: rgba(239,56,38,0.15);  color: #EF3826; }
.action-tag-bulk    { background: rgba(124,58,237,0.15); color: #7C3AED; }
.action-tag-default { background: var(--bg-hover);       color: var(--text-secondary); }
[data-theme="dark"] .action-tag-create  { background: rgba(0,182,155,0.25);  color: #6EE7B7; }
[data-theme="dark"] .action-tag-update  { background: rgba(45,127,249,0.25); color: #93C5FD; }
[data-theme="dark"] .action-tag-delete  { background: rgba(239,56,38,0.25);  color: #FCA5A5; }
[data-theme="dark"] .action-tag-bulk    { background: rgba(124,58,237,0.25); color: #C4B5FD; }

.timeline-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: auto;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.timeline-exact-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
  opacity: 0.7;
}
.timeline-desc {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
  margin-top: 2px;
  padding: 8px 12px;
  background: var(--bg-hover);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}


/* ============================================
 * PHASE K: REVENUE + ROI + TRAFFIC CHART
 * ============================================ */
.revenue-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.rev-summary-card {
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 18px;
}
.rev-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.rev-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.rev-value.rev-success { color: #00B69B; }
.rev-value.rev-danger  { color: #EF3826; }
.rev-foot {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 600;
}

/* Chart Section */
.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 18px 20px;
}
.chart-head { margin-bottom: 14px; }
.chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.chart-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.traffic-chart {
  width: 100%;
  position: relative;
}
.traffic-chart canvas {
  width: 100% !important;
  height: 260px !important;
  display: block;
}
.text-success { color: #00B69B !important; }

/* ============================================
 * PHASE L: COMPARE + CSV IMPORT
 * ============================================ */

/* CSV Import */
.csv-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: var(--bg-hover);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}
.csv-upload-zone:hover, .csv-upload-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.csv-upload-zone.has-file {
  border-color: #00B69B;
  border-style: solid;
  background: rgba(0,182,155,0.08);
  color: #00B69B;
}
.csv-upload-zone .zone-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 8px;
}
.csv-upload-zone .zone-sub {
  font-size: 12px;
  color: var(--text-secondary);
}
.csv-upload-zone.has-file .zone-title { color: #00B69B; }

/* Import result block */
.import-result {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.import-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.import-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.import-stat {
  padding: 12px 16px;
  background: var(--bg-hover);
  border-radius: 10px;
  text-align: center;
}
.import-stat .stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}
.import-stat .stat-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.import-stat.success .stat-num { color: #00B69B; }
.import-stat.info .stat-num    { color: #2D7FF9; }
.import-stat.warning .stat-num { color: #F59E0B; }
.import-stat.danger .stat-num  { color: #EF3826; }

/* CSV docs table */
.csv-doc-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}
.csv-doc-table thead th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-light);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.4px;
}
.csv-doc-table tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}
.csv-doc-table tbody tr:last-child td { border-bottom: 0; }


/* ============================================
 * PHASE L v2: PROFESSIONAL COMPARE PAGE
 * ============================================ */

/* Topbar */
.compare-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* HERO GRID - 2 cards side by side */
.compare-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.compare-hero-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.compare-hero-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #7C3AED 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}
.compare-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.compare-hero-favicon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, #6366F1 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.compare-hero-info {
  flex: 1;
  min-width: 0;
}
.compare-hero-domain {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 8px;
  line-height: 1.2;
  word-break: break-word;
}
.compare-hero-domain:hover { color: var(--accent); }
.compare-hero-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.compare-hero-badges .tag { font-size: 11px; padding: 3px 8px; }
.compare-hero-badges .geo-flag { padding: 2px 8px; font-size: 11px; }

.compare-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-light);
}
.hero-stat {
  display: flex;
  align-items: center;
  gap: 9px;
}
.hero-stat-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero-stat-body { min-width: 0; flex: 1; }
.hero-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.hero-stat-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-stat-value.text-success { color: #00B69B; }
.hero-stat-value.text-danger  { color: #EF3826; }

/* Health Score Ring */
.compare-health-ring {
  position: absolute;
  bottom: 18px;
  right: 18px;
  width: 56px;
  height: 56px;
}
.compare-health-ring svg {
  transform: rotate(-90deg);
  position: absolute;
  top: 0; left: 0;
}
.compare-health-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.compare-health-num {
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}
.compare-health-lbl {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* KEY METRICS SUMMARY */
.compare-summary-section {
  margin-bottom: 24px;
}
.compare-section-heading {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 12px;
}
.compare-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.key-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.key-metric-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.key-metric-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.key-metric-side {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  background: var(--bg-hover);
  transition: all 0.2s;
}
.key-metric-side.winning {
  background: rgba(0,182,155,0.10);
}
[data-theme="dark"] .key-metric-side.winning {
  background: rgba(0,182,155,0.20);
}
.key-metric-tag-a, .key-metric-tag-b {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  margin-bottom: 5px;
  letter-spacing: 0.4px;
}
.key-metric-tag-a {
  background: rgba(72,128,255,0.15);
  color: var(--accent);
}
.key-metric-tag-b {
  background: rgba(124,58,237,0.15);
  color: #7C3AED;
}
[data-theme="dark"] .key-metric-tag-a { background: rgba(72,128,255,0.30); color: #93C5FD; }
[data-theme="dark"] .key-metric-tag-b { background: rgba(124,58,237,0.30); color: #C4B5FD; }

.key-metric-side.winning .key-metric-value { color: #00B69B; }
.key-metric-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}
.key-metric-vs {
  flex-shrink: 0;
  width: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.key-metric-diff {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.key-metric-diff.diff-up    { background: rgba(0,182,155,0.15); color: #00B69B; }
.key-metric-diff.diff-down  { background: rgba(239,56,38,0.15); color: #EF3826; }
.key-metric-diff.diff-equal { background: var(--bg-hover); color: var(--text-secondary); padding: 5px 14px; }
[data-theme="dark"] .key-metric-diff.diff-up   { background: rgba(0,182,155,0.25); color: #6EE7B7; }
[data-theme="dark"] .key-metric-diff.diff-down { background: rgba(239,56,38,0.25); color: #FCA5A5; }

/* DETAIL CARD - Tabbed comparison */
.compare-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.compare-detail-tabs {
  display: flex;
  gap: 0;
  padding: 0 8px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-hover);
  overflow-x: auto;
}
.compare-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 14px 18px;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.compare-tab:hover { color: var(--text-primary); }
.compare-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-card);
}
.compare-tab-panel {
  display: none;
  padding: 6px 0;
}
.compare-tab-panel.active { display: block; }

/* Comparison rows */
.compare-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
}
.compare-row:last-child { border-bottom: 0; }
.compare-row.simple { grid-template-columns: 240px 1fr; }
.compare-row-label { min-width: 0; }
.compare-row-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.compare-row-hint {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Bar visualization (SEO tab) */
.compare-row-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compare-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.compare-tag-a, .compare-tag-b {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.compare-tag-a {
  background: rgba(72,128,255,0.15);
  color: var(--accent);
}
.compare-tag-b {
  background: rgba(124,58,237,0.15);
  color: #7C3AED;
}
[data-theme="dark"] .compare-tag-a { background: rgba(72,128,255,0.30); color: #93C5FD; }
[data-theme="dark"] .compare-tag-b { background: rgba(124,58,237,0.30); color: #C4B5FD; }
.compare-bar-track {
  flex: 1;
  height: 10px;
  background: var(--bg-hover);
  border-radius: 999px;
  overflow: hidden;
}
.compare-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #7C3AED 100%);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.compare-bar-fill.winner {
  background: linear-gradient(90deg, #00B69B 0%, #00D9B8 100%);
}
.compare-bar-val {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 75px;
  text-align: right;
}
.compare-bar-val.winner { color: #00B69B; }

/* Value boxes (Financials, Infra, Dates) */
.compare-row-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.compare-val-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-hover);
  position: relative;
  transition: all 0.2s;
}
.compare-val-box.winner {
  background: rgba(0,182,155,0.10);
  border: 1px solid rgba(0,182,155,0.25);
}
[data-theme="dark"] .compare-val-box.winner {
  background: rgba(0,182,155,0.18);
  border-color: rgba(0,182,155,0.35);
}
.compare-val-box.winner::after {
  content: '🏆';
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font-size: 13px;
}
.compare-val-box.infra.shared {
  background: rgba(245,158,11,0.10);
  border: 1px dashed rgba(245,158,11,0.30);
}
[data-theme="dark"] .compare-val-box.infra.shared {
  background: rgba(245,158,11,0.18);
}
.compare-val-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  flex: 1;
}
.compare-val-box.winner .compare-val-num:not(.text-danger):not(.text-success) {
  color: #00B69B;
}
.compare-val-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.compare-val-main {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}
.compare-val-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  word-break: break-word;
}

/* Verdict panel */
.compare-verdict {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(0,182,155,0.10) 0%, rgba(45,127,249,0.06) 100%);
  border: 1px solid rgba(0,182,155,0.20);
  border-radius: 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.compare-verdict.tied {
  background: linear-gradient(135deg, rgba(124,58,237,0.10) 0%, rgba(245,158,11,0.06) 100%);
  border-color: rgba(124,58,237,0.20);
}
[data-theme="dark"] .compare-verdict {
  background: linear-gradient(135deg, rgba(0,182,155,0.18) 0%, rgba(45,127,249,0.12) 100%);
}
.verdict-icon {
  font-size: 36px;
  flex-shrink: 0;
}
.verdict-body { flex: 1; }
.verdict-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.verdict-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 900px) {
  .compare-hero-grid { grid-template-columns: 1fr; }
  .compare-row { grid-template-columns: 1fr; gap: 12px; }
  .compare-row-values { grid-template-columns: 1fr 1fr; }
}


/* ============================================
 * PHASE M: SEO TOOLBOX (Keywords/Content/Competitors)
 * ============================================ */
.seo-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 14px 18px;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.seo-tab:hover { color: var(--text-primary); }
.seo-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-card);
}
.seo-tab-count {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-hover);
  font-size: 10px;
  font-weight: 800;
  color: var(--text-secondary);
}
.seo-tab.active .seo-tab-count {
  background: var(--accent-light);
  color: var(--accent);
}
.seo-panel {
  display: none;
  padding: 18px 22px;
}
.seo-panel.active { display: block; }
.seo-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Soft tag variants */
.tag.tag-soft {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}
.tag-info-soft    { background: rgba(45,127,249,0.12);  color: #2D7FF9; }
.tag-success-soft { background: rgba(0,182,155,0.12);   color: #00B69B; }
.tag-warning-soft { background: rgba(245,158,11,0.15);  color: #B45309; }
.tag-danger-soft  { background: rgba(239,56,38,0.12);   color: #EF3826; }
[data-theme="dark"] .tag-info-soft    { background: rgba(45,127,249,0.22); color: #93C5FD; }
[data-theme="dark"] .tag-success-soft { background: rgba(0,182,155,0.22);  color: #6EE7B7; }
[data-theme="dark"] .tag-warning-soft { background: rgba(245,158,11,0.25); color: #FCD34D; }
[data-theme="dark"] .tag-danger-soft  { background: rgba(239,56,38,0.22);  color: #FCA5A5; }

/* Rank badges */
.rank-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
}
.rank-top  { background: rgba(0,182,155,0.18); color: #00B69B; }   /* 1-3 */
.rank-good { background: rgba(45,127,249,0.18); color: #2D7FF9; }  /* 4-10 */
.rank-fair { background: rgba(245,158,11,0.18); color: #B45309; }  /* 11-30 */
.rank-poor { background: rgba(255,138,86,0.18); color: #C2410C; }  /* 31-50 */
.rank-bad  { background: rgba(239,56,38,0.18); color: #EF3826; }   /* 51+ */
.rank-none { background: var(--bg-hover); color: var(--text-secondary); }
[data-theme="dark"] .rank-top  { color: #6EE7B7; }
[data-theme="dark"] .rank-good { color: #93C5FD; }
[data-theme="dark"] .rank-fair { color: #FCD34D; }
[data-theme="dark"] .rank-poor { color: #FED7AA; }
[data-theme="dark"] .rank-bad  { color: #FCA5A5; }

.rank-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}
.rank-change.up      { background: rgba(0,182,155,0.15);  color: #00B69B; }
.rank-change.down    { background: rgba(239,56,38,0.15);  color: #EF3826; }
.rank-change.neutral { background: var(--bg-hover);       color: var(--text-secondary); }
[data-theme="dark"] .rank-change.up   { background: rgba(0,182,155,0.25); color: #6EE7B7; }
[data-theme="dark"] .rank-change.down { background: rgba(239,56,38,0.25); color: #FCA5A5; }


/* ============================================
 * PHASE N: DASHBOARD PRO REDESIGN
 * ============================================ */

/* 6 Stat Cards Grid */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.dash-stat-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}
a.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.dash-stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-stat-body { flex: 1; min-width: 0; }
.dash-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.dash-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 6px;
}
.dash-stat-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}
.trend-pill.up   { background: rgba(0,182,155,0.15); color: #00B69B; }
.trend-pill.down { background: rgba(239,56,38,0.15); color: #EF3826; }
[data-theme="dark"] .trend-pill.up   { background: rgba(0,182,155,0.25); color: #6EE7B7; }
[data-theme="dark"] .trend-pill.down { background: rgba(239,56,38,0.25); color: #FCA5A5; }

.dash-health-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}
.dash-health-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Charts Grid */
.dash-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.dash-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.dash-chart-card.wide { grid-column: 1; }
.dash-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dash-chart-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}
.dash-chart-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}
.dash-chart-legend {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dash-chart-wrap {
  width: 100%;
  position: relative;
}
.dash-chart-wrap canvas {
  width: 100% !important;
  height: 260px !important;
  display: block;
}
.dash-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}
.dash-chart-empty small {
  font-size: 11px;
  opacity: 0.7;
}

/* Donut Chart */
.dash-donut-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.dash-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-light);
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-row .legend-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.legend-row .legend-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Bars list (Top Brands) */
.dash-bars-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-bar-label {
  flex-shrink: 0;
  width: 90px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-bar-track {
  flex: 1;
  height: 10px;
  background: var(--bg-hover);
  border-radius: 999px;
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #7C3AED 100%);
  transition: width 0.5s ease;
}
.dash-bar-count {
  flex-shrink: 0;
  width: 30px;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

/* GEO Grid */
.dash-geo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.dash-geo-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-hover);
  border-radius: 10px;
}
.dash-geo-flag {
  font-size: 22px;
  flex-shrink: 0;
}
.dash-geo-info { flex: 1; min-width: 0; }
.dash-geo-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.dash-geo-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.dash-geo-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.dash-geo-count {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}

/* Top Performers List */
.top-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.top-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-hover);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.top-list-item:hover {
  background: var(--bg-card);
  transform: translateX(2px);
}
.top-rank {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.top-rank.money {
  background: linear-gradient(135deg, #00B69B, #00D9B8);
}
.top-favicon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #6366F1);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.top-info { flex: 1; min-width: 0; }
.top-domain {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.top-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.top-stat {
  flex-shrink: 0;
  text-align: right;
  min-width: 90px;
}
.top-stat-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}
.top-stat-val.text-success { color: #00B69B; }
.top-stat-lbl {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 2px;
}
.top-bar {
  margin-top: 4px;
  height: 3px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.top-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.top-bar-fill.money { background: #00B69B; }
.dash-view-all {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.dash-view-all:hover { text-decoration: underline; }

/* Quick Actions */
.dash-quick-actions {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.quick-actions-head { margin-bottom: 14px; }
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.quick-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
  position: relative;
}
.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.quick-action-card.blue   { background: linear-gradient(135deg, rgba(72,128,255,0.10), rgba(72,128,255,0.04)); border: 1px solid rgba(72,128,255,0.20); }
.quick-action-card.purple { background: linear-gradient(135deg, rgba(124,58,237,0.10), rgba(124,58,237,0.04)); border: 1px solid rgba(124,58,237,0.20); }
.quick-action-card.teal   { background: linear-gradient(135deg, rgba(0,182,155,0.10), rgba(0,182,155,0.04));   border: 1px solid rgba(0,182,155,0.20); }
.quick-action-card.red    { background: linear-gradient(135deg, rgba(239,56,38,0.10), rgba(239,56,38,0.04));   border: 1px solid rgba(239,56,38,0.20); }
.quick-action-card.amber  { background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(245,158,11,0.04)); border: 1px solid rgba(245,158,11,0.20); }
.quick-action-card.gray   { background: linear-gradient(135deg, rgba(107,114,128,0.08), rgba(107,114,128,0.03)); border: 1px solid rgba(107,114,128,0.20); }
[data-theme="dark"] .quick-action-card.blue   { background: linear-gradient(135deg, rgba(72,128,255,0.20), rgba(72,128,255,0.08)); }
[data-theme="dark"] .quick-action-card.purple { background: linear-gradient(135deg, rgba(124,58,237,0.20), rgba(124,58,237,0.08)); }
[data-theme="dark"] .quick-action-card.teal   { background: linear-gradient(135deg, rgba(0,182,155,0.20), rgba(0,182,155,0.08)); }
[data-theme="dark"] .quick-action-card.red    { background: linear-gradient(135deg, rgba(239,56,38,0.20), rgba(239,56,38,0.08)); }
[data-theme="dark"] .quick-action-card.amber  { background: linear-gradient(135deg, rgba(245,158,11,0.20), rgba(245,158,11,0.08)); }
[data-theme="dark"] .quick-action-card.gray   { background: linear-gradient(135deg, rgba(156,163,175,0.15), rgba(156,163,175,0.05)); }

.quick-action-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.7);
  color: var(--text-primary);
}
.quick-action-card.blue   .quick-action-icon { color: #4880FF; }
.quick-action-card.purple .quick-action-icon { color: #7C3AED; }
.quick-action-card.teal   .quick-action-icon { color: #00B69B; }
.quick-action-card.red    .quick-action-icon { color: #EF3826; }
.quick-action-card.amber  .quick-action-icon { color: #B45309; }
.quick-action-card.gray   .quick-action-icon { color: #4B5563; }
[data-theme="dark"] .quick-action-icon { background: rgba(255,255,255,0.10); }
[data-theme="dark"] .quick-action-card.blue   .quick-action-icon { color: #93C5FD; }
[data-theme="dark"] .quick-action-card.purple .quick-action-icon { color: #C4B5FD; }
[data-theme="dark"] .quick-action-card.teal   .quick-action-icon { color: #6EE7B7; }
[data-theme="dark"] .quick-action-card.red    .quick-action-icon { color: #FCA5A5; }
[data-theme="dark"] .quick-action-card.amber  .quick-action-icon { color: #FCD34D; }
[data-theme="dark"] .quick-action-card.gray   .quick-action-icon { color: #D1D5DB; }

.quick-action-body { flex: 1; min-width: 0; }
.quick-action-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.quick-action-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}
.quick-action-arrow {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--text-secondary);
  opacity: 0.5;
  transition: all 0.15s;
}
.quick-action-card:hover .quick-action-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* Activity List on Dashboard */
.dash-activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.dash-activity-row:last-child { border-bottom: 0; }
.dash-activity-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-activity-body { flex: 1; min-width: 0; }
.dash-activity-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}
.dash-activity-target {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
}
.dash-activity-target:hover { text-decoration: underline; }
.dash-activity-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.5;
}
.dash-activity-time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .dash-charts-grid { grid-template-columns: 1fr; }
}




/* ============================================
 * PHASE O v3: FOOTPRINT - CLEAN DATA TABLE
 * Notion/Linear/Airtable inspired
 * ============================================ */

/* Stat cards - minimal */
.fp2-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.fp2-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px 18px;
}
.fp2-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.fp2-stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.fp2-stat-value.danger  { color: #DC2626; }
.fp2-stat-value.warning { color: #B45309; }

/* Main card */
.fp2-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}

/* Toolbar */
.fp2-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
  flex-wrap: wrap;
}
.fp2-toolbar-left {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fp2-toolbar-right {
  display: flex;
  gap: 8px;
}
.fp2-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}
.fp2-filter:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.fp2-filter.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-card);
}
.fp2-filter span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  height: 16px;
  min-width: 16px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.fp2-filter.active span {
  background: rgba(255,255,255,0.20);
  color: rgba(255,255,255,0.95);
}

/* Search */
.fp2-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  min-width: 240px;
  transition: all 0.12s;
}
.fp2-search:focus-within {
  border-color: var(--accent);
  background: var(--bg-card);
}
.fp2-search svg { color: var(--text-secondary); flex-shrink: 0; }
.fp2-search input {
  border: 0;
  background: transparent;
  outline: 0;
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  padding: 0;
}
.fp2-search input::placeholder { color: var(--text-secondary); }

/* Table */
.fp2-table-wrap {
  overflow-x: auto;
}
.fp2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fp2-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-hover);
  white-space: nowrap;
  user-select: none;
}
.fp2-table thead th.sortable {
  cursor: pointer;
}
.fp2-table thead th.sortable:hover {
  color: var(--text-primary);
}
.fp2-table thead th .sort-arrows {
  opacity: 0.4;
  margin-left: 4px;
  font-size: 10px;
}
.fp2-table thead th.sort-asc .sort-arrows::before { content: '↑'; opacity: 1; }
.fp2-table thead th.sort-asc .sort-arrows { font-size: 12px; }
.fp2-table thead th.sort-desc .sort-arrows::before { content: '↓'; opacity: 1; }
.fp2-table thead th.sort-desc .sort-arrows { font-size: 12px; }
.fp2-table thead th.sort-asc .sort-arrows,
.fp2-table thead th.sort-desc .sort-arrows {
  color: var(--accent);
}
.fp2-table thead th.sort-asc .sort-arrows::after,
.fp2-table thead th.sort-desc .sort-arrows::after { content: ''; }

.fp2-table tbody tr.fp2-row {
  cursor: pointer;
  transition: background 0.1s;
}
.fp2-table tbody tr.fp2-row:hover {
  background: var(--bg-hover);
}
.fp2-table tbody tr.fp2-row.expanded {
  background: var(--bg-hover);
}
.fp2-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-primary);
}
.fp2-table tbody tr:last-child td { border-bottom: 0; }

/* Expand cell */
.fp2-expand-cell {
  width: 30px;
  padding: 0 0 0 10px !important;
}
.fp2-expand-btn {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.fp2-expand-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.fp2-expand-btn svg {
  transition: transform 0.2s;
}
.fp2-row.expanded .fp2-expand-btn svg {
  transform: rotate(180deg);
}

/* Type cell */
.fp2-type-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}
.fp2-type-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fp2-type-icon.t-server_ip   { background: #FEE4E2; color: #B91C1C; }
.fp2-type-icon.t-cloudflare  { background: #FEF3C7; color: #B45309; }
.fp2-type-icon.t-ga_property { background: #EDE9FE; color: #6D28D9; }
.fp2-type-icon.t-whois_email { background: #DBEAFE; color: #1D4ED8; }
.fp2-type-icon.t-gsc_gmail   { background: #CCFBF1; color: #0F766E; }
[data-theme="dark"] .fp2-type-icon.t-server_ip   { background: rgba(239,56,38,0.20); color: #FCA5A5; }
[data-theme="dark"] .fp2-type-icon.t-cloudflare  { background: rgba(245,158,11,0.20); color: #FCD34D; }
[data-theme="dark"] .fp2-type-icon.t-ga_property { background: rgba(124,58,237,0.22); color: #C4B5FD; }
[data-theme="dark"] .fp2-type-icon.t-whois_email { background: rgba(45,127,249,0.22); color: #93C5FD; }
[data-theme="dark"] .fp2-type-icon.t-gsc_gmail   { background: rgba(0,182,155,0.20); color: #6EE7B7; }

/* Resource cell - monospace */
.fp2-resource-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp2-resource-cell code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--text-primary);
  background: transparent;
  padding: 0;
}

/* Sites count cell */
.fp2-sites-cell {
  text-align: center;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}

/* Risk pill - clean Linear style */
.fp2-risk-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.fp2-risk-pill.r-critical { background: #FEE4E2; color: #B91C1C; }
.fp2-risk-pill.r-warning  { background: #FEF3C7; color: #B45309; }
.fp2-risk-pill.r-low      { background: #D1FAE5; color: #047857; }
[data-theme="dark"] .fp2-risk-pill.r-critical { background: rgba(239,56,38,0.22); color: #FCA5A5; }
[data-theme="dark"] .fp2-risk-pill.r-warning  { background: rgba(245,158,11,0.22); color: #FCD34D; }
[data-theme="dark"] .fp2-risk-pill.r-low      { background: rgba(0,182,155,0.22); color: #6EE7B7; }

/* Suggestion - muted */
.fp2-suggestion-cell {
  color: var(--text-secondary);
  font-size: 12px;
}

/* Detail row */
.fp2-detail-row {
  background: var(--bg-hover);
}
.fp2-detail-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border-light) !important;
}
.fp2-detail-content {
  padding: 16px 24px 20px 50px;
}
.fp2-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.fp2-detail-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fp2-site-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.fp2-site-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.fp2-site-link:hover svg { color: var(--accent); }
.fp2-site-link svg {
  color: var(--text-secondary);
  margin-left: 2px;
}
.fp2-site-letter {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Empty state */
.fp2-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}
.fp2-empty svg {
  color: #00B69B;
  margin-bottom: 14px;
}
.fp2-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.fp2-empty-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.fp2-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 13px;
  gap: 10px;
}

/* Responsive */
@media (max-width: 900px) {
  .fp2-stats { grid-template-columns: repeat(2, 1fr); }
  .fp2-resource-cell { max-width: 180px; }
  .fp2-suggestion-cell { display: none; }
  .fp2-table thead th:last-child { display: none; }
  .fp2-table tbody td:last-child { display: none; }
}
@media (max-width: 600px) {
  .fp2-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .fp2-stat { padding: 12px 14px; }
  .fp2-stat-value { font-size: 22px; }
  .fp2-toolbar { padding: 12px; }
  .fp2-search { min-width: 0; flex: 1; }
}


/* ============================================
 * PHASE O v4: BOARD VIEW + BIGGER LIST
 * ============================================ */

/* View toggle */
.fp2-view-toggle {
  display: inline-flex;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.fp2-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.fp2-view-btn:hover { color: var(--text-primary); }
.fp2-view-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.fp2-toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border-light);
  margin: 0 4px;
}

/* View panels */
.fp2-view-panel { display: none; }
.fp2-view-panel.active { display: block; }

/* LIST VIEW - bigger spacing */
.fp2-table thead th {
  padding: 14px 18px !important;
  font-size: 12px !important;
}
.fp2-table tbody td {
  padding: 16px 18px !important;
  font-size: 14px;
}
.fp2-type-cell {
  font-size: 14px !important;
  font-weight: 600;
}
.fp2-type-icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
}
.fp2-resource-cell code {
  font-size: 13px !important;
}
.fp2-sites-cell {
  font-size: 17px !important;
}
.fp2-risk-pill {
  font-size: 12px !important;
  padding: 4px 11px !important;
}
.fp2-suggestion-cell {
  font-size: 13px !important;
}
.fp2-expand-cell {
  width: 36px !important;
  padding-left: 12px !important;
}
.fp2-expand-btn {
  width: 26px !important;
  height: 26px !important;
}
.fp2-expand-btn svg {
  width: 14px !important;
  height: 14px !important;
}
.fp2-detail-content {
  padding: 18px 26px 22px 56px !important;
}

/* BOARD VIEW */
.fp2-board-panel {
  padding: 20px;
}
.fp2-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}
.fp2-board-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.15s;
}
.fp2-board-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.fp2-board-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.fp2-board-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fp2-board-icon.t-server_ip   { background: #FEE4E2; color: #B91C1C; }
.fp2-board-icon.t-cloudflare  { background: #FEF3C7; color: #B45309; }
.fp2-board-icon.t-ga_property { background: #EDE9FE; color: #6D28D9; }
.fp2-board-icon.t-whois_email { background: #DBEAFE; color: #1D4ED8; }
.fp2-board-icon.t-gsc_gmail   { background: #CCFBF1; color: #0F766E; }
[data-theme="dark"] .fp2-board-icon.t-server_ip   { background: rgba(239,56,38,0.20); color: #FCA5A5; }
[data-theme="dark"] .fp2-board-icon.t-cloudflare  { background: rgba(245,158,11,0.20); color: #FCD34D; }
[data-theme="dark"] .fp2-board-icon.t-ga_property { background: rgba(124,58,237,0.22); color: #C4B5FD; }
[data-theme="dark"] .fp2-board-icon.t-whois_email { background: rgba(45,127,249,0.22); color: #93C5FD; }
[data-theme="dark"] .fp2-board-icon.t-gsc_gmail   { background: rgba(0,182,155,0.20); color: #6EE7B7; }

.fp2-board-info {
  flex: 1;
  min-width: 0;
}
.fp2-board-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.fp2-board-resource {
  overflow: hidden;
}
.fp2-board-resource code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.fp2-board-body {
  padding: 16px 20px;
  flex: 1;
}
.fp2-board-count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.fp2-board-count-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.fp2-board-count-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.fp2-board-sites {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fp2-board-site-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  background: var(--bg-hover);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.12s;
}
.fp2-board-site-row:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.fp2-board-site-row:hover svg { color: var(--accent); }
.fp2-board-site-row svg {
  color: var(--text-tertiary, #9CA3AF);
  margin-left: auto;
  flex-shrink: 0;
}
.fp2-board-site-letter {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fp2-board-site-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.fp2-board-hidden {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 5px;
  margin-bottom: 5px;
}

.fp2-board-toggle-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: transparent;
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
  transition: all 0.15s;
}
.fp2-board-toggle-more:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.fp2-board-toggle-more svg {
  transition: transform 0.2s;
}

.fp2-board-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 500;
}
.fp2-board-footer svg { flex-shrink: 0; }
.fp2-board-footer.s-critical {
  background: #FEE4E2;
  color: #B91C1C;
}
.fp2-board-footer.s-warning {
  background: #FEF3C7;
  color: #B45309;
}
.fp2-board-footer.s-low {
  background: #D1FAE5;
  color: #047857;
}
[data-theme="dark"] .fp2-board-footer.s-critical { background: rgba(239,56,38,0.18); color: #FCA5A5; }
[data-theme="dark"] .fp2-board-footer.s-warning  { background: rgba(245,158,11,0.18); color: #FCD34D; }
[data-theme="dark"] .fp2-board-footer.s-low      { background: rgba(0,182,155,0.18); color: #6EE7B7; }

@media (max-width: 900px) {
  .fp2-board-grid { grid-template-columns: 1fr; }
}


/* ============================================
 * PHASE P: NOTIFICATIONS DROPDOWN
 * ============================================ */

.notif-wrap {
  position: relative;
}

/* Badge - red dot with count */
.topbar-icon-btn .badge-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #EF3826;
  color: #fff;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
  line-height: 1;
}

/* Dropdown panel */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 20px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.18s ease;
  overflow: hidden;
}
.notif-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Header */
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}
.notif-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.notif-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}
.notif-mark-all {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.notif-mark-all:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Tabs */
.notif-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-hover);
}
.notif-tab {
  flex: 1;
  padding: 6px 12px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}
.notif-tab:hover { color: var(--text-primary); }
.notif-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* List */
.notif-list {
  max-height: 440px;
  overflow-y: auto;
}
.notif-loading, .notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}
.notif-loading svg {
  animation: notif-spin 1s linear infinite;
}
@keyframes notif-spin {
  to { transform: rotate(360deg); }
}
.notif-empty svg {
  color: #00B69B;
  margin-bottom: 6px;
}
.notif-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.notif-empty-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Notification item */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.12s;
  position: relative;
}
.notif-item:hover {
  background: var(--bg-hover);
}
.notif-item:last-child {
  border-bottom: 0;
}
.notif-item.unread {
  background: rgba(72,128,255,0.04);
}
.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
[data-theme="dark"] .notif-item.unread {
  background: rgba(72,128,255,0.12);
}

.notif-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-icon.sev-info    { background: #DBEAFE; color: #1D4ED8; }
.notif-icon.sev-success { background: #D1FAE5; color: #047857; }
.notif-icon.sev-warning { background: #FEF3C7; color: #B45309; }
.notif-icon.sev-danger  { background: #FEE4E2; color: #B91C1C; }
[data-theme="dark"] .notif-icon.sev-info    { background: rgba(45,127,249,0.22); color: #93C5FD; }
[data-theme="dark"] .notif-icon.sev-success { background: rgba(0,182,155,0.22); color: #6EE7B7; }
[data-theme="dark"] .notif-icon.sev-warning { background: rgba(245,158,11,0.22); color: #FCD34D; }
[data-theme="dark"] .notif-icon.sev-danger  { background: rgba(239,56,38,0.22); color: #FCA5A5; }

.notif-body {
  flex: 1;
  min-width: 0;
}
.notif-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.35;
}
.notif-time {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}
.notif-msg {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-del {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: all 0.15s;
}
.notif-item:hover .notif-del { opacity: 0.7; }
.notif-del:hover { opacity: 1 !important; background: var(--bg-hover); color: #EF3826; }

/* Footer */
.notif-footer {
  display: flex;
  justify-content: center;
  padding: 8px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-hover);
}
.notif-clear-btn {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}
.notif-clear-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .notif-dropdown {
    width: calc(100vw - 20px);
    right: -10px;
  }
}


/* ============================================
 * PHASE Q: REPORTS MODULE
 * ============================================ */

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: all 0.15s;
}
.report-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.report-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .report-card-icon { opacity: 0.85; }

.report-card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}
.report-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 14px 0;
}

.report-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.report-features li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}
.report-features li svg {
  color: #00B69B;
  flex-shrink: 0;
}

.report-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.report-card-actions .btn {
  flex: 1;
}

.report-select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}
.report-select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
}

.report-help {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(72,128,255,0.06);
  border: 1px solid rgba(72,128,255,0.20);
  border-radius: 12px;
}
[data-theme="dark"] .report-help {
  background: rgba(72,128,255,0.12);
}
.report-help-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(72,128,255,0.15);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.report-help kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 2px;
}


/* ============================================
 * PHASE R: BACKUP + USERS + GOALS
 * ============================================ */

/* Backup rows */
.backup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.12s;
}
.backup-row:hover { background: var(--bg-hover); }
.backup-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #FEF3C7;
  color: #B45309;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .backup-row-icon { background: rgba(245,158,11,0.20); color: #FCD34D; }
.backup-row-info { flex: 1; min-width: 0; }
.backup-row-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: ui-monospace, monospace;
}
.backup-row-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.backup-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* User avatar */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* btn-icon */
.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-icon:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-icon.danger:hover {
  background: rgba(239,56,38,0.10);
  border-color: #EF3826;
  color: #EF3826;
}

/* Form fields */
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}
.form-input {
  padding: 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s;
  width: 100%;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(72,128,255,0.15);
}

/* Goal progress bar */
.goal-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-hover);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.goal-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Goals section on site detail (added to site detail page later) */
.goals-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 20px;
}
.goals-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}
.goals-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}
.goals-card:last-child { border-bottom: 0; }
.goals-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--bg-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}


/* ============================================
 * PHASE S: Permissions Grid + Goal Modal
 * ============================================ */

/* Permissions Grid */
.perms-grid {
  display: grid;
  gap: 8px;
}
.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}
.perm-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.perm-segment {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 3px;
  gap: 2px;
}
.perm-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.perm-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.perm-opt:hover {
  color: var(--text-primary);
}
.perm-opt.active {
  background: var(--accent);
  color: #fff;
}
.perm-opt:has(input[value="none"]).active { background: var(--text-secondary); }
.perm-opt:has(input[value="read"]).active { background: #2D7FF9; }
.perm-opt:has(input[value="edit"]).active { background: #047857; }

.btn-sm {
  padding: 5px 10px !important;
  font-size: 11px !important;
}

/* GOAL MODAL */
.goal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.goal-modal-content {
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.30);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: gmodal-fade 0.18s ease;
}
@keyframes gmodal-fade {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.goal-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
}
.goal-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.goal-modal-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 3px 0 0;
}
.goal-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--bg-hover);
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.goal-modal-close:hover {
  background: #FEE4E2;
  color: #B91C1C;
}

.goal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 20px 24px;
}
.goal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.goal-field.full {
  grid-column: 1 / -1;
}
.goal-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.goal-field input,
.goal-field select,
.goal-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.goal-field input:focus,
.goal-field select:focus,
.goal-field textarea:focus {
  border-color: var(--accent);
}
.goal-readonly {
  padding: 9px 11px;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  background: var(--bg-hover);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}
.goal-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border-light);
}

@media (max-width: 600px) {
  .goal-form-grid { grid-template-columns: 1fr; }
  .perm-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .perm-segment { width: 100%; justify-content: space-between; }
  .perm-opt { flex: 1; justify-content: center; }
}


/* ============================================
 * ClickUp link icon - purple accent
 * ============================================ */
.link-icon-clickup {
  color: #7C3AED !important;
}
.link-icon-clickup:hover {
  background: rgba(124,58,237,0.12) !important;
}
[data-theme="dark"] .link-icon-clickup {
  color: #C4B5FD !important;
}
[data-theme="dark"] .link-icon-clickup:hover {
  background: rgba(124,58,237,0.22) !important;
}


/* ============================================
 * PHASE U: PWA BANNER + GLOBAL SEARCH + MOBILE
 * ============================================ */

/* PWA Install Banner */
#pwa-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 100px);
  width: calc(100% - 40px);
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9998;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#pwa-install-banner.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}
.pwa-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4880FF, #7C3AED);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pwa-banner-text {
  flex: 1;
  min-width: 0;
}
.pwa-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.pwa-banner-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}
.pwa-banner-install {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.pwa-banner-install:hover { opacity: 0.9; }
.pwa-banner-close {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-hover);
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
  .topbar-search { max-width: 100%; }
  .search-kbd { display: none; }
  #pwa-install-banner {
    width: calc(100% - 24px);
    bottom: 12px;
  }
  .search-dropdown {
    position: fixed;
    top: 60px;
    left: 12px;
    right: 12px;
    max-height: calc(100vh - 80px);
  }

  /* Larger tap targets */
  .nav-item, .btn, .fp2-filter, .fp2-tab {
    min-height: 40px;
  }

  /* Better mobile tables - horizontal scroll */
  .fp2-table-wrap, .table-wrap {
    -webkit-overflow-scrolling: touch;
  }
}

/* iPhone notch safe area */
@supports (padding: env(safe-area-inset-top)) {
  body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .topbar { padding-top: env(safe-area-inset-top); }
}


/* ============================================
 * COMMAND PALETTE (Global Search Modal)
 * ============================================ */

/* Topbar search trigger button */
.topbar-search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 480px;
  padding: 0 14px;
  height: 40px;
  background: var(--bg-hover);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.topbar-search-trigger:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
}
.topbar-search-trigger .search-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
  position: static !important;
  transform: none !important;
}
.topbar-search-placeholder {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}
.search-kbd {
  padding: 2px 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  font-size: 10px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, monospace;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* Command Palette Modal */
.cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.cmd-palette.visible { opacity: 1; }
.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
}
.cmd-palette-modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.30);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(-8px);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.cmd-palette.visible .cmd-palette-modal {
  transform: scale(1) translateY(0);
}

.cmd-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
}
.cmd-search-icon {
  color: var(--text-secondary);
  flex-shrink: 0;
}
#cmd-input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  padding: 0;
}
#cmd-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}
.cmd-esc-key {
  padding: 3px 9px;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.cmd-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 4px;
}

.cmd-group-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 12px 6px;
  opacity: 0.7;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
}
.cmd-item:hover,
.cmd-item.active {
  background: var(--accent-light);
}
.cmd-item.active .cmd-item-title {
  color: var(--accent);
}
.cmd-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .cmd-item-icon { opacity: 0.9; }
.cmd-item-body {
  flex: 1;
  min-width: 0;
}
.cmd-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.cmd-item-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmd-item-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border-radius: 5px;
  flex-shrink: 0;
}
.cmd-item.active .cmd-item-tag {
  background: var(--bg-card);
}
.cmd-item-arrow {
  color: var(--text-secondary);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.1s;
}
.cmd-item.active .cmd-item-arrow,
.cmd-item:hover .cmd-item-arrow {
  opacity: 1;
}

.cmd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 8px;
  text-align: center;
}
.cmd-empty svg {
  color: var(--text-secondary);
  opacity: 0.5;
  margin-bottom: 4px;
}
.cmd-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.cmd-empty-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.cmd-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-hover);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}
.cmd-foot-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}
.cmd-foot-item kbd {
  padding: 2px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 18px;
  text-align: center;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .cmd-palette {
    padding: 12px;
    align-items: flex-start;
  }
  .cmd-palette-modal {
    max-height: 85vh;
  }
  .topbar-search-placeholder {
    font-size: 12px;
  }
  .search-kbd { display: none; }
}


/* ============================================
 * BULLETPROOF: Prevent giant SVG bug
 * ============================================ */
.topbar svg,
.topbar-search-trigger svg,
.notif-wrap svg,
.topbar-icon-btn svg,
.btn-sidebar-toggle svg {
  max-width: 24px;
  max-height: 24px;
}
.topbar-search-trigger {
  overflow: hidden;
}
.topbar-search-trigger > svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
}

/* Prevent any SVG from rendering as default 300x150 */
svg:not([width]):not([height]) {
  width: 16px;
  height: 16px;
}


/* ============================================
 * PHASE V: Back Button + Site Comparison
 * ============================================ */

/* Universal Back Button */
.back-bar {
  margin-bottom: 16px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.back-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}
.back-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}


/* ============================================
 * SITE COMPARISON - FIGMA STYLE
 * ============================================ */

/* PICKER */
.cmp-picker {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  margin-bottom: 20px;
  overflow: hidden;
}
.cmp-picker-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
}
.cmp-picker-head h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 3px;
}
.cmp-picker-head p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}
.cmp-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px;
  padding: 18px 22px;
  align-items: end;
}
.cmp-picker-slot label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.cmp-slot-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.cmp-picker-slot select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 13px;
  outline: 0;
  font-family: inherit;
  transition: border-color 0.15s;
}
.cmp-picker-slot select:focus {
  border-color: var(--accent);
}
.cmp-picker-btn {
  min-width: 130px;
}

/* EMPTY STATE */
.cmp-empty {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 64px 24px;
  text-align: center;
}
.cmp-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.cmp-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.cmp-empty-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

/* SITE HEADER CARDS */
.cmp-headers {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}
.cmp-header-card {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
[data-theme="dark"] .cmp-header-card {
  background: var(--bg-card) !important;
}
.cmp-header-domain {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  word-break: break-all;
}
.cmp-header-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cmp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
}
.cmp-badge-tier {
  background: var(--accent-light);
  color: var(--accent);
}
.cmp-badge-brand {
  background: rgba(124,58,237,0.12);
  color: #6D28D9;
}
.cmp-badge-geo {
  background: var(--bg-hover);
  color: var(--text-primary);
  letter-spacing: 0.2px;
}
[data-theme="dark"] .cmp-badge-brand { background: rgba(124,58,237,0.25); color: #C4B5FD; }
.cmp-header-status {
  margin-top: 2px;
}
.cmp-header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.15s;
  align-self: flex-start;
}
.cmp-header-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* SECTIONS */
.cmp-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
.cmp-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}
.cmp-section-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .cmp-section-icon { opacity: 0.9; }

.cmp-rows {
  padding: 6px 0;
}
.cmp-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}
.cmp-row:last-child { border-bottom: 0; }
.cmp-row:hover { background: var(--bg-hover); }
.cmp-row-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.cmp-row-values {
  display: grid;
  gap: 14px;
}
.cmp-row-highlight {
  background: linear-gradient(90deg, rgba(72,128,255,0.05), transparent);
}
.cmp-row-highlight .cmp-row-label {
  color: var(--text-primary);
  font-weight: 700;
}

.cmp-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.cmp-cell-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.cmp-cell-text {
  font-size: 13px;
  color: var(--text-primary);
}
.cmp-cell-winner {
  position: relative;
}
.cmp-cell-winner .cmp-cell-value {
  color: #047857;
}
.cmp-winner-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FCD34D, #F59E0B);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(245,158,11,0.4);
  flex-shrink: 0;
}

.cmp-health-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.cmp-health-bar {
  flex: 1;
  max-width: 140px;
  height: 8px;
  background: var(--bg-hover);
  border-radius: 999px;
  overflow: hidden;
}
.cmp-health-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 28px;
}

/* LEGEND */
.cmp-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.cmp-legend strong { color: var(--text-primary); }

/* MOBILE */
@media (max-width: 800px) {
  .cmp-picker-grid {
    grid-template-columns: 1fr;
  }
  .cmp-picker-btn { min-width: auto; }
  .cmp-headers { grid-template-columns: 1fr !important; }
  .cmp-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .cmp-row-label {
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
  }
}


/* ============================================
 * PHASE W: BULK OPERATIONS ENHANCED
 * ============================================ */

.bulk-info-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
}
.bulk-section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}
.bulk-section-label:first-of-type {
  margin-top: 0;
}
.bulk-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.bulk-grid-2 .form-row {
  margin-bottom: 0 !important;
}

.bulk-radio-group {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.bulk-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s;
  flex: 1;
  justify-content: center;
}
.bulk-radio:has(input:checked) {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.bulk-radio input {
  margin: 0;
  accent-color: var(--accent);
}

@media (max-width: 600px) {
  .bulk-grid-2 { grid-template-columns: 1fr; }
}


/* ============================================
 * Login URL icon + Password masked pill
 * ============================================ */
.link-icon-login {
  color: #047857 !important;
}
.link-icon-login:hover {
  background: rgba(4,120,87,0.12) !important;
}
[data-theme="dark"] .link-icon-login {
  color: #6EE7B7 !important;
}
[data-theme="dark"] .link-icon-login:hover {
  background: rgba(4,120,87,0.22) !important;
}

.pwd-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 11px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, monospace;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}
.pwd-pill svg { flex-shrink: 0; opacity: 0.7; }
.pwd-pill .pwd-text {
  color: var(--text-primary);
}

