/* Merci Blacklist — theme tokens for day and night. Bootstrap 5.3 colour modes via data-bs-theme. */
:root, [data-bs-theme="light"] {
  --bl-brand: #b4232c; --bl-brand-hover: #971c24; --bl-brand-soft: #fbe9ea; --bl-on-brand: #ffffff;
  --bl-bg: #f4f5f7; --bl-surface: #ffffff; --bl-surface-2: #f8f9fb; --bl-border: #e3e6eb;
  --bl-ink: #1d2330; --bl-muted: #5b6474; --bl-side: #1d2330; --bl-side-ink: #c9cfda; --bl-side-active: #ffffff;
  --bl-shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-bg: var(--bl-bg); --bs-body-color: var(--bl-ink);
  --bs-primary: var(--bl-brand); --bs-primary-rgb: 180,35,44; --bs-link-color: var(--bl-brand); --bs-link-hover-color: var(--bl-brand-hover);
  --bs-link-color-rgb: 180,35,44; --bs-border-color: var(--bl-border);
}
[data-bs-theme="dark"] {
  --bl-brand: #ef5a63; --bl-brand-hover: #f47b82; --bl-brand-soft: #3a1c1f; --bl-on-brand: #0d0d0d;
  --bl-bg: #0f1218; --bl-surface: #171b23; --bl-surface-2: #1d222c; --bl-border: #2a303c;
  --bl-ink: #e7eaf0; --bl-muted: #a3abb9; --bl-side: #0b0e13; --bl-side-ink: #a9b1bf; --bl-side-active: #ffffff;
  --bl-shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 22px rgba(0,0,0,.35);
  --bs-body-bg: var(--bl-bg); --bs-body-color: var(--bl-ink); --bs-primary-rgb: 239,90,99;
  --bs-link-color: var(--bl-brand); --bs-link-hover-color: var(--bl-brand-hover); --bs-link-color-rgb: 239,90,99;
  --bs-border-color: var(--bl-border); --bs-secondary-color: var(--bl-muted);
}
body { background: var(--bl-bg); color: var(--bl-ink); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--bl-brand); }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.01em; }
.text-muted, .form-text, .text-body-secondary { color: var(--bl-muted) !important; }

.btn-primary { --bs-btn-bg: var(--bl-brand); --bs-btn-border-color: var(--bl-brand); --bs-btn-color: var(--bl-on-brand);
  --bs-btn-hover-bg: var(--bl-brand-hover); --bs-btn-hover-border-color: var(--bl-brand-hover); --bs-btn-hover-color: var(--bl-on-brand);
  --bs-btn-active-bg: var(--bl-brand-hover); --bs-btn-active-border-color: var(--bl-brand-hover); --bs-btn-active-color: var(--bl-on-brand);
  --bs-btn-disabled-bg: var(--bl-brand); --bs-btn-disabled-border-color: var(--bl-brand); --bs-btn-disabled-color: var(--bl-on-brand);
  font-weight: 600; }
.btn { min-height: 44px; border-radius: 10px; }
.btn-icon { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--bl-ink); border: 1px solid var(--bl-border); background: var(--bl-surface); padding: 0; }
.btn-icon:hover { background: var(--bl-surface-2); color: var(--bl-ink); }
[data-bs-theme="light"] .theme-light-hide, [data-bs-theme="dark"] .theme-dark-hide { display: none; }
.form-control, .form-select { min-height: 46px; font-size: 16px; border-radius: 10px; background-color: var(--bl-surface); border-color: var(--bl-border); }
.form-control:focus, .form-select:focus { border-color: var(--bl-brand); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .18); }
.form-check-input:checked { background-color: var(--bl-brand); border-color: var(--bl-brand); }
.form-check-input { width: 1.2em; height: 1.2em; margin-top: .15em; }
.form-label { font-weight: 600; font-size: 14px; }
.card { background: var(--bl-surface); border: 1px solid var(--bl-border); border-radius: 14px; box-shadow: var(--bl-shadow); }

