/* ═══════════════════════════════════════════════════════════════════
   TCAC SITE INTELLIGENCE — Platform CSS
   Matches mockup v2 with dark/light theme toggle.
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --blue:        #1A6BB5;
  --blue-bright: #2E8FE8;
  --teal:        #0EA5A0;
  --green:       #22C55E;
  --amber:       #F59E0B;
  --red:         #EF4444;
  --font:        'IBM Plex Sans', -apple-system, sans-serif;
  --mono:        'IBM Plex Mono', Menlo, monospace;
  --sidebar-w:   192px;
  --topbar-h:    56px;
}

[data-theme="dark"], html:not([data-theme]) {
  --bg-page:      #0B1829;
  --bg-sidebar:   #111C2D;
  --bg-card:      #142033;
  --bg-card2:     #162440;
  --bg-hover:     rgba(255,255,255,0.04);
  --bg-input:     rgba(255,255,255,0.06);
  --border:       rgba(255,255,255,0.07);
  --border-mid:   rgba(255,255,255,0.12);
  --text-primary: #E4EEF9;
  --text-sec:     #7A99BB;
  --text-dim:     #4A6480;
  --shadow:       rgba(0,0,0,0.5);
  --map-bg:       #0A1525;
  --overlay-bg:   rgba(10,22,42,0.96);
}
[data-theme="light"] {
  --bg-page:      #F0F4FA;
  --bg-sidebar:   #1A2A3F;
  --bg-card:      #FFFFFF;
  --bg-card2:     #F7FAFF;
  --bg-hover:     rgba(0,0,0,0.03);
  --bg-input:     rgba(0,0,0,0.04);
  --border:       rgba(0,0,0,0.08);
  --border-mid:   rgba(0,0,0,0.12);
  --text-primary: #1A2A3F;
  --text-sec:     #4A6480;
  --text-dim:     #8AA0B8;
  --shadow:       rgba(0,0,0,0.1);
  --map-bg:       #C8DCF0;
  --overlay-bg:   rgba(255,255,255,0.96);
}

/* Reset theme defaults that wp themes might override */
body.tcac-platform {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}
body.tcac-platform * { box-sizing: border-box; }

/* ════════════════════════════════════════════════
   GODADDY / THEME OVERRIDE
   Take over the viewport completely on platform pages.
   The plugin renders a full-screen app, NOT a page within
   a theme. We force every possible theme wrapper out of
   the way and pin the app to viewport edges.
   ═══════════════════════════════════════════════════ */

html.tcac-platform-active,
body.tcac-platform {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
  overflow-x: hidden !important;
  background: var(--bg-page) !important;
}

/* Hide every conceivable theme chrome element */
body.tcac-platform .site-header,
body.tcac-platform .site-footer,
body.tcac-platform header[role="banner"],
body.tcac-platform footer[role="contentinfo"],
body.tcac-platform .entry-title,
body.tcac-platform .entry-header,
body.tcac-platform .page-header,
body.tcac-platform .post-thumbnail,
body.tcac-platform .nav-links,
body.tcac-platform .post-navigation,
body.tcac-platform .comments-area,
body.tcac-platform #comments,
body.tcac-platform .widget-area,
body.tcac-platform aside.sidebar,
body.tcac-platform .wp-site-blocks > header,
body.tcac-platform .wp-site-blocks > footer,
body.tcac-platform .has-global-padding > header,
body.tcac-platform .has-global-padding > footer,
body.tcac-platform .gd-aff-banner,
body.tcac-platform #wpadminbar { display: none !important; }

/* Strip ALL constraints from any wrapper between <body> and #tcac-app */
body.tcac-platform > div,
body.tcac-platform > main,
body.tcac-platform > section,
body.tcac-platform > article,
body.tcac-platform .wp-site-blocks,
body.tcac-platform .has-global-padding,
body.tcac-platform .is-layout-constrained,
body.tcac-platform .is-layout-flow,
body.tcac-platform .is-layout-flex,
body.tcac-platform .site,
body.tcac-platform #page,
body.tcac-platform #content,
body.tcac-platform #main,
body.tcac-platform #primary,
body.tcac-platform .site-content,
body.tcac-platform .content-area,
body.tcac-platform main,
body.tcac-platform article,
body.tcac-platform .entry-content,
body.tcac-platform .post,
body.tcac-platform .page,
body.tcac-platform .wp-block-group,
body.tcac-platform .wp-block-post-content,
body.tcac-platform .container,
body.tcac-platform .container-fluid,
body.tcac-platform .row,
body.tcac-platform .col,
body.tcac-platform .col-12 {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
  min-width: 0 !important;
  float: none !important;
  display: block !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
}

