@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --bg:           #06060a;
  --surface:      rgba(255,255,255,0.03);
  --surface2:     rgba(255,255,255,0.05);
  --surface3:     rgba(255,255,255,0.08);
  --border:       rgba(255,255,255,0.08);
  --border-bright:rgba(255,255,255,0.14);
  --accent:       #6366f1;
  --accent2:      #8b5cf6;
  --accent-glow:  rgba(99,102,241,0.25);
  --text:         #f8f8ff;
  --text-muted:   #9090a8;
  --text-faint:   #44445a;
  --green:        #10b981;
  --yellow:       #f59e0b;
  --red:          #ef4444;
  --radius:       16px;
  --radius-sm:    10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Animated mesh background */
.mesh {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  filter: blur(72px); opacity: .75;
}
.orb {
  position: absolute; border-radius: 50%;
  animation: orbFloat linear infinite;
}
.orb1 {
  width: 650px; height: 650px; top: -150px; left: -150px;
  background: radial-gradient(circle, rgba(99,102,241,.55) 0%, transparent 70%);
  animation-duration: 20s;
}
.orb2 {
  width: 550px; height: 550px; bottom: -120px; right: -120px;
  background: radial-gradient(circle, rgba(139,92,246,.45) 0%, transparent 70%);
  animation-duration: 26s; animation-direction: reverse;
}
.orb3 {
  width: 420px; height: 420px; top: 35%; left: 38%;
  background: radial-gradient(circle, rgba(59,130,246,.28) 0%, transparent 70%);
  animation-duration: 17s; animation-delay: -8s;
}
.orb4 {
  width: 360px; height: 360px; top: 15%; right: 15%;
  background: radial-gradient(circle, rgba(236,72,153,.18) 0%, transparent 70%);
  animation-duration: 23s; animation-delay: -5s;
}
@keyframes orbFloat {
  0%   { transform: translate(0,    0)    scale(1);    }
  25%  { transform: translate(55px, -45px) scale(1.06); }
  50%  { transform: translate(25px,  60px) scale(0.94); }
  75%  { transform: translate(-45px, 20px) scale(1.08); }
  100% { transform: translate(0,    0)    scale(1);    }
}

/* Subtle dot grid */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.app { max-width: 1200px; margin: 0 auto; padding: 48px 24px; position: relative; z-index: 1; }

/* ── Header ─────────────────────────────────────── */
.header { text-align: center; margin-bottom: 56px; position: relative; }

/* Language switcher */
.lang-switcher {
  position: absolute; top: 0; right: 0;
  display: flex; gap: 4px;
}
.lang-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 8px; cursor: pointer;
  transition: all .15s;
}
.lang-btn:hover { color: var(--text); border-color: var(--border-bright); }
.lang-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.logo {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 28px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.02em;
  background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 40%, #818cf8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(99,102,241,0.4);
  flex-shrink: 0;
}

.subtitle {
  color: var(--text-muted); font-size: 15px; font-weight: 400;
  letter-spacing: .005em; line-height: 1.6;
}

/* ── Search card ────────────────────────────────── */
.search-section {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 680px;
  margin: 0 auto 40px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 32px 80px rgba(0,0,0,0.5),
    0 0 60px rgba(99,102,241,0.06);
  position: relative; overflow: hidden;
}

.search-section::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,0.6), rgba(99,102,241,0.6), transparent);
}

