/* ─── Shared Component Styles ──────────────────────────────────────────────── */
/* Reusable patterns used across multiple components.                            */
/* Component-specific styles live alongside their component JS files via         */
/* injected <style> blocks or additional CSS files loaded by the orchestrator.  */

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--bdr);
  border-radius: var(--rad);
  overflow: hidden;
}

.card-body {
  padding: 16px 18px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bdr);
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}

.badge-accent   { background: var(--acc-bg);    color: #3730a3; }
.badge-green    { background: var(--green-bg);  color: #065f46; }
.badge-red      { background: var(--red-bg);    color: #991b1b; }
.badge-amber    { background: var(--amber-bg);  color: #92400e; }
.badge-blue     { background: var(--blue-bg);   color: #1e40af; }
.badge-muted    { background: var(--bdr2);      color: var(--muted); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--rad-sm);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
}

.btn:hover { opacity: .88; }

.btn-primary {
  background: var(--acc);
  color: #fff;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--bdr);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--acc);
  color: var(--acc);
  opacity: 1;
}

/* ── Skeleton loading ───────────────────────────────────────────────────────── */
.skeleton-line {
  height: 12px;
  background: var(--bdr);
  border-radius: 4px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-line + .skeleton-line {
  margin-top: 8px;
}

.skeleton-line.wide   { width: 75%; }
.skeleton-line.medium { width: 55%; }
.skeleton-line.narrow { width: 35%; }

.skeleton-block {
  background: var(--surface);
  border: 1px solid var(--bdr);
  border-radius: var(--rad);
  padding: 16px;
  margin-bottom: 10px;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1;  }
  50%       { opacity: .4; }
}

/* ── Empty state ────────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  color: var(--dim);
  font-size: 13px;
  text-align: center;
  gap: 6px;
}

.empty-state-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

/* ── Error state ────────────────────────────────────────────────────────────── */
.error-state {
  background: var(--red-bg);
  border: 1px solid #fca5a5;
  border-radius: var(--rad);
  padding: 12px 16px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── KPI cell ───────────────────────────────────────────────────────────────── */
.kpi-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--txt);
}

.kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--dim);
}

/* ── Divider ────────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--bdr);
  margin: 12px 0;
}

/* ── Dot indicator ──────────────────────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.green  { background: var(--green); }
.status-dot.amber  { background: var(--amber); }
.status-dot.red    { background: var(--red);   }
.status-dot.muted  { background: var(--bdr);   }

/* ── Signal type label (shared: used in TODAY + PIPELINE) ───────────────────── */
.signal-type-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--dim);
}

/* ── Intelligence Search Overlay ────────────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 23, 42, .55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  backdrop-filter: blur(2px);
}

.search-overlay.open {
  display: flex;
}

.search-modal {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: var(--rad);
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}

/* Modal header — search input row */
.search-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--txt);
  background: none;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--dim);
  font-weight: 400;
}

.search-esc-btn {
  background: var(--bdr2);
  border: 1px solid var(--bdr);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: background .12s;
}

.search-esc-btn:hover {
  background: var(--bdr);
}

/* Results list */
.search-results {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.search-empty {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--bdr2);
  transition: background .1s;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result:hover,
.search-result.active {
  background: var(--acc-bg);
}

.search-result-main {
  flex: 1;
  min-width: 0;
}

.search-result-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.search-type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  flex-shrink: 0;
}

.search-result-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-tab-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bdr2);
  border-radius: 4px;
  padding: 2px 7px;
}

.search-arrow {
  font-size: 16px;
  color: var(--dim);
  line-height: 1;
}

/* Footer — keyboard hints */
.search-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  border-top: 1px solid var(--bdr);
  flex-shrink: 0;
  background: var(--bg);
}

.search-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--dim);
}

.search-hint kbd {
  background: #fff;
  border: 1px solid var(--bdr);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: inherit;
  color: var(--muted);
  box-shadow: 0 1px 0 var(--bdr);
}