/* The admin bar offset that WP normally injects — kill it */
body.tcac-platform.admin-bar { margin-top: 0 !important; }
html[lang].tcac-platform-active { margin-top: 0 !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.3); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ════════════════════════════════════════════════
   APP SHELL — fixed-positioned to escape theme entirely
═════════════════════════════════════════════════ */
#tcac-app {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  background: var(--bg-page) !important;
  z-index: 99999 !important;
  overflow: hidden !important;
  font-family: var(--font);
  color: var(--text-primary);
}

.tcac-sidebar {
  position: relative;
  flex-shrink: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column;
  z-index: 100;
  color: rgba(255,255,255,0.7);
  overflow-y: auto;
}
[data-theme="light"] .tcac-sidebar { background: #1A2A3F; }

.tcac-brand {
  padding: 16px 16px 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Glowing logo wrapper - works for both icon and uploaded image */
.tcac-brand-logo-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tcac-brand-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  background: radial-gradient(circle, rgba(46,143,232,0.55) 0%, rgba(14,165,160,0.3) 40%, transparent 70%);
  filter: blur(12px);
  opacity: 0.85;
  z-index: 0;
  animation: tcac-glow-pulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes tcac-glow-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.08); }
}
.tcac-brand-logo-img {
  position: relative;
  z-index: 1;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
  display: block;
}
.tcac-brand-logo-wrap .tcac-brand-icon {
  position: relative;
  z-index: 1;
}

.tcac-brand-icon {
  width: 30px; height: 30px;
  background: var(--blue);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 14px;
  box-shadow: 0 2px 10px rgba(46,143,232,0.4);
  flex-shrink: 0;
}
.tcac-brand-name { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.85); letter-spacing: 0.04em; line-height: 1.2; }
.tcac-brand-sub  { font-size: 9px; color: rgba(255,255,255,0.4); letter-spacing: 0.06em; }

.tcac-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.tcac-nav-section {
  font-size: 9px; font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 12px 16px 6px;
  font-family: var(--mono);
}
.tcac-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.tcac-nav-item:hover { color: white; background: rgba(255,255,255,0.05); }
.tcac-nav-item.active {
  color: white;
  background: rgba(46,143,232,0.18);
  border-left-color: var(--blue-bright);
}
.tcac-nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.tcac-nav-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 6px 0; }

.tcac-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 10px; color: rgba(255,255,255,0.3);
  font-family: var(--mono);
}

/* ════════════════════════════════════════════════
   MAIN
═════════════════════════════════════════════════ */
.tcac-main {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-page);
}

.tcac-topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 12px var(--shadow);
}
.tcac-topbar-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.tcac-topbar-pill {
  font-size: 9px; font-weight: 700;
  padding: 3px 9px; border-radius: 3px;
  letter-spacing: 0.1em; text-transform: uppercase;
  font-family: var(--mono);
  background: rgba(14,165,160,0.12);
  border: 1px solid rgba(14,165,160,0.25);
  color: var(--teal);
}
.tcac-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.tcac-theme-toggle {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-mid);
  border-radius: 22px;
  padding: 4px 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
}
.tcac-theme-toggle:hover { border-color: var(--blue-bright); }
.tcac-toggle-track {
  width: 32px; height: 16px;
  background: var(--blue);
  border-radius: 8px;
  position: relative;
}
[data-theme="light"] .tcac-toggle-track { background: #c0d0e0; }
.tcac-toggle-thumb {
  position: absolute; top: 2px;
  width: 12px; height: 12px;
  background: white;
  border-radius: 50%;
  transition: left 0.25s cubic-bezier(0.4,0,0.2,1);
  left: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
[data-theme="light"] .tcac-toggle-thumb { left: 2px; }

.tcac-api-health {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-sec);
  font-family: var(--mono);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 10px;
}
.tcac-health-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: tcac-pulse 2s infinite;
}
.tcac-health-dot.amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.tcac-health-dot.red   { background: var(--red);   box-shadow: 0 0 6px var(--red); }
@keyframes tcac-pulse {
  0%,100% { box-shadow: 0 0 4px currentColor; }
  50% { box-shadow: 0 0 10px currentColor; }
}