.form-row { display: flex; gap: 14px; margin-bottom: 20px; }
.field { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.field input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus {
  border-color: rgba(99,102,241,0.6);
  background: rgba(99,102,241,0.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12), 0 0 20px rgba(99,102,241,0.08);
}
.field input::placeholder { color: var(--text-faint); }

/* Global toggle */
.global-toggle {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 24px; cursor: pointer;
  font-size: 13px; color: var(--text-muted);
  user-select: none;
}
.global-toggle input { display: none; }
.global-toggle-box {
  width: 40px; height: 22px; flex-shrink: 0;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 99px; position: relative; transition: all .25s;
}
.global-toggle-box::after {
  content: ''; position: absolute;
  top: 4px; left: 4px;
  width: 12px; height: 12px;
  background: var(--text-muted); border-radius: 50%;
  transition: transform .25s, background .25s;
}
.global-toggle input:checked + .global-toggle-box {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  box-shadow: 0 0 12px rgba(99,102,241,0.35);
}
.global-toggle input:checked + .global-toggle-box::after { transform: translateX(18px); background: white; }
.global-hint { color: var(--text-faint); font-size: 12px; }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: white; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; font-family: inherit; letter-spacing: .01em;
  cursor: pointer;
  transition: opacity .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35), 0 0 0 1px rgba(255,255,255,0.06) inset;
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
}
.btn-primary:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 8px 28px rgba(99,102,241,0.45); }
.btn-primary:active { transform: translateY(0); opacity: 1; }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; transform: none; }

/* ── Progress ───────────────────────────────────── */
.progress-section {
  max-width: 680px; margin: 0 auto 40px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius); padding: 32px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}

.progress-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; font-weight: 500; font-size: 14px;
  color: var(--text-muted);
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar-wrap {
  height: 4px; background: rgba(255,255,255,0.05);
  border-radius: 99px; overflow: hidden; margin-bottom: 20px;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2), #c084fc);
  border-radius: 99px;
  transition: width .4s ease;
  box-shadow: 0 0 12px rgba(99,102,241,0.6);
}

.log {
  max-height: 180px; overflow-y: auto;
  font-size: 12px; color: var(--text-faint);
  display: flex; flex-direction: column; gap: 4px;
  font-variant-numeric: tabular-nums;
}
.log-line { padding: 2px 0; }

/* ── Results ────────────────────────────────────── */
.results-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}

.results-meta h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; letter-spacing: -.01em; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  padding: 4px 12px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.badge-total  { background: rgba(255,255,255,.07); color: var(--text); border: 1px solid var(--border-bright); font-size: 12px; font-weight: 700; }
.badge-green  { background: rgba(16,185,129,.1);  color: #34d399; border: 1px solid rgba(16,185,129,.2); }
.badge-yellow { background: rgba(245,158,11,.1);  color: #fbbf24; border: 1px solid rgba(245,158,11,.2); }
.badge-red    { background: rgba(239,68,68,.1);   color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.badge-blue   { background: rgba(99,102,241,.1);  color: #a5b4fc; border: 1px solid rgba(99,102,241,.2); }
.badge-purple { background: rgba(139,92,246,.1);  color: #c4b5fd; border: 1px solid rgba(139,92,246,.2); }

.export-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-export {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: all .2s;
  backdrop-filter: blur(8px);
}
.btn-export:hover { border-color: rgba(99,102,241,0.5); background: var(--surface3); box-shadow: 0 0 12px rgba(99,102,241,0.12); }

.btn-secondary {
  padding: 9px 16px;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit;
  cursor: pointer; transition: all .2s;
}
.btn-secondary:hover { color: var(--text); border-color: var(--border-bright); }

/* ── Filters ────────────────────────────────────── */
.filters { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-btn {
  padding: 5px 14px;
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 99px;
  font-size: 12px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: all .2s;
  backdrop-filter: blur(8px);
}
.filter-btn:hover { color: var(--text); border-color: var(--border-bright); background: var(--surface2); }
.filter-btn.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.2));
  color: #a5b4fc; border-color: rgba(99,102,241,0.4);
  box-shadow: 0 0 12px rgba(99,102,241,0.15);
}
.filter-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }

/* ── Table ──────────────────────────────────────── */
.table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--border-bright);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.02) inset;
  backdrop-filter: blur(8px);
}

.results-table { width: 100%; border-collapse: collapse; }

.results-table thead th {
  background: rgba(255,255,255,0.03);
  padding: 12px 16px;
  text-align: left;
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
  backdrop-filter: blur(12px);
}

