/* ============================================================
   FalcoHRMS — Shared component CSS
   Modals, toasts, spinners, empty states
   ============================================================ */

/* ANNOUNCEMENT SPOTLIGHT BANNER */
.falco-announce-banner {
  margin: 1rem 1.5rem 0;
  border-radius: var(--radius-lg, 12px);
  /* Fallbacks first for browsers without color-mix() */
  background: var(--gp-primary-light, #E6F7F4);
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--gp-primary) 14%, var(--gp-card-bg)),
    var(--gp-card-bg) 70%);
  border: 1px solid var(--gp-primary, #0ab39c);
  border-color: color-mix(in srgb, var(--gp-primary) 35%, var(--gp-border-color));
  box-shadow: var(--shadow-2, 0 4px 14px rgba(0,0,0,.07));
  overflow: hidden;
  animation: fhAnnounceIn .4s cubic-bezier(.2,.8,.2,1);
}
.falco-announce-banner.leaving { animation: fhAnnounceOut .3s ease forwards; }
@keyframes fhAnnounceIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fhAnnounceOut { to { opacity: 0; transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .falco-announce-banner { animation: none; } }

.fab-row { display: flex; align-items: flex-start; gap: .9rem; padding: .9rem 1.1rem; }
.fab-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px;
  display: grid; place-items: center; font-size: 19px; color: #fff;
  background: linear-gradient(135deg, var(--gp-primary), #15b6a0);
}
.fab-body { flex: 1; min-width: 0; }
.fab-eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--gp-primary); display: flex; align-items: center; gap: .4rem;
}
.fab-title { font-weight: 700; font-size: 14.5px; color: var(--gp-heading); margin: 1px 0; }
.fab-text { font-size: 13px; color: var(--gp-text); line-height: 1.45; }
.fab-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.fab-nav {
  background: transparent; border: 1px solid var(--gp-border-color); color: var(--gp-text-muted);
  width: 28px; height: 28px; border-radius: 7px; cursor: pointer; display: grid; place-items: center;
}
.fab-nav:hover:not(:disabled) { border-color: var(--gp-primary); color: var(--gp-primary); }
.fab-nav:disabled { opacity: .4; cursor: not-allowed; }
.fab-count { font-size: 11px; color: var(--gp-text-muted); min-width: 30px; text-align: center; }
.fab-close {
  background: transparent; border: none; color: var(--gp-text-muted); cursor: pointer;
  width: 28px; height: 28px; border-radius: 7px; font-size: 18px; line-height: 1; display: grid; place-items: center;
}
.fab-close:hover { background: var(--gp-bg-light); color: var(--gp-danger); }
@media (max-width: 640px) { .falco-announce-banner { margin: .75rem; } .fab-row { flex-wrap: wrap; } }