.tcac-user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
}
.tcac-user-chip:hover { border-color: var(--blue-bright); }
.tcac-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-bright));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11px; font-weight: 700;
}
.tcac-user-name { font-size: 12px; font-weight: 600; line-height: 1.2; }
.tcac-user-role { font-size: 9px; color: var(--text-sec); }

.tcac-user-menu {
  position: absolute;
  top: calc(var(--topbar-h) - 6px);
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 12px 32px var(--shadow);
  z-index: 200;
}
.tcac-user-menu a {
  display: block; padding: 8px 12px;
  font-size: 12px; color: var(--text-primary);
  text-decoration: none; border-radius: 4px;
}
.tcac-user-menu a:hover { background: var(--bg-hover); }

/* ════════════════════════════════════════════════
   CONTENT AREA
═════════════════════════════════════════════════ */
.tcac-content { padding: 20px 24px; }

.tcac-row { display: grid; gap: 14px; }
.tcac-row-5 { grid-template-columns: repeat(5, 1fr); }
.tcac-row-2-side { grid-template-columns: 1fr 380px; }
.tcac-row-half { grid-template-columns: 1fr 1fr; }

@media (max-width: 1280px) {
  .tcac-row-5 { grid-template-columns: repeat(3, 1fr); }
  .tcac-row-2-side { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 60px; }
  .tcac-row-5, .tcac-row-half { grid-template-columns: 1fr; }
  .tcac-nav-item span:not(.tcac-nav-icon) { display: none; }
  .tcac-brand-name, .tcac-brand-sub { display: none; }
}

/* KPI cards */
.tcac-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 12px;
  position: relative; overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}
.tcac-kpi:hover { transform: translateY(-1px); border-color: var(--border-mid); }
.tcac-kpi-label {
  font-size: 9px; font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.1em;
  font-family: var(--mono);
  margin-bottom: 6px;
}
.tcac-kpi-value {
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1;
  margin-bottom: 10px;
}
.tcac-kpi-value.blue   { color: var(--blue-bright); }
.tcac-kpi-value.green  { color: var(--green); }
.tcac-kpi-value.amber  { color: var(--amber); }
.tcac-kpi-value.teal   { color: var(--teal); }
.tcac-kpi-value.small  { font-size: 22px; }
.tcac-kpi-spark { height: 28px; width: 100%; margin-bottom: 6px; }
.tcac-kpi-sub {
  font-size: 9px; color: var(--text-sec);
  font-family: var(--mono);
}
.tcac-kpi-sub .up   { color: var(--green); }
.tcac-kpi-sub .down { color: var(--red); }
.tcac-kpi-sub .warn { color: var(--amber); }
.tcac-kpi-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px;
}

/* Panels */
.tcac-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.tcac-panel-head {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card2);
  display: flex; align-items: center; gap: 8px;
}
.tcac-panel-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  font-family: var(--mono);
}
.tcac-panel-body { padding: 14px 16px; }

/* Chips */
.tcac-chip {
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 3px;
  font-family: var(--mono); letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tcac-chip.blue   { background:rgba(46,143,232,0.12); color:var(--blue-bright); border:1px solid rgba(46,143,232,0.22); }
.tcac-chip.green  { background:rgba(34,197,94,0.1);   color:var(--green);       border:1px solid rgba(34,197,94,0.2); }
.tcac-chip.amber  { background:rgba(245,158,11,0.1);  color:var(--amber);       border:1px solid rgba(245,158,11,0.2); }
.tcac-chip.red    { background:rgba(239,68,68,0.1);   color:var(--red);         border:1px solid rgba(239,68,68,0.2); }
.tcac-chip.teal   { background:rgba(14,165,160,0.1);  color:var(--teal);        border:1px solid rgba(14,165,160,0.2); }

/* Map */
.tcac-map-wrap {
  position: relative;
  background: var(--map-bg);
  min-height: 380px;
  overflow: hidden;
}
#tcac-map { width: 100%; height: 380px; }
.tcac-map-overlay {
  position: absolute; top: 14px; left: 14px; transform: none;
  width: 320px; max-width: calc(100% - 60px);
  background: var(--overlay-bg);
  border: 1px solid rgba(46,143,232,0.35);
  border-radius: 10px;
  padding: 10px 12px 12px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 1000;
}
.tcac-map-overlay-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.tcac-map-overlay-title {
  font-size: 9px; font-weight: 700;
  color: var(--blue-bright);
  letter-spacing: 0.12em; text-transform: uppercase;
  font-family: var(--mono);
  flex: 1;
  cursor: move;
  user-select: none;
  padding: 4px 0;
}
.tcac-overlay-min {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-sec);
  width: 22px; height: 22px;
  border-radius: 4px;
  font-size: 14px; line-height: 1;
  cursor: pointer;
  font-family: var(--mono);
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.tcac-overlay-min:hover { background: var(--bg-card2); color: var(--text-primary); }
.tcac-map-overlay input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px; color: var(--text-primary);
  font-family: var(--font);
  margin-bottom: 8px;
  outline: none;
}
.tcac-map-overlay input:focus { border-color: var(--blue-bright); }
.tcac-btn-primary {
  width: 100%;
  background: var(--blue);
  border: none; border-radius: 6px;
  padding: 10px; font-size: 11px; font-weight: 700;
  color: white; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; font-family: var(--mono);
  transition: background 0.15s;
}
.tcac-btn-primary:hover { background: var(--blue-bright); }
.tcac-btn-primary:disabled { opacity: 0.5; cursor: wait; }

