/* ==========================================================================
   iFinance LMS theme — indigo, clean cards, light & dark modes.
   Bootstrap 5.3 is the base; this file sets the design tokens and component styles.
   ========================================================================== */

@font-face { font-family: "Inter"; src: url("../vendor/fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("../vendor/fonts/outfit-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ---------- design tokens ---------- */
:root, [data-bs-theme="light"] {
  --if-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --if-display: "Outfit", "Inter", system-ui, sans-serif;
  --if-mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --if-primary: #6366f1;
  --if-primary-strong: #4f46e5;
  --if-primary-text: #4f46e5;
  --if-primary-soft: #eef2ff;
  --if-primary-rgb: 99, 102, 241;

  --if-bg: #f9fafb;
  --if-surface: #ffffff;
  --if-surface-2: #f9fafb;
  --if-hover: #f3f4f6;
  --if-border: #e5e7eb;
  --if-border-strong: #d1d5db;
  --if-text: #1f2937;
  --if-heading: #111827;
  --if-muted: #6b7280;
  --if-subtle: #9ca3af;
  --if-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --if-shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);

  --if-good: #059669; --if-bad: #dc2626;
  --if-success-bg: #dcfce7; --if-success-fg: #15803d;
  --if-warning-bg: #fef9c3; --if-warning-fg: #a16207;
  --if-danger-bg:  #fee2e2; --if-danger-fg:  #dc2626;
  --if-info-bg:    #dbeafe; --if-info-fg:    #1d4ed8;
  --if-purple-bg:  #ede9fe; --if-purple-fg:  #7c3aed;
  --if-orange-bg:  #ffedd5; --if-orange-fg:  #c2410c;
  --if-gray-bg:    #f3f4f6; --if-gray-fg:    #4b5563;
  --if-cyan-bg:    #cffafe; --if-cyan-fg:    #0e7490;
}
[data-bs-theme="dark"] {
  --if-primary-text: #a5b4fc;
  --if-primary-soft: rgba(99, 102, 241, .16);
  --if-bg: #111827;
  --if-surface: #1f2937;
  --if-surface-2: #18212f;
  --if-hover: #273244;
  --if-border: #374151;
  --if-border-strong: #4b5563;
  --if-text: #e5e7eb;
  --if-heading: #f9fafb;
  --if-muted: #9ca3af;
  --if-subtle: #6b7280;
  --if-shadow: none;
  --if-shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
  --if-good: #34d399; --if-bad: #f87171;
  --if-success-bg: #052e16; --if-success-fg: #4ade80;
  --if-warning-bg: #1c1400; --if-warning-fg: #fbbf24;
  --if-danger-bg:  #2a0a0a; --if-danger-fg:  #f87171;
  --if-info-bg:    #0c1f3f; --if-info-fg:    #60a5fa;
  --if-purple-bg:  #1e1245; --if-purple-fg:  #a78bfa;
  --if-orange-bg:  #1c0d00; --if-orange-fg:  #fb923c;
  --if-gray-bg:    #273244; --if-gray-fg:    #d1d5db;
  --if-cyan-bg:    #082f37; --if-cyan-fg:    #67e8f9;
}

/* ---------- Bootstrap mapped onto the tokens ---------- */
:root, [data-bs-theme] {
  --bs-body-font-family: var(--if-font);
  --bs-body-font-size: .9rem;
  --bs-body-bg: var(--if-bg);
  --bs-body-color: var(--if-text);
  --bs-emphasis-color: var(--if-heading);
  --bs-secondary-color: var(--if-muted);
  --bs-tertiary-bg: var(--if-surface-2);
  --bs-border-color: var(--if-border);
  --bs-primary: var(--if-primary);
  --bs-primary-rgb: var(--if-primary-rgb);
  --bs-link-color: var(--if-primary-text);
  --bs-link-color-rgb: var(--if-primary-rgb);
  --bs-link-hover-color: var(--if-primary-strong);
  --bs-border-radius: .5rem;
  --bs-border-radius-lg: .75rem;
  --bs-focus-ring-color: rgba(var(--if-primary-rgb), .25);
}
body { background: var(--if-bg); color: var(--if-text); font-family: var(--if-font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5, .font-display { font-family: var(--if-display); color: var(--if-heading); letter-spacing: -.01em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.text-primary { color: var(--if-primary-text) !important; }
.bg-primary { background-color: var(--if-primary) !important; }
.text-muted, .muted { color: var(--if-muted) !important; }
.border { border-color: var(--if-border) !important; }
.bg-white { background-color: var(--if-surface) !important; }
.bg-light { background-color: var(--if-surface-2) !important; }

/* buttons */
.btn { --bs-btn-font-weight: 500; --bs-btn-border-radius: .5rem; --bs-btn-padding-x: .95rem; --bs-btn-padding-y: .45rem; --bs-btn-font-size: .875rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn-sm { --bs-btn-padding-x: .65rem; --bs-btn-padding-y: .28rem; --bs-btn-font-size: .8rem; }
.btn-lg { --bs-btn-padding-y: .65rem; --bs-btn-font-size: 1rem; }
.btn-tall { padding-top: .7rem; padding-bottom: .7rem; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--if-primary); --bs-btn-border-color: var(--if-primary); --bs-btn-hover-bg: var(--if-primary-strong); --bs-btn-hover-border-color: var(--if-primary-strong); --bs-btn-active-bg: #4338ca; --bs-btn-active-border-color: #4338ca; --bs-btn-disabled-bg: #a5b4fc; --bs-btn-disabled-border-color: #a5b4fc; --bs-btn-focus-shadow-rgb: var(--if-primary-rgb); }
.btn-outline-primary { --bs-btn-color: var(--if-primary-text); --bs-btn-border-color: rgba(var(--if-primary-rgb), .45); --bs-btn-hover-bg: var(--if-primary-soft); --bs-btn-hover-color: var(--if-primary-text); --bs-btn-hover-border-color: var(--if-primary); --bs-btn-active-bg: var(--if-primary-soft); --bs-btn-active-color: var(--if-primary-text); --bs-btn-active-border-color: var(--if-primary); }
.btn-outline-secondary, .btn-light { --bs-btn-color: var(--if-text); --bs-btn-bg: var(--if-surface); --bs-btn-border-color: var(--if-border); --bs-btn-hover-bg: var(--if-hover); --bs-btn-hover-color: var(--if-heading); --bs-btn-hover-border-color: var(--if-border-strong); --bs-btn-active-bg: var(--if-hover); --bs-btn-active-color: var(--if-heading); --bs-btn-active-border-color: var(--if-border-strong); }
.btn-outline-danger { --bs-btn-color: var(--if-danger-fg); --bs-btn-border-color: rgba(220, 38, 38, .4); --bs-btn-hover-bg: var(--if-danger-bg); --bs-btn-hover-color: var(--if-danger-fg); --bs-btn-hover-border-color: var(--if-danger-fg); }
.btn-success { --bs-btn-bg: #059669; --bs-btn-border-color: #059669; --bs-btn-hover-bg: #047857; --bs-btn-hover-border-color: #047857; }
.btn-danger { --bs-btn-bg: #dc2626; --bs-btn-border-color: #dc2626; --bs-btn-hover-bg: #b91c1c; --bs-btn-hover-border-color: #b91c1c; }
.btn-link { --bs-btn-color: var(--if-primary-text); --bs-btn-hover-color: var(--if-primary-strong); }

/* forms */
.form-control, .form-select { border-color: var(--if-border); border-radius: .5rem; background-color: var(--if-surface); color: var(--if-text); padding-top: .5rem; padding-bottom: .5rem; }
.form-control-sm, .form-select-sm { padding-top: .3rem; padding-bottom: .3rem; }
.form-control::placeholder { color: var(--if-subtle); }
.form-control:focus, .form-select:focus { border-color: var(--if-primary); box-shadow: 0 0 0 3px rgba(var(--if-primary-rgb), .18); background-color: var(--if-surface); color: var(--if-text); }
.form-check-input:checked { background-color: var(--if-primary); border-color: var(--if-primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(var(--if-primary-rgb), .18); border-color: var(--if-primary); }
.form-label { font-weight: 500; font-size: .85rem; color: var(--if-text); margin-bottom: .3rem; }
.form-text { color: var(--if-muted); }
.input-group-text { background: var(--if-surface-2); border-color: var(--if-border); color: var(--if-muted); }
.required::after { content: " *"; color: var(--if-bad); }

/* ---------- app shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; background: var(--if-surface); border-right: 1px solid var(--if-border); position: sticky; top: 0; height: 100vh; flex-shrink: 0; display: flex; flex-direction: column; transition: width .25s cubic-bezier(.4, 0, .2, 1); z-index: 40; }
.brand { display: flex; align-items: center; gap: .75rem; padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--if-border); text-decoration: none !important; min-height: 72px; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-family: var(--if-display); font-weight: 700; font-size: 1.15rem; color: var(--if-heading); }
.brand-sub { font-size: .72rem; color: var(--if-muted); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; scrollbar-width: thin; }
.nav-section { font-size: .68rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--if-muted); padding: 1.1rem .65rem .45rem; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; margin: 2px 0; border-radius: .5rem; color: var(--if-text); font-size: .9rem; font-weight: 500; text-decoration: none !important; white-space: nowrap; transition: background .15s, color .15s; }
.nav-item > .bi:first-child { font-size: 1.1rem; width: 20px; text-align: center; color: var(--if-muted); flex-shrink: 0; }
.nav-item:hover { background: var(--if-hover); color: var(--if-heading); }
.nav-item.active { background: var(--if-primary-soft); color: var(--if-primary-text); font-weight: 600; }
.nav-item.active > .bi:first-child { color: var(--if-primary-text); }
.nav-chev { margin-left: auto; font-size: .75rem; }
.nav-text { overflow: hidden; text-overflow: ellipsis; }
.sidebar-collapse { display: flex; align-items: center; gap: .7rem; border: 0; border-top: 1px solid var(--if-border); background: transparent; color: var(--if-text); padding: 1rem 1.5rem; font-size: .875rem; font-weight: 500; white-space: nowrap; }
.sidebar-collapse:hover { background: var(--if-hover); }
.sidebar-collapse .bi { transition: transform .25s; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; background: var(--if-surface); border-bottom: 1px solid var(--if-border); padding: 0 1.5rem; min-height: 72px; position: sticky; top: 0; z-index: 30; }
.icon-btn { width: 40px; height: 40px; border-radius: .55rem; border: 1px solid var(--if-border); background: var(--if-surface); color: var(--if-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; transition: background .15s; }
.icon-btn:hover { background: var(--if-hover); }
.crumbs { display: flex; align-items: center; gap: .45rem; font-size: .95rem; white-space: nowrap; overflow: hidden; min-width: 0; }
.crumb-section { color: var(--if-muted); }
.crumb-sep { color: var(--if-subtle); }
.crumb-page { color: var(--if-heading); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.top-search { margin-left: auto; position: relative; width: min(380px, 32vw); }
.top-search .bi-search { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--if-subtle); }
.top-search input { width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--if-border); background: var(--if-surface-2); color: var(--if-text); padding: 0 2.6rem 0 2.5rem; font-size: .875rem; outline: none; }
.top-search input:focus { border-color: var(--if-primary); box-shadow: 0 0 0 3px rgba(var(--if-primary-rgb), .15); background: var(--if-surface); }
.top-search kbd { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); background: var(--if-hover); color: var(--if-muted); font-size: .7rem; padding: .05rem .4rem; border-radius: .3rem; box-shadow: none; }
.top-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.top-search + .top-actions { margin-left: 0; }
.btn-create { height: 40px; }
.user-chip { display: flex; align-items: center; gap: .6rem; border: 0; background: transparent; padding: .25rem .25rem .25rem 0; color: var(--if-muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; font-weight: 600; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-meta { flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-name { font-weight: 600; color: var(--if-heading); font-size: .875rem; }
.user-role { font-size: .75rem; color: var(--if-muted); }
.dropdown-menu { --bs-dropdown-bg: var(--if-surface); --bs-dropdown-border-color: var(--if-border); --bs-dropdown-link-color: var(--if-text); --bs-dropdown-link-hover-bg: var(--if-hover); --bs-dropdown-link-active-bg: var(--if-primary); border-radius: .75rem; box-shadow: var(--if-shadow-lg); padding: .4rem; font-size: .875rem; }
.dropdown-item { border-radius: .45rem; padding: .5rem .7rem; display: flex; gap: .55rem; align-items: center; }
.dropdown-menu.narrow { min-width: 300px; }
.content { padding: 1.75rem 2rem 2.5rem; width: 100%; min-width: 0; }

/* collapsed sidebar (desktop) */
@media (min-width: 992px) {
  .sidebar-collapsed .sidebar { width: 76px; }
  .sidebar-collapsed .brand { padding-left: 18px; padding-right: 18px; }
  .sidebar-collapsed .brand-text, .sidebar-collapsed .nav-text, .sidebar-collapsed .nav-chev { display: none; }
  .sidebar-collapsed .nav-section { font-size: 0; padding: .6rem 0 .3rem; border-top: 1px solid var(--if-border); margin: .4rem .3rem 0; }
  .sidebar-collapsed .nav-item { justify-content: center; padding: .65rem 0; }
  .sidebar-collapsed .sidebar-collapse { justify-content: center; padding: 1rem 0; }
  .sidebar-collapsed .sidebar-collapse .bi { transform: rotate(180deg); }
  .sidebar-backdrop { display: none; }
}
/* phones & tablets: sidebar slides in */
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--if-shadow-lg); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-collapse { display: none; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 35; display: none; }
  .sidebar-open .sidebar-backdrop { display: block; }
  .topbar { padding: 0 1rem; gap: .6rem; }
  .top-search { display: none; }
  .content { padding: 1.1rem 1rem 2rem; }
}

/* ---------- page header ---------- */
.page-title { display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-title h1 { font-size: 1.75rem; font-weight: 700; margin: 0; }
.page-title .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.page-sub { color: var(--if-muted); font-size: .95rem; margin-top: .2rem; }

/* ---------- cards ---------- */
.card { --bs-card-bg: var(--if-surface); --bs-card-border-color: var(--if-border); --bs-card-border-radius: 1rem; --bs-card-inner-border-radius: calc(1rem - 1px); --bs-card-cap-bg: transparent; --bs-card-spacer-x: 1.5rem; --bs-card-spacer-y: 1.25rem; --bs-card-cap-padding-x: 1.5rem; --bs-card-cap-padding-y: 1.05rem; box-shadow: var(--if-shadow); }
.card-header { font-family: var(--if-display); font-weight: 600; font-size: 1.02rem; color: var(--if-heading); border-bottom: 1px solid var(--if-border); }
.card-footer { background: transparent; border-top: 1px solid var(--if-border); }
.card > .table-responsive > .table, .card > .table { margin: 0; }

/* stat cards */
.stat { position: relative; background: var(--if-surface); border: 1px solid var(--if-border); border-radius: 1rem; padding: 1.35rem 1.5rem; height: 100%; box-shadow: var(--if-shadow); transition: transform .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 24, 40, .06); }
.stat .label { font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--if-muted); }
.stat-icon + .label { padding-right: 3.5rem; }
.stat .value { font-family: var(--if-display); font-size: clamp(1.2rem, 1.55vw, 1.6rem); font-weight: 700; color: var(--if-heading); margin-top: .45rem; line-height: 1.2; overflow-wrap: normal; word-break: normal; }
.stat .value.good { color: var(--if-good); }
.stat .value.bad { color: var(--if-bad); }
.stat .small { margin-top: .4rem; }
.stat-icon { position: absolute; top: 1.2rem; right: 1.25rem; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.trend-up { color: var(--if-good) !important; font-weight: 500; }
.trend-down { color: var(--if-bad) !important; font-weight: 500; }
.tone-indigo { background: var(--if-primary-soft); color: var(--if-primary-text); }
.tone-green  { background: var(--if-success-bg); color: var(--if-success-fg); }
.tone-amber  { background: var(--if-warning-bg); color: var(--if-warning-fg); }
.tone-red    { background: var(--if-danger-bg); color: var(--if-danger-fg); }
.tone-blue   { background: var(--if-info-bg); color: var(--if-info-fg); }
.tone-purple { background: var(--if-purple-bg); color: var(--if-purple-fg); }
.tone-orange { background: var(--if-orange-bg); color: var(--if-orange-fg); }
.tone-cyan   { background: var(--if-cyan-bg); color: var(--if-cyan-fg); }

/* quick action tiles */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .85rem; }
.quick-tile { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem; border-radius: 999px; font-weight: 500; text-decoration: none !important; transition: transform .15s, filter .15s; }
.quick-tile:hover { transform: translateY(-1px); filter: brightness(.97); }
.quick-tile .bi { font-size: 1.25rem; }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--if-text); --bs-table-border-color: var(--if-border); --bs-table-hover-bg: var(--if-surface-2); --bs-table-striped-bg: var(--if-surface-2); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .85rem 1rem; border-bottom-color: var(--if-border); }
.table-sm > :not(caption) > * > * { padding: .5rem .75rem; }
.table thead th { background: var(--if-surface-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--if-muted); font-weight: 600; border-bottom: 1px solid var(--if-border); white-space: nowrap; }
.table tfoot td { background: var(--if-surface-2); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--if-surface-2); }
.card .table thead th:first-child, .card .table tbody td:first-child { padding-left: 1.5rem; }
.card .table thead th:last-child, .card .table tbody td:last-child { padding-right: 1.5rem; }
.table a.mono, .table .mono a { color: var(--if-primary-text); font-weight: 500; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--if-mono); font-size: .84em; }
.empty { color: var(--if-subtle); text-align: center; padding: 2.5rem 1rem !important; }

/* ---------- badges: soft pills ---------- */
.badge { --bs-badge-font-weight: 600; --bs-badge-font-size: .68rem; --bs-badge-padding-x: .65rem; --bs-badge-padding-y: .32rem; border-radius: 999px; letter-spacing: .03em; text-transform: uppercase; }
.badge.bg-success, .badge.text-bg-success { background: var(--if-success-bg) !important; color: var(--if-success-fg) !important; }
.badge.bg-warning, .badge.text-bg-warning { background: var(--if-warning-bg) !important; color: var(--if-warning-fg) !important; }
.badge.bg-danger, .badge.text-bg-danger { background: var(--if-danger-bg) !important; color: var(--if-danger-fg) !important; }
.badge.bg-info, .badge.text-bg-info { background: var(--if-info-bg) !important; color: var(--if-info-fg) !important; }
.badge.bg-primary, .badge.text-bg-primary { background: var(--if-primary-soft) !important; color: var(--if-primary-text) !important; }
.badge.bg-secondary, .badge.bg-light, .badge.text-bg-secondary, .badge.text-bg-light { background: var(--if-gray-bg) !important; color: var(--if-gray-fg) !important; }
.badge.bg-dark, .badge.text-bg-dark { background: #111827 !important; color: #f9fafb !important; }
[data-bs-theme="dark"] .badge.bg-dark { background: #000 !important; }
.badge.bg-success-subtle { background: var(--if-success-bg) !important; color: var(--if-success-fg) !important; }
.badge.bg-danger-subtle { background: var(--if-danger-bg) !important; color: var(--if-danger-fg) !important; }
.badge.text-dark { color: inherit; }
.badge-count { background: var(--if-primary) !important; color: #fff !important; text-transform: none; }

/* ---------- tabs & pills ---------- */
.nav-tabs { --bs-nav-tabs-border-color: var(--if-border); --bs-nav-tabs-link-active-bg: transparent; --bs-nav-tabs-link-active-border-color: transparent; gap: .25rem; border-bottom: 1px solid var(--if-border); }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--if-muted); font-weight: 500; padding: .7rem .9rem; display: inline-flex; align-items: center; gap: .4rem; margin-bottom: -1px; }
.nav-tabs .nav-link:hover { color: var(--if-heading); border-bottom-color: var(--if-border-strong); }
.nav-tabs .nav-link.active { color: var(--if-primary-text); border-bottom-color: var(--if-primary); background: transparent; font-weight: 600; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--if-primary); }

/* ---------- alerts, lists, misc ---------- */
.alert { position: relative; display: block; border-radius: .85rem; border: 1px solid transparent; border-left-width: 4px; padding: .85rem 1rem; line-height: 1.5; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.alert:has(> .bi:first-child) { padding-left: 2.85rem; }
.alert > .bi:first-child { position: absolute; left: 1rem; top: .9rem; font-size: 1.1rem; line-height: 1.2; }
.alert.d-flex { gap: .75rem; align-items: center; }
.alert > div { min-width: 0; }
.alert.alert-dismissible { padding-right: 3rem; }
.alert .btn-close { position: absolute; top: .7rem; right: .7rem; padding: .5rem; opacity: .55; }
.alert-success { background: var(--if-success-bg); color: var(--if-success-fg); border-color: rgba(21, 128, 61, .18); border-left-color: #16a34a; }
.alert-danger  { background: var(--if-danger-bg); color: var(--if-danger-fg); border-color: rgba(220, 38, 38, .18); border-left-color: #dc2626; }
.alert-warning { background: var(--if-warning-bg); color: var(--if-warning-fg); border-color: rgba(161, 98, 7, .18); border-left-color: #d97706; }
.alert-info    { background: var(--if-info-bg); color: var(--if-info-fg); border-color: rgba(29, 78, 216, .18); border-left-color: #2563eb; }
.alert strong { font-weight: 600; }
.alert .alert-link, .alert a:not(.btn) { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.list-group { --bs-list-group-bg: var(--if-surface); --bs-list-group-border-color: var(--if-border); --bs-list-group-action-hover-bg: var(--if-hover); --bs-list-group-color: var(--if-text); --bs-list-group-active-bg: var(--if-primary); --bs-list-group-active-border-color: var(--if-primary); }
.modal-content { background: var(--if-surface); border-color: var(--if-border); border-radius: 1rem; }
.page-link { color: var(--if-primary-text); }
.active > .page-link, .page-link.active { background: var(--if-primary); border-color: var(--if-primary); }
.progress { --bs-progress-bar-bg: var(--if-primary); --bs-progress-bg: var(--if-hover); }
hr { border-color: var(--if-border); opacity: 1; }
code { color: var(--if-purple-fg); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
dl.kv dt { color: var(--if-muted); font-weight: 500; }
dl.kv dd { margin: 0; }
.w-money { max-width: 220px; }
.hidden { display: none !important; }
.narrow { max-width: 480px; }
.narrow-lg { max-width: 760px; }
.dup-warning { border-left: 4px solid #d97706; }
.big-amount { font-family: var(--if-display); font-size: 1.6rem; font-weight: 700; }
.qr-box img { width: 200px; height: 200px; image-rendering: pixelated; background: #fff; padding: 6px; border-radius: .5rem; }
.secret-code { letter-spacing: .12em; word-break: break-all; }
.recovery-codes { columns: 2; font-family: var(--if-mono); font-size: 1rem; }
.bg-success-subtle { background-color: var(--if-success-bg) !important; }
.bg-danger-subtle { background-color: var(--if-danger-bg) !important; }
.bg-warning-subtle { background-color: var(--if-warning-bg) !important; }
.bg-info-subtle { background-color: var(--if-info-bg) !important; }
.text-success, .text-success-emphasis { color: var(--if-good) !important; }
.text-danger, .text-danger-emphasis { color: var(--if-bad) !important; }
.user-select-all.bg-light { background: var(--if-surface-2) !important; }

/* ---------- sign-in (split screen) ---------- */
.auth-body { min-height: 100vh; background: var(--if-surface); }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; isolation: isolate; color: #fff; padding: 2.75rem clamp(2rem, 4.5vw, 4.5rem); display: flex; flex-direction: column;
  background: #070a1f; }
.aurora { position: absolute; inset: 0; z-index: -2; filter: blur(70px) saturate(140%); opacity: .9; }
.aurora span { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.aurora-a { width: 60%; height: 60%; left: -12%; top: -18%; background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 65%); animation: drift-a 18s ease-in-out infinite alternate; }
.aurora-b { width: 55%; height: 55%; right: -14%; top: 22%; background: radial-gradient(circle, #a855f7 0%, rgba(168, 85, 247, 0) 65%); animation: drift-b 22s ease-in-out infinite alternate; }
.aurora-c { width: 60%; height: 50%; left: 18%; bottom: -22%; background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 65%); opacity: .7; animation: drift-c 26s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(18%, 14%) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-16%, -10%) scale(1.1); } }
@keyframes drift-c { to { transform: translate(-12%, -16%) scale(1.2); } }
.auth-grid { position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 30%, transparent 85%); mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 30%, transparent 85%); }
.auth-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.auth-logo { display: flex; align-items: center; gap: .8rem; font-family: var(--if-display); font-weight: 700; font-size: 1.35rem; }
.auth-logo .brand-mark { width: 46px; height: 46px; font-size: 1.25rem; box-shadow: 0 0 0 6px rgba(99, 102, 241, .18), 0 10px 30px rgba(99, 102, 241, .45); }
.auth-logo-sm { color: var(--if-heading); font-size: 1.2rem; margin-bottom: 2rem; }
.auth-pill { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 500; letter-spacing: .02em; padding: .4rem .85rem; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); color: #c7d2fe; backdrop-filter: blur(8px); }
.pulse-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.auth-hero-main { margin: auto 0; padding: 2.5rem 0 1.5rem; }
.auth-hero h1 { color: #fff; font-size: clamp(2.3rem, 4vw, 3.4rem); font-weight: 700; line-height: 1.06; letter-spacing: -.03em; margin-bottom: 1.1rem; }
.grad-text { background: linear-gradient(90deg, #a5b4fc 0%, #e879f9 45%, #67e8f9 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-tagline { color: #c7d2fe; opacity: .85; font-size: 1.05rem; line-height: 1.65; max-width: 31rem; margin-bottom: 0; }
.auth-stage { position: relative; height: 280px; max-width: 580px; margin-top: 2.5rem; }
.glass { background: linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .04)); border: 1px solid rgba(255, 255, 255, .16); border-radius: 1.1rem;
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 20px 50px rgba(2, 6, 23, .45), inset 0 1px 0 rgba(255, 255, 255, .12); }
.glass-chart { position: absolute; left: 0; top: 0; width: 60%; padding: 1rem 1.1rem 1.1rem; animation: float 7s ease-in-out infinite; }
.glass-head { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; font-weight: 600; color: #e0e7ff; margin-bottom: .55rem; }
.glass-head .bi { color: #a5b4fc; }
.glass-tag { font-size: .68rem; font-weight: 500; color: #a5b4fc; background: rgba(129, 140, 248, .15); padding: .15rem .5rem; border-radius: 999px; }
.spark { width: 100%; height: 86px; display: block; overflow: visible; }
.spark-line { fill: none; stroke: #a5b4fc; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 520; stroke-dashoffset: 520; animation: draw 2.4s .3s ease-out forwards; }
.spark-dot { fill: #fff; stroke: #818cf8; stroke-width: 3; opacity: 0; animation: pop .4s 2.5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }
.glass-bars { display: flex; align-items: flex-end; gap: 6px; height: 34px; margin-top: .7rem; }
.glass-bars span { flex: 1; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, rgba(165, 180, 252, .9), rgba(165, 180, 252, .25)); transform-origin: bottom; animation: grow 1s ease-out both; }
.glass-bars .b1 { height: 45%; animation-delay: .5s; } .glass-bars .b2 { height: 70%; animation-delay: .6s; } .glass-bars .b3 { height: 55%; animation-delay: .7s; }
.glass-bars .b4 { height: 85%; animation-delay: .8s; } .glass-bars .b5 { height: 60%; animation-delay: .9s; } .glass-bars .b6 { height: 95%; animation-delay: 1s; } .glass-bars .b7 { height: 75%; animation-delay: 1.1s; }
@keyframes grow { from { transform: scaleY(0); } }
.toast-card { position: absolute; display: flex; gap: .75rem; align-items: center; padding: .7rem .95rem; min-width: 230px; }
.toast-card strong { display: block; font-size: .86rem; color: #fff; }
.toast-card small { display: block; font-size: .74rem; color: #c7d2fe; opacity: .85; }
.tc-icon { width: 2.1rem; height: 2.1rem; border-radius: .65rem; display: grid; place-items: center; font-size: 1.05rem; flex: 0 0 auto; }
.tc-green { background: rgba(52, 211, 153, .18); color: #6ee7b7; } .tc-blue { background: rgba(96, 165, 250, .18); color: #93c5fd; } .tc-amber { background: rgba(251, 191, 36, .18); color: #fcd34d; }
.toast-card.t1 { right: 0; top: 4px; animation: slide-in .7s .4s both, float 8s 1.1s ease-in-out infinite; }
.toast-card.t2 { right: 8%; top: 98px; animation: slide-in .7s .9s both, float 9s 1.6s ease-in-out infinite; }
.toast-card.t3 { right: 0; top: 192px; animation: slide-in .7s 1.4s both, float 10s 2.1s ease-in-out infinite; }
@keyframes slide-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.auth-hero-foot { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; font-size: .8rem; color: #a5b4fc; }
.auth-hero-foot .bi { color: #818cf8; margin-right: .3rem; }

.auth-panel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1.5rem 4.5rem; background: var(--if-surface); overflow: hidden; }
.auth-dots { position: absolute; inset: 0; background-image: radial-gradient(var(--if-border) 1px, transparent 1px); background-size: 22px 22px; opacity: .55;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 70% 20%, #000, transparent 70%); mask-image: radial-gradient(ellipse 60% 55% at 70% 20%, #000, transparent 70%); pointer-events: none; }
.auth-card { position: relative; width: 100%; max-width: 440px; padding: 2.4rem 2.2rem; background: var(--if-surface); border: 1px solid var(--if-border); border-radius: 1.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 24px 60px -20px rgba(79, 70, 229, .25); animation: card-in .6s cubic-bezier(.2, .8, .2, 1) both; }
.auth-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(99, 102, 241, .55), transparent 40%, transparent 60%, rgba(168, 85, 247, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px); } }
.auth-greet { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; color: var(--if-primary); background: var(--if-primary-soft); padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1rem; }
.auth-title { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .35rem; }
.auth-sub { color: var(--if-muted); margin-bottom: 1.8rem; }
.auth-card .form-control { padding-top: .75rem; padding-bottom: .75rem; border-radius: .8rem; }
.auth-card .form-label { font-weight: 500; font-size: .88rem; }
.auth-card h5 { font-family: var(--if-display); font-size: 1.4rem; font-weight: 700; }
.field-icon { position: relative; }
.field-icon > .bi { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--if-muted); pointer-events: none; transition: color .15s; }
.field-icon .form-control { padding-left: 2.6rem; }
.field-icon:focus-within > .bi { color: var(--if-primary); }
.field-eye { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--if-muted); width: 2.3rem; height: 2.3rem; border-radius: .6rem; }
.field-eye:hover { background: var(--if-hover); color: var(--if-text); }
.field-icon .form-control[type="password"], .field-icon .form-control#password { padding-right: 3rem; }
.caps-warn { margin-top: .45rem; font-size: .8rem; color: #b45309; display: flex; align-items: center; gap: .35rem; }
.caps-warn.hidden { display: none; }
.btn-signin { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border: 0; font-weight: 600; border-radius: .85rem;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%); box-shadow: 0 10px 24px -8px rgba(99, 102, 241, .65); transition: transform .15s, box-shadow .15s; overflow: hidden; }
.btn-signin::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); transition: left .6s; }
.btn-signin:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -8px rgba(99, 102, 241, .75); background: linear-gradient(135deg, #5b5ff0 0%, #7330e6 100%); }
.btn-signin:hover::after { left: 120%; }
.btn-signin:hover .btn-arrow { transform: translateX(3px); }
.btn-arrow { transition: transform .15s; }
.btn-signin.is-busy .btn-arrow { display: none; }
.btn-signin .spinner-border.hidden { display: none; }
.auth-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem .9rem; margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px dashed var(--if-border); font-size: .74rem; color: var(--if-muted); }
.auth-trust .bi { color: var(--if-good); margin-right: .2rem; }
.auth-note { display: flex; gap: .6rem; background: var(--if-surface-2); border: 1px solid var(--if-border); border-radius: 1rem; padding: 1rem 1.1rem; color: var(--if-muted); font-size: .82rem; }
.auth-legal { position: absolute; bottom: 1.3rem; left: 0; right: 0; text-align: center; font-size: .75rem; color: var(--if-muted); }
.auth-theme { position: absolute; top: 1.25rem; right: 1.25rem; z-index: 2; }
[data-bs-theme="dark"] .auth-card { box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6); }
[data-bs-theme="dark"] .caps-warn { color: #fbbf24; }
@media (max-width: 1199.98px) { .auth-stage { height: 250px; } .toast-card { min-width: 200px; } }
@media (max-width: 991.98px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card { padding: 2rem 1.5rem; }
}
@media (max-height: 760px) { .auth-stage { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .aurora span, .glass-chart, .toast-card, .pulse-dot, .auth-card { animation: none !important; }
  .spark-line { animation: none; stroke-dashoffset: 0; } .spark-dot { animation: none; opacity: 1; } .glass-bars span { animation: none; }
}

/* ---------- receipts & print ---------- */
.receipt { max-width: 540px; margin: 0 auto; background: var(--if-surface); border: 1px solid var(--if-border); border-radius: 1rem; padding: 1.75rem; }
.receipt .co { font-family: var(--if-display); font-size: 1.3rem; font-weight: 700; color: var(--if-primary-text); }
.receipt table td { padding: .32rem 0; }
@media print {
  html, body, [data-bs-theme] { background: #fff !important; color: #000 !important; --if-surface: #fff; --if-text: #000; --if-heading: #000; --if-border: #ddd; }
  .sidebar, .topbar, .sidebar-backdrop, .d-print-none { display: none !important; }
  .content { padding: 0; }
  .receipt { border: 0; }
}
.card .table tbody tr:last-child > * { border-bottom: 0; }
.card > .table-responsive:last-child { border-bottom-left-radius: calc(1rem - 1px); border-bottom-right-radius: calc(1rem - 1px); }
@media (max-width: 575.98px) {
  .stat { padding: 1rem 1.05rem; }
  .stat-icon { width: 34px; height: 34px; font-size: .95rem; top: .85rem; right: .85rem; }
  .stat-icon + .label { padding-right: 2.4rem; }
  .page-title h1 { font-size: 1.45rem; }
  .crumb-section, .crumb-sep { display: none; }
  .top-actions { margin-left: auto !important; }
}

/* ---------- avatars & photos ---------- */
.avatar-img { border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--if-hover); border: 2px solid var(--if-surface); box-shadow: 0 0 0 1px var(--if-border); }
.avatar-sm { width: 32px !important; height: 32px !important; font-size: .7rem; }
.avatar-chip { width: 38px !important; height: 38px !important; font-size: .8rem; }
.avatar-md { width: 48px !important; height: 48px !important; font-size: .95rem; }
.avatar-lg { width: 72px !important; height: 72px !important; font-size: 1.35rem; }
.avatar-xl { width: 112px !important; height: 112px !important; font-size: 2rem; }
.avatar-soft { background: var(--if-primary-soft); color: var(--if-primary-text); }
.page-title > .avatar, .page-title > .avatar-img { margin-right: .1rem; }
.profile-head { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.profile-pic { position: relative; }
.photo-drop { width: 132px; height: 132px; margin: 0 auto; border-radius: 50%; border: 2px dashed var(--if-border-strong); background: var(--if-surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
#photo-placeholder { display: flex; flex-direction: column; align-items: center; gap: .3rem; color: var(--if-subtle); font-size: .78rem; }
#photo-placeholder .bi { font-size: 2rem; }

/* ---------- roles & permissions ---------- */
.min-w-0 { min-width: 0; }
.role-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.role-grid > .role-card { flex: 1 1 260px; display: flex; flex-direction: column; }
.role-card .role-desc { flex: 1 1 auto; }
.role-card { display: block; background: var(--if-surface); border: 1px solid var(--if-border); border-radius: 1rem; padding: 1.1rem 1.25rem; box-shadow: var(--if-shadow); color: var(--if-text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.role-card:hover { border-color: var(--if-primary); transform: translateY(-2px); box-shadow: var(--if-shadow-lg); color: var(--if-text); }
.role-card.is-off { opacity: .65; }
.role-name { font-weight: 600; color: var(--if-heading); line-height: 1.25; }
.role-desc { min-height: 2.6em; }
.role-meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--if-muted); }
.role-card .progress { height: 6px; }
.matrix-wrap { overflow-x: auto; }
.matrix { width: 100%; table-layout: auto; }
.matrix thead th { background: var(--if-surface); }
.matrix .role-col { min-width: 92px; font-size: .75rem; white-space: normal; vertical-align: bottom; }
.matrix .role-col a { color: inherit; text-decoration: none; }
.matrix .perm-col { position: sticky; left: 0; background: var(--if-surface); z-index: 1; min-width: 240px; }
.matrix thead .perm-col { z-index: 3; }
.matrix-group td { background: var(--if-surface-2) !important; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--if-muted); }
.perm-filter { max-width: 240px; }
.perm-module { border-top: 1px solid var(--if-border); }
.perm-module:first-child { border-top: 0; }
.perm-module-head { display: flex; align-items: center; gap: .5rem; padding: .75rem 1.5rem; background: var(--if-surface-2); }
.perm-row { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.5rem; border-top: 1px solid var(--if-border); }
.perm-row:hover { background: var(--if-hover); }
.perm-text { flex: 1 1 auto; min-width: 0; }
.perm-choice { flex: 0 0 auto; }
.perm-choice .btn { min-width: 3.4rem; }
.badge.scope-all { background: var(--if-success-bg); color: var(--if-success-fg); }
.badge.scope-branch { background: var(--if-primary-soft); color: var(--if-primary-text); }
.badge.scope-own { background: var(--if-warning-bg); color: var(--if-warning-fg); }
.sticky-save { position: sticky; bottom: 0; background: var(--if-surface); z-index: 4; }
@media (max-width: 575.98px) { .perm-row { flex-direction: column; align-items: flex-start; } .perm-module-head, .perm-row { padding-left: 1rem; padding-right: 1rem; } }

/* ---------- settings ---------- */
.settings-nav-card { position: sticky; top: 84px; }
.settings-nav { padding: .5rem; gap: 2px; }
.settings-nav .nav-link { text-align: left; color: var(--if-text); border-radius: .6rem; padding: .55rem .8rem; font-weight: 500; }
.settings-nav .nav-link .bi { width: 1.4rem; display: inline-block; color: var(--if-muted); }
.settings-nav .nav-link:hover { background: var(--if-hover); }
.settings-nav .nav-link.active { background: var(--if-primary-soft); color: var(--if-primary-text); }
.settings-nav .nav-link.active .bi { color: var(--if-primary-text); }
.setting-card fieldset { min-width: 0; }
.setting-actions { display: flex; justify-content: flex-end; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--if-border); }
.setting-switch { padding-top: .25rem; padding-bottom: .25rem; margin-bottom: .35rem; }
.setting-sub { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--if-muted); margin: .25rem 0 .75rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.check-tile { display: flex; align-items: center; gap: .55rem; padding: .55rem .75rem; border: 1px solid var(--if-border); border-radius: .6rem; cursor: pointer; margin: 0; }
.check-tile:hover { border-color: var(--if-border-strong); background: var(--if-hover); }
.check-tile .form-check-input { margin: 0; flex: 0 0 auto; }
.check-tile:has(input:checked) { border-color: var(--if-primary); background: var(--if-primary-soft); }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.choice-card { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--if-border); border-radius: .75rem; padding: .9rem 1rem; cursor: pointer; margin: 0; }
.choice-card .form-check-input { margin-top: .2rem; flex: 0 0 auto; }
.choice-card:has(input:checked) { border-color: var(--if-primary); background: var(--if-primary-soft); }
.order-list { list-style: none; padding: 0; margin: 0; counter-reset: ord; max-width: 420px; }
.order-item { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem .45rem .75rem; border: 1px solid var(--if-border); border-radius: .6rem; margin-bottom: .4rem; background: var(--if-surface); counter-increment: ord; }
.order-item::before { content: counter(ord); width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--if-primary-soft); color: var(--if-primary-text); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; }
.tier-summary { border: 1px dashed var(--if-border-strong); border-radius: .75rem; padding: .5rem .9rem; }
.tier-summary-row { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .35rem 0; }
.tier-summary-row + .tier-summary-row { border-top: 1px solid var(--if-border); }
.tier-range { font-weight: 600; min-width: 210px; font-variant-numeric: tabular-nums; }
.tier { border: 1px solid var(--if-border); border-radius: .85rem; padding: 1rem; margin-bottom: .75rem; background: var(--if-surface-2); }
.tier-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.tier-no { font-weight: 700; color: var(--if-heading); min-width: 3.5rem; }
.tier-max { max-width: 330px; }
.tier-level { background: var(--if-surface); border: 1px solid var(--if-border); border-radius: .65rem; padding: .6rem .75rem; margin-bottom: .5rem; }
.tier-level-head { display: flex; align-items: center; gap: .35rem; margin-bottom: .45rem; }
.tier-level-no { font-weight: 600; font-size: .85rem; }
.role-picks { display: flex; flex-wrap: wrap; gap: .35rem; }
.role-picks .btn { border-radius: 999px; font-size: .78rem; }
.role-picks .btn-check:checked + .btn, .perm-choice .btn-check:checked + .btn-outline-primary { background: var(--if-primary); border-color: var(--if-primary); color: #fff; }
.perm-choice .btn-check:checked + .btn-outline-secondary { background: var(--if-gray-bg); border-color: var(--if-border-strong); color: var(--if-heading); }
.role-picks .btn-check:checked + .btn::before { content: "\2713\00a0"; }
.role-card:hover, .role-card:hover * { text-decoration: none; }
.check-col { width: 2.25rem; }
.assign-bar { position: sticky; top: 76px; z-index: 5; border-color: var(--if-primary); }
.assign-bar.is-empty { border-color: var(--if-border); }

/* ---------- inactivity warning ---------- */
.idle-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(17, 24, 39, .55); display: flex; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(3px); }
.idle-overlay.hidden { display: none; }
.idle-box { background: var(--if-surface); color: var(--if-text); border-radius: 1rem; box-shadow: var(--if-shadow-lg); padding: 2rem 2rem 1.5rem; max-width: 420px; text-align: center; }
.idle-box h2 { font-size: 1.25rem; color: var(--if-heading); margin: .75rem 0 .5rem; }
.idle-icon { width: 3.5rem; height: 3.5rem; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; background: var(--if-warning-bg); color: var(--if-warning-fg); }
#idle-count { font-variant-numeric: tabular-nums; }
/* ---------- policies overview ---------- */
.policy-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75rem; }
.policy-chip { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; background: var(--if-surface); border: 1px solid var(--if-border); border-radius: .85rem; color: var(--if-text); text-decoration: none; box-shadow: var(--if-shadow); }
.policy-chip:hover { border-color: var(--if-primary); color: var(--if-text); }
.policy-chip .bi { font-size: 1.25rem; color: var(--if-primary-text); background: var(--if-primary-soft); border-radius: .6rem; width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.policy-chip strong { display: block; color: var(--if-heading); }
.policy-chip span { font-size: .85rem; line-height: 1.25; }
.setting-card .row + .setting-sub { margin-top: 1.25rem; }


/* ---------- toasts ---------- */
.toast-stack { position: fixed; top: 84px; right: 1.25rem; z-index: 1900; display: flex; flex-direction: column; gap: .6rem; width: min(400px, calc(100vw - 2rem)); pointer-events: none; }
.toast-item { pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: .75rem; padding: .85rem .9rem .9rem 1rem; background: var(--if-surface); color: var(--if-text);
  border: 1px solid var(--if-border); border-radius: .9rem; box-shadow: 0 12px 32px -8px rgba(16, 24, 40, .22), 0 4px 8px -4px rgba(16, 24, 40, .08); animation: toast-in .28s cubic-bezier(.2, .9, .3, 1.2) both; }
.toast-item.is-leaving { animation: toast-out .2s ease-in forwards; }
.toast-icon { flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.toast-success .toast-icon { background: var(--if-success-bg); color: #16a34a; }
.toast-error .toast-icon   { background: var(--if-danger-bg); color: #dc2626; }
.toast-warning .toast-icon { background: var(--if-warning-bg); color: #d97706; }
.toast-info .toast-icon    { background: var(--if-info-bg); color: #2563eb; }
.toast-body { flex: 1 1 auto; min-width: 0; padding-top: .1rem; }
.toast-title { font-weight: 600; color: var(--if-heading); font-size: .92rem; margin-bottom: .1rem; }
.toast-text { font-size: .875rem; color: var(--if-muted); overflow-wrap: anywhere; }
.toast-close { flex: 0 0 auto; border: 0; background: transparent; color: var(--if-muted); width: 1.75rem; height: 1.75rem; border-radius: .5rem; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.toast-close:hover { background: var(--if-hover); color: var(--if-heading); }
.toast-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; animation: toast-progress 5s linear forwards; }
.toast-success .toast-progress { background: #16a34a; }
.toast-warning .toast-progress { background: #d97706; animation-duration: 7s; }
.toast-info .toast-progress { background: #2563eb; }
.toast-item.is-paused .toast-progress { animation-play-state: paused; }
.toast-error { border-left: 4px solid #dc2626; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); height: 0; margin: 0; padding-top: 0; padding-bottom: 0; } }
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 575.98px) { .toast-stack { top: auto; bottom: 1rem; right: 1rem; left: 1rem; width: auto; } }

/* ---------- confirmation dialog & inactivity box (shared look) ---------- */
.ui-dialog-backdrop { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(15, 23, 42, 0); backdrop-filter: blur(0); transition: background .16s ease, backdrop-filter .16s ease; }
.ui-dialog-backdrop.is-open { background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); }
.ui-dialog, .idle-box { background: var(--if-surface); color: var(--if-text); border-radius: 1.1rem; padding: 1.75rem 1.75rem 1.4rem; width: min(440px, 100%); text-align: center;
  box-shadow: 0 24px 64px -12px rgba(15, 23, 42, .35); border: 1px solid var(--if-border); }
.ui-dialog { opacity: 0; transform: translateY(8px) scale(.97); transition: opacity .16s ease, transform .16s ease; }
.ui-dialog-backdrop.is-open .ui-dialog { opacity: 1; transform: none; }
.ui-dialog-icon, .idle-icon { width: 3.25rem; height: 3.25rem; margin: 0 auto .9rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.45rem; }
.ui-dialog-primary .ui-dialog-icon { background: var(--if-primary-soft); color: var(--if-primary-text); box-shadow: 0 0 0 8px color-mix(in srgb, var(--if-primary-soft) 45%, transparent); }
.ui-dialog-danger .ui-dialog-icon { background: var(--if-danger-bg); color: #dc2626; box-shadow: 0 0 0 8px color-mix(in srgb, var(--if-danger-bg) 45%, transparent); }
.ui-dialog h2, .idle-box h2 { font-size: 1.15rem; font-weight: 600; color: var(--if-heading); margin: 0 0 .4rem; }
.ui-dialog p, .idle-box p { color: var(--if-muted); font-size: .92rem; margin: 0 0 1.35rem; overflow-wrap: anywhere; }
.ui-dialog-actions { display: flex; gap: .6rem; }
.ui-dialog-actions .btn { flex: 1 1 0; padding: .6rem 1rem; font-weight: 500; border-radius: .7rem; }
body.ui-dialog-open { overflow: hidden; }
.idle-icon { box-shadow: 0 0 0 8px color-mix(in srgb, var(--if-warning-bg) 45%, transparent); }
@media (prefers-reduced-motion: reduce) { .toast-item, .toast-item.is-leaving, .ui-dialog, .ui-dialog-backdrop { animation: none !important; transition: none !important; } .toast-progress { display: none; } }
.perf-targets .w-target { width: 13rem; }
.perf-targets .w-weight { width: 8rem; }

/* ---------- staff performance ---------- */
:root { --viz-series: #2a78d6; --viz-good: #0ca30c; --viz-warning: #fab219; --viz-serious: #ec835a; --viz-critical: #d03b3b; --viz-grid: #e6e5e0; }
[data-bs-theme="dark"] { --viz-series: #3987e5; --viz-grid: #34342f; }
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.period-custom { display: inline-flex; align-items: center; gap: .4rem; }
.period-custom.hidden { display: none !important; }
.stat .value-name { font-size: 1.15rem; line-height: 1.3; }
.grade { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--if-surface-2); color: var(--if-text); border: 1px solid var(--if-border); white-space: nowrap; }
.grade .bi { font-size: .9rem; }
.grade-good .bi { color: var(--viz-good); }
.grade-warning .bi { color: var(--viz-warning); }
.grade-serious .bi { color: var(--viz-serious); }
.grade-critical .bi { color: var(--viz-critical); }
.grade-none { color: var(--if-muted); font-weight: 500; }
.perf-table .rank-col { width: 2.5rem; color: var(--if-muted); font-variant-numeric: tabular-nums; }
.perf-table .score-col { min-width: 170px; }
.perf-table th.num { white-space: normal; min-width: 76px; max-width: 112px; font-size: .76rem; line-height: 1.25; vertical-align: bottom; text-transform: none; letter-spacing: 0; font-weight: 600; }
.perf-table td, .perf-table th { padding-left: .6rem; padding-right: .6rem; }
.perf-table .score-col { min-width: 120px; }
.perf-table .score-col .score-bar { width: 64px; }
.perf-table tr.row-idle td { color: var(--if-muted); }
.perf-table tr.row-idle .avatar, .perf-table tr.row-idle img { opacity: .6; }
.th-target { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--if-muted); font-size: .72rem; }
.score-cell { display: flex; align-items: center; gap: .6rem; }
.score-bar { width: 110px; height: 8px; flex: 0 0 auto; }
.score-track { fill: var(--viz-grid); }
.score-fill { fill: var(--viz-series); }
.meter-full { fill: var(--viz-good); }
.score-num { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--if-heading); min-width: 1.75rem; }
.met { font-weight: 600; color: var(--if-heading); }
.score-hero .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--if-muted); font-weight: 600; }
.hero-num { font-size: 3.5rem; font-weight: 700; color: var(--if-heading); line-height: 1.1; margin: .35rem 0 .6rem; font-variant-numeric: tabular-nums; }
.hero-num span { font-size: 1.1rem; font-weight: 500; color: var(--if-muted); margin-left: .35rem; }
.trend-wrap { position: relative; }
.trend-chart { width: 100%; height: auto; display: block; overflow: visible; }
.trend-chart .grid { stroke: var(--viz-grid); stroke-width: 1; }
.trend-chart .ref { stroke: var(--viz-good); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .8; }
.trend-chart .axis { fill: var(--if-muted); font-size: 11px; }
.trend-chart .line { fill: none; stroke: var(--viz-series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend-chart .dot { fill: var(--viz-series); stroke: var(--if-surface); stroke-width: 2; }
.trend-chart .dlabel { fill: var(--if-heading); font-size: 12px; font-weight: 600; }
.trend-chart .hit { fill: transparent; cursor: default; outline: none; }
.trend-chart .hit.is-active { fill: var(--viz-series); fill-opacity: .06; }
.chart-tip { position: absolute; top: 0; transform: translate(-50%, -6px); background: var(--if-heading); color: var(--if-surface); font-size: .78rem; padding: .3rem .55rem; border-radius: .45rem; white-space: nowrap; pointer-events: none; box-shadow: var(--if-shadow); }
.legend-line, .legend-dash { display: inline-block; width: 18px; height: 0; vertical-align: middle; border-top: 2px solid var(--viz-series); margin-right: .2rem; }
.legend-dash { border-top: 2px dashed var(--viz-good); margin-left: .5rem; }
.breakdown .progress-col { min-width: 180px; }
.meter { display: flex; align-items: center; gap: .5rem; }
.meter svg { width: 120px; height: 6px; flex: 0 0 auto; }

/* ---------- notifications ---------- */
.send-state { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600; border: 1px solid var(--if-border); }
.send-state.send-smtp { color: #0a7d0a; background: rgba(12, 163, 12, .1); border-color: rgba(12, 163, 12, .3); }
.send-state.send-log { color: #8a5a00; background: rgba(250, 178, 25, .14); border-color: rgba(250, 178, 25, .4); }
.send-state.send-off { color: var(--if-muted); background: var(--if-hover); }
[data-bs-theme="dark"] .send-state.send-smtp { color: #5fd35f; }
[data-bs-theme="dark"] .send-state.send-log { color: #ffcf66; }
.notif-table th.aud-col, .notif-table td.aud-col { width: 108px; min-width: 96px; }
.notif-table th.aud-col { font-size: .74rem; text-transform: none; letter-spacing: 0; white-space: normal; line-height: 1.2; vertical-align: bottom; cursor: help; }
.notif-table .form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; margin: 0; float: none; }
.notif-table .aud-na { color: var(--if-border-strong); }
.notif-table tbody tr:hover { background: var(--if-hover); }
.notif-groups.is-paused { opacity: .55; }
.notif-groups.is-paused .card-header::after { content: "Paused"; margin-left: auto; font-size: .72rem; font-weight: 600; color: var(--if-muted); text-transform: uppercase; letter-spacing: .04em; }
.master-switch .form-check-input { width: 2.8em; height: 1.5em; cursor: pointer; }
.master-switch .form-check-label { padding-left: .35rem; padding-top: .15rem; }
.form-check-input.is-saving { opacity: .55; }
.help-card h2 { margin-bottom: .6rem; }
.fill-bar { height: 8px; border-radius: 999px; background: var(--if-hover); overflow: hidden; }
.fill-bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: #2a78d6; }
[data-bs-theme="dark"] .fill-bar > span { background: #3987e5; }
.email-frame { display: block; width: 100%; height: 720px; border: 0; border-top: 1px solid var(--if-border); background: #f3f4f6; border-radius: 0 0 var(--bs-card-border-radius, .75rem) var(--bs-card-border-radius, .75rem); }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; }
.detail-list dt { font-weight: 500; color: var(--if-muted); font-size: .85rem; }
.detail-list dd { margin: 0; }

/* ---------- user manual ---------- */
.help-search { position: relative; max-width: 760px; }
.help-search > .bi-search { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--if-muted); }
.help-search .form-control { padding-left: 2.6rem; padding-right: 2.6rem; border-radius: .9rem; }
.help-search-clear { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--if-muted); }
.help-list li a { display: block; padding: .7rem 1rem; color: inherit; text-decoration: none; border-top: 1px solid var(--if-border); }
.help-list li:first-child a { border-top: 0; }
.help-list li a:hover { background: var(--if-hover); }
.help-list li a .fw-medium { color: var(--if-primary); }
.help-results { display: grid; gap: .5rem; max-width: 900px; }
.help-result { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--if-border); border-radius: .8rem; background: var(--if-surface); color: inherit; text-decoration: none; }
.help-result:hover { border-color: var(--if-primary); }
.help-result-icon { width: 2.2rem; height: 2.2rem; border-radius: .6rem; background: var(--if-primary-soft); color: var(--if-primary); display: grid; place-items: center; flex: 0 0 auto; }
.help-result-title { font-weight: 600; }
.help-crumbs a { text-decoration: none; }
.manual-article .card-body { padding: 1.6rem 1.8rem; font-size: 1rem; line-height: 1.65; max-width: 860px; }
.manual-article h2 { font-size: 1.2rem; margin: 1.8rem 0 .7rem; padding-top: .3rem; scroll-margin-top: 90px; }
.manual-article h2:first-child { margin-top: 0; }
.manual-article h3 { font-size: 1.02rem; margin: 1.3rem 0 .5rem; scroll-margin-top: 90px; }
.manual-article ol, .manual-article ul { padding-left: 1.4rem; margin-bottom: 1rem; }
.manual-article li { margin-bottom: .35rem; }
.manual-article ol > li::marker { font-weight: 700; color: var(--if-primary); }
.manual-article code { font-size: .88em; padding: .1rem .35rem; border-radius: .3rem; background: var(--if-hover); color: inherit; }
.manual-table { font-size: .92rem; }
.manual-callout { display: flex; gap: .7rem; padding: .8rem 1rem; border-radius: .7rem; margin: 0 0 1rem; border: 1px solid; }
.manual-callout > .bi { font-size: 1.1rem; line-height: 1.5; }
.manual-callout.callout-tip { background: rgba(42, 120, 214, .07); border-color: rgba(42, 120, 214, .25); }
.manual-callout.callout-tip > .bi { color: #2a78d6; }
.manual-callout.callout-note { background: var(--if-surface-2); border-color: var(--if-border); }
.manual-callout.callout-note > .bi { color: var(--if-muted); }
.manual-callout.callout-warn { background: rgba(250, 178, 25, .1); border-color: rgba(250, 178, 25, .45); }
.manual-callout.callout-warn > .bi { color: #b57f00; }
.help-side { position: sticky; top: 88px; }
.help-toc li a { display: block; padding: .45rem 1rem; color: inherit; text-decoration: none; font-size: .9rem; border-left: 3px solid transparent; }
.help-toc li.lvl-3 a { padding-left: 1.9rem; font-size: .85rem; color: var(--if-muted); }
.help-toc li a:hover { background: var(--if-hover); }
.help-toc li.active a { border-left-color: var(--if-primary); color: var(--if-primary); font-weight: 600; background: var(--if-primary-soft); }
.help-nav { display: inline-flex; align-items: center; gap: .6rem; max-width: 48%; }
@media print {
  .sidebar, .topbar, .assistant, .help-crumbs, .page-title .actions { display: none !important; }
  .manual-article { border: 0; box-shadow: none; }
}

/* ---------- help assistant (chat bubble) ---------- */
.assistant { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1060; }
.assistant-fab { width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 0; background: var(--if-primary); color: #fff; font-size: 1.4rem;
  box-shadow: 0 10px 25px rgba(79, 70, 229, .35); display: grid; place-items: center; transition: transform .15s; }
.assistant-fab:hover { transform: scale(1.06); }
.assistant.is-open .assistant-fab { display: none; }
.assistant-panel { position: absolute; right: 0; bottom: 0; width: 390px; max-width: calc(100vw - 2rem); height: 600px; max-height: calc(100vh - 2.5rem);
  display: flex; flex-direction: column; background: var(--if-surface); border: 1px solid var(--if-border); border-radius: 1rem; overflow: hidden;
  box-shadow: 0 24px 60px rgba(17, 24, 39, .25); }
.assistant-panel.hidden { display: none; }
.assistant-head { display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem; background: var(--if-primary); color: #fff; }
.assistant-avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 1.1rem; }
.assistant-title { font-weight: 700; line-height: 1.2; }
.assistant-sub { font-size: .75rem; opacity: .85; }
.assistant-icon { border: 0; background: transparent; color: #fff; width: 2rem; height: 2rem; border-radius: .5rem; opacity: .85; }
.assistant-icon:hover { background: rgba(255, 255, 255, .15); opacity: 1; }
.assistant-log { flex: 1; overflow-y: auto; padding: 1rem .9rem; display: flex; flex-direction: column; gap: .7rem; background: var(--if-surface-2); }
.amsg { max-width: 92%; }
.amsg-user { align-self: flex-end; }
.amsg-user .amsg-body { background: var(--if-primary); color: #fff; border-radius: 1rem 1rem .25rem 1rem; padding: .55rem .85rem; white-space: pre-wrap; }
.amsg-assistant .amsg-body { background: var(--if-surface); border: 1px solid var(--if-border); border-radius: 1rem 1rem 1rem .25rem; padding: .65rem .9rem; font-size: .92rem; line-height: 1.5; }
.amsg-body p { margin: 0 0 .5rem; }
.amsg-body p:last-child, .amsg-body ol:last-child, .amsg-body ul:last-child { margin-bottom: 0; }
.amsg-body ol, .amsg-body ul { padding-left: 1.2rem; margin: .3rem 0 .5rem; }
.amsg-body li { margin-bottom: .2rem; }
.amsg-body h2, .amsg-body h3 { font-size: .95rem; margin: .5rem 0 .3rem; }
.amsg-body .manual-callout { padding: .5rem .7rem; font-size: .88rem; }
.amsg-body code { font-size: .85em; padding: 0 .25rem; border-radius: .25rem; background: var(--if-hover); }
.asrcs { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.asrc { font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; background: var(--if-primary-soft); color: var(--if-primary); text-decoration: none; }
.afb { display: flex; align-items: center; gap: .25rem; margin-top: .3rem; font-size: .75rem; color: var(--if-muted); }
.afb button { border: 0; background: transparent; color: var(--if-muted); padding: .1rem .3rem; border-radius: .3rem; }
.afb button:hover, .afb button.on { color: var(--if-primary); background: var(--if-primary-soft); }
.amode { margin-left: auto; font-style: italic; }
.atips { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.atip { text-align: left; border: 1px solid var(--if-border); background: var(--if-surface); border-radius: .7rem; padding: .45rem .7rem; font-size: .85rem; color: var(--if-primary); text-decoration: none; }
.atip:hover { border-color: var(--if-primary); }
.atip-page { color: inherit; }
.adots { display: inline-flex; gap: .25rem; padding: .25rem 0; }
.adots i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--if-muted); animation: adot 1s infinite ease-in-out; }
.adots i:nth-child(2) { animation-delay: .15s; } .adots i:nth-child(3) { animation-delay: .3s; }
@keyframes adot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.assistant-form { display: flex; gap: .5rem; padding: .65rem; border-top: 1px solid var(--if-border); background: var(--if-surface); align-items: flex-end; }
.assistant-form textarea { flex: 1; resize: none; border: 1px solid var(--if-border); border-radius: .8rem; padding: .55rem .8rem; background: var(--if-surface-2); color: inherit; max-height: 120px; font-size: .92rem; }
.assistant-form textarea:focus { outline: 2px solid var(--if-primary-soft); border-color: var(--if-primary); }
.assistant-send { width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: var(--if-primary); color: #fff; flex: 0 0 auto; }
.assistant-foot { font-size: .7rem; color: var(--if-muted); padding: 0 .9rem .6rem; background: var(--if-surface); }
@media (max-width: 575.98px) { .assistant { right: .75rem; bottom: .75rem; } .assistant-panel { height: calc(100vh - 1.5rem); } }
@media (prefers-reduced-motion: reduce) { .adots i { animation: none; } .assistant-fab { transition: none; } }

/* ---------- my account: two-step verification ---------- */
.mfa-codes { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; border-radius: .8rem; background: var(--if-success-bg); color: var(--if-success-fg); }
.mfa-codes.is-low { background: var(--if-danger-bg); color: var(--if-danger-fg); }
.mfa-codes-n { font-size: 1.8rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.mfa-form { margin-top: .9rem; padding: .9rem; border: 1px solid var(--if-border); border-radius: .75rem; background: var(--if-surface-2); }

/* ---------- reversals ---------- */
.receipt-side { max-width: 540px; margin: 1rem auto 0; }
.rev-decide { min-width: 260px; }
