/* CRMG LOS runtime styles — offline font fallbacks + data toolbar + importer */

/* The original CSS asks for the Geist webfont (CDN). Offline we fall back to
   the OS UI font and a system monospace so nothing looks broken. */
:root {
  --font-sans-fallback: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono-fallback: ui-monospace, "Cascadia Code", "Consolas", "Courier New", monospace;
}
body, .input, .select, button, textarea {
  font-family: var(--font-sans-fallback);
}
.badge-mono, .num, [style*="Geist Mono"] {
  font-family: var(--font-mono-fallback) !important;
}

/* ---- NexLoan brand wordmark ---- */
.nexloan-mark { height: 22px; display: block; }
.nexloan-mark svg { height: 100%; width: auto; display: block; }
.nexloan-mark-lg { height: 30px; }
.sb-brand-nexloan {
  flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px;
}
[data-theme="dark"] .nexloan-mark svg { filter: brightness(1.35) saturate(1.1); }

/* ---- data toolbar (bottom-left) ---- */
.sb-data { padding: 8px 10px; border-top: 1px solid var(--border); }
.sb-data-title { font: 600 10px/1 var(--font-sans-fallback); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 2px 2px 7px; }
.sb-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.sb-data-btn {
  appearance: none; display: inline-flex; align-items: center; gap: 5px; justify-content: center;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--ink-1);
  font: 500 11px var(--font-sans-fallback); padding: 6px 8px; border-radius: 7px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-data-btn:hover { background: var(--bg-sunken); }
.sb-data-btn.sb-data-danger { grid-column: 1 / -1; color: var(--danger); }
.sb-data-btn.sb-data-danger:hover { background: var(--danger-soft); }

/* ---- CSV / XLSX import dialog ---- */
.crmg-imp-overlay {
  position: fixed; inset: 0; z-index: 2147483646;
  background: rgba(15,20,30,0.45);
  display: flex; align-items: center; justify-content: center;
}
.crmg-imp {
  width: 620px; max-width: 92vw; max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  font-family: var(--font-sans-fallback);
}
.crmg-imp-hd { padding: 16px 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid #eef1f5; }
.crmg-imp-bd { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.crmg-imp-bd select { padding: 5px 8px; border-radius: 7px; border: 1px solid #cbd2dc; }
.crmg-imp-note { font-size: 12px; color: #5a6472; line-height: 1.5; margin: 0; }
.crmg-imp-prev { font-size: 12px; color: #333; }
.crmg-imp-count { font-weight: 600; margin-bottom: 6px; color: #1f7a3d; }
.crmg-imp-prev table { width: 100%; border-collapse: collapse; }
.crmg-imp-prev th, .crmg-imp-prev td {
  border: 1px solid #e6e9ee; padding: 4px 8px; text-align: left;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crmg-imp-prev th { background: #f6f8fa; font-weight: 600; }
.crmg-imp-ft { padding: 14px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #eef1f5; }
.crmg-imp-ft button {
  padding: 8px 16px; border-radius: 8px; border: 1px solid #cbd2dc;
  background: #fff; cursor: pointer; font: 500 13px var(--font-sans-fallback);
}
.crmg-imp-ft button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.crmg-imp-ft button.primary:disabled { opacity: 0.5; cursor: not-allowed; }