.results-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background .15s;
}
.results-table tbody tr:last-child { border-bottom: none; }
.results-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.results-table td {
  padding: 13px 16px;
  vertical-align: middle;
  font-size: 13px;
}

.company-name { font-weight: 600; color: var(--text); line-height: 1.4; }
.company-addr { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

.link { color: #a5b4fc; text-decoration: none; transition: color .15s; }
.link:hover { color: #c7d2fe; text-decoration: underline; }

.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 24px; padding: 0 7px;
  border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.score-good { background: rgba(16,185,129,.1); color: #34d399; border: 1px solid rgba(16,185,129,.2); }
.score-med  { background: rgba(245,158,11,.1);  color: #fbbf24; border: 1px solid rgba(245,158,11,.2); }
.score-bad  { background: rgba(239,68,68,.1);   color: #f87171; border: 1px solid rgba(239,68,68,.2); }

.rating-stars { color: #fbbf24; font-size: 11px; }

.tag {
  display: inline-block; padding: 2px 8px;
  background: rgba(255,255,255,0.05); border-radius: 4px;
  font-size: 11px; color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Type badges */
.type-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.type-manufacturer { background: rgba(99,102,241,.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,.25); }
.type-retailer     { background: rgba(16,185,129,.1);  color: #34d399; border: 1px solid rgba(16,185,129,.2); }

/* ── Chat container ─────────────────────────────── */
.chat-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 199;
  display: flex; align-items: center; gap: 12px;
}

.chat-hint {
  display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-bright);
  padding: 9px 16px; border-radius: 99px;
  font-size: 13px; font-weight: 500;
  white-space: nowrap; color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transition: opacity .3s;
  pointer-events: none;
}
.chat-hint.hidden { opacity: 0; }
.chat-hint svg { color: #a5b4fc; flex-shrink: 0; }

.chat-bubble {
  display: flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white; padding: 13px 20px; border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(99,102,241,0.5), 0 0 0 1px rgba(255,255,255,0.06) inset;
  font-size: 13px; font-weight: 600; font-family: inherit;
  transition: transform .2s, box-shadow .2s;
  user-select: none; position: relative; overflow: hidden;
}
.chat-bubble::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
}
.chat-bubble:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(99,102,241,0.6); }
.chat-bubble:active { transform: translateY(0); }

/* ── Chat panel ─────────────────────────────────── */
.chat-panel {
  position: fixed; bottom: 84px; right: 24px; z-index: 200;
  width: 360px; max-height: 520px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(10,10,18,0.85);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.03) inset, 0 0 40px rgba(99,102,241,0.08);
  overflow: hidden;
}

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
  background: rgba(255,255,255,0.02);
}

.chat-header-left { display: flex; align-items: center; gap: 10px; }

.chat-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 0 12px rgba(99,102,241,0.3);
}

.chat-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 4px;
  transition: color .15s; border-radius: 4px;
}
.chat-close:hover { color: var(--text); background: var(--surface2); }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}

.chat-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.55;
}
.chat-msg.bot {
  background: rgba(255,255,255,0.06); color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px; align-self: flex-start;
}
.chat-msg.user {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white; border-bottom-right-radius: 4px; align-self: flex-end;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.chat-msg.typing { color: var(--text-faint); font-style: italic; align-self: flex-start; }

.chat-input-row {
  display: flex; gap: 8px; padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.chat-input-row input {
  flex: 1; background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text);
  font-size: 13px; font-family: inherit; outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.chat-input-row input:focus {
  border-color: rgba(99,102,241,0.5);
  background: rgba(99,102,241,0.07);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.chat-input-row input::placeholder { color: var(--text-faint); }
.chat-input-row button {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: var(--radius-sm);
  color: white; padding: 10px 14px; cursor: pointer;
  transition: opacity .2s, transform .15s;
  display: flex; align-items: center;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.chat-input-row button:hover { opacity: .85; transform: scale(1.05); }

/* ── Tips panel ─────────────────────────────────── */
.tips-wrap {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.tips-toggle {
  display: flex; align-items: center; gap: 7px;
  background: none; border: none; outline: none;
  -webkit-appearance: none; appearance: none;
  color: var(--text-muted); font-size: 12px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  padding: 4px 0; width: 100%;
  transition: color .15s;
}
.tips-toggle:hover { color: var(--text); }
.tips-toggle:focus { outline: none; }
.tips-chevron {
  margin-left: auto;
  transition: transform .2s;
}
.tips-toggle.open .tips-chevron { transform: rotate(180deg); }

.tips-body {
  margin-top: 14px;
  animation: tipsOpen .2s ease both;
}
@keyframes tipsOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tips-col-full { grid-column: 1 / -1; }

.tips-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: 8px;
}

.tips-do { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.tips-tag {
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.25);
  color: #a5b4fc;
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 500;
}

.tips-dont {
  font-size: 11.5px; color: var(--text-faint); line-height: 1.5;
}

.tips-auto {
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
  padding: 10px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ── KPI cards ──────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  cursor: default;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  border-radius: 99px;
}
.kpi-card.kpi-purple::before { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.kpi-card.kpi-green::before  { background: linear-gradient(90deg, #10b981, #34d399); }
.kpi-card.kpi-blue::before   { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.kpi-card.kpi-indigo::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.kpi-card.kpi-amber::before  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.kpi-icon {
  font-size: 15px; margin-bottom: 2px;
  opacity: .7;
}
.kpi-value {
  font-size: 26px; font-weight: 800; line-height: 1;
  letter-spacing: -.02em;
}
.kpi-card.kpi-purple .kpi-value { color: #a5b4fc; }
.kpi-card.kpi-green  .kpi-value { color: #34d399; }
.kpi-card.kpi-blue   .kpi-value { color: #60a5fa; }
.kpi-card.kpi-indigo .kpi-value { color: #818cf8; }
.kpi-card.kpi-amber  .kpi-value { color: #fbbf24; }

.kpi-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .07em;
}

/* ── KPI clickable / active states ─────────────── */
.kpi-clickable { cursor: pointer; }
.kpi-clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}
.kpi-active {
  box-shadow: 0 0 0 2px var(--accent), 0 8px 24px rgba(99,102,241,0.3) !important;
}
.kpi-active.kpi-green  { box-shadow: 0 0 0 2px #10b981, 0 8px 24px rgba(16,185,129,0.3) !important; }
.kpi-active.kpi-blue   { box-shadow: 0 0 0 2px #3b82f6, 0 8px 24px rgba(59,130,246,0.3) !important; }
.kpi-active.kpi-indigo { box-shadow: 0 0 0 2px #6366f1, 0 8px 24px rgba(99,102,241,0.3) !important; }
.kpi-active.kpi-amber  { box-shadow: 0 0 0 2px #f59e0b, 0 8px 24px rgba(245,158,11,0.3) !important; }

/* ── Row entrance animation ─────────────────────── */
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tr-enter { animation: rowIn .25s ease both; }

/* ── KPI count-up ───────────────────────────────── */
@keyframes kpiPop {
  0%   { transform: scale(.8); opacity: 0; }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1);  opacity: 1; }
}
.kpi-pop { animation: kpiPop .4s cubic-bezier(.34,1.56,.64,1) both; }

/* ── Utility ────────────────────────────────────── */
.hidden { display: none !important; }

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .app { padding: 24px 14px; }
  .form-row { flex-direction: column; }
  .results-header { flex-direction: column; }
  .search-section { padding: 24px 18px; }
  .chat-container { right: 16px; bottom: 16px; }
  .chat-panel { width: calc(100vw - 32px); right: 16px; bottom: 72px; }
  .chat-hint { display: none; }
  .chat-bubble { padding: 12px 16px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 22px; }
}
