/* DrivenLeads KPI — contrast iteration (>=3:1 panel separation) + QA fixes
*/
:root{
  --bg: #070b13;            /* page background */
  --panel: #34668b;         /* increased contrast, bg vs panel ~3.21:1 */
  --card: #3b6f95;          /* card surface */
  --text: #ffffff;
  --soft: #cfe0ff;
  --muted: #9aa6c4;
  --border: rgba(255,255,255,0.12);
  --border2: rgba(255,255,255,0.08);
  --accent: #3b7ef5;
  --accent2: #f5a623;
  --glow: rgba(59,126,245,0.20);
  --shadow: 0 28px 90px rgba(2,6,23,0.6);
  --shadow2: 0 12px 36px rgba(2,6,23,0.55);
  --r: 16px;
  --r2: 10px;
  --font: "Plus Jakarta Sans", Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body{ background:var(--bg); color:var(--text); font-family:var(--font); }

/* panels */
.app-header{ border-radius:18px; border:1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); box-shadow:var(--shadow); }
.panel{ border:1px solid var(--border); background: linear-gradient(180deg, var(--panel), var(--card)); box-shadow: var(--shadow2); padding:10px; }

/* stronger separation */
.kpi{ background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); border:1px solid rgba(255,255,255,0.06); }

/* text */
.kpi .n{ font-size:26px; font-weight:900; color:var(--text); }
.kpi .muted{ color:var(--soft); }

/* inputs */
input, select{ background: rgba(255,255,255,0.03); color:var(--text); border:1px solid var(--border2); border-radius:12px; padding:10px 12px; }
input:focus, select:focus{ box-shadow: 0 0 0 8px var(--glow); border-color:var(--accent); }

/* table */
.table-scroll{ border-radius:14px; overflow:auto; border:1px solid var(--border); }
table.terms th{ position:sticky; top:0; background: rgba(52,102,139,0.98); color:var(--muted); }
table.terms td.term{ color:var(--text); }

/* shadows and spacing */
.page-shell{ padding:28px 0 48px; }
.panel{ padding:18px; }
.kpi{ padding:18px; border-radius:14px; }

/* responsive */
@media (max-width:980px){ #kpis{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){ #kpis{ grid-template-columns:1fr; } .controls-grid{ grid-template-columns:1fr; } }
/* Table / search terms layout improvements — reduce 'glued on' feeling */
.table-scroll{
  border-radius:14px;
  overflow:auto;
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding:8px; /* reduce huge whitespace */
}
.terms-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid rgba(255,255,255,0.03);background:transparent;position:sticky;top:0;z-index:3;
}
.terms-tabs{display:flex;gap:10px;align-items:center}
.terms-tabs .ghost{padding:8px 10px;border-radius:10px}
.terms-tabs .ghost.active{border-color: rgba(59,126,245,0.65); box-shadow:0 0 0 6px rgba(59,126,245,0.06); background: rgba(59,126,245,0.03); color:var(--text)}
.terms-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.terms-empty{padding:12px;color:var(--muted);font-size:13px}
.table-scroll table.terms{min-width:760px} /* reduce horizontal empty space when table empty */
.table-scroll td, .table-scroll th{background:transparent}
.table-scroll .terms-toolbar + .terms-empty{padding:18px 14px}
.terms-pager{display:flex;gap:10px;align-items:center}
/* Compact toolbar + inline controls for Search Terms */
.terms-toolbar{ display:grid; grid-template-columns: auto 1fr auto; gap:16px; align-items:center; padding:12px; }
.terms-tabs{ margin:0; }
.terms-tabs .ghost{ padding:8px 10px; border-radius:10px; font-weight:700 }
.terms-actions{ display:flex; align-items:center; gap:10px; justify-self:start; }
.terms-actions select, .terms-actions input{ min-width:120px; width:auto; padding:8px 10px; border-radius:10px; }
.terms-actions .mini{ display:block; font-size:11px; margin-right:6px; color:var(--muted) }
.terms-pager{ justify-self:end; display:flex; gap:10px; align-items:center }
.table-scroll{ padding:10px; }
/* make empty state less lonely */
.terms-empty{ padding:18px; color:var(--muted); font-size:13px }
@media (max-width:980px){
  .terms-toolbar{ grid-template-columns: 1fr; gap:10px; }
  .terms-pager{ justify-self:start }
  .terms-actions{ flex-wrap:wrap }
}
/* inline tab styling moved into section header */
.terms-tabs-inline{ display:flex; gap:10px; align-items:center; }
.terms-tabs-inline .ghost{ padding:8px 10px; border-radius:10px; }
.terms-tabs-inline .ghost.active{ background: rgba(59,126,245,0.06); border-color: rgba(59,126,245,0.6); color:var(--text); }
