/* =====================================================================
   Prospect Console — utilitarian data-console theme
   ===================================================================== */
:root {
  --bg:        #0d0f14;
  --bg-2:      #12151c;
  --panel:     #161a23;
  --panel-2:   #1b2029;
  --line:      #262c39;
  --line-2:    #323a4b;
  --fg:        #e7ebf2;
  --fg-dim:    #aeb6c4;
  --mut:       #6b7384;
  --acc:       #4d7cff;
  --acc-dim:   #2c4488;
  --ok:        #38c172;
  --warn:      #f0a020;
  --err:       #ff5d5d;
  --radius:    10px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, #16203a33, transparent 60%),
    var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acc); text-decoration: none; }
button { font-family: inherit; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--fg); font-size: 13px; cursor: pointer;
  transition: background .12s, border-color .12s, transform .04s;
}
.btn:hover { background: #232a37; border-color: #3c465a; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); border-color: #4a2a2f; }
.btn.danger:hover { background: #2a1a1d; }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  font-family: inherit; font-size: 13px; color: var(--fg);
  background: #0e1117; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px 10px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); }
label.fld { display:block; font-size:12px; color:var(--mut); margin: 10px 0 4px; }

/* ---- login ---- */
#login-view {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}
#login-card {
  width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 30px;
}
#login-card h1 { margin: 0 0 2px; font-size: 22px; letter-spacing: -.02em; }
#login-card p { margin: 0 0 22px; color: var(--mut); font-size: 13px; }
#login-card input { width: 100%; margin-bottom: 10px; }
#login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
#login-error { color: var(--err); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---- app shell ---- */
#app-view { display: none; min-height: 100vh; }
header.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: var(--bg-2); position: sticky; top: 0; z-index: 30;
}
.brand { font-weight: 700; letter-spacing: -.02em; font-size: 16px; }
.brand .dot { color: var(--acc); }
nav.tabs { display: flex; gap: 4px; }
nav.tabs button {
  background: transparent; border: 0; color: var(--fg-dim); padding: 8px 12px;
  border-radius: 8px; cursor: pointer; font-size: 13px;
}
nav.tabs button.active { background: var(--panel-2); color: var(--fg); }
nav.tabs button:hover { color: var(--fg); }
.spacer { flex: 1; }
.whoami { font-size: 12.5px; color: var(--mut); }
.whoami b { color: var(--fg-dim); font-weight: 600; }
.badge {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  background: var(--acc-dim); color: #cfe; padding: 2px 6px; border-radius: 5px; margin-left: 6px;
}