/* PAGINATION (Falco.pager) */
.fh-pager {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
  padding: .75rem 1.25rem; border-top: 1px solid var(--gp-border-color);
  font-size: 13px; color: var(--gp-text-muted);
}
.fh-pager-btns { display: flex; align-items: center; gap: .4rem; }
.fh-pager-page { min-width: 92px; text-align: center; font-weight: 500; color: var(--gp-text); }
.fh-pager-btn {
  width: 32px; height: 32px; border-radius: 7px;
  border: 1px solid var(--gp-border-color); background: var(--gp-card-bg);
  color: var(--gp-text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s;
}
.fh-pager-btn:hover:not(:disabled) { border-color: var(--gp-primary); color: var(--gp-primary); }
.fh-pager-btn:disabled { opacity: .4; cursor: not-allowed; }

/* MODAL */
.fh-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1050; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
  padding: 1rem;
}
.fh-modal-backdrop.show { display: flex; }
.fh-modal {
  background: var(--gp-bg, #fff); border-radius: 10px;
  max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fhModalIn 0.2s ease-out;
}
.fh-modal.fh-modal-lg { max-width: 800px; }
.fh-modal.fh-modal-xl { max-width: 1100px; }
@keyframes fhModalIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.fh-modal-header {
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--gp-border-color, #e9ebec);
  display: flex; justify-content: space-between; align-items: center;
}
.fh-modal-header h5 { margin: 0; font-weight: 600; }
.fh-modal-body { padding: 1.5rem; }
.fh-modal-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--gp-border-color, #e9ebec);
  display: flex; justify-content: flex-end; gap: 0.5rem;
  flex-wrap: wrap;
}
.fh-modal-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  color: var(--gp-text-muted, #6b7280); padding: 0; line-height: 1;
}
.fh-modal-close:hover { color: var(--gp-danger, #f06548); }

/* TOAST */
/* The stack is the fixed anchor; toasts flow inside it so concurrent
   messages stack vertically instead of overlapping pixel-for-pixel. */
.fh-toast-stack {
  position: fixed; top: 80px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem;
  pointer-events: none;
}
.fh-toast {
  position: static; pointer-events: auto;
  background: var(--gp-card-bg, #fff); color: var(--gp-text, #495057);
  padding: 0.75rem 2.25rem 0.75rem 1.25rem; border-radius: 8px;
  box-shadow: var(--shadow-3, 0 8px 24px rgba(0,0,0,0.15));
  border-left: 4px solid var(--gp-success, #0ab39c);
  min-width: 280px; max-width: 400px;
  opacity: 0; transform: translateX(100%);
  transition: opacity .25s ease, transform .25s ease;
}
.fh-toast.show { opacity: 1; transform: translateX(0); }
.fh-toast.hide { opacity: 0; transform: translateX(100%); }
.fh-toast.error { border-left-color: var(--gp-danger, #f06548); }
.fh-toast.info { border-left-color: var(--gp-info, #299cdb); }
.fh-toast.warning { border-left-color: var(--gp-warning, #f7b84b); }
@media (prefers-reduced-motion: reduce) { .fh-toast { transition: none; } }

.fh-toast-close {
  position: absolute; top: 6px; right: 8px;
  background: none; border: none; padding: 2px; line-height: 1;
  font-size: 1rem; cursor: pointer;
  color: var(--gp-text-muted, #6b7280);
}
.fh-toast-close:hover { color: var(--gp-heading, #212529); }

/* CONFIRM DIALOG (falco.js v2 contract) */
/* Hidden by default; falco.js toggles .show (same contract as .fh-modal-backdrop).
   Without the default display:none the backdrop stayed on screen forever after
   the first Falco.confirm(), bricking the page. */
.fh-confirm-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1060; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
  padding: 1rem;
}
.fh-confirm-backdrop.show { display: flex; }
.fh-confirm-backdrop[hidden] { display: none; }
.fh-confirm {
  background: var(--gp-card-bg, #fff); color: var(--gp-text, #495057);
  border-radius: var(--radius-lg, 10px);
  width: 100%; max-width: 420px;
  padding: 1.5rem;
  box-shadow: var(--shadow-3, 0 20px 60px rgba(0,0,0,0.3));
  text-align: center;
  animation: fhModalIn 0.2s ease-out;
}
.fh-confirm h5, .fh-confirm .fh-confirm-title {
  margin: 0 0 .35rem; font-weight: 600; font-size: var(--fs-md, 15px);
  color: var(--gp-heading, #212529);
}
.fh-confirm p, .fh-confirm .fh-confirm-message {
  margin: 0 0 1.25rem; font-size: 13px; color: var(--gp-text-muted, #6b7280);
}
.fh-confirm i { font-size: 2rem; line-height: 1; color: var(--gp-primary, #0ab39c); }
.fh-confirm.danger i { color: var(--gp-danger, #f06548); }

.fh-confirm-actions, .fh-confirm-footer {
  display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap;
}

.fh-btn-cancel, .fh-btn-confirm {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 36px; min-width: 88px; padding: .4rem 1rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 13px; font-weight: 500; font-family: inherit; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer; transition: all .2s;
}
.fh-btn-cancel {
  background: transparent; color: var(--gp-text, #495057);
  border-color: var(--gp-border-color, #e9ebec);
}
.fh-btn-cancel:hover { background: var(--gp-bg-light, #f3f3f9); }
.fh-btn-confirm {
  background: var(--gp-primary, #0ab39c); border-color: var(--gp-primary, #0ab39c); color: #fff;
}
.fh-btn-confirm:hover { background: var(--gp-primary-dark, #099885); border-color: var(--gp-primary-dark, #099885); }
.fh-confirm.danger .fh-btn-confirm {
  background: var(--gp-danger, #f06548); border-color: var(--gp-danger, #f06548);
}
.fh-confirm.danger .fh-btn-confirm:hover { filter: brightness(.9); }
.fh-btn-cancel:disabled, .fh-btn-confirm:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* SPINNER */
.fh-loading { text-align: center; padding: 3rem; color: var(--gp-text-muted, #6b7280); }
.fh-spinner {
  display: inline-block; width: 32px; height: 32px;
  border: 3px solid var(--gp-border-color, #e9ebec);
  border-top-color: var(--gp-primary, #0ab39c);
  border-radius: 50%; animation: fhSpin 0.8s linear infinite;
  vertical-align: middle;
}
.fh-spinner-sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes fhSpin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.fh-empty { text-align: center; padding: 3rem; color: var(--gp-text-muted, #6b7280); }
.fh-empty i { font-size: 3rem; opacity: 0.3; }
.fh-empty .fh-empty-title { font-weight: 600; margin-top: .5rem; }

/* Shared markup emitted by Falco.emptyState() / Falco.errorState() — the
   helpers render .fh-empty-state (and .fh-error-state for failures). Global
   so all 22 pages render these states centered and dimmed, not as raw text. */
.fh-empty-state {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  text-align: center; padding: 2.5rem 1rem; color: var(--gp-text-muted, #6b7280);
}
.fh-empty-state i { font-size: 2.5rem; line-height: 1; opacity: .35; }
.fh-empty-state p { margin: 0; font-size: 13px; }
.fh-error-state i { color: var(--gp-danger, #f06548); opacity: .6; }