/* ════════════════════════════════════════════════════════════════════
 * Invoiso — Gmail invoice AUTO-FIND UI styles (2026-08)
 * Matches the redesign-2026-06 visual language (pills, cards, tokens).
 * ════════════════════════════════════════════════════════════════════ */

/* toolbar button */
.inv-af-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px; margin-left: 8px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border: 1px solid transparent; border-radius: 11px;
  cursor: pointer; transition: all .14s ease;
  box-shadow: 0 6px 14px -6px rgba(124, 58, 237, .55);
}
.inv-af-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.inv-af-btn:hover { filter: brightness(1.08); }
.inv-af-btn.is-busy {
  background: #eef2f7; color: #475569; box-shadow: none;
  border-color: #e7ecf3; cursor: progress;
}
.inv-af-btn.is-busy svg { animation: invAfSpin 1.1s linear infinite; }
@keyframes invAfSpin { to { transform: rotate(360deg); } }

/* review-queue chip */
.inv-af-queue {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px; margin-left: 8px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  color: #92400e; background: #fef3c7;
  border: 1px solid #fde68a; border-radius: 11px;
  cursor: pointer; transition: all .14s ease;
}
.inv-af-queue:hover { background: #fde68a; }
.inv-af-qcount {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  font-size: 11px; font-weight: 800; line-height: 1;
  color: #fff; background: #f59e0b; border-radius: 999px;
}

/* toast */
#inv-af-toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 100000;
  max-width: 420px; padding: 12px 16px; border-radius: 10px;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
#inv-af-toast.is-ok { background: #dcfce7; color: #14532d; }
#inv-af-toast.is-error { background: #fee2e2; color: #991b1b; }

/* modal */
#inv-af-modal { position: fixed; inset: 0; z-index: 99998; }
#inv-af-modal .inv-af-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}
#inv-af-modal .inv-af-panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(860px, calc(100vw - 32px)); max-height: min(80vh, 720px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .3);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.inv-af-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #e7ecf3;
  font-size: 15px; color: #0f172a;
}
.inv-af-headbtns { display: flex; align-items: center; gap: 8px; }
.inv-af-all {
  height: 32px; padding: 0 13px; border: none; border-radius: 9px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
  color: #fff; background: #16a34a;
  box-shadow: 0 3px 9px -5px rgba(22, 163, 74, .7);
  transition: background .14s ease;
}
.inv-af-all:hover:not(:disabled) { background: #15803d; }
.inv-af-all:disabled { background: #cbd5e1; color: #64748b; cursor: progress; box-shadow: none; }

.inv-af-x {
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: #f1f5f9; color: #475569; font-size: 14px; cursor: pointer;
}
.inv-af-x:hover { background: #e2e8f0; }
.inv-af-body { overflow-y: auto; padding: 14px 20px 20px; }
.inv-af-empty { padding: 40px 0; text-align: center; color: #64748b; font-size: 14px; }

/* candidate card */
.inv-af-card {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: center;
  padding: 13px 14px; margin-bottom: 10px;
  border: 1px solid #e7ecf3; border-radius: 12px; background: #fbfdff;
  transition: opacity .25s ease, transform .25s ease;
}
.inv-af-card.is-busy { opacity: .55; pointer-events: none; }
.inv-af-card.is-done { opacity: 0; transform: translateX(24px); }
.inv-af-date { font-size: 12px; color: #64748b; margin-bottom: 2px; }
.inv-af-desc { font-size: 13px; font-weight: 600; color: #0f172a; word-break: break-word; }
.inv-af-amt { margin-top: 3px; font-size: 13px; font-weight: 800; color: #dc2626; font-variant-numeric: tabular-nums; }
.inv-af-file { font-size: 13px; margin-bottom: 3px; }
.inv-af-file a { color: #1f7ae0; font-weight: 600; text-decoration: none; word-break: break-all; }
.inv-af-file a:hover { text-decoration: underline; }
.inv-af-mail { font-size: 12px; color: #64748b; word-break: break-word; margin-bottom: 3px; }
.inv-af-why {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: #92400e; background: #fef3c7; border-radius: 6px; padding: 2px 8px;
}
.inv-af-actions { display: flex; flex-direction: column; gap: 7px; }
.inv-af-ok, .inv-af-no {
  height: 32px; padding: 0 14px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.inv-af-ok { color: #fff; background: #16a34a; }
.inv-af-ok:hover { background: #15803d; }
.inv-af-no { color: #475569; background: #fff; border-color: #e2e8f0; }
.inv-af-no:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

@media (max-width: 640px) {
  .inv-af-card { grid-template-columns: 1fr; }
  .inv-af-actions { flex-direction: row; }
}