main { padding: 18px; max-width: 1500px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

/* ---- contact totals banner ---- */
.banner {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.banner .big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.banner .lbl { color: var(--mut); font-size: 13px; }

/* ---- filter bar ---- */
.filterbar {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.searchrow { display: flex; gap: 10px; margin-bottom: 12px; }
.searchrow input.search { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 5px 6px 5px 11px; font-size: 12.5px;
}
.chip .k { color: var(--mut); }
.chip .mode { color: var(--warn); font-style: italic; }
.chip .mode.none { color: var(--err); }
.chip .v { color: var(--fg); }
.chip .x { cursor: pointer; color: var(--mut); border:0; background:transparent; font-size:14px; line-height:1; padding:0 4px; }
.chip .x:hover { color: var(--err); }
.toolrow { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:12px; }
.toolrow .grp { display:flex; gap:6px; align-items:center; }
.cont-btn { padding:4px 9px; font-size:12px; border-radius:999px; border:1px solid var(--line-2); background:transparent; color:var(--fg-dim); cursor:pointer; }
.cont-btn:hover { border-color: var(--acc); color: var(--fg); }
.cont-btn.on { background: var(--acc-dim); border-color: var(--acc); color:#dde9ff; }
.tri { display:inline-flex; border:1px solid var(--line-2); border-radius:8px; overflow:hidden; }
.tri button { background:transparent; border:0; color:var(--mut); padding:5px 9px; font-size:12px; cursor:pointer; }
.tri button.on { background: var(--panel-2); color: var(--fg); }

/* ---- results ---- */
.resulthead { display:flex; align-items:center; gap:14px; margin: 4px 0 10px; flex-wrap:wrap; }
.matched { font-size: 13px; color: var(--fg-dim); }
.matched b { color: var(--fg); }
.cap-note { color: var(--warn); font-size: 12px; }
.tablewrap { overflow:auto; border:1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.grid { width:100%; border-collapse: collapse; font-size: 12.5px; }
table.grid th {
  position: sticky; top: 0; background: var(--panel-2); color: var(--mut);
  text-align: left; font-weight: 600; padding: 9px 11px; white-space: nowrap;
  border-bottom: 1px solid var(--line); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
}
table.grid td { padding: 8px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 280px; overflow:hidden; text-overflow: ellipsis; }
table.grid tr:hover td { background: #181d27; }
table.grid a { color: var(--acc); }
.pager { display:flex; align-items:center; gap:10px; margin-top: 12px; }
.pager .info { color: var(--mut); font-size: 12.5px; }

/* ---- panels / cards ---- */
.card { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 15px; letter-spacing: -.01em; }
.card h2 .sub { color: var(--mut); font-weight: 400; font-size: 12px; margin-left: 8px; }
.row2 { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 26px; text-align:center;
  color: var(--mut); cursor: pointer; transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--acc); background: #131826; color: var(--fg-dim); }

/* progress */
.prog { height: 7px; background: #0e1117; border-radius: 999px; overflow:hidden; border:1px solid var(--line); }
.prog > i { display:block; height:100%; background: linear-gradient(90deg,var(--acc),#7aa0ff); width:0; transition: width .4s; }
.statepill { font-size: 11px; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.s-queued{ background:#23304a; color:#9cc0ff;} .s-processing{ background:#2b3a22; color:#bfe89a;}
.s-completed{ background:#1e3a2c; color:#7ee0a8;} .s-failed{ background:#3a1f22; color:#ff9a9a;}
.s-canceled{ background:#2c2c34; color:#b9bfca;}

/* modal */
.modal-bg { position: fixed; inset:0; background: rgba(4,6,10,.66); display:grid; place-items:center; z-index: 60; padding: 18px; }
.modal { width:100%; max-width: 520px; background: var(--panel); border:1px solid var(--line-2); border-radius: 14px; padding: 22px; }
.modal h3 { margin:0 0 4px; font-size: 17px; }
.modal p.hint { margin: 0 0 14px; color: var(--mut); font-size: 12.5px; }
.modal textarea { width:100%; min-height: 96px; resize: vertical; }
.modal .actions { display:flex; gap:10px; justify-content:flex-end; margin-top: 16px; }
.popover { position:absolute; z-index:50; background: var(--panel); border:1px solid var(--line-2); border-radius: 12px; padding: 16px; width: 320px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }

/* toast */
#toasts { position: fixed; right: 16px; bottom: 16px; display:flex; flex-direction:column; gap:8px; z-index: 80; }
.toast { background: var(--panel-2); border:1px solid var(--line-2); border-left-width:3px; padding: 10px 14px; border-radius: 9px; font-size: 13px; max-width: 340px; }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.info { border-left-color: var(--acc); }

.tag-input { display:flex; flex-wrap:wrap; gap:5px; align-items:center; padding:5px; min-height: 36px; }
.tag-input .tag { background: var(--acc-dim); color:#dde9ff; border-radius: 6px; padding: 2px 6px; font-size: 12px; display:inline-flex; gap:5px; align-items:center; }
.tag-input .tag b { cursor:pointer; }
.tag-input input { border:0; background:transparent; flex:1; min-width: 90px; padding: 3px; }
datalist { color: #000; }

.muted { color: var(--mut); }
.right { text-align: right; }
.flex { display:flex; gap:10px; align-items:center; }
.wrap-gap { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
small.k { color: var(--mut); }