.tcac-map-legend {
  position: absolute; bottom: 12px; left: 12px;
  background: var(--overlay-bg);
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
  z-index: 1000;
  font-family: var(--mono);
}
.tcac-legend-title { font-size: 8px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.tcac-legend-row { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-sec); margin-bottom: 3px; }
.tcac-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* Recent Analysis */
.tcac-recent-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.tcac-recent-row:hover { background: var(--bg-hover); }
.tcac-recent-row:last-child { border-bottom: none; }
.tcac-recent-addr { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.tcac-recent-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-sec); font-family: var(--mono); }

/* AI panel */
.tcac-ai-brand {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 700;
  color: var(--teal); font-family: var(--mono);
  background: rgba(14,165,160,0.08);
  border: 1px solid rgba(14,165,160,0.2);
  padding: 3px 8px; border-radius: 3px;
  margin-bottom: 10px;
}
.tcac-ai-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-items: baseline; }
.tcac-ai-k { font-size: 9px; font-weight: 700; font-family: var(--mono); color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.tcac-ai-v { font-size: 11px; line-height: 1.4; }
.tcac-ai-v.hi { color: var(--teal); font-weight: 600; }
.tcac-ai-v.warn { color: var(--amber); }

/* Histogram */
.tcac-hist-wrap { display: flex; align-items: flex-end; gap: 0; }
.tcac-hist-y { display: flex; flex-direction: column; justify-content: space-between; height: 100px; margin-right: 8px; padding-bottom: 22px; }
.tcac-hist-tick { font-size: 9px; color: var(--text-dim); font-family: var(--mono); }
.tcac-hist-bars { flex: 1; }
.tcac-hist-row { display: flex; align-items: flex-end; gap: 6px; height: 100px; }
.tcac-hist-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.tcac-hist-cnt { font-size: 9px; color: var(--text-dim); font-family: var(--mono); }
.tcac-hist-bar { width: 100%; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 2px; transition: opacity 0.2s; cursor: pointer; }
.tcac-hist-bar:hover { opacity: 0.85; }
.tcac-hist-bar.peak { background: var(--teal); }
.tcac-hist-labels { display: flex; gap: 6px; margin-top: 6px; }
.tcac-hist-lbl { flex: 1; text-align: center; font-size: 9px; color: var(--text-dim); font-family: var(--mono); }

/* Review table */
.tcac-table {
  width: 100%; border-collapse: collapse;
}
.tcac-table th {
  font-size: 9px; font-weight: 700;
  color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.08em; font-family: var(--mono);
  padding: 9px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card2);
}
.tcac-table td {
  font-size: 11.5px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}
.tcac-table tbody tr:hover td { background: var(--bg-hover); }
.tcac-table tbody tr:last-child td { border-bottom: none; }

.tcac-flag-pill {
  font-size: 9px; padding: 2px 7px; border-radius: 3px;
  font-family: var(--mono); font-weight: 600;
  background: rgba(245,158,11,0.1);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,0.22);
  white-space: nowrap;
}
.tcac-flag-pill.barrier { background:rgba(239,68,68,0.1); color:var(--red); border-color:rgba(239,68,68,0.22); }
.tcac-flag-pill.missing { background:rgba(148,163,184,0.1); color:var(--text-sec); border-color:rgba(148,163,184,0.2); }

