/* ══════════════════════════════════════════════════════════════
   search.css
   Quick search overlay.
   ══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   QUICK SEARCH  (Ctrl/⌘ + K) — jump to any job, invoice, sale or page
   ═══════════════════════════════════════════════════════════════ */
.sb-search {
  display: flex; align-items: center; gap: 10px; width: calc(100% - 28px);
  margin: 0 14px 12px; padding: 8px 11px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.66); font-family: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background .14s, border-color .14s, color .14s;
}
.sb-search i { font-size: 16px; flex-shrink: 0; }
.sb-search:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.26); color: #fff; }
.sb-search .sb-kbd {
  margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  background: rgba(255,255,255,.13); border-radius: 5px; padding: 1px 6px;
}
body.sb-collapsed .sb-search { width: auto; margin: 0 10px 12px; padding: 9px; justify-content: center; }

.qs-overlay {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
  background: rgba(17,20,45,.46); backdrop-filter: blur(4px);
}
.qs-overlay.open { display: flex; }
.qs-panel {
  width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.3); overflow: hidden;
  display: flex; flex-direction: column; max-height: 72vh; animation: slideUp .18s ease;
}
.qs-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.qs-input-wrap > i { font-size: 19px; color: var(--text-muted); flex-shrink: 0; }
.qs-input-wrap input {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  font-family: inherit; font-size: 15px; color: var(--text); padding: 0;
}
.qs-esc {
  border: 1px solid var(--border); background: var(--bg); color: var(--text-muted);
  font-family: inherit; font-size: 10.5px; font-weight: 700; padding: 3px 8px;
  border-radius: 6px; cursor: pointer; flex-shrink: 0;
}
.qs-esc:hover { color: var(--text); border-color: var(--text-muted); }

.qs-results { flex: 1; overflow-y: auto; padding: 6px; min-height: 0; }
.qs-group {
  font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); padding: 10px 10px 5px;
}
.qs-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 9px 10px; border: none; border-radius: 9px; background: none;
  font-family: inherit; cursor: pointer; color: var(--text);
}
.qs-item:hover, .qs-item.sel { background: var(--bg); }
.qs-item.sel { box-shadow: inset 0 0 0 1px var(--cs-accent); }
.qs-ico {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--cs-accent); font-size: 15px;
}
.qs-item.sel .qs-ico { background: var(--cs-accent); color: #fff; }
.qs-mid { flex: 1; min-width: 0; display: block; }
.qs-title { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-sub { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-tag { font-size: 10px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.qs-empty { text-align: center; padding: 34px 12px; color: var(--text-muted); font-size: 12.5px; }

.qs-foot {
  display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--border);
  background: var(--bg); font-size: 10.5px; color: var(--text-muted); flex-shrink: 0;
}
.qs-foot span { display: flex; align-items: center; gap: 4px; }
.qs-foot kbd {
  font-family: inherit; font-size: 10px; font-weight: 700; background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text-secondary);
}
@media (max-width: 640px) { .qs-overlay { padding: 8vh 10px 10px; } .qs-foot { display: none; } }
