/* ══════════════════════════════════════════════════════════════════════════
   importer-monitor.css  —  Importer Monitor page specific styles
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Stat chips ── */
.stat-chips {
  display: flex; gap: 0.65rem; flex-wrap: wrap;
  margin-bottom: 1rem; position: relative; z-index: 1;
}
.stat-chip {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.55rem 1rem;
  display: flex; flex-direction: column; gap: 0.15rem;
  flex: 1; min-width: 90px;
}
.stat-chip-n {
  font-size: 1.35rem; font-weight: 700;
  font-family: 'DM Mono', monospace; line-height: 1;
  color: var(--text);
}
.stat-chip-n.green  { color: var(--green); }
.stat-chip-n.amber  { color: var(--amber); }
.stat-chip-n.accent { color: var(--accent2); }
.stat-chip-l {
  font-size: 0.67rem; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted);
}

/* ── Log viewer ── */
.card-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-dim); margin: 0 0 1.1rem;
}
.log-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.85rem; position: relative; z-index: 1; }
.log-tab {
  padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
  border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--text-dim); cursor: pointer; transition: all 0.18s; font-family: inherit;
}
.log-tab:hover  { border-color: rgba(88,101,242,0.4); color: var(--text); }
.log-tab.active { background: rgba(88,101,242,0.18); border-color: rgba(88,101,242,0.45); color: #a8b4ff; }
.log-wrap {
  background: rgba(0,0,0,0.5); border: 1px solid rgba(88,101,242,0.12);
  border-radius: 12px; overflow: hidden; position: relative; z-index: 1;
}
.log-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.85rem; border-bottom: 1px solid rgba(88,101,242,0.1);
  background: rgba(0,0,0,0.2); gap: 0.5rem; flex-wrap: wrap;
}
.log-search {
  flex: 1; min-width: 140px; max-width: 260px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(88,101,242,0.18);
  border-radius: 7px; padding: 0.3rem 0.7rem; color: var(--text);
  font-size: 0.77rem; outline: none; font-family: inherit; transition: border-color 0.2s;
}
.log-search:focus            { border-color: rgba(88,101,242,0.45); }
.log-search::placeholder     { color: var(--text-muted); }
.log-body {
  padding: 0.6rem 0.85rem;
  font-family: 'DM Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.74rem; line-height: 1.65; color: #8899cc;
  max-height: 360px; overflow-y: auto; word-break: break-all;
}
.log-body::-webkit-scrollbar       { width: 4px; }
.log-body::-webkit-scrollbar-track { background: transparent; }
.log-body::-webkit-scrollbar-thumb { background: rgba(88,101,242,0.2); border-radius: 2px; }
.ll          { display: flex; gap: 0.4rem; padding: 0.05rem 0; }
.ll.hidden   { display: none; }
.ll-prompt   { color: rgba(124,92,252,0.45); flex-shrink: 0; user-select: none; }
.ll-ts       { color: var(--text-muted); font-size: 0.69rem; flex-shrink: 0; user-select: none; white-space: nowrap; }
.ll-body     { flex: 1; }
.lc-success  { color: var(--green); }
.lc-error    { color: var(--red); }
.lc-warn     { color: var(--amber); }
.lc-info     { color: #5865f2; }
.lc-match    { color: #a8d8ff; }
.lc-dim      { color: var(--text-muted); }
.lc-default  { color: #8899cc; }
.log-empty   { padding: 2rem; text-align: center; color: var(--text-dim); font-size: 0.83rem; font-style: italic; }

/* ── Two-column layout ── */
.im-two-col {
  display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; align-items: start;
}
.im-two-col .card { margin-bottom: 0; }

/* ── Active jobs ── */
.jobs-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; position: relative; z-index: 1;
}
.job-pills     { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.im-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.65rem; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; border: 1px solid;
}
.pill-running { background: rgba(52,211,153,0.08);  border-color: rgba(52,211,153,0.25); color: var(--green); }
.pill-queued  { background: rgba(251,191,36,0.08);  border-color: rgba(251,191,36,0.25); color: var(--amber); }
.pill-dot     { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pill-dot.pulse { animation: dotpulse 1.4s ease-in-out infinite; }
@keyframes dotpulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.refresh-ts {
  font-size: 0.72rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.4rem;
}
.refresh-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: dotpulse 2s ease-in-out infinite; flex-shrink: 0;
}
.refresh-live.live { background: var(--green); }
.jobs-list     { display: flex; flex-direction: column; gap: 0.5rem; position: relative; z-index: 1; }
.job-row {
  display: flex; align-items: center; gap: 0.85rem;
  background: rgba(255,255,255,0.025); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.65rem 0.9rem;
}
.job-row.running { border-color: rgba(52,211,153,0.18); background: rgba(52,211,153,0.04); }
.job-row.queued  { opacity: 0.7; }
.job-row.dead    { opacity: 0.38; }
.job-status-dot         { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.job-status-dot.running { background: var(--green); box-shadow: 0 0 7px rgba(52,211,153,0.5); animation: dotpulse 1.4s ease-in-out infinite; }
.job-status-dot.queued  { background: var(--amber); box-shadow: 0 0 5px rgba(251,191,36,0.4); }
.job-status-dot.dead    { background: rgba(255,255,255,0.15); }
.job-info          { flex: 1; min-width: 0; }
.job-name          { font-size: 0.86rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-meta          { font-size: 0.71rem; color: var(--text-muted); margin-top: 0.1rem; }
.job-badge         { font-family: 'DM Mono', monospace; font-size: 0.65rem; font-weight: 500; padding: 0.15rem 0.5rem; border-radius: 20px; border: 1px solid; flex-shrink: 0; }
.job-badge.running { background: rgba(52,211,153,0.1);  border-color: rgba(52,211,153,0.28); color: var(--green); }
.job-badge.queued  { background: rgba(251,191,36,0.1);  border-color: rgba(251,191,36,0.28); color: var(--amber); }
.job-badge.dead    { background: rgba(100,115,148,0.1); border-color: rgba(100,115,148,0.2);  color: var(--text-dim); }
.no-jobs           { text-align: center; padding: 2rem; color: var(--text-dim); font-size: 0.88rem; }
.no-jobs .idle-icon{ font-size: 2rem; display: block; margin-bottom: 0.5rem; opacity: 0.4; }
.spinner-sm { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(88,101,242,0.3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Expand button */
.jobs-expand-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.45rem;
  width: 100%; padding: 0.5rem; border-radius: var(--radius-xs);
  border: 1px dashed rgba(255,255,255,0.09); background: transparent;
  color: var(--text-muted); font-size: 0.76rem; font-family: 'DM Sans', inherit;
  cursor: pointer; transition: all 0.18s; margin-top: 0.35rem;
  font-weight: 600; position: relative; z-index: 1;
}
.jobs-expand-btn:hover { border-color: rgba(251,191,36,0.3); color: var(--amber); background: rgba(251,191,36,0.04); }
.jobs-expand-btn .expand-arrow { transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1); font-size: 0.7rem; }
.jobs-expand-btn.open .expand-arrow { transform: rotate(180deg); }

/* ── Import history ── */
.history-row     { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.55rem; }
.history-row:last-child { margin-bottom: 0; }
.history-row-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.history-name    { font-size: 0.82rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.history-pct     { font-family: 'DM Mono', monospace; font-size: 0.75rem; font-weight: 500; flex-shrink: 0; min-width: 32px; text-align: right; }
.match-bar       { height: 3px; background: rgba(255,255,255,0.07); border-radius: 2px; overflow: hidden; }
.match-fill      { height: 100%; border-radius: 2px; }
.match-fill.good { background: var(--green); }
.match-fill.mid  { background: var(--amber); }
.match-fill.low  { background: var(--red); }
.history-meta    { font-size: 0.67rem; color: var(--text-muted); }

/* ── Threshold ── */
.threshold-row {
  display: flex; align-items: center; gap: 0.75rem;
  flex-wrap: wrap; position: relative; z-index: 1;
}
.threshold-label       { font-size: 0.72rem; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.threshold-slider-wrap { flex: 1; display: flex; align-items: center; gap: 0.65rem; min-width: 120px; }
input[type=range]  { flex: 1; accent-color: var(--accent); cursor: pointer; }
.slider-val        { font-family: 'DM Mono', monospace; font-size: 0.82rem; font-weight: 700; color: var(--accent2); min-width: 38px; text-align: right; }

/* ── cfg-notice ── */
.cfg-notice { display: none; position: fixed; inset: 0; z-index: 800; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); align-items: center; justify-content: center; }
.cfg-notice.show { display: flex; }
.cfg-notice-card {
  background: linear-gradient(145deg,#13131f,#0f0f1a); border: 1px solid rgba(88,101,242,0.35);
  border-radius: var(--radius); padding: 2rem 2.25rem; max-width: 420px; width: 90%;
  text-align: center; animation: cfgNoticeIn 0.3s cubic-bezier(.16,1,.3,1) both;
}
@keyframes cfgNoticeIn { from{transform:scale(0.92);opacity:0} to{transform:scale(1);opacity:1} }
.cfg-notice-icon  { font-size: 2.5rem; margin-bottom: 0.75rem; }
.cfg-notice-title { font-size: 1.05rem; font-weight: 800; color: var(--text); margin-bottom: 0.5rem; }
.cfg-notice-body  { font-size: 0.84rem; color: var(--text-dim); line-height: 1.55; margin: 0 0 1.25rem; }
.cfg-notice-body a       { color: #a8b4ff; text-decoration: none; }
.cfg-notice-body a:hover { text-decoration: underline; }
.cfg-notice-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  padding: 0.65rem 1rem; border-radius: 10px; border: 1px solid rgba(88,101,242,0.4);
  background: rgba(88,101,242,0.15); color: #a8b4ff;
  font-size: 0.88rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.cfg-notice-btn:hover { background: rgba(88,101,242,0.25); border-color: rgba(88,101,242,0.65); }

/* ── Responsive ── */
@media(max-width:760px) {
  .im-two-col { grid-template-columns: 1fr; }
  .stat-chips { gap: 0.4rem; }
  .stat-chip  { min-width: 70px; }
}
@media(max-width:600px) {
  body { padding: 1rem 0.5rem 3rem; }
  .card { padding: 1rem; border-radius: 14px; }
  .log-body { font-size: 0.69rem; max-height: 320px; }
}
@media(max-width:540px) {
  body { padding-left: 0.65rem; padding-right: 0.65rem; }
}

/* ── Log toolbar button group ── */
.log-toolbar-btns { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
