/* ═══════════════════════════════════════════════════════════════
   rx-command-palette.css — Command Palette / Spotlight Overlay
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay ───────────────────────────────────────────────── */
.rxcp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: min(18vh, 160px);
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
}
.rxcp-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Container ─────────────────────────────────────────────── */
.rxcp-container {
  width: min(620px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-12px) scale(0.98);
  transition: transform 150ms ease;
}
.rxcp-overlay.open .rxcp-container {
  transform: translateY(0) scale(1);
}

/* ── Search input ──────────────────────────────────────────── */
.rxcp-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.rxcp-input-wrap svg {
  flex-shrink: 0;
  color: #94a3b8;
}
.rxcp-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #1e293b;
  background: transparent;
  font-family: inherit;
}
.rxcp-input::placeholder {
  color: #94a3b8;
}
.rxcp-kbd {
  font-size: 0.7rem;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  font-family: monospace;
  flex-shrink: 0;
}

/* ── Results ───────────────────────────────────────────────── */
.rxcp-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.rxcp-results::-webkit-scrollbar { width: 6px; }
.rxcp-results::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Group header ──────────────────────────────────────────── */
.rxcp-group {
  padding: 0 8px;
}
.rxcp-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 10px 10px 4px;
}

/* ── Result item ───────────────────────────────────────────── */
.rxcp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 8px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: #1e293b;
  transition: background 80ms;
}
.rxcp-item:hover,
.rxcp-item.selected {
  background: #f0fdfa;
}
.rxcp-item.selected {
  outline: 2px solid #0d9488;
  outline-offset: -2px;
}
.rxcp-item-icon {
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f8fafc;
  flex-shrink: 0;
}
.rxcp-item-text {
  flex: 1;
  min-width: 0;
}
.rxcp-item-label {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rxcp-item-detail {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rxcp-item-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  flex-shrink: 0;
  text-transform: capitalize;
}
.rxcp-item-badge[data-type="customer"] { background: #eff6ff; color: #2563eb; }
.rxcp-item-badge[data-type="product"]  { background: #f0fdf4; color: #16a34a; }
.rxcp-item-badge[data-type="vendor"]   { background: #fefce8; color: #ca8a04; }
.rxcp-item-badge[data-type="receipt"]  { background: #fdf2f8; color: #db2777; }
.rxcp-item-badge[data-type="action"]   { background: #f0fdfa; color: #0d9488; }
.rxcp-item-badge[data-type="page"]     { background: #f8fafc; color: #475569; }

/* ── Favorite star ─────────────────────────────────────────── */
.rxcp-fav {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 1rem;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 100ms;
  padding: 0;
}
.rxcp-fav:hover { color: #f59e0b; }
.rxcp-fav.is-fav { color: #f59e0b; }

/* ── Footer ────────────────────────────────────────────────── */
.rxcp-footer {
  display: flex;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.72rem;
  color: #94a3b8;
  flex-shrink: 0;
}
.rxcp-footer span { display: flex; align-items: center; gap: 4px; }
.rxcp-footer kbd {
  font-size: 0.65rem;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  font-family: monospace;
}

/* ── Empty / loading ───────────────────────────────────────── */
.rxcp-empty {
  text-align: center;
  padding: 32px 16px;
  color: #94a3b8;
  font-size: 0.88rem;
}
.rxcp-loading {
  text-align: center;
  padding: 24px 16px;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* ── Section tabs (Favorites / Recents toggle) ─────────────── */
.rxcp-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 16px 0;
}
.rxcp-tab {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 100ms, color 100ms;
}
.rxcp-tab:hover { background: #f1f5f9; }
.rxcp-tab.active { background: #0f766e; color: #fff; }

/* ── Dark theme support ────────────────────────────────────── */
[data-theme="dark"] .rxcp-container,
[data-theme="midnight"] .rxcp-container {
  background: #1e293b;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
}
[data-theme="dark"] .rxcp-input,
[data-theme="midnight"] .rxcp-input {
  color: #e2e8f0;
}
[data-theme="dark"] .rxcp-item,
[data-theme="midnight"] .rxcp-item {
  color: #e2e8f0;
}
[data-theme="dark"] .rxcp-item:hover,
[data-theme="dark"] .rxcp-item.selected,
[data-theme="midnight"] .rxcp-item:hover,
[data-theme="midnight"] .rxcp-item.selected {
  background: rgba(13,148,136,0.15);
}
[data-theme="dark"] .rxcp-input-wrap,
[data-theme="dark"] .rxcp-footer,
[data-theme="midnight"] .rxcp-input-wrap,
[data-theme="midnight"] .rxcp-footer {
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .rxcp-group-label,
[data-theme="midnight"] .rxcp-group-label {
  color: #64748b;
}
[data-theme="dark"] .rxcp-item-detail,
[data-theme="midnight"] .rxcp-item-detail {
  color: #94a3b8;
}
[data-theme="dark"] .rxcp-item-icon,
[data-theme="midnight"] .rxcp-item-icon {
  background: rgba(255,255,255,0.05);
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .rxcp-overlay { padding-top: 16px; }
  .rxcp-container { width: calc(100vw - 16px); max-height: calc(100vh - 32px); border-radius: 12px; }
  .rxcp-footer { display: none; }
}