/* Brand mark */
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--bl-brand); color: #fff; display: grid; place-items: center; font-size: 18px; }
[data-bs-theme="dark"] .brand-mark { color: #0d0d0d; }
.brand-text { font-size: 18px; font-weight: 500; white-space: nowrap; }
.brand-text b { font-weight: 800; color: var(--bl-brand); }
.brand-text small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; margin-left: 4px; }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
.auth-side { display: none; }
.auth-main { display: flex; flex-direction: column; padding: 16px; }
.auth-top { display: flex; align-items: center; gap: 12px; color: var(--bl-ink); }
.auth-card { width: 100%; max-width: 460px; margin: 28px auto; background: var(--bl-surface); border: 1px solid var(--bl-border); border-radius: 16px; box-shadow: var(--bl-shadow); padding: 28px 22px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .35rem; }
.auth-card .lead { font-size: 15px; color: var(--bl-muted); margin-bottom: 1.4rem; }
@media (min-width: 992px) {
  .auth-wrap { grid-template-columns: 420px minmax(0, 1fr); }
  .auth-side { display: flex; flex-direction: column; justify-content: space-between; background: var(--bl-side); color: #e7eaf0; padding: 36px 40px; }
  .auth-side .brand-text { color: #fff; }
  .auth-side .brand-text b { color: #ff7a82; }
  .auth-pitch h2 { font-size: 1.9rem; line-height: 1.25; margin-bottom: 1.4rem; color: #fff; }
  .auth-pitch li { margin-bottom: .8rem; color: #c9cfda; display: flex; gap: 10px; }
  .auth-pitch i { color: #ff7a82; }
  .auth-main { padding: 22px 32px; }
  .auth-card { padding: 36px 36px; }
}
.otp-input { font-size: 28px !important; letter-spacing: 12px; text-align: center; font-weight: 700; }

/* Panel shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex-shrink: 0; background: var(--bl-side); color: var(--bl-side-ink); }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.sidebar.offcanvas-lg { --bs-offcanvas-width: 270px; --bs-offcanvas-bg: var(--bl-side); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px; }
.sidebar-head .brand-text { color: #fff; }
.sidebar-head .brand-text b { color: #ff7a82; }
.sidebar-head .btn-close { filter: invert(1); }
.sidebar .nav { padding: 6px 10px 24px; gap: 2px; }
.sidebar .nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--bl-side-ink); border-radius: 10px; padding: 8px 12px; font-weight: 500; }
.sidebar .nav-link i { font-size: 18px; width: 20px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,122,130,.16); color: var(--bl-side-active); box-shadow: inset 3px 0 0 #ff7a82; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bl-surface); border-bottom: 1px solid var(--bl-border); }
.topbar-title { font-size: 1.1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topsearch { position: relative; flex: 1; max-width: 520px; min-width: 0; }
.topsearch i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--bl-muted); }
.topsearch .form-control { padding-left: 40px; background: var(--bl-surface-2); }
.btn-user { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--bl-border); background: var(--bl-surface); color: var(--bl-ink); }
.btn-user:hover, .btn-user.show { background: var(--bl-surface-2); color: var(--bl-ink); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--bl-brand); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; }
[data-bs-theme="dark"] .avatar { color: #0d0d0d; }
.page { padding: 20px 16px 40px; width: 100%; max-width: 1280px; }
@media (min-width: 768px) { .page { padding: 28px 28px 48px; } .topbar { padding: 10px 28px; } }
.page-head h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.page-head p { color: var(--bl-muted); }

/* Dashboard tiles */
.stat { padding: 18px 20px; height: 100%; }
.stat .label { font-size: 13px; color: var(--bl-muted); font-weight: 500; }
.stat .value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; line-height: 1.2; overflow-wrap: anywhere; }
.stat .sub { font-size: 13px; color: var(--bl-muted); margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bl-brand-soft); color: var(--bl-brand); }
.empty { text-align: center; padding: 40px 16px; color: var(--bl-muted); }
.empty i { font-size: 40px; display: block; margin-bottom: 10px; opacity: .6; }

/* Tables become cards on phones */
.table { --bs-table-bg: transparent; margin: 0; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--bl-muted); font-weight: 600; white-space: nowrap; }
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack tr { display: block; border-bottom: 1px solid var(--bl-border); padding: 10px 4px; }
  .table-stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 8px; overflow-wrap: anywhere; }
  .table-stack td::before { content: attr(data-label); color: var(--bl-muted); font-size: 12px; font-weight: 600; flex-shrink: 0; }
}

/* Modal dialogs (BL.alert / BL.confirm) */
.bl-modal .modal-content { background: var(--bl-surface); border: 1px solid var(--bl-border); border-radius: 16px; box-shadow: var(--bl-shadow); }
.bl-modal .modal-header, .bl-modal .modal-footer { border: 0; }
.bl-modal .dlg-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.bl-modal .dlg-info .dlg-icon { background: rgba(13,110,253,.12); color: #3d8bfd; }
.bl-modal .dlg-success .dlg-icon { background: rgba(25,135,84,.14); color: #2fb27c; }
.bl-modal .dlg-danger .dlg-icon, .bl-modal .dlg-warning .dlg-icon { background: var(--bl-brand-soft); color: var(--bl-brand); }

/* Busy state */
.is-busy { pointer-events: none; cursor: progress; opacity: .85; }
.spinner-border-sm { width: 1rem; height: 1rem; border-width: .16em; }

/* Bootstrap's offcanvas-lg forces a transparent background on desktop; the sidebar keeps its own colour in both themes. */
@media (min-width: 992px) { .sidebar.offcanvas-lg { background-color: var(--bl-side) !important; } }
.sidebar-head .brand-text small { display: block; margin: 2px 0 0; font-size: 10px; color: #ff9aa0; opacity: 1; }
.sidebar-head .brand-text { line-height: 1.15; }

/* "or" divider between single sign-on and the local form */
.or-rule { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--bl-muted); font-size: 13px; }
.or-rule::before, .or-rule::after { content: ""; flex: 1; height: 1px; background: var(--bl-border); }