.tcac-btn-sm {
  background: var(--blue); border: none; border-radius: 4px;
  padding: 4px 10px; font-size: 10px; font-weight: 700;
  color: white; cursor: pointer; font-family: var(--mono);
  letter-spacing: 0.05em; text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
}
.tcac-btn-sm:hover { background: var(--blue-bright); color: white; }

/* Status tags */
.tcac-stag {
  font-size: 9px; font-weight: 700; padding: 2px 7px;
  border-radius: 3px; letter-spacing: 0.06em;
  text-transform: uppercase; font-family: var(--mono);
  white-space: nowrap;
}
.tcac-stag.barrier  { background:rgba(239,68,68,0.1);  color:var(--red); border:1px solid rgba(239,68,68,0.2); }
.tcac-stag.strong   { background:rgba(34,197,94,0.1);  color:var(--green); border:1px solid rgba(34,197,94,0.2); }
.tcac-stag.review   { background:rgba(245,158,11,0.1); color:var(--amber); border:1px solid rgba(245,158,11,0.2); }
.tcac-stag.analysis { background:rgba(148,163,184,0.1);color:var(--text-sec); border:1px solid rgba(148,163,184,0.2); }

/* Loading */
.tcac-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  color: var(--text-dim); font-family: var(--mono); font-size: 11px;
}
.tcac-spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border-mid);
  border-top-color: var(--blue-bright);
  border-radius: 50%;
  animation: tcac-spin 0.8s linear infinite;
  margin-right: 10px;
}
@keyframes tcac-spin { to { transform: rotate(360deg); } }

/* New Site form */
.tcac-form-card {
  max-width: 720px; margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}
.tcac-form-card h1 {
  font-size: 22px; font-weight: 700;
  margin: 0 0 8px; letter-spacing: -0.02em;
}
.tcac-form-card .subtitle {
  font-size: 13px; color: var(--text-sec);
  margin-bottom: 22px;
}
.tcac-tabs {
  display: flex; gap: 4px;
  background: var(--bg-input);
  padding: 4px; border-radius: 8px;
  margin-bottom: 20px;
}
.tcac-tab {
  flex: 1;
  padding: 8px 14px;
  font-size: 12px; font-weight: 600;
  border: none; background: transparent;
  border-radius: 5px; cursor: pointer;
  color: var(--text-sec); font-family: var(--font);
  transition: all 0.15s;
}
.tcac-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.tcac-field { display: block; margin-bottom: 16px; }
.tcac-field-label {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-sec); font-family: var(--mono);
  margin-bottom: 6px;
}
.tcac-field input, .tcac-field select, .tcac-field textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px; color: var(--text-primary);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
.tcac-field input:focus, .tcac-field select:focus, .tcac-field textarea:focus { border-color: var(--blue-bright); }

/* Filters */
.tcac-filters {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.tcac-filter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px; color: var(--text-primary);
  font-family: var(--font);
  outline: none;
}

/* ════════════════════════════════════════════════
   LOGIN PAGE
═════════════════════════════════════════════════ */
.tcac-login-wrap {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0B1829 0%, #142033 50%, #1A2A3F 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 9999;
}
.tcac-login-wrap::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(46,143,232,0.15), transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(14,165,160,0.1), transparent 50%);
  pointer-events: none;
}
.tcac-login-card {
  position: relative;
  width: 100%; max-width: 420px;
  background: rgba(20,32,51,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 36px 32px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  color: #E4EEF9;
  font-family: var(--font);
}
.tcac-login-brand {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 32px;
}

/* Bigger, more dramatic glow on the login screen */
.tcac-login-card .tcac-brand-logo-wrap {
  position: relative;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tcac-login-card .tcac-brand-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -22px;
  background: radial-gradient(circle,
    rgba(46,143,232,0.7) 0%,
    rgba(14,165,160,0.4) 35%,
    rgba(46,143,232,0.15) 60%,
    transparent 75%);
  filter: blur(22px);
  opacity: 0.95;
  z-index: 0;
  animation: tcac-glow-pulse-strong 3.5s ease-in-out infinite;
  pointer-events: none;
}
.tcac-login-card .tcac-brand-logo-wrap::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
  filter: blur(8px);
  z-index: 0;
  pointer-events: none;
}
@keyframes tcac-glow-pulse-strong {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.12); }
}
.tcac-login-card .tcac-brand-logo-img {
  position: relative;
  z-index: 1;
  max-width: 56px;
  max-height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(46,143,232,0.4));
}

.tcac-login-card .tcac-brand-icon {
  position: relative;
  z-index: 1;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--blue), var(--blue-bright));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 22px;
  box-shadow: 0 4px 16px rgba(46,143,232,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.tcac-brand-title { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.2; color: white; }
.tcac-brand-sub   { font-size: 11px; color: rgba(255,255,255,0.5); letter-spacing: 0.04em; margin-top: 2px; }
.tcac-login-h1 { font-size: 26px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.02em; }
.tcac-login-sub { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 22px; }
.tcac-login-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #FCA5A5; padding: 10px 14px; border-radius: 6px; font-size: 12px; margin-bottom: 16px; }
.tcac-login-form .tcac-field-label { color: rgba(255,255,255,0.5); }
.tcac-login-form input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: white;
}
.tcac-login-form input:focus { border-color: var(--blue-bright); background: rgba(255,255,255,0.1); }
.tcac-checkbox { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255,255,255,0.7); margin: 12px 0 18px; cursor: pointer; }
.tcac-checkbox input { width: auto; margin: 0; }
.tcac-login-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--blue), var(--blue-bright));
  border: none; border-radius: 8px;
  padding: 12px 18px;
  font-size: 14px; font-weight: 700;
  color: white; cursor: pointer;
  font-family: var(--font);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  display: inline-block; text-align: center;
}
.tcac-login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(46,143,232,0.4); color: white; }
.tcac-login-footer { text-align: center; margin-top: 20px; color: rgba(255,255,255,0.3); font-family: var(--mono); }

/* Logout page */
.tcac-logout-wrap {
  position: fixed; inset: 0;
  background: var(--bg-page);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.tcac-logout-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
  text-align: center;
  max-width: 380px;
  font-family: var(--font);
}
.tcac-logout-card h1 { font-size: 22px; margin: 0 0 8px; }
.tcac-logout-card p { color: var(--text-sec); margin: 0 0 20px; font-size: 13px; }

/* Notification toast */
.tcac-toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 12px; color: var(--text-primary);
  box-shadow: 0 10px 30px var(--shadow);
  z-index: 9000;
  animation: tcac-slide-in 0.25s ease;
  max-width: 340px;
}
.tcac-toast.success { border-color: rgba(34,197,94,0.4); }
.tcac-toast.error   { border-color: rgba(239,68,68,0.4); }
@keyframes tcac-slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Detail view */
.tcac-detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 14px; }
@media (max-width: 1100px) { .tcac-detail-grid { grid-template-columns: 1fr; } }
.tcac-score-display {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--mono);
}
.tcac-score-num { font-size: 36px; font-weight: 800; color: var(--blue-bright); }
.tcac-score-max { font-size: 13px; color: var(--text-dim); }
.tcac-score-bar {
  height: 6px; background: var(--bg-input); border-radius: 3px;
  overflow: hidden; margin-top: 10px;
}
.tcac-score-fill {
  height: 100%; background: linear-gradient(90deg, var(--blue), var(--teal));
  transition: width 0.4s;
}

/* Empty state */
.tcac-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-sec);
}
.tcac-empty-icon { font-size: 32px; opacity: 0.4; margin-bottom: 8px; }
.tcac-empty-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.tcac-empty-sub { font-size: 12px; }

/* ───── MODAL ───── */
.tcac-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: tcac-fade-in 0.15s ease-out;
}
@keyframes tcac-fade-in { from { opacity: 0; } to { opacity: 1; } }
.tcac-modal {
  background: var(--bg-card, #0e1726);
  border: 1px solid var(--border, #233044);
  border-radius: 10px;
  width: 100%; max-width: 720px; max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}
.tcac-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.tcac-modal-title {
  margin: 0;
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-transform: capitalize;
}
.tcac-modal-close {
  background: transparent; border: none;
  color: var(--text-sec);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.tcac-modal-close:hover { background: var(--bg-card2); color: var(--text-primary); }
.tcac-modal-body { padding: 18px; overflow-y: auto; }
.tcac-modal-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tcac-modal-table th, .tcac-modal-table td {
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.tcac-modal-table th {
  font-size: 10px; font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--mono);
}

/* ───── TOOLTIP ───── */
.tcac-tooltip {
  position: fixed;
  background: #0a1320;
  color: #e2e8f0;
  border: 1px solid #2e8fe8;
  padding: 8px 11px;
  border-radius: 6px;
  font-size: 12px; line-height: 1.4;
  max-width: 320px;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.tcac-tip:hover {
  border-color: var(--blue-bright);
  color: var(--blue-bright);
  background: var(--bg-card2);
}
